File manager - Edit - /home/u816558632/domains/postills.com/public_html/public/twilio.tar
Back
sdk/Dockerfile-dev 0000644 00000000570 15002236443 0010074 0 ustar 00 ARG version FROM php:$version RUN curl --silent --show-error https://getcomposer.org/installer | php RUN mv composer.phar /usr/local/bin/composer RUN apt-get update -y && \ apt-get upgrade -y && \ apt-get dist-upgrade -y && \ apt-get -y autoremove && \ apt-get clean RUN apt-get install -y zip unzip git ENV COMPOSER_ALLOW_SUPERUSER=1 WORKDIR /twilio sdk/composer.json 0000644 00000001466 15002236443 0010055 0 ustar 00 { "name": "twilio/sdk", "type": "library", "description": "A PHP wrapper for Twilio's API", "keywords": ["twilio", "sms", "api"], "homepage": "http://github.com/twilio/twilio-php", "license": "MIT", "authors": [ { "name": "Twilio API Team", "email": "api@twilio.com" } ], "require": { "php": ">=5.5.0" }, "require-dev": { "guzzlehttp/guzzle": "^6.3", "apigen/apigen": "^4.1", "phpunit/phpunit": ">=4.5" }, "suggest": { "guzzlehttp/guzzle": "An HTTP client to execute the API requests" }, "autoload": { "psr-4": { "Twilio\\": "src/Twilio/" } }, "autoload-dev": { "psr-4": { "Twilio\\Tests\\": "tests/Twilio/" } } } sdk/Dockerfile 0000644 00000000343 15002236443 0007316 0 ustar 00 FROM php:7.1 RUN mkdir /twilio WORKDIR /twilio COPY src src COPY composer* ./ RUN curl --silent --show-error https://getcomposer.org/installer | php RUN mv composer.phar /usr/local/bin/composer RUN composer install --no-dev sdk/src/Services/Twilio.php 0000644 00000004144 15002236443 0011661 0 ustar 00 <?php abstract class Obsolete_Service_Twilio { public function __construct($sid, $token, $version = null, $http = null, $retryAttempts = 1) { $name = \get_class($this); \trigger_error($name . ' has been removed from this version of the library. Please refer to https://www.twilio.com/docs/libraries/php for more information.', E_USER_WARNING); } } class Services_Twilio extends Obsolete_Service_Twilio { public function __construct($sid, $token, $version = null, $http = null, $retryAttempts = 1) { parent::__construct($sid, $token, $version, $http, $retryAttempts); } } class TaskRouter_Services_Twilio extends Obsolete_Service_Twilio { public function __construct($sid, $token, $workspaceSid, $version = null, $http = null, $retryAttempts = 1) { parent::__construct($sid, $token, $version, $http, $retryAttempts); } } class Lookups_Services_Twilio extends Obsolete_Service_Twilio { public function __construct($sid, $token, $version = null, $http = null, $retryAttempts = 1) { parent::__construct($sid, $token, $version, $http, $retryAttempts); } } class Pricing_Services_Twilio extends Obsolete_Service_Twilio { public function __construct($sid, $token, $version = null, $http = null, $retryAttempts = 1) { parent::__construct($sid, $token, $version, $http, $retryAttempts); } } class Monitor_Services_Twilio extends Obsolete_Service_Twilio { public function __construct($sid, $token, $version = null, $http = null, $retryAttempts = 1) { parent::__construct($sid, $token, $version, $http, $retryAttempts); } } class Trunking_Services_Twilio extends Obsolete_Service_Twilio { public function __construct($sid, $token, $version = null, $http = null, $retryAttempts = 1) { parent::__construct($sid, $token, $version, $http, $retryAttempts); } } class IPMessaging_Services_Twilio extends Obsolete_Service_Twilio { public function __construct($sid, $token, $version = null, $http = null, $retryAttempts = 1) { parent::__construct($sid, $token, $version, $http, $retryAttempts); } } sdk/src/Twilio/Values.php 0000644 00000004605 15002236443 0011337 0 ustar 00 <?php namespace Twilio; class Values implements \ArrayAccess { const NONE = 'Twilio\\Values\\NONE'; protected $options; public static function array_get($array, $key, $default = null) { if (\array_key_exists($key, $array)) { return $array[$key]; } return $default; } public static function of($array) { $result = array(); foreach ($array as $key => $value) { if ($value === self::NONE) { continue; } $result[$key] = $value; } return $result; } public function __construct($options) { $this->options = array(); foreach ($options as $key => $value) { $this->options[\strtolower($key)] = $value; } } /** * (PHP 5 >= 5.0.0)<br/> * Whether a offset exists * @link http://php.net/manual/en/arrayaccess.offsetexists.php * @param mixed $offset <p> * An offset to check for. * </p> * @return boolean true on success or false on failure. * </p> * <p> * The return value will be casted to boolean if non-boolean was returned. */ public function offsetExists($offset) { return true; } /** * (PHP 5 >= 5.0.0)<br/> * Offset to retrieve * @link http://php.net/manual/en/arrayaccess.offsetget.php * @param mixed $offset <p> * The offset to retrieve. * </p> * @return mixed Can return all value types. */ public function offsetGet($offset) { $offset = \strtolower($offset); return \array_key_exists($offset, $this->options) ? $this->options[$offset] : self::NONE; } /** * (PHP 5 >= 5.0.0)<br/> * Offset to set * @link http://php.net/manual/en/arrayaccess.offsetset.php * @param mixed $offset <p> * The offset to assign the value to. * </p> * @param mixed $value <p> * The value to set. * </p> * @return void */ public function offsetSet($offset, $value) { $this->options[\strtolower($offset)] = $value; } /** * (PHP 5 >= 5.0.0)<br/> * Offset to unset * @link http://php.net/manual/en/arrayaccess.offsetunset.php * @param mixed $offset <p> * The offset to unset. * </p> * @return void */ public function offsetUnset($offset) { unset($this->options[$offset]); } } sdk/src/Twilio/Security/RequestValidator.php 0000644 00000014245 15002236443 0015206 0 ustar 00 <?php namespace Twilio\Security; use Twilio\Values; /** * RequestValidator is a helper to validate that a request to a web server was actually made from Twilio * EXAMPLE USAGE: * $validator = new RequestValidator('your auth token here'); * $isFromTwilio = $validator->validate($_SERVER['HTTP_X_TWILIO_SIGNATURE'], 'https://your-example-url.com/api/route/', $_REQUEST); * $isFromTwilio // <- if this is true, the request did come from Twilio, if not, it didn't */ final class RequestValidator { /** * @access private * @var string The auth token to the Twilio Account */ private $authToken; /** * constructor * @access public * @param string $authToken the auth token of the Twilio user's account * Sets the account auth token to be used by the rest of the class */ public function __construct($authToken) { $this->authToken = $authToken; } /** * Creates the actual base64 encoded signature of the sha1 hash of the concatenated URL and your auth token * @param string $url the full URL of the request URL you specify for your phone number or app, from the protocol (https...) through the end of the query string (everything after the ?) * @param array $data the Twilio parameters the request was made with * @return string */ public function computeSignature($url, $data = array()) { // sort the array by keys \ksort($data); // append them to the data string in order // with no delimiters foreach ($data as $key => $value) { $url .= $key.$value; } // sha1 then base64 the url to the auth token and return the base64-ed string return \base64_encode(\hash_hmac('sha1', $url, $this->authToken, true)); } /** * Converts the raw binary output to a hexadecimal return * @param string $data * @return string */ public static function computeBodyHash($data = '') { return \bin2hex(\hash('sha256', $data, true)); } /** * The only method the client should be running...takes the Twilio signature, their URL, and the Twilio params and validates the signature * @param string $expectedSignature * @param string $url * @param array $data * @return bool */ public function validate($expectedSignature, $url, $data = array()) { $parsedUrl = \parse_url($url); $urlWithPort = RequestValidator::addPort($parsedUrl); $urlWithoutPort = RequestValidator::removePort($parsedUrl); $validBodyHash = true; // May not receive body hash, so default succeed if (!\is_array($data)) { // handling if the data was passed through as a string instead of an array of params $queryString = \explode('?', $url); $queryString = $queryString[1]; \parse_str($queryString, $params); $validBodyHash = self::compare(self::computeBodyHash($data), Values::array_get($params, 'bodySHA256')); $data = array(); } /* * Check signature of the URL with and without port information * since sig generation on the back end is inconsistent. */ $validSignatureWithPort = self::compare( $this->computeSignature($urlWithPort, $data), $expectedSignature ); $validSignatureWithoutPort = self::compare( $this->computeSignature($urlWithoutPort, $data), $expectedSignature ); return $validBodyHash && ($validSignatureWithPort || $validSignatureWithoutPort); } /** * Time insensitive compare, function's runtime is governed by the length * of the first argument, not the difference between the arguments. * @param $a string First part of the comparison pair * @param $b string Second part of the comparison pair * @return bool True if $a === $b, false otherwise. */ public static function compare($a, $b) { // if the strings are different lengths, obviously they're invalid if (\strlen($a) !== \strlen($b)) { return false; } if (!$a && !$b) { return true; } $limit = \strlen($a); // checking every character for an exact difference, if you find one, return false for ($i = 0; $i < $limit; ++$i) { if ($a[$i] !== $b[$i]) { return false; } } // there have been no differences found return true; } /* * Removes the port from the URL * @param $parsedURL array * @returns string Full URL without the port number */ private static function removePort($parsedUrl) { unset($parsedUrl['port']); return RequestValidator::buildUrl($parsedUrl); } /* * Adds the port to the URL * @param $parsedURL array * @returns string Full URL with the port number */ private static function addPort($parsedUrl) { if (!isset($parsedUrl['port'])) { $port = ($parsedUrl['scheme'] === 'https') ? 443 : 80; $parsedUrl['port'] = $port; } return RequestValidator::buildUrl($parsedUrl); } /* * Builds the URL from its parsed component pieces * @param $parsedURL array * @returns string Full URL */ private static function buildUrl($parsedUrl) { $url = ''; $parts = array(); $parts['scheme'] = isset($parsedUrl['scheme']) ? $parsedUrl['scheme'] . '://' : ''; $parts['user'] = isset($parsedUrl['user']) ? $parsedUrl['user'] : ''; $parts['pass'] = isset($parsedUrl['pass']) ? ':' . $parsedUrl['pass'] : ''; $parts['pass'] = ($parts['user'] || $parts['pass']) ? $parts['pass'] . '@' : ''; $parts['host'] = isset($parsedUrl['host']) ? $parsedUrl['host'] : ''; $parts['port'] = isset($parsedUrl['port']) ? ':' . $parsedUrl['port'] : ''; $parts['path'] = isset($parsedUrl['path']) ? $parsedUrl['path'] : ''; $parts['query'] = isset($parsedUrl['query']) ? '?' . $parsedUrl['query'] : ''; $parts['fragment'] = isset($parsedUrl['fragment']) ? '#' . $parsedUrl['fragment'] : ''; return \implode('', $parts); } } sdk/src/Twilio/Options.php 0000644 00000000324 15002236443 0011525 0 ustar 00 <?php namespace Twilio; abstract class Options implements \IteratorAggregate { protected $options = array(); public function getIterator() { return new \ArrayIterator($this->options); } } sdk/src/Twilio/Exceptions/HttpException.php 0000644 00000000127 15002236443 0015012 0 ustar 00 <?php namespace Twilio\Exceptions; class HttpException extends TwilioException { } sdk/src/Twilio/Exceptions/DeserializeException.php 0000644 00000000136 15002236443 0016333 0 ustar 00 <?php namespace Twilio\Exceptions; class DeserializeException extends TwilioException { } sdk/src/Twilio/Exceptions/TwimlException.php 0000644 00000000130 15002236443 0015161 0 ustar 00 <?php namespace Twilio\Exceptions; class TwimlException extends TwilioException { } sdk/src/Twilio/Exceptions/TwilioException.php 0000644 00000000124 15002236443 0015337 0 ustar 00 <?php namespace Twilio\Exceptions; class TwilioException extends \Exception { } sdk/src/Twilio/Exceptions/ConfigurationException.php 0000644 00000000140 15002236443 0016675 0 ustar 00 <?php namespace Twilio\Exceptions; class ConfigurationException extends TwilioException { } sdk/src/Twilio/Exceptions/EnvironmentException.php 0000644 00000000136 15002236443 0016377 0 ustar 00 <?php namespace Twilio\Exceptions; class EnvironmentException extends TwilioException { } sdk/src/Twilio/Exceptions/RestException.php 0000644 00000001460 15002236443 0015011 0 ustar 00 <?php namespace Twilio\Exceptions; class RestException extends TwilioException { protected $statusCode; /** * Construct the exception. Note: The message is NOT binary safe. * @link http://php.net/manual/en/exception.construct.php * @param string $message [optional] The Exception message to throw. * @param int $code [optional] The Exception code. * @param int $statusCode [optional] The HTTP Status code. * @since 5.1.0 */ public function __construct($message, $code, $statusCode) { $this->statusCode = $statusCode; parent::__construct($message, $code); } /** * Get the HTTP Status Code of the RestException * @return int HTTP Status Code */ public function getStatusCode() { return $this->statusCode; } } sdk/src/Twilio/InstanceResource.php 0000644 00000000653 15002236443 0013353 0 ustar 00 <?php namespace Twilio; class InstanceResource { protected $version; protected $context = null; protected $properties = array(); protected $solution = array(); public function __construct(Version $version) { $this->version = $version; } public function toArray() { return $this->properties; } public function __toString() { return '[InstanceResource]'; } } sdk/src/Twilio/Stream.php 0000644 00000005300 15002236443 0011324 0 ustar 00 <?php namespace Twilio; class Stream implements \Iterator { public $page; public $firstPage; public $limit; public $currentRecord; public $pageLimit; public $currentPage; function __construct(Page $page, $limit, $pageLimit) { $this->page = $page; $this->firstPage = $page; $this->limit = $limit; $this->currentRecord = 1; $this->pageLimit = $pageLimit; $this->currentPage = 1; } /** * (PHP 5 >= 5.0.0)<br/> * Return the current element * @link http://php.net/manual/en/iterator.current.php * @return mixed Can return any type. */ public function current() { return $this->page->current(); } /** * (PHP 5 >= 5.0.0)<br/> * Move forward to next element * @link http://php.net/manual/en/iterator.next.php * @return void Any returned value is ignored. */ public function next() { $this->page->next(); $this->currentRecord++; if ($this->overLimit()) { return; } if (!$this->page->valid()) { if ($this->overPageLimit()) { return; } $this->page = $this->page->nextPage(); $this->currentPage++; } } /** * (PHP 5 >= 5.0.0)<br/> * Return the key of the current element * @link http://php.net/manual/en/iterator.key.php * @return mixed scalar on success, or null on failure. */ public function key() { return $this->currentRecord; } /** * (PHP 5 >= 5.0.0)<br/> * Checks if current position is valid * @link http://php.net/manual/en/iterator.valid.php * @return boolean The return value will be casted to boolean and then evaluated. * Returns true on success or false on failure. */ public function valid() { return $this->page && $this->page->valid() && !$this->overLimit() && !$this->overPageLimit(); } /** * (PHP 5 >= 5.0.0)<br/> * Rewind the Iterator to the first element * @link http://php.net/manual/en/iterator.rewind.php * @return void Any returned value is ignored. */ public function rewind() { $this->page = $this->firstPage; $this->page->rewind(); $this->currentPage = 1; $this->currentRecord = 1; } protected function overLimit() { return ($this->limit !== null && $this->limit !== Values::NONE && $this->limit < $this->currentRecord); } protected function overPageLimit() { return ($this->pageLimit !== null && $this->pageLimit !== Values::NONE && $this->pageLimit < $this->currentPage); } } sdk/src/Twilio/Page.php 0000644 00000013167 15002236443 0010757 0 ustar 00 <?php namespace Twilio; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\RestException; use Twilio\Http\Response; abstract class Page implements \Iterator { protected static $metaKeys = array( 'end', 'first_page_uri', 'next_page_uri', 'last_page_uri', 'page', 'page_size', 'previous_page_uri', 'total', 'num_pages', 'start', 'uri', ); protected $version; protected $payload; protected $solution; protected $records; abstract public function buildInstance(array $payload); public function __construct(Version $version, Response $response) { $payload = $this->processResponse($response); $this->version = $version; $this->payload = $payload; $this->solution = array(); $this->records = new \ArrayIterator($this->loadPage()); } protected function processResponse(Response $response) { if ($response->getStatusCode() != 200 && !$this->isPagingEol($response->getContent())) { $message = '[HTTP ' . $response->getStatusCode() . '] Unable to fetch page'; $code = $response->getStatusCode(); $content = $response->getContent(); if (\is_array($content)) { $message .= isset($content['message']) ? ': ' . $content['message'] : ''; $code = isset($content['code']) ? $content['code'] : $code; } throw new RestException($message, $code, $response->getStatusCode()); } return $response->getContent(); } protected function isPagingEol($content) { return !\is_null($content) && \array_key_exists('code', $content) && $content['code'] == 20006; } protected function hasMeta($key) { return \array_key_exists('meta', $this->payload) && \array_key_exists($key, $this->payload['meta']); } protected function getMeta($key, $default=null) { return $this->hasMeta($key) ? $this->payload['meta'][$key] : $default; } protected function loadPage() { $key = $this->getMeta('key'); if ($key) { return $this->payload[$key]; } else { $keys = \array_keys($this->payload); $key = \array_diff($keys, self::$metaKeys); $key = \array_values($key); if (\count($key) == 1) { return $this->payload[$key[0]]; } } // handle end of results error code if ($this->isPagingEol($this->payload)) { return array(); } throw new DeserializeException('Page Records can not be deserialized'); } public function getPreviousPageUrl() { if ($this->hasMeta('previous_page_url')) { return $this->getMeta('previous_page_url'); } else if (\array_key_exists('previous_page_uri', $this->payload) && $this->payload['previous_page_uri']) { return $this->getVersion()->getDomain()->absoluteUrl($this->payload['previous_page_uri']); } return null; } public function getNextPageUrl() { if ($this->hasMeta('next_page_url')) { return $this->getMeta('next_page_url'); } else if (\array_key_exists('next_page_uri', $this->payload) && $this->payload['next_page_uri']) { return $this->getVersion()->getDomain()->absoluteUrl($this->payload['next_page_uri']); } return null; } public function nextPage() { if (!$this->getNextPageUrl()) { return null; } $response = $this->getVersion()->getDomain()->getClient()->request('GET', $this->getNextPageUrl()); return new static($this->getVersion(), $response, $this->solution); } public function previousPage() { if (!$this->getPreviousPageUrl()) { return null; } $response = $this->getVersion()->getDomain()->getClient()->request('GET', $this->getPreviousPageUrl()); return new static($this->getVersion(), $response, $this->solution); } /** * (PHP 5 >= 5.0.0)<br/> * Return the current element * @link http://php.net/manual/en/iterator.current.php * @return mixed Can return any type. */ public function current() { return $this->buildInstance($this->records->current()); } /** * (PHP 5 >= 5.0.0)<br/> * Move forward to next element * @link http://php.net/manual/en/iterator.next.php * @return void Any returned value is ignored. */ public function next() { $this->records->next(); } /** * (PHP 5 >= 5.0.0)<br/> * Return the key of the current element * @link http://php.net/manual/en/iterator.key.php * @return mixed scalar on success, or null on failure. */ public function key() { return $this->records->key(); } /** * (PHP 5 >= 5.0.0)<br/> * Checks if current position is valid * @link http://php.net/manual/en/iterator.valid.php * @return boolean The return value will be casted to boolean and then evaluated. * Returns true on success or false on failure. */ public function valid() { return $this->records->valid(); } /** * (PHP 5 >= 5.0.0)<br/> * Rewind the Iterator to the first element * @link http://php.net/manual/en/iterator.rewind.php * @return void Any returned value is ignored. */ public function rewind() { $this->records->rewind(); } /** * @return Version */ public function getVersion() { return $this->version; } public function __toString() { return '[Page]'; } } sdk/src/Twilio/Serialize.php 0000644 00000004604 15002236443 0012026 0 ustar 00 <?php namespace Twilio; class Serialize { private static function flatten($map, $result = array(), $previous = array()) { foreach ($map as $key => $value) { if (\is_array($value)) { $result = self::flatten($value, $result, \array_merge($previous, array($key))); } else { $result[\join(".", \array_merge($previous, array($key)))] = $value; } } return $result; } public static function prefixedCollapsibleMap($map, $prefix) { if (\is_null($map) || $map == \Twilio\Values::NONE) { return array(); } $flattened = self::flatten($map); $result = array(); foreach ($flattened as $key => $value) { $result[$prefix . '.' . $key] = $value; } return $result; } public static function iso8601Date($dateTime) { if (\is_null($dateTime) || $dateTime == \Twilio\Values::NONE) { return \Twilio\Values::NONE; } if (\is_string($dateTime)) { return $dateTime; } $utcDate = clone $dateTime; $utcDate->setTimezone(new \DateTimeZone('UTC')); return $utcDate->format('Y-m-d'); } public static function iso8601DateTime($dateTime) { if (\is_null($dateTime) || $dateTime == \Twilio\Values::NONE) { return \Twilio\Values::NONE; } if (\is_string($dateTime)) { return $dateTime; } $utcDate = clone $dateTime; $utcDate->setTimezone(new \DateTimeZone('UTC')); return $utcDate->format('Y-m-d\TH:i:s\Z'); } public static function booleanToString($boolOrStr) { if (\is_null($boolOrStr) || \is_string($boolOrStr)) { return $boolOrStr; } return $boolOrStr ? 'True' : 'False'; } public static function json_object($object) { \trigger_error("Serialize::json_object has been deprecated in favor of Serialize::jsonObject", E_USER_NOTICE); return Serialize::jsonObject($object); } public static function jsonObject($object) { if (\is_array($object)) { return \json_encode($object); } return $object; } public static function map($values, $map_func) { if (!\is_array($values)) { return $values; } return \array_map($map_func, $values); } } sdk/src/Twilio/InstanceContext.php 0000644 00000000460 15002236443 0013204 0 ustar 00 <?php namespace Twilio; class InstanceContext { protected $version; protected $solution = array(); protected $uri; public function __construct(Version $version) { $this->version = $version; } public function __toString() { return '[InstanceContext]'; } } sdk/src/Twilio/Jwt/Grants/Grant.php 0000644 00000000471 15002236443 0013152 0 ustar 00 <?php namespace Twilio\Jwt\Grants; interface Grant { /** * Returns the grant type * * @return string type of the grant */ public function getGrantKey(); /** * Returns the grant data * * @return array data of the grant */ public function getPayload(); } sdk/src/Twilio/Jwt/Grants/VideoGrant.php 0000644 00000003546 15002236443 0014147 0 ustar 00 <?php namespace Twilio\Jwt\Grants; class VideoGrant implements Grant { private $configurationProfileSid; private $room; /** * Returns the configuration profile sid * * @return string the configuration profile sid */ public function getConfigurationProfileSid() { return $this->configurationProfileSid; } /** * Set the configuration profile sid of the grant * @deprecated in favor of setRoom/getRoom * * @param string $configurationProfileSid configuration profile sid of grant * * @return $this updated grant */ public function setConfigurationProfileSid($configurationProfileSid) { \trigger_error('Configuration profile sid is deprecated, use room instead.', E_USER_NOTICE); $this->configurationProfileSid = $configurationProfileSid; return $this; } /** * Returns the room * * @return string room name or sid set in this grant */ public function getRoom() { return $this->room; } /** * Set the room to allow access to in the grant * * @param string $roomSidOrName room sid or name * @return $this updated grant */ public function setRoom($roomSidOrName) { $this->room = $roomSidOrName; return $this; } /** * Returns the grant type * * @return string type of the grant */ public function getGrantKey() { return "video"; } /** * Returns the grant data * * @return array data of the grant */ public function getPayload() { $payload = array(); if ($this->configurationProfileSid) { $payload['configuration_profile_sid'] = $this->configurationProfileSid; } if ($this->room) { $payload['room'] = $this->room; } return $payload; } } sdk/src/Twilio/Jwt/Grants/ChatGrant.php 0000644 00000005627 15002236443 0013762 0 ustar 00 <?php namespace Twilio\Jwt\Grants; class ChatGrant implements Grant { private $serviceSid; private $endpointId; private $deploymentRoleSid; private $pushCredentialSid; /** * Returns the service sid * * @return string the service sid */ public function getServiceSid() { return $this->serviceSid; } /** * Set the service sid of this grant * * @param string $serviceSid service sid of the grant * * @return $this updated grant */ public function setServiceSid($serviceSid) { $this->serviceSid = $serviceSid; return $this; } /** * Returns the endpoint id of the grant * * @return string the endpoint id */ public function getEndpointId() { return $this->endpointId; } /** * Set the endpoint id of the grant * * @param string $endpointId endpoint id of the grant * * @return $this updated grant */ public function setEndpointId($endpointId) { $this->endpointId = $endpointId; return $this; } /** * Returns the deployment role sid of the grant * * @return string the deployment role sid */ public function getDeploymentRoleSid() { return $this->deploymentRoleSid; } /** * Set the role sid of the grant * * @param string $deploymentRoleSid role sid of the grant * * @return $this updated grant */ public function setDeploymentRoleSid($deploymentRoleSid) { $this->deploymentRoleSid = $deploymentRoleSid; return $this; } /** * Returns the push credential sid of the grant * * @return string the push credential sid */ public function getPushCredentialSid() { return $this->pushCredentialSid; } /** * Set the credential sid of the grant * * @param string $pushCredentialSid push credential sid of the grant * * @return $this updated grant */ public function setPushCredentialSid($pushCredentialSid) { $this->pushCredentialSid = $pushCredentialSid; return $this; } /** * Returns the grant type * * @return string type of the grant */ public function getGrantKey() { return "chat"; } /** * Returns the grant data * * @return array data of the grant */ public function getPayload() { $payload = array(); if ($this->serviceSid) { $payload['service_sid'] = $this->serviceSid; } if ($this->endpointId) { $payload['endpoint_id'] = $this->endpointId; } if ($this->deploymentRoleSid) { $payload['deployment_role_sid'] = $this->deploymentRoleSid; } if ($this->pushCredentialSid) { $payload['push_credential_sid'] = $this->pushCredentialSid; } return $payload; } } sdk/src/Twilio/Jwt/Grants/TaskRouterGrant.php 0000644 00000004246 15002236443 0015202 0 ustar 00 <?php namespace Twilio\Jwt\Grants; class TaskRouterGrant implements Grant { private $workspaceSid; private $workerSid; private $role; /** * Returns the workspace sid * * @return string the workspace sid */ public function getWorkspaceSid() { return $this->workspaceSid; } /** * Set the workspace sid of this grant * * @param string $workspaceSid workspace sid of the grant * * @return Services_Twilio_Auth_TaskRouterGrant updated grant */ public function setWorkspaceSid($workspaceSid) { $this->workspaceSid = $workspaceSid; return $this; } /** * Returns the worker sid * * @return string the worker sid */ public function getWorkerSid() { return $this->workerSid; } /** * Set the worker sid of this grant * * @param string $worker worker sid of the grant * * @return Services_Twilio_Auth_TaskRouterGrant updated grant */ public function setWorkerSid($workerSid) { $this->workerSid = $workerSid; return $this; } /** * Returns the role * * @return string the role */ public function getRole() { return $this->role; } /** * Set the role of this grant * * @param string $role role of the grant * * @return Services_Twilio_Auth_TaskRouterGrant updated grant */ public function setRole($role) { $this->role = $role; return $this; } /** * Returns the grant type * * @return string type of the grant */ public function getGrantKey() { return "task_router"; } /** * Returns the grant data * * @return array data of the grant */ public function getPayload() { $payload = array(); if ($this->workspaceSid) { $payload['workspace_sid'] = $this->workspaceSid; } if ($this->workerSid) { $payload['worker_sid'] = $this->workerSid; } if ($this->role) { $payload['role'] = $this->role; } return $payload; } } sdk/src/Twilio/Jwt/Grants/SyncGrant.php 0000644 00000006050 15002236443 0014006 0 ustar 00 <?php namespace Twilio\Jwt\Grants; class SyncGrant implements Grant { private $serviceSid; private $endpointId; private $deploymentRoleSid; private $pushCredentialSid; /** * Returns the service sid * * @return string the service sid */ public function getServiceSid() { return $this->serviceSid; } /** * Set the service sid of this grant * * @param string $serviceSid service sid of the grant * * @return Services_Twilio_Auth_SyncGrant updated grant */ public function setServiceSid($serviceSid) { $this->serviceSid = $serviceSid; return $this; } /** * Returns the endpoint id of the grant * * @return string the endpoint id */ public function getEndpointId() { return $this->endpointId; } /** * Set the endpoint id of the grant * * @param string $endpointId endpoint id of the grant * * @return Services_Twilio_Auth_SyncGrant updated grant */ public function setEndpointId($endpointId) { $this->endpointId = $endpointId; return $this; } /** * Returns the deployment role sid of the grant * * @return string the deployment role sid */ public function getDeploymentRoleSid() { return $this->deploymentRoleSid; } /** * Set the role sid of the grant * * @param string $deploymentRoleSid role sid of the grant * * @return Services_Twilio_Auth_SyncGrant updated grant */ public function setDeploymentRoleSid($deploymentRoleSid) { $this->deploymentRoleSid = $deploymentRoleSid; return $this; } /** * Returns the push credential sid of the grant * * @return string the push credential sid */ public function getPushCredentialSid() { return $this->pushCredentialSid; } /** * Set the credential sid of the grant * * @param string $pushCredentialSid push credential sid of the grant * * @return Services_Twilio_Auth_SyncGrant updated grant */ public function setPushCredentialSid($pushCredentialSid) { $this->pushCredentialSid = $pushCredentialSid; return $this; } /** * Returns the grant type * * @return string type of the grant */ public function getGrantKey() { return "data_sync"; } /** * Returns the grant data * * @return array data of the grant */ public function getPayload() { $payload = array(); if ($this->serviceSid) { $payload['service_sid'] = $this->serviceSid; } if ($this->endpointId) { $payload['endpoint_id'] = $this->endpointId; } if ($this->deploymentRoleSid) { $payload['deployment_role_sid'] = $this->deploymentRoleSid; } if ($this->pushCredentialSid) { $payload['push_credential_sid'] = $this->pushCredentialSid; } return $payload; } } sdk/src/Twilio/Jwt/Grants/VoiceGrant.php 0000644 00000007716 15002236443 0014151 0 ustar 00 <?php namespace Twilio\Jwt\Grants; class VoiceGrant implements Grant { private $incomingAllow; private $outgoingApplicationSid; private $outgoingApplicationParams; private $pushCredentialSid; private $endpointId; /** * Returns whether incoming is allowed * * @return boolean whether incoming is allowed */ public function getIncomingAllow() { return $this->incomingAllow; } /** * Set whether incoming is allowed * * @param boolean $incomingAllow whether incoming is allowed * * @return $this updated grant */ public function setIncomingAllow($incomingAllow) { $this->incomingAllow = $incomingAllow; return $this; } /** * Returns the outgoing application sid * * @return string the outgoing application sid */ public function getOutgoingApplicationSid() { return $this->outgoingApplicationSid; } /** * Set the outgoing application sid of the grant * * @param string $outgoingApplicationSid outgoing application sid of grant * * @return $this updated grant */ public function setOutgoingApplicationSid($outgoingApplicationSid) { $this->outgoingApplicationSid = $outgoingApplicationSid; return $this; } /** * Returns the outgoing application params * * @return array the outgoing application params */ public function getOutgoingApplicationParams() { return $this->outgoingApplicationParams; } /** * Set the outgoing application of the the grant * * @param string $sid outgoing application sid of the grant * @param string $params params to pass the the application * * @return $this updated grant */ public function setOutgoingApplication($sid, $params) { $this->outgoingApplicationSid = $sid; $this->outgoingApplicationParams = $params; return $this; } /** * Returns the push credential sid * * @return string the push credential sid */ public function getPushCredentialSid() { return $this->pushCredentialSid; } /** * Set the push credential sid * * @param string $pushCredentialSid * * @return $this updated grant */ public function setPushCredentialSid($pushCredentialSid) { $this->pushCredentialSid = $pushCredentialSid; return $this; } /** * Returns the endpoint id * * @return string the endpoint id */ public function getEndpointId() { return $this->endpointId; } /** * Set the endpoint id * * @param string $endpointId endpoint id * * @return $this updated grant */ public function setEndpointId($endpointId) { $this->endpointId = $endpointId; return $this; } /** * Returns the grant type * * @return string type of the grant */ public function getGrantKey() { return "voice"; } /** * Returns the grant data * * @return array data of the grant */ public function getPayload() { $payload = array(); if ($this->incomingAllow == true) { $incoming = array(); $incoming['allow'] = true; $payload['incoming'] = $incoming; } if ($this->outgoingApplicationSid) { $outgoing = array(); $outgoing['application_sid'] = $this->outgoingApplicationSid; if ($this->outgoingApplicationParams) { $outgoing['params'] = $this->outgoingApplicationParams; } $payload['outgoing'] = $outgoing; } if ($this->pushCredentialSid) { $payload['push_credential_sid'] = $this->pushCredentialSid; } if ($this->endpointId) { $payload['endpoint_id'] = $this->endpointId; } return $payload; } } sdk/src/Twilio/Jwt/Grants/IpMessagingGrant.php 0000644 00000006060 15002236443 0015301 0 ustar 00 <?php namespace Twilio\Jwt\Grants; class IpMessagingGrant implements Grant { private $serviceSid; private $endpointId; private $deploymentRoleSid; private $pushCredentialSid; public function __construct() { \trigger_error("IpMessagingGrant is deprecated, please use ChatGrant", E_USER_NOTICE); } /** * Returns the service sid * * @return string the service sid */ public function getServiceSid() { return $this->serviceSid; } /** * Set the service sid of this grant * * @param string $serviceSid service sid of the grant * * @return $this updated grant */ public function setServiceSid($serviceSid) { $this->serviceSid = $serviceSid; return $this; } /** * Returns the endpoint id of the grant * * @return string the endpoint id */ public function getEndpointId() { return $this->endpointId; } /** * Set the endpoint id of the grant * * @param string $endpointId endpoint id of the grant * * @return $this updated grant */ public function setEndpointId($endpointId) { $this->endpointId = $endpointId; return $this; } /** * Returns the deployment role sid of the grant * * @return string the deployment role sid */ public function getDeploymentRoleSid() { return $this->deploymentRoleSid; } /** * Set the role sid of the grant * * @param string $deploymentRoleSid role sid of the grant * * @return $this updated grant */ public function setDeploymentRoleSid($deploymentRoleSid) { $this->deploymentRoleSid = $deploymentRoleSid; return $this; } /** * Returns the push credential sid of the grant * * @return string the push credential sid */ public function getPushCredentialSid() { return $this->pushCredentialSid; } /** * Set the credential sid of the grant * * @param string $pushCredentialSid push credential sid of the grant * * @return $this updated grant */ public function setPushCredentialSid($pushCredentialSid) { $this->pushCredentialSid = $pushCredentialSid; return $this; } /** * Returns the grant type * * @return string type of the grant */ public function getGrantKey() { return "ip_messaging"; } /** * Returns the grant data * * @return array data of the grant */ public function getPayload() { $payload = array(); if ($this->serviceSid) { $payload['service_sid'] = $this->serviceSid; } if ($this->endpointId) { $payload['endpoint_id'] = $this->endpointId; } if ($this->deploymentRoleSid) { $payload['deployment_role_sid'] = $this->deploymentRoleSid; } if ($this->pushCredentialSid) { $payload['push_credential_sid'] = $this->pushCredentialSid; } return $payload; } } sdk/src/Twilio/Jwt/Grants/ConversationsGrant.php 0000644 00000002447 15002236443 0015735 0 ustar 00 <?php namespace Twilio\Jwt\Grants; class ConversationsGrant implements Grant { private $configurationProfileSid; public function __construct() { \trigger_error("ConversationsGrant is deprecated, please use VideoGrant", E_USER_NOTICE); } /** * Returns the configuration profile sid * * @return string the configuration profile sid */ public function getConfigurationProfileSid() { return $this->configurationProfileSid; } /** * @param string $configurationProfileSid the configuration profile sid * we want to enable for this grant * * @return $this updated grant */ public function setConfigurationProfileSid($configurationProfileSid) { $this->configurationProfileSid = $configurationProfileSid; return $this; } /** * Returns the grant type * * @return string type of the grant */ public function getGrantKey() { return "rtc"; } /** * Returns the grant data * * @return array data of the grant */ public function getPayload() { $payload = array(); if ($this->configurationProfileSid) { $payload['configuration_profile_sid'] = $this->configurationProfileSid; } return $payload; } } sdk/src/Twilio/Jwt/Client/ScopeURI.php 0000644 00000003203 15002236443 0013504 0 ustar 00 <?php namespace Twilio\Jwt\Client; /** * Scope URI implementation * * Simple way to represent configurable privileges in an OAuth * friendly way. For our case, they look like this: * * scope:<service>:<privilege>?<params> * * For example: * scope:client:incoming?name=jonas */ class ScopeURI { public $service; public $privilege; public $params; public function __construct($service, $privilege, $params = array()) { $this->service = $service; $this->privilege = $privilege; $this->params = $params; } public function toString() { $uri = "scope:{$this->service}:{$this->privilege}"; if (\count($this->params)) { $uri .= "?" . \http_build_query($this->params, '', '&'); } return $uri; } /** * Parse a scope URI into a ScopeURI object * * @param string $uri The scope URI * @return ScopeURI The parsed scope uri * @throws \UnexpectedValueException */ public static function parse($uri) { if (\strpos($uri, 'scope:') !== 0) { throw new \UnexpectedValueException( 'Not a scope URI according to scheme'); } $parts = \explode('?', $uri, 1); $params = null; if (\count($parts) > 1) { \parse_str($parts[1], $params); } $parts = \explode(':', $parts[0], 2); if (\count($parts) != 3) { throw new \UnexpectedValueException( 'Not enough parts for scope URI'); } list($scheme, $service, $privilege) = $parts; return new ScopeURI($service, $privilege, $params); } } sdk/src/Twilio/Jwt/JWT.php 0000644 00000012364 15002236443 0011311 0 ustar 00 <?php namespace Twilio\Jwt; /** * JSON Web Token implementation * * Minimum implementation used by Realtime auth, based on this spec: * http://self-issued.info/docs/draft-jones-json-web-token-01.html. * * @author Neuman Vong <neuman@twilio.com> */ class JWT { /** * @param string $jwt The JWT * @param string|null $key The secret key * @param bool $verify Don't skip verification process * @return object The JWT's payload as a PHP object * @throws \DomainException * @throws \UnexpectedValueException */ public static function decode($jwt, $key = null, $verify = true) { $tks = \explode('.', $jwt); if (\count($tks) != 3) { throw new \UnexpectedValueException('Wrong number of segments'); } list($headb64, $payloadb64, $cryptob64) = $tks; if (null === ($header = self::jsonDecode(self::urlsafeB64Decode($headb64))) ) { throw new \UnexpectedValueException('Invalid segment encoding'); } if (null === $payload = self::jsonDecode(self::urlsafeB64Decode($payloadb64)) ) { throw new \UnexpectedValueException('Invalid segment encoding'); } $sig = self::urlsafeB64Decode($cryptob64); if ($verify) { if (empty($header->alg)) { throw new \DomainException('Empty algorithm'); } if ($sig != self::sign("$headb64.$payloadb64", $key, $header->alg)) { throw new \UnexpectedValueException('Signature verification failed'); } } return $payload; } /** * @param object|array $payload PHP object or array * @param string $key The secret key * @param string $algo The signing algorithm * @param array $additionalHeaders Additional keys/values to add to the header * * @return string A JWT */ public static function encode($payload, $key, $algo = 'HS256', $additionalHeaders = array()) { $header = array('typ' => 'JWT', 'alg' => $algo); $header = $header + $additionalHeaders; $segments = array(); $segments[] = self::urlsafeB64Encode(self::jsonEncode($header)); $segments[] = self::urlsafeB64Encode(self::jsonEncode($payload)); $signing_input = \implode('.', $segments); $signature = self::sign($signing_input, $key, $algo); $segments[] = self::urlsafeB64Encode($signature); return \implode('.', $segments); } /** * @param string $msg The message to sign * @param string $key The secret key * @param string $method The signing algorithm * @return string An encrypted message * @throws \DomainException */ public static function sign($msg, $key, $method = 'HS256') { $methods = array( 'HS256' => 'sha256', 'HS384' => 'sha384', 'HS512' => 'sha512', ); if (empty($methods[$method])) { throw new \DomainException('Algorithm not supported'); } return \hash_hmac($methods[$method], $msg, $key, true); } /** * @param string $input JSON string * @return object Object representation of JSON string * @throws \DomainException */ public static function jsonDecode($input) { $obj = \json_decode($input); if (\function_exists('json_last_error') && $errno = \json_last_error()) { self::handleJsonError($errno); } else if ($obj === null && $input !== 'null') { throw new \DomainException('Null result with non-null input'); } return $obj; } /** * @param object|array $input A PHP object or array * @return string JSON representation of the PHP object or array * @throws \DomainException */ public static function jsonEncode($input) { $json = \json_encode($input); if (\function_exists('json_last_error') && $errno = \json_last_error()) { self::handleJsonError($errno); } else if ($json === 'null' && $input !== null) { throw new \DomainException('Null result with non-null input'); } return $json; } /** * @param string $input A base64 encoded string * * @return string A decoded string */ public static function urlsafeB64Decode($input) { $padlen = 4 - \strlen($input) % 4; $input .= \str_repeat('=', $padlen); return \base64_decode(\strtr($input, '-_', '+/')); } /** * @param string $input Anything really * * @return string The base64 encode of what you passed in */ public static function urlsafeB64Encode($input) { return \str_replace('=', '', \strtr(\base64_encode($input), '+/', '-_')); } /** * @param int $errno An error number from json_last_error() * * @throws \DomainException */ private static function handleJsonError($errno) { $messages = array( JSON_ERROR_DEPTH => 'Maximum stack depth exceeded', JSON_ERROR_CTRL_CHAR => 'Unexpected control character found', JSON_ERROR_SYNTAX => 'Syntax error, malformed JSON' ); throw new \DomainException(isset($messages[$errno]) ? $messages[$errno] : 'Unknown JSON error: ' . $errno ); } } sdk/src/Twilio/Jwt/TaskRouter/Policy.php 0000644 00000003014 15002236443 0014177 0 ustar 00 <?php namespace Twilio\Jwt\TaskRouter; /** * Twilio API Policy constructor * * @author Justin Witz <justin.witz@twilio.com> * @license http://creativecommons.org/licenses/MIT/ MIT */ class Policy { private $url; private $method; private $queryFilter; private $postFilter; private $allow; public function __construct($url, $method, $queryFilter = array(), $postFilter = array(), $allow = true) { $this->url = $url; $this->method = $method; $this->queryFilter = $queryFilter; $this->postFilter = $postFilter; $this->allow = $allow; } public function addQueryFilter($queryFilter) { \array_push($this->queryFilter, $queryFilter); } public function addPostFilter($postFilter) { \array_push($this->postFilter, $postFilter); } public function toArray() { $policy_array = array('url' => $this->url, 'method' => $this->method, 'allow' => $this->allow); if (!\is_null($this->queryFilter)) { if (\count($this->queryFilter) > 0) { $policy_array['query_filter'] = $this->queryFilter; } else { $policy_array['query_filter'] = new \stdClass(); } } if (!\is_null($this->postFilter)) { if (\count($this->postFilter) > 0) { $policy_array['post_filter'] = $this->postFilter; } else { $policy_array['post_filter'] = new \stdClass(); } } return $policy_array; } } sdk/src/Twilio/Jwt/TaskRouter/WorkerCapability.php 0000644 00000003357 15002236443 0016225 0 ustar 00 <?php namespace Twilio\Jwt\TaskRouter; /** * Twilio TaskRouter Worker Capability assigner * * @author Justin Witz <justin.witz@twilio.com> * @license http://creativecommons.org/licenses/MIT/ MIT */ class WorkerCapability extends CapabilityToken { private $tasksUrl; private $workerReservationsUrl; private $activityUrl; public function __construct($accountSid, $authToken, $workspaceSid, $workerSid, $overrideBaseUrl = null, $overrideBaseWSUrl = null) { parent::__construct($accountSid, $authToken, $workspaceSid, $workerSid, null, $overrideBaseUrl, $overrideBaseWSUrl); $this->tasksUrl = $this->baseUrl . '/Tasks/**'; $this->activityUrl = $this->baseUrl . '/Activities'; $this->workerReservationsUrl = $this->resourceUrl . '/Reservations/**'; //add permissions to fetch the list of activities, tasks, and worker reservations $this->allow($this->activityUrl, "GET", null, null); $this->allow($this->tasksUrl, "GET", null, null); $this->allow($this->workerReservationsUrl, "GET", null, null); } protected function setupResource() { $this->resourceUrl = $this->baseUrl . '/Workers/' . $this->channelId; } public function allowActivityUpdates() { $method = 'POST'; $queryFilter = array(); $postFilter = array("ActivitySid" => $this->required); $this->allow($this->resourceUrl, $method, $queryFilter, $postFilter); } public function allowReservationUpdates() { $method = 'POST'; $queryFilter = array(); $postFilter = array(); $this->allow($this->tasksUrl, $method, $queryFilter, $postFilter); $this->allow($this->workerReservationsUrl, $method, $queryFilter, $postFilter); } } sdk/src/Twilio/Jwt/TaskRouter/WorkspaceCapability.php 0000644 00000000701 15002236443 0016700 0 ustar 00 <?php namespace Twilio\Jwt\TaskRouter; class WorkspaceCapability extends CapabilityToken { public function __construct($accountSid, $authToken, $workspaceSid, $overrideBaseUrl = null, $overrideBaseWSUrl = null) { parent::__construct($accountSid, $authToken, $workspaceSid, $workspaceSid, null, $overrideBaseUrl, $overrideBaseWSUrl); } protected function setupResource() { $this->resourceUrl = $this->baseUrl; } } sdk/src/Twilio/Jwt/TaskRouter/TaskQueueCapability.php 0000644 00000001233 15002236443 0016652 0 ustar 00 <?php namespace Twilio\Jwt\TaskRouter; /** * Twilio TaskRouter TaskQueue Capability assigner * * @author Justin Witz <justin.witz@twilio.com> * @license http://creativecommons.org/licenses/MIT/ MIT */ class TaskQueueCapability extends CapabilityToken { public function __construct($accountSid, $authToken, $workspaceSid, $taskQueueSid, $overrideBaseUrl = null, $overrideBaseWSUrl = null) { parent::__construct($accountSid, $authToken, $workspaceSid, $taskQueueSid, null, $overrideBaseUrl, $overrideBaseWSUrl); } protected function setupResource() { $this->resourceUrl = $this->baseUrl . '/TaskQueues/' . $this->channelId; } } sdk/src/Twilio/Jwt/TaskRouter/CapabilityToken.php 0000644 00000012637 15002236443 0016035 0 ustar 00 <?php namespace Twilio\Jwt\TaskRouter; use Twilio\Jwt\JWT; /** * Twilio TaskRouter Capability assigner * * @author Justin Witz <justin.witz@twilio.com> * @license http://creativecommons.org/licenses/MIT/ MIT */ class CapabilityToken { protected $accountSid; protected $authToken; private $friendlyName; /** @var Policy[] $policies */ private $policies; protected $baseUrl = 'https://taskrouter.twilio.com/v1'; protected $baseWsUrl = 'https://event-bridge.twilio.com/v1/wschannels'; protected $version = 'v1'; protected $workspaceSid; protected $channelId; protected $resourceUrl; protected $required = array("required" => true); protected $optional = array("required" => false); public function __construct($accountSid, $authToken, $workspaceSid, $channelId, $resourceUrl = null, $overrideBaseUrl = null, $overrideBaseWSUrl = null) { $this->accountSid = $accountSid; $this->authToken = $authToken; $this->friendlyName = $channelId; $this->policies = array(); $this->workspaceSid = $workspaceSid; $this->channelId = $channelId; if (isset($overrideBaseUrl)) { $this->baseUrl = $overrideBaseUrl; } if (isset($overrideBaseWSUrl)) { $this->baseWsUrl = $overrideBaseWSUrl; } $this->baseUrl = $this->baseUrl . '/Workspaces/' . $workspaceSid; $this->validateJWT(); if (!isset($resourceUrl)) { $this->setupResource(); } //add permissions to GET and POST to the event-bridge channel $this->allow($this->baseWsUrl . "/" . $this->accountSid . "/" . $this->channelId, "GET", null, null); $this->allow($this->baseWsUrl . "/" . $this->accountSid . "/" . $this->channelId, "POST", null, null); //add permissions to fetch the instance resource $this->allow($this->resourceUrl, "GET", null, null); } protected function setupResource() { } public function addPolicyDeconstructed($url, $method, $queryFilter = array(), $postFilter = array(), $allow = true) { $policy = new Policy($url, $method, $queryFilter, $postFilter, $allow); \array_push($this->policies, $policy); return $policy; } public function allow($url, $method, $queryFilter = array(), $postFilter = array()) { $this->addPolicyDeconstructed($url, $method, $queryFilter, $postFilter, true); } public function deny($url, $method, $queryFilter = array(), $postFilter = array()) { $this->addPolicyDeconstructed($url, $method, $queryFilter, $postFilter, false); } private function validateJWT() { if (!isset($this->accountSid) || \substr($this->accountSid, 0, 2) != 'AC') { throw new \Exception("Invalid AccountSid provided: " . $this->accountSid); } if (!isset($this->workspaceSid) || \substr($this->workspaceSid, 0, 2) != 'WS') { throw new \Exception("Invalid WorkspaceSid provided: " . $this->workspaceSid); } if (!isset($this->channelId)) { throw new \Exception("ChannelId not provided"); } $prefix = \substr($this->channelId, 0, 2); if ($prefix != 'WS' && $prefix != 'WK' && $prefix != 'WQ') { throw new \Exception("Invalid ChannelId provided: " . $this->channelId); } } public function allowFetchSubresources() { $method = 'GET'; $queryFilter = array(); $postFilter = array(); $this->allow($this->resourceUrl . '/**', $method, $queryFilter, $postFilter); } public function allowUpdates() { $method = 'POST'; $queryFilter = array(); $postFilter = array(); $this->allow($this->resourceUrl, $method, $queryFilter, $postFilter); } public function allowUpdatesSubresources() { $method = 'POST'; $queryFilter = array(); $postFilter = array(); $this->allow($this->resourceUrl . '/**', $method, $queryFilter, $postFilter); } public function allowDelete() { $method = 'DELETE'; $queryFilter = array(); $postFilter = array(); $this->allow($this->resourceUrl, $method, $queryFilter, $postFilter); } public function allowDeleteSubresources() { $method = 'DELETE'; $queryFilter = array(); $postFilter = array(); $this->allow($this->resourceUrl . '/**', $method, $queryFilter, $postFilter); } public function generateToken($ttl = 3600, $extraAttributes = array()) { $payload = array( 'version' => $this->version, 'friendly_name' => $this->friendlyName, 'iss' => $this->accountSid, 'exp' => \time() + $ttl, 'account_sid' => $this->accountSid, 'channel' => $this->channelId, 'workspace_sid' => $this->workspaceSid ); if (\substr($this->channelId, 0, 2) == 'WK') { $payload['worker_sid'] = $this->channelId; } else if (\substr($this->channelId, 0, 2) == 'WQ') { $payload['taskqueue_sid'] = $this->channelId; } foreach ($extraAttributes as $key => $value) { $payload[$key] = $value; } $policyStrings = array(); foreach ($this->policies as $policy) { $policyStrings[] = $policy->toArray(); } $payload['policies'] = $policyStrings; return JWT::encode($payload, $this->authToken, 'HS256'); } } sdk/src/Twilio/Jwt/ClientToken.php 0000644 00000010150 15002236443 0013053 0 ustar 00 <?php namespace Twilio\Jwt; use Twilio\Jwt\Client\ScopeURI; /** * Twilio Capability Token generator */ class ClientToken { public $accountSid; public $authToken; /** @var ScopeURI[] $scopes */ public $scopes; /** @var string[] $customClaims */ private $customClaims; /** * Create a new TwilioCapability with zero permissions. Next steps are to * grant access to resources by configuring this token through the * functions allowXXXX. * * @param string $accountSid the account sid to which this token is granted * access * @param string $authToken the secret key used to sign the token. Note, * this auth token is not visible to the user of the token. */ public function __construct($accountSid, $authToken) { $this->accountSid = $accountSid; $this->authToken = $authToken; $this->scopes = array(); $this->clientName = false; $this->customClaims = array(); } /** * If the user of this token should be allowed to accept incoming * connections then configure the TwilioCapability through this method and * specify the client name. * * @param $clientName * @throws \InvalidArgumentException */ public function allowClientIncoming($clientName) { // clientName must be a non-zero length alphanumeric string if (\preg_match('/\W/', $clientName)) { throw new \InvalidArgumentException( 'Only alphanumeric characters allowed in client name.'); } if (\strlen($clientName) == 0) { throw new \InvalidArgumentException( 'Client name must not be a zero length string.'); } $this->clientName = $clientName; $this->allow('client', 'incoming', array('clientName' => $clientName)); } /** * Allow the user of this token to make outgoing connections. * * @param string $appSid the application to which this token grants access * @param mixed[] $appParams signed parameters that the user of this token * cannot overwrite. */ public function allowClientOutgoing($appSid, array $appParams = array()) { $this->allow('client', 'outgoing', array( 'appSid' => $appSid, 'appParams' => \http_build_query($appParams, '', '&'))); } /** * Allow the user of this token to access their event stream. * * @param mixed[] $filters key/value filters to apply to the event stream */ public function allowEventStream(array $filters = array()) { $this->allow('stream', 'subscribe', array( 'path' => '/2010-04-01/Events', 'params' => \http_build_query($filters, '', '&'), )); } /** * Allows to set custom claims, which then will be encoded into JWT payload. * * @param string $name * @param string $value */ public function addClaim($name, $value) { $this->customClaims[$name] = $value; } /** * Generates a new token based on the credentials and permissions that * previously has been granted to this token. * * @param int $ttl the expiration time of the token (in seconds). Default * value is 3600 (1hr) * @return ClientToken the newly generated token that is valid for $ttl * seconds */ public function generateToken($ttl = 3600) { $payload = \array_merge($this->customClaims, array( 'scope' => array(), 'iss' => $this->accountSid, 'exp' => \time() + $ttl, )); $scopeStrings = array(); foreach ($this->scopes as $scope) { if ($scope->privilege == "outgoing" && $this->clientName) $scope->params["clientName"] = $this->clientName; $scopeStrings[] = $scope->toString(); } $payload['scope'] = \implode(' ', $scopeStrings); return JWT::encode($payload, $this->authToken, 'HS256'); } protected function allow($service, $privilege, $params) { $this->scopes[] = new ScopeURI($service, $privilege, $params); } } sdk/src/Twilio/Jwt/AccessToken.php 0000644 00000006375 15002236443 0013054 0 ustar 00 <?php namespace Twilio\Jwt; use Twilio\Jwt\Grants\Grant; class AccessToken { private $signingKeySid; private $accountSid; private $secret; private $ttl; private $identity; private $nbf; /** @var Grant[] $grants */ private $grants; /** @var string[] $customClaims */ private $customClaims; public function __construct($accountSid, $signingKeySid, $secret, $ttl = 3600, $identity = null) { $this->signingKeySid = $signingKeySid; $this->accountSid = $accountSid; $this->secret = $secret; $this->ttl = $ttl; if (!\is_null($identity)) { $this->identity = $identity; } $this->grants = array(); $this->customClaims = array(); } /** * Set the identity of this access token * * @param string $identity identity of the grant * * @return $this updated access token */ public function setIdentity($identity) { $this->identity = $identity; return $this; } /** * Returns the identity of the grant * * @return string the identity */ public function getIdentity() { return $this->identity; } /** * Set the nbf of this access token * * @param integer $nbf nbf in epoch seconds of the grant * * @return $this updated access token */ public function setNbf($nbf) { $this->nbf = $nbf; return $this; } /** * Returns the nbf of the grant * * @return integer the nbf in epoch seconds */ public function getNbf() { return $this->nbf; } /** * Add a grant to the access token * * @param Grant $grant to be added * * @return $this the updated access token */ public function addGrant(Grant $grant) { $this->grants[] = $grant; return $this; } /** * Allows to set custom claims, which then will be encoded into JWT payload. * * @param string $name * @param string $value */ public function addClaim($name, $value) { $this->customClaims[$name] = $value; } public function toJWT($algorithm = 'HS256') { $header = array( 'cty' => 'twilio-fpa;v=1', 'typ' => 'JWT' ); $now = \time(); $grants = array(); if ($this->identity) { $grants['identity'] = $this->identity; } foreach ($this->grants as $grant) { $payload = $grant->getPayload(); if (empty($payload)) { $payload = \json_decode('{}'); } $grants[$grant->getGrantKey()] = $payload; } if (empty($grants)) { $grants = \json_decode('{}'); } $payload = \array_merge($this->customClaims, array( 'jti' => $this->signingKeySid . '-' . $now, 'iss' => $this->signingKeySid, 'sub' => $this->accountSid, 'exp' => $now + $this->ttl, 'grants' => $grants )); if (!\is_null($this->nbf)) { $payload['nbf'] = $this->nbf; } return JWT::encode($payload, $this->secret, $algorithm, $header); } public function __toString() { return $this->toJWT(); } } sdk/src/Twilio/ListResource.php 0000644 00000000452 15002236443 0012517 0 ustar 00 <?php namespace Twilio; class ListResource { protected $version; protected $solution = array(); protected $uri; public function __construct(Version $version) { $this->version = $version; } public function __toString() { return '[ListResource]'; } } sdk/src/Twilio/Version.php 0000644 00000015074 15002236443 0011527 0 ustar 00 <?php namespace Twilio; use Twilio\Exceptions\RestException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; abstract class Version { /** * @const int MAX_PAGE_SIZE largest page the Twilio API will return */ const MAX_PAGE_SIZE = 1000; /** * @var \Twilio\Domain $domain */ protected $domain; /** * @var string $version */ protected $version; /** * @param \Twilio\Domain $domain */ public function __construct(Domain $domain) { $this->domain = $domain; $this->version = null; } /** * Generate an absolute URL from a version relative uri * @param string $uri Version relative uri * @return string Absolute URL */ public function absoluteUrl($uri) { return $this->getDomain()->absoluteUrl($this->relativeUri($uri)); } /** * Generate a domain relative uri from a version relative uri * @param string $uri Version relative uri * @return string Domain relative uri */ public function relativeUri($uri) { return \trim($this->version, '/') . '/' . \trim($uri, '/'); } public function request($method, $uri, $params = array(), $data = array(), $headers = array(), $username = null, $password = null, $timeout = null) { $uri = $this->relativeUri($uri); return $this->getDomain()->request( $method, $uri, $params, $data, $headers, $username, $password, $timeout ); } /** * Create the best possible exception for the response. * * Attempts to parse the response for Twilio Standard error messages and use * those to populate the exception, falls back to generic error message and * HTTP status code. * * @param Response $response Error response * @param string $header Header for exception message * @return TwilioException */ protected function exception($response, $header) { $message = '[HTTP ' . $response->getStatusCode() . '] ' . $header; $content = $response->getContent(); if (\is_array($content)) { $message .= isset($content['message']) ? ': ' . $content['message'] : ''; $code = isset($content['code']) ? $content['code'] : $response->getStatusCode(); return new RestException($message, $code, $response->getStatusCode()); } else { return new RestException($message, $response->getStatusCode(), $response->getStatusCode()); } } /** * @throws TwilioException */ public function fetch($method, $uri, $params = array(), $data = array(), $headers = array(), $username = null, $password = null, $timeout = null) { $response = $this->request( $method, $uri, $params, $data, $headers, $username, $password, $timeout ); if ($response->getStatusCode() < 200 || $response->getStatusCode() >= 300) { throw $this->exception($response, 'Unable to fetch record'); } return $response->getContent(); } /** * @throws TwilioException */ public function update($method, $uri, $params = array(), $data = array(), $headers = array(), $username = null, $password = null, $timeout = null) { $response = $this->request( $method, $uri, $params, $data, $headers, $username, $password, $timeout ); if ($response->getStatusCode() < 200 || $response->getStatusCode() >= 300) { throw $this->exception($response, 'Unable to update record'); } return $response->getContent(); } /** * @throws TwilioException */ public function delete($method, $uri, $params = array(), $data = array(), $headers = array(), $username = null, $password = null, $timeout = null) { $response = $this->request( $method, $uri, $params, $data, $headers, $username, $password, $timeout ); if ($response->getStatusCode() < 200 || $response->getStatusCode() >= 300) { throw $this->exception($response, 'Unable to delete record'); } return $response->getStatusCode() == 204; } public function readLimits($limit = null, $pageSize = null) { $pageLimit = Values::NONE; if ($limit) { if (\is_null($pageSize)) { $pageSize = \min($limit, self::MAX_PAGE_SIZE); } $pageLimit = (int)(\ceil($limit / (float)$pageSize)); } $pageSize = \min($pageSize, self::MAX_PAGE_SIZE); return array( 'limit' => $limit ?: Values::NONE, 'pageSize' => $pageSize ?: Values::NONE, 'pageLimit' => $pageLimit, ); } public function page($method, $uri, $params = array(), $data = array(), $headers = array(), $username = null, $password = null, $timeout = null) { return $this->request( $method, $uri, $params, $data, $headers, $username, $password, $timeout ); } public function stream($page, $limit = null, $pageLimit = null) { return new Stream($page, $limit, $pageLimit); } /** * @throws TwilioException */ public function create($method, $uri, $params = array(), $data = array(), $headers = array(), $username = null, $password = null, $timeout = null) { $response = $this->request( $method, $uri, $params, $data, $headers, $username, $password, $timeout ); if ($response->getStatusCode() < 200 || $response->getStatusCode() >= 300) { throw $this->exception($response, 'Unable to create record'); } return $response->getContent(); } /** * @return \Twilio\Domain $domain */ public function getDomain() { return $this->domain; } public function __toString() { return '[Version]'; } } sdk/src/Twilio/Domain.php 0000644 00000004037 15002236443 0011306 0 ustar 00 <?php namespace Twilio; use Twilio\Rest\Client; /** * Class Domain * Abstracts a Twilio sub domain * @package Twilio */ abstract class Domain { /** * @var \Twilio\Rest\Client Twilio Client */ protected $client; /** * @var string Base URL for this domain */ protected $baseUrl; /** * Construct a new Domain * @param \Twilio\Rest\Client $client used to communicate with Twilio */ public function __construct(Client $client) { $this->client = $client; $this->baseUrl = ''; } /** * Translate version relative URIs into absolute URLs * * @param string $uri Version relative URI * @return string Absolute URL for this domain */ public function absoluteUrl($uri) { return \implode('/', array(\trim($this->baseUrl, '/'), \trim($uri, '/'))); } /** * Make an HTTP request to the domain * * @param string $method HTTP Method to make the request with * @param string $uri Relative uri to make a request to * @param array $params Query string arguments * @param array $data Post form data * @param array $headers HTTP headers to send with the request * @param string $user User to authenticate as * @param string $password Password * @param null $timeout Request timeout * @return \Twilio\Http\Response the response for the request */ public function request($method, $uri, $params = array(), $data = array(), $headers = array(), $user = null, $password=null, $timeout=null) { $url = $this->absoluteUrl($uri); return $this->client->request( $method, $url, $params, $data, $headers, $user, $password, $timeout ); } /** * @return \Twilio\Rest\Client */ public function getClient() { return $this->client; } public function __toString() { return '[Domain]'; } } sdk/src/Twilio/autoload.php 0000644 00000012333 15002236443 0011705 0 ustar 00 <?php /* * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * This software consists of voluntary contributions made by many individuals * and is licensed under the MIT license. For more information, see * <http://www.doctrine-project.org>. */ /** * SplClassLoader implementation that implements the technical interoperability * standards for PHP 5.3 namespaces and class names. * * http://groups.google.com/group/php-standards/web/psr-0-final-proposal?pli=1 * * // Example which loads classes for the Doctrine Common package in the * // Doctrine\Common namespace. * $classLoader = new SplClassLoader('Doctrine\Common', '/path/to/doctrine'); * $classLoader->register(); * * @license http://www.opensource.org/licenses/mit-license.html MIT License * @author Jonathan H. Wage <jonwage@gmail.com> * @author Roman S. Borschel <roman@code-factory.org> * @author Matthew Weier O'Phinney <matthew@zend.com> * @author Kris Wallsmith <kris.wallsmith@gmail.com> * @author Fabien Potencier <fabien.potencier@symfony-project.org> */ class SplClassLoader { private $_fileExtension = '.php'; private $_namespace; private $_includePath; private $_namespaceSeparator = '\\'; /** * Creates a new <tt>SplClassLoader</tt> that loads classes of the * specified namespace. * * @param string $ns The namespace to use. * @param string $includePath The include path to search */ public function __construct($ns = null, $includePath = null) { $this->_namespace = $ns; $this->_includePath = $includePath; } /** * Sets the namespace separator used by classes in the namespace of this class loader. * * @param string $sep The separator to use. */ public function setNamespaceSeparator($sep) { $this->_namespaceSeparator = $sep; } /** * Gets the namespace separator used by classes in the namespace of this class loader. * * @return string The separator to use. */ public function getNamespaceSeparator() { return $this->_namespaceSeparator; } /** * Sets the base include path for all class files in the namespace of this class loader. * * @param string $includePath */ public function setIncludePath($includePath) { $this->_includePath = $includePath; } /** * Gets the base include path for all class files in the namespace of this class loader. * * @return string $includePath */ public function getIncludePath() { return $this->_includePath; } /** * Sets the file extension of class files in the namespace of this class loader. * * @param string $fileExtension */ public function setFileExtension($fileExtension) { $this->_fileExtension = $fileExtension; } /** * Gets the file extension of class files in the namespace of this class loader. * * @return string $fileExtension */ public function getFileExtension() { return $this->_fileExtension; } /** * Installs this class loader on the SPL autoload stack. */ public function register() { \spl_autoload_register(array($this, 'loadClass')); } /** * Uninstalls this class loader from the SPL autoloader stack. */ public function unregister() { \spl_autoload_unregister(array($this, 'loadClass')); } /** * Loads the given class or interface. * * @param string $className The name of the class to load. * @return void */ public function loadClass($className) { if (null === $this->_namespace || $this->_namespace . $this->_namespaceSeparator === \substr($className, 0, \strlen($this->_namespace . $this->_namespaceSeparator))) { $fileName = ''; $namespace = ''; if (false !== ($lastNsPos = \strripos($className, $this->_namespaceSeparator))) { $namespace = \substr($className, 0, $lastNsPos); $className = \substr($className, $lastNsPos + 1); $fileName = \str_replace($this->_namespaceSeparator, DIRECTORY_SEPARATOR, $namespace) . DIRECTORY_SEPARATOR; } $fileName .= \str_replace('_', DIRECTORY_SEPARATOR, $className) . $this->_fileExtension; require ($this->_includePath !== null ? $this->_includePath . DIRECTORY_SEPARATOR : '') . $fileName; } } } $twilioClassLoader = new SplClassLoader('Twilio', \realpath(__DIR__ . DIRECTORY_SEPARATOR . '..')); $twilioClassLoader->register(); sdk/src/Twilio/VersionInfo.php 0000644 00000000352 15002236443 0012334 0 ustar 00 <?php namespace Twilio; class VersionInfo { const MAJOR = 5; const MINOR = 41; const PATCH = 1; public static function string() { return implode('.', array(self::MAJOR, self::MINOR, self::PATCH)); } } sdk/src/Twilio/TaskRouter/WorkflowRule.php 0000644 00000001460 15002236443 0014641 0 ustar 00 <?php namespace Twilio\TaskRouter; /** * Twilio TaskRouter Workflow Rule * * @author Justin Witz <jwitz@twilio.com> * @license http://creativecommons.org/licenses/MIT/ MIT */ class WorkflowRule implements \JsonSerializable { public $expression; public $friendly_name; public $targets; public function __construct($expression, $targets, $friendly_name = null) { $this->expression = $expression; $this->targets = $targets; $this->friendly_name = $friendly_name; } public function jsonSerialize() { $json = array(); $json["expression"] = $this->expression; $json["targets"] = $this->targets; if($this->friendly_name != null) { $json["friendly_name"] = $this->friendly_name; } return $json; } } sdk/src/Twilio/TaskRouter/WorkflowRuleTarget.php 0000644 00000001762 15002236443 0016015 0 ustar 00 <?php namespace Twilio\TaskRouter; /** * Twilio TaskRouter Workflow Rule Target * * @author Justin Witz <jwitz@twilio.com> * @license http://creativecommons.org/licenses/MIT/ MIT */ class WorkflowRuleTarget implements \JsonSerializable { public $queue; public $expression; public $priority; public $timeout; public function __construct($queue, $priority = null, $timeout = null, $expression = null) { $this->queue = $queue; $this->priority = $priority; $this->timeout = $timeout; $this->expression = $expression; } public function jsonSerialize() { $json = array(); $json["queue"] = $this->queue; if($this->priority != null) { $json["priority"] = $this->priority; } if($this->timeout != null) { $json["timeout"] = $this->timeout; } if($this->expression != null) { $json["expression"] = $this->expression; } return $json; } } sdk/src/Twilio/TaskRouter/WorkflowConfiguration.php 0000644 00000002574 15002236443 0016550 0 ustar 00 <?php namespace Twilio\TaskRouter; /** * Twilio TaskRouter Workflow Builder * * @author Justin Witz <jwitz@twilio.com> * @license http://creativecommons.org/licenses/MIT/ MIT */ class WorkflowConfiguration implements \JsonSerializable { public $filters; public $default_filter; public function __construct($filters, $default_filter = null) { $this->filters = $filters; $this->default_filter = $default_filter; } public function toJSON() { return \json_encode($this); } public static function parse($json) { return \json_decode($json); } public static function fromJson($json) { $configJSON = self::parse($json); $default_filter = $configJSON->task_routing->default_filter; $filters = array(); foreach($configJSON->task_routing->filters as $filter) { // friendly_name and filter_friendly_name should map to same variable $friendly_name = isset($filter->filter_friendly_name) ? $filter->filter_friendly_name : $filter->friendly_name; $filter = new WorkflowRule($filter->expression, $filter->targets, $friendly_name); $filters[] = $filter; } return new WorkflowConfiguration($filters, $default_filter); } public function jsonSerialize() { $json = array(); $task_routing = array(); $task_routing["filters"] = $this->filters; $task_routing["default_filter"] = $this->default_filter; $json["task_routing"] = $task_routing; return $json; } } sdk/src/Twilio/TwiML/Voice/Pause.php 0000644 00000001224 15002236443 0013210 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\TwiML\Voice; use Twilio\TwiML\TwiML; class Pause extends TwiML { /** * Pause constructor. * * @param array $attributes Optional attributes */ public function __construct($attributes = array()) { parent::__construct('Pause', null, $attributes); } /** * Add Length attribute. * * @param int $length Length in seconds to pause * @return static $this. */ public function setLength($length) { return $this->setAttribute('length', $length); } } sdk/src/Twilio/TwiML/Voice/Leave.php 0000644 00000000512 15002236443 0013166 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\TwiML\Voice; use Twilio\TwiML\TwiML; class Leave extends TwiML { /** * Leave constructor. */ public function __construct() { parent::__construct('Leave', null); } } sdk/src/Twilio/TwiML/Voice/Room.php 0000644 00000001517 15002236443 0013054 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\TwiML\Voice; use Twilio\TwiML\TwiML; class Room extends TwiML { /** * Room constructor. * * @param string $name Room name * @param array $attributes Optional attributes */ public function __construct($name, $attributes = array()) { parent::__construct('Room', $name, $attributes); } /** * Add ParticipantIdentity attribute. * * @param string $participantIdentity Participant identity when connecting to * the Room * @return static $this. */ public function setParticipantIdentity($participantIdentity) { return $this->setAttribute('participantIdentity', $participantIdentity); } } sdk/src/Twilio/TwiML/Voice/SsmlW.php 0000644 00000001440 15002236443 0013200 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\TwiML\Voice; use Twilio\TwiML\TwiML; class SsmlW extends TwiML { /** * SsmlW constructor. * * @param string $words Words to speak * @param array $attributes Optional attributes */ public function __construct($words, $attributes = array()) { parent::__construct('w', $words, $attributes); } /** * Add Role attribute. * * @param string $role Customize the pronunciation of words by specifying the * word’s part of speech or alternate meaning * @return static $this. */ public function setRole($role) { return $this->setAttribute('role', $role); } } sdk/src/Twilio/TwiML/Voice/SsmlPhoneme.php 0000644 00000001726 15002236443 0014374 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\TwiML\Voice; use Twilio\TwiML\TwiML; class SsmlPhoneme extends TwiML { /** * SsmlPhoneme constructor. * * @param string $words Words to speak * @param array $attributes Optional attributes */ public function __construct($words, $attributes = array()) { parent::__construct('phoneme', $words, $attributes); } /** * Add Alphabet attribute. * * @param string $alphabet Specify the phonetic alphabet * @return static $this. */ public function setAlphabet($alphabet) { return $this->setAttribute('alphabet', $alphabet); } /** * Add Ph attribute. * * @param string $ph Specifiy the phonetic symbols for pronunciation * @return static $this. */ public function setPh($ph) { return $this->setAttribute('ph', $ph); } } sdk/src/Twilio/TwiML/Voice/SsmlLang.php 0000644 00000001323 15002236443 0013653 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\TwiML\Voice; use Twilio\TwiML\TwiML; class SsmlLang extends TwiML { /** * SsmlLang constructor. * * @param string $words Words to speak * @param array $attributes Optional attributes */ public function __construct($words, $attributes = array()) { parent::__construct('lang', $words, $attributes); } /** * Add Xml:Lang attribute. * * @param string $xmlLang Specify the language * @return static $this. */ public function setXmlLang($xmlLang) { return $this->setAttribute('xml:Lang', $xmlLang); } } sdk/src/Twilio/TwiML/Voice/Gather.php 0000644 00000013137 15002236443 0013353 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\TwiML\Voice; use Twilio\TwiML\TwiML; class Gather extends TwiML { /** * Gather constructor. * * @param array $attributes Optional attributes */ public function __construct($attributes = array()) { parent::__construct('Gather', null, $attributes); } /** * Add Say child. * * @param string $message Message to say * @param array $attributes Optional attributes * @return Say Child element. */ public function say($message, $attributes = array()) { return $this->nest(new Say($message, $attributes)); } /** * Add Pause child. * * @param array $attributes Optional attributes * @return Pause Child element. */ public function pause($attributes = array()) { return $this->nest(new Pause($attributes)); } /** * Add Play child. * * @param string $url Media URL * @param array $attributes Optional attributes * @return Play Child element. */ public function play($url = null, $attributes = array()) { return $this->nest(new Play($url, $attributes)); } /** * Add Input attribute. * * @param string $input Input type Twilio should accept * @return static $this. */ public function setInput($input) { return $this->setAttribute('input', $input); } /** * Add Action attribute. * * @param string $action Action URL * @return static $this. */ public function setAction($action) { return $this->setAttribute('action', $action); } /** * Add Method attribute. * * @param string $method Action URL method * @return static $this. */ public function setMethod($method) { return $this->setAttribute('method', $method); } /** * Add Timeout attribute. * * @param int $timeout Time to wait to gather input * @return static $this. */ public function setTimeout($timeout) { return $this->setAttribute('timeout', $timeout); } /** * Add SpeechTimeout attribute. * * @param string $speechTimeout Time to wait to gather speech input and it * should be either auto or a positive integer. * @return static $this. */ public function setSpeechTimeout($speechTimeout) { return $this->setAttribute('speechTimeout', $speechTimeout); } /** * Add MaxSpeechTime attribute. * * @param int $maxSpeechTime Max allowed time for speech input * @return static $this. */ public function setMaxSpeechTime($maxSpeechTime) { return $this->setAttribute('maxSpeechTime', $maxSpeechTime); } /** * Add ProfanityFilter attribute. * * @param bool $profanityFilter Profanity Filter on speech * @return static $this. */ public function setProfanityFilter($profanityFilter) { return $this->setAttribute('profanityFilter', $profanityFilter); } /** * Add FinishOnKey attribute. * * @param string $finishOnKey Finish gather on key * @return static $this. */ public function setFinishOnKey($finishOnKey) { return $this->setAttribute('finishOnKey', $finishOnKey); } /** * Add NumDigits attribute. * * @param int $numDigits Number of digits to collect * @return static $this. */ public function setNumDigits($numDigits) { return $this->setAttribute('numDigits', $numDigits); } /** * Add PartialResultCallback attribute. * * @param string $partialResultCallback Partial result callback URL * @return static $this. */ public function setPartialResultCallback($partialResultCallback) { return $this->setAttribute('partialResultCallback', $partialResultCallback); } /** * Add PartialResultCallbackMethod attribute. * * @param string $partialResultCallbackMethod Partial result callback URL method * @return static $this. */ public function setPartialResultCallbackMethod($partialResultCallbackMethod) { return $this->setAttribute('partialResultCallbackMethod', $partialResultCallbackMethod); } /** * Add Language attribute. * * @param string $language Language to use * @return static $this. */ public function setLanguage($language) { return $this->setAttribute('language', $language); } /** * Add Hints attribute. * * @param string $hints Speech recognition hints * @return static $this. */ public function setHints($hints) { return $this->setAttribute('hints', $hints); } /** * Add BargeIn attribute. * * @param bool $bargeIn Stop playing media upon speech * @return static $this. */ public function setBargeIn($bargeIn) { return $this->setAttribute('bargeIn', $bargeIn); } /** * Add Debug attribute. * * @param bool $debug Allow debug for gather * @return static $this. */ public function setDebug($debug) { return $this->setAttribute('debug', $debug); } /** * Add ActionOnEmptyResult attribute. * * @param bool $actionOnEmptyResult Force webhook to the action URL event if * there is no input * @return static $this. */ public function setActionOnEmptyResult($actionOnEmptyResult) { return $this->setAttribute('actionOnEmptyResult', $actionOnEmptyResult); } } sdk/src/Twilio/TwiML/Voice/Redirect.php 0000644 00000001306 15002236443 0013675 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\TwiML\Voice; use Twilio\TwiML\TwiML; class Redirect extends TwiML { /** * Redirect constructor. * * @param string $url Redirect URL * @param array $attributes Optional attributes */ public function __construct($url, $attributes = array()) { parent::__construct('Redirect', $url, $attributes); } /** * Add Method attribute. * * @param string $method Redirect URL method * @return static $this. */ public function setMethod($method) { return $this->setAttribute('method', $method); } } sdk/src/Twilio/TwiML/Voice/Enqueue.php 0000644 00000003737 15002236443 0013555 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\TwiML\Voice; use Twilio\TwiML\TwiML; class Enqueue extends TwiML { /** * Enqueue constructor. * * @param string $name Friendly name * @param array $attributes Optional attributes */ public function __construct($name = null, $attributes = array()) { parent::__construct('Enqueue', $name, $attributes); } /** * Add Task child. * * @param string $body TaskRouter task attributes * @param array $attributes Optional attributes * @return Task Child element. */ public function task($body, $attributes = array()) { return $this->nest(new Task($body, $attributes)); } /** * Add Action attribute. * * @param string $action Action URL * @return static $this. */ public function setAction($action) { return $this->setAttribute('action', $action); } /** * Add Method attribute. * * @param string $method Action URL method * @return static $this. */ public function setMethod($method) { return $this->setAttribute('method', $method); } /** * Add WaitUrl attribute. * * @param string $waitUrl Wait URL * @return static $this. */ public function setWaitUrl($waitUrl) { return $this->setAttribute('waitUrl', $waitUrl); } /** * Add WaitUrlMethod attribute. * * @param string $waitUrlMethod Wait URL method * @return static $this. */ public function setWaitUrlMethod($waitUrlMethod) { return $this->setAttribute('waitUrlMethod', $waitUrlMethod); } /** * Add WorkflowSid attribute. * * @param string $workflowSid TaskRouter Workflow SID * @return static $this. */ public function setWorkflowSid($workflowSid) { return $this->setAttribute('workflowSid', $workflowSid); } } sdk/src/Twilio/TwiML/Voice/SsmlProsody.php 0000644 00000002665 15002236443 0014443 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\TwiML\Voice; use Twilio\TwiML\TwiML; class SsmlProsody extends TwiML { /** * SsmlProsody constructor. * * @param string $words Words to speak * @param array $attributes Optional attributes */ public function __construct($words, $attributes = array()) { parent::__construct('prosody', $words, $attributes); } /** * Add Volume attribute. * * @param string $volume Specify the volume, available values: default, silent, * x-soft, soft, medium, loud, x-loud, +ndB, -ndB * @return static $this. */ public function setVolume($volume) { return $this->setAttribute('volume', $volume); } /** * Add Rate attribute. * * @param string $rate Specify the rate, available values: x-slow, slow, * medium, fast, x-fast, n% * @return static $this. */ public function setRate($rate) { return $this->setAttribute('rate', $rate); } /** * Add Pitch attribute. * * @param string $pitch Specify the pitch, available values: default, x-low, * low, medium, high, x-high, +n%, -n% * @return static $this. */ public function setPitch($pitch) { return $this->setAttribute('pitch', $pitch); } } sdk/src/Twilio/TwiML/Voice/Stream.php 0000644 00000003250 15002236443 0013367 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\TwiML\Voice; use Twilio\TwiML\TwiML; class Stream extends TwiML { /** * Stream constructor. * * @param array $attributes Optional attributes */ public function __construct($attributes = array()) { parent::__construct('Stream', null, $attributes); } /** * Add Parameter child. * * @param array $attributes Optional attributes * @return Parameter Child element. */ public function parameter($attributes = array()) { return $this->nest(new Parameter($attributes)); } /** * Add Name attribute. * * @param string $name Friendly name given to the Stream * @return static $this. */ public function setName($name) { return $this->setAttribute('name', $name); } /** * Add ConnectorName attribute. * * @param string $connectorName Unique name for Stream Connector * @return static $this. */ public function setConnectorName($connectorName) { return $this->setAttribute('connectorName', $connectorName); } /** * Add Url attribute. * * @param string $url URL of the remote service where the Stream is routed * @return static $this. */ public function setUrl($url) { return $this->setAttribute('url', $url); } /** * Add Track attribute. * * @param string $track Track to be streamed to remote service * @return static $this. */ public function setTrack($track) { return $this->setAttribute('track', $track); } } sdk/src/Twilio/TwiML/Voice/Start.php 0000644 00000002540 15002236443 0013232 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\TwiML\Voice; use Twilio\TwiML\TwiML; class Start extends TwiML { /** * Start constructor. * * @param array $attributes Optional attributes */ public function __construct($attributes = array()) { parent::__construct('Start', null, $attributes); } /** * Add Stream child. * * @param array $attributes Optional attributes * @return Stream Child element. */ public function stream($attributes = array()) { return $this->nest(new Stream($attributes)); } /** * Add Siprec child. * * @param array $attributes Optional attributes * @return Siprec Child element. */ public function siprec($attributes = array()) { return $this->nest(new Siprec($attributes)); } /** * Add Action attribute. * * @param string $action Action URL * @return static $this. */ public function setAction($action) { return $this->setAttribute('action', $action); } /** * Add Method attribute. * * @param string $method Action URL method * @return static $this. */ public function setMethod($method) { return $this->setAttribute('method', $method); } } sdk/src/Twilio/TwiML/Voice/SsmlS.php 0000644 00000000600 15002236443 0013171 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\TwiML\Voice; use Twilio\TwiML\TwiML; class SsmlS extends TwiML { /** * SsmlS constructor. * * @param string $words Words to speak */ public function __construct($words) { parent::__construct('s', $words); } } sdk/src/Twilio/TwiML/Voice/Autopilot.php 0000644 00000000645 15002236443 0014121 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\TwiML\Voice; use Twilio\TwiML\TwiML; class Autopilot extends TwiML { /** * Autopilot constructor. * * @param string $name Autopilot assistant sid or unique name */ public function __construct($name) { parent::__construct('Autopilot', $name); } } sdk/src/Twilio/TwiML/Voice/Echo.php 0000644 00000000510 15002236443 0013006 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\TwiML\Voice; use Twilio\TwiML\TwiML; class Echo_ extends TwiML { /** * Echo constructor. */ public function __construct() { parent::__construct('Echo', null); } } sdk/src/Twilio/TwiML/Voice/Number.php 0000644 00000004143 15002236443 0013366 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\TwiML\Voice; use Twilio\TwiML\TwiML; class Number extends TwiML { /** * Number constructor. * * @param string $phoneNumber Phone Number to dial * @param array $attributes Optional attributes */ public function __construct($phoneNumber, $attributes = array()) { parent::__construct('Number', $phoneNumber, $attributes); } /** * Add SendDigits attribute. * * @param string $sendDigits DTMF tones to play when the call is answered * @return static $this. */ public function setSendDigits($sendDigits) { return $this->setAttribute('sendDigits', $sendDigits); } /** * Add Url attribute. * * @param string $url TwiML URL * @return static $this. */ public function setUrl($url) { return $this->setAttribute('url', $url); } /** * Add Method attribute. * * @param string $method TwiML URL method * @return static $this. */ public function setMethod($method) { return $this->setAttribute('method', $method); } /** * Add StatusCallbackEvent attribute. * * @param string $statusCallbackEvent Events to call status callback * @return static $this. */ public function setStatusCallbackEvent($statusCallbackEvent) { return $this->setAttribute('statusCallbackEvent', $statusCallbackEvent); } /** * Add StatusCallback attribute. * * @param string $statusCallback Status callback URL * @return static $this. */ public function setStatusCallback($statusCallback) { return $this->setAttribute('statusCallback', $statusCallback); } /** * Add StatusCallbackMethod attribute. * * @param string $statusCallbackMethod Status callback URL method * @return static $this. */ public function setStatusCallbackMethod($statusCallbackMethod) { return $this->setAttribute('statusCallbackMethod', $statusCallbackMethod); } } sdk/src/Twilio/TwiML/Voice/Reject.php 0000644 00000001220 15002236443 0013343 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\TwiML\Voice; use Twilio\TwiML\TwiML; class Reject extends TwiML { /** * Reject constructor. * * @param array $attributes Optional attributes */ public function __construct($attributes = array()) { parent::__construct('Reject', null, $attributes); } /** * Add Reason attribute. * * @param string $reason Rejection reason * @return static $this. */ public function setReason($reason) { return $this->setAttribute('reason', $reason); } } sdk/src/Twilio/TwiML/Voice/Say.php 0000644 00000007704 15002236443 0012700 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\TwiML\Voice; use Twilio\TwiML\TwiML; class Say extends TwiML { /** * Say constructor. * * @param string $message Message to say * @param array $attributes Optional attributes */ public function __construct($message, $attributes = array()) { parent::__construct('Say', $message, $attributes); } /** * Add Break child. * * @param array $attributes Optional attributes * @return SsmlBreak Child element. */ public function break_($attributes = array()) { return $this->nest(new SsmlBreak($attributes)); } /** * Add Emphasis child. * * @param string $words Words to emphasize * @param array $attributes Optional attributes * @return SsmlEmphasis Child element. */ public function emphasis($words, $attributes = array()) { return $this->nest(new SsmlEmphasis($words, $attributes)); } /** * Add Lang child. * * @param string $words Words to speak * @param array $attributes Optional attributes * @return SsmlLang Child element. */ public function lang($words, $attributes = array()) { return $this->nest(new SsmlLang($words, $attributes)); } /** * Add P child. * * @param string $words Words to speak * @return SsmlP Child element. */ public function p($words) { return $this->nest(new SsmlP($words)); } /** * Add Phoneme child. * * @param string $words Words to speak * @param array $attributes Optional attributes * @return SsmlPhoneme Child element. */ public function phoneme($words, $attributes = array()) { return $this->nest(new SsmlPhoneme($words, $attributes)); } /** * Add Prosody child. * * @param string $words Words to speak * @param array $attributes Optional attributes * @return SsmlProsody Child element. */ public function prosody($words, $attributes = array()) { return $this->nest(new SsmlProsody($words, $attributes)); } /** * Add S child. * * @param string $words Words to speak * @return SsmlS Child element. */ public function s($words) { return $this->nest(new SsmlS($words)); } /** * Add Say-As child. * * @param string $words Words to be interpreted * @param array $attributes Optional attributes * @return SsmlSayAs Child element. */ public function say_As($words, $attributes = array()) { return $this->nest(new SsmlSayAs($words, $attributes)); } /** * Add Sub child. * * @param string $words Words to be substituted * @param array $attributes Optional attributes * @return SsmlSub Child element. */ public function sub($words, $attributes = array()) { return $this->nest(new SsmlSub($words, $attributes)); } /** * Add W child. * * @param string $words Words to speak * @param array $attributes Optional attributes * @return SsmlW Child element. */ public function w($words, $attributes = array()) { return $this->nest(new SsmlW($words, $attributes)); } /** * Add Voice attribute. * * @param string $voice Voice to use * @return static $this. */ public function setVoice($voice) { return $this->setAttribute('voice', $voice); } /** * Add Loop attribute. * * @param int $loop Times to loop message * @return static $this. */ public function setLoop($loop) { return $this->setAttribute('loop', $loop); } /** * Add Language attribute. * * @param string $language Message langauge * @return static $this. */ public function setLanguage($language) { return $this->setAttribute('language', $language); } } sdk/src/Twilio/TwiML/Voice/Stop.php 0000644 00000001471 15002236443 0013064 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\TwiML\Voice; use Twilio\TwiML\TwiML; class Stop extends TwiML { /** * Stop constructor. */ public function __construct() { parent::__construct('Stop', null); } /** * Add Stream child. * * @param array $attributes Optional attributes * @return Stream Child element. */ public function stream($attributes = array()) { return $this->nest(new Stream($attributes)); } /** * Add Siprec child. * * @param array $attributes Optional attributes * @return Siprec Child element. */ public function siprec($attributes = array()) { return $this->nest(new Siprec($attributes)); } } sdk/src/Twilio/TwiML/Voice/Client.php 0000644 00000004533 15002236443 0013357 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\TwiML\Voice; use Twilio\TwiML\TwiML; class Client extends TwiML { /** * Client constructor. * * @param string $identity Client identity * @param array $attributes Optional attributes */ public function __construct($identity = null, $attributes = array()) { parent::__construct('Client', $identity, $attributes); } /** * Add Identity child. * * @param string $clientIdentity Identity of the client to dial * @return Identity Child element. */ public function identity($clientIdentity) { return $this->nest(new Identity($clientIdentity)); } /** * Add Parameter child. * * @param array $attributes Optional attributes * @return Parameter Child element. */ public function parameter($attributes = array()) { return $this->nest(new Parameter($attributes)); } /** * Add Url attribute. * * @param string $url Client URL * @return static $this. */ public function setUrl($url) { return $this->setAttribute('url', $url); } /** * Add Method attribute. * * @param string $method Client URL Method * @return static $this. */ public function setMethod($method) { return $this->setAttribute('method', $method); } /** * Add StatusCallbackEvent attribute. * * @param string $statusCallbackEvent Events to trigger status callback * @return static $this. */ public function setStatusCallbackEvent($statusCallbackEvent) { return $this->setAttribute('statusCallbackEvent', $statusCallbackEvent); } /** * Add StatusCallback attribute. * * @param string $statusCallback Status Callback URL * @return static $this. */ public function setStatusCallback($statusCallback) { return $this->setAttribute('statusCallback', $statusCallback); } /** * Add StatusCallbackMethod attribute. * * @param string $statusCallbackMethod Status Callback URL Method * @return static $this. */ public function setStatusCallbackMethod($statusCallbackMethod) { return $this->setAttribute('statusCallbackMethod', $statusCallbackMethod); } } sdk/src/Twilio/TwiML/Voice/Sim.php 0000644 00000000572 15002236443 0012670 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\TwiML\Voice; use Twilio\TwiML\TwiML; class Sim extends TwiML { /** * Sim constructor. * * @param string $simSid SIM SID */ public function __construct($simSid) { parent::__construct('Sim', $simSid); } } sdk/src/Twilio/TwiML/Voice/Record.php 0000644 00000007262 15002236443 0013361 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\TwiML\Voice; use Twilio\TwiML\TwiML; class Record extends TwiML { /** * Record constructor. * * @param array $attributes Optional attributes */ public function __construct($attributes = array()) { parent::__construct('Record', null, $attributes); } /** * Add Action attribute. * * @param string $action Action URL * @return static $this. */ public function setAction($action) { return $this->setAttribute('action', $action); } /** * Add Method attribute. * * @param string $method Action URL method * @return static $this. */ public function setMethod($method) { return $this->setAttribute('method', $method); } /** * Add Timeout attribute. * * @param int $timeout Timeout to begin recording * @return static $this. */ public function setTimeout($timeout) { return $this->setAttribute('timeout', $timeout); } /** * Add FinishOnKey attribute. * * @param string $finishOnKey Finish recording on key * @return static $this. */ public function setFinishOnKey($finishOnKey) { return $this->setAttribute('finishOnKey', $finishOnKey); } /** * Add MaxLength attribute. * * @param int $maxLength Max time to record in seconds * @return static $this. */ public function setMaxLength($maxLength) { return $this->setAttribute('maxLength', $maxLength); } /** * Add PlayBeep attribute. * * @param bool $playBeep Play beep * @return static $this. */ public function setPlayBeep($playBeep) { return $this->setAttribute('playBeep', $playBeep); } /** * Add Trim attribute. * * @param string $trim Trim the recording * @return static $this. */ public function setTrim($trim) { return $this->setAttribute('trim', $trim); } /** * Add RecordingStatusCallback attribute. * * @param string $recordingStatusCallback Status callback URL * @return static $this. */ public function setRecordingStatusCallback($recordingStatusCallback) { return $this->setAttribute('recordingStatusCallback', $recordingStatusCallback); } /** * Add RecordingStatusCallbackMethod attribute. * * @param string $recordingStatusCallbackMethod Status callback URL method * @return static $this. */ public function setRecordingStatusCallbackMethod($recordingStatusCallbackMethod) { return $this->setAttribute('recordingStatusCallbackMethod', $recordingStatusCallbackMethod); } /** * Add RecordingStatusCallbackEvent attribute. * * @param string $recordingStatusCallbackEvent Recording status callback events * @return static $this. */ public function setRecordingStatusCallbackEvent($recordingStatusCallbackEvent) { return $this->setAttribute('recordingStatusCallbackEvent', $recordingStatusCallbackEvent); } /** * Add Transcribe attribute. * * @param bool $transcribe Transcribe the recording * @return static $this. */ public function setTranscribe($transcribe) { return $this->setAttribute('transcribe', $transcribe); } /** * Add TranscribeCallback attribute. * * @param string $transcribeCallback Transcribe callback URL * @return static $this. */ public function setTranscribeCallback($transcribeCallback) { return $this->setAttribute('transcribeCallback', $transcribeCallback); } } sdk/src/Twilio/TwiML/Voice/SsmlSayAs.php 0000644 00000002054 15002236443 0014014 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\TwiML\Voice; use Twilio\TwiML\TwiML; class SsmlSayAs extends TwiML { /** * SsmlSayAs constructor. * * @param string $words Words to be interpreted * @param array $attributes Optional attributes */ public function __construct($words, $attributes = array()) { parent::__construct('say-as', $words, $attributes); } /** * Add Interpret-As attribute. * * @param string $interpretAs Specify the type of words are spoken * @return static $this. */ public function setInterpretAs($interpretAs) { return $this->setAttribute('interpret-as', $interpretAs); } /** * Add Role attribute. * * @param string $role Specify the format of the date when interpret-as is set * to date * @return static $this. */ public function setRole($role) { return $this->setAttribute('role', $role); } } sdk/src/Twilio/TwiML/Voice/SsmlP.php 0000644 00000000600 15002236443 0013166 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\TwiML\Voice; use Twilio\TwiML\TwiML; class SsmlP extends TwiML { /** * SsmlP constructor. * * @param string $words Words to speak */ public function __construct($words) { parent::__construct('p', $words); } } sdk/src/Twilio/TwiML/Voice/Task.php 0000644 00000001703 15002236443 0013037 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\TwiML\Voice; use Twilio\TwiML\TwiML; class Task extends TwiML { /** * Task constructor. * * @param string $body TaskRouter task attributes * @param array $attributes Optional attributes */ public function __construct($body, $attributes = array()) { parent::__construct('Task', $body, $attributes); } /** * Add Priority attribute. * * @param int $priority Task priority * @return static $this. */ public function setPriority($priority) { return $this->setAttribute('priority', $priority); } /** * Add Timeout attribute. * * @param int $timeout Timeout associated with task * @return static $this. */ public function setTimeout($timeout) { return $this->setAttribute('timeout', $timeout); } } sdk/src/Twilio/TwiML/Voice/Prompt.php 0000644 00000004302 15002236443 0013414 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\TwiML\Voice; use Twilio\TwiML\TwiML; class Prompt extends TwiML { /** * Prompt constructor. * * @param array $attributes Optional attributes */ public function __construct($attributes = array()) { parent::__construct('Prompt', null, $attributes); } /** * Add Say child. * * @param string $message Message to say * @param array $attributes Optional attributes * @return Say Child element. */ public function say($message, $attributes = array()) { return $this->nest(new Say($message, $attributes)); } /** * Add Play child. * * @param string $url Media URL * @param array $attributes Optional attributes * @return Play Child element. */ public function play($url = null, $attributes = array()) { return $this->nest(new Play($url, $attributes)); } /** * Add Pause child. * * @param array $attributes Optional attributes * @return Pause Child element. */ public function pause($attributes = array()) { return $this->nest(new Pause($attributes)); } /** * Add For_ attribute. * * @param string $for_ Name of the payment source data element * @return static $this. */ public function setFor_($for_) { return $this->setAttribute('for_', $for_); } /** * Add ErrorType attribute. * * @param string $errorType Type of error * @return static $this. */ public function setErrorType($errorType) { return $this->setAttribute('errorType', $errorType); } /** * Add CardType attribute. * * @param string $cardType Type of the credit card * @return static $this. */ public function setCardType($cardType) { return $this->setAttribute('cardType', $cardType); } /** * Add Attempt attribute. * * @param int $attempt Current attempt count * @return static $this. */ public function setAttempt($attempt) { return $this->setAttribute('attempt', $attempt); } } sdk/src/Twilio/TwiML/Voice/Identity.php 0000644 00000000670 15002236443 0013730 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\TwiML\Voice; use Twilio\TwiML\TwiML; class Identity extends TwiML { /** * Identity constructor. * * @param string $clientIdentity Identity of the client to dial */ public function __construct($clientIdentity) { parent::__construct('Identity', $clientIdentity); } } sdk/src/Twilio/TwiML/Voice/Dial.php 0000644 00000013735 15002236443 0013016 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\TwiML\Voice; use Twilio\TwiML\TwiML; class Dial extends TwiML { /** * Dial constructor. * * @param string $number Phone number to dial * @param array $attributes Optional attributes */ public function __construct($number = null, $attributes = array()) { parent::__construct('Dial', $number, $attributes); } /** * Add Client child. * * @param string $identity Client identity * @param array $attributes Optional attributes * @return Client Child element. */ public function client($identity = null, $attributes = array()) { return $this->nest(new Client($identity, $attributes)); } /** * Add Conference child. * * @param string $name Conference name * @param array $attributes Optional attributes * @return Conference Child element. */ public function conference($name, $attributes = array()) { return $this->nest(new Conference($name, $attributes)); } /** * Add Number child. * * @param string $phoneNumber Phone Number to dial * @param array $attributes Optional attributes * @return Number Child element. */ public function number($phoneNumber, $attributes = array()) { return $this->nest(new Number($phoneNumber, $attributes)); } /** * Add Queue child. * * @param string $name Queue name * @param array $attributes Optional attributes * @return Queue Child element. */ public function queue($name, $attributes = array()) { return $this->nest(new Queue($name, $attributes)); } /** * Add Sim child. * * @param string $simSid SIM SID * @return Sim Child element. */ public function sim($simSid) { return $this->nest(new Sim($simSid)); } /** * Add Sip child. * * @param string $sipUrl SIP URL * @param array $attributes Optional attributes * @return Sip Child element. */ public function sip($sipUrl, $attributes = array()) { return $this->nest(new Sip($sipUrl, $attributes)); } /** * Add Action attribute. * * @param string $action Action URL * @return static $this. */ public function setAction($action) { return $this->setAttribute('action', $action); } /** * Add Method attribute. * * @param string $method Action URL method * @return static $this. */ public function setMethod($method) { return $this->setAttribute('method', $method); } /** * Add Timeout attribute. * * @param int $timeout Time to wait for answer * @return static $this. */ public function setTimeout($timeout) { return $this->setAttribute('timeout', $timeout); } /** * Add HangupOnStar attribute. * * @param bool $hangupOnStar Hangup call on star press * @return static $this. */ public function setHangupOnStar($hangupOnStar) { return $this->setAttribute('hangupOnStar', $hangupOnStar); } /** * Add TimeLimit attribute. * * @param int $timeLimit Max time length * @return static $this. */ public function setTimeLimit($timeLimit) { return $this->setAttribute('timeLimit', $timeLimit); } /** * Add CallerId attribute. * * @param string $callerId Caller ID to display * @return static $this. */ public function setCallerId($callerId) { return $this->setAttribute('callerId', $callerId); } /** * Add Record attribute. * * @param string $record Record the call * @return static $this. */ public function setRecord($record) { return $this->setAttribute('record', $record); } /** * Add Trim attribute. * * @param string $trim Trim the recording * @return static $this. */ public function setTrim($trim) { return $this->setAttribute('trim', $trim); } /** * Add RecordingStatusCallback attribute. * * @param string $recordingStatusCallback Recording status callback URL * @return static $this. */ public function setRecordingStatusCallback($recordingStatusCallback) { return $this->setAttribute('recordingStatusCallback', $recordingStatusCallback); } /** * Add RecordingStatusCallbackMethod attribute. * * @param string $recordingStatusCallbackMethod Recording status callback URL * method * @return static $this. */ public function setRecordingStatusCallbackMethod($recordingStatusCallbackMethod) { return $this->setAttribute('recordingStatusCallbackMethod', $recordingStatusCallbackMethod); } /** * Add RecordingStatusCallbackEvent attribute. * * @param string $recordingStatusCallbackEvent Recording status callback events * @return static $this. */ public function setRecordingStatusCallbackEvent($recordingStatusCallbackEvent) { return $this->setAttribute('recordingStatusCallbackEvent', $recordingStatusCallbackEvent); } /** * Add AnswerOnBridge attribute. * * @param bool $answerOnBridge Preserve the ringing behavior of the inbound * call until the Dialed call picks up * @return static $this. */ public function setAnswerOnBridge($answerOnBridge) { return $this->setAttribute('answerOnBridge', $answerOnBridge); } /** * Add RingTone attribute. * * @param string $ringTone Ringtone allows you to override the ringback tone * that Twilio will play back to the caller while * executing the Dial * @return static $this. */ public function setRingTone($ringTone) { return $this->setAttribute('ringTone', $ringTone); } } sdk/src/Twilio/TwiML/Voice/Hangup.php 0000644 00000000515 15002236443 0013357 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\TwiML\Voice; use Twilio\TwiML\TwiML; class Hangup extends TwiML { /** * Hangup constructor. */ public function __construct() { parent::__construct('Hangup', null); } } sdk/src/Twilio/TwiML/Voice/Refer.php 0000644 00000002104 15002236443 0013174 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\TwiML\Voice; use Twilio\TwiML\TwiML; class Refer extends TwiML { /** * Refer constructor. * * @param array $attributes Optional attributes */ public function __construct($attributes = array()) { parent::__construct('Refer', null, $attributes); } /** * Add Sip child. * * @param string $sipUrl SIP URL * @return ReferSip Child element. */ public function sip($sipUrl) { return $this->nest(new ReferSip($sipUrl)); } /** * Add Action attribute. * * @param string $action Action URL * @return static $this. */ public function setAction($action) { return $this->setAttribute('action', $action); } /** * Add Method attribute. * * @param string $method Action URL method * @return static $this. */ public function setMethod($method) { return $this->setAttribute('method', $method); } } sdk/src/Twilio/TwiML/Voice/Siprec.php 0000644 00000002257 15002236443 0013367 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\TwiML\Voice; use Twilio\TwiML\TwiML; class Siprec extends TwiML { /** * Siprec constructor. * * @param array $attributes Optional attributes */ public function __construct($attributes = array()) { parent::__construct('Siprec', null, $attributes); } /** * Add Parameter child. * * @param array $attributes Optional attributes * @return Parameter Child element. */ public function parameter($attributes = array()) { return $this->nest(new Parameter($attributes)); } /** * Add Name attribute. * * @param string $name Friendly name given to SIPREC * @return static $this. */ public function setName($name) { return $this->setAttribute('name', $name); } /** * Add ConnectorName attribute. * * @param string $connectorName Unique name for Connector * @return static $this. */ public function setConnectorName($connectorName) { return $this->setAttribute('connectorName', $connectorName); } } sdk/src/Twilio/TwiML/Voice/Connect.php 0000644 00000003216 15002236443 0013527 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\TwiML\Voice; use Twilio\TwiML\TwiML; class Connect extends TwiML { /** * Connect constructor. * * @param array $attributes Optional attributes */ public function __construct($attributes = array()) { parent::__construct('Connect', null, $attributes); } /** * Add Room child. * * @param string $name Room name * @param array $attributes Optional attributes * @return Room Child element. */ public function room($name, $attributes = array()) { return $this->nest(new Room($name, $attributes)); } /** * Add Autopilot child. * * @param string $name Autopilot assistant sid or unique name * @return Autopilot Child element. */ public function autopilot($name) { return $this->nest(new Autopilot($name)); } /** * Add Stream child. * * @param array $attributes Optional attributes * @return Stream Child element. */ public function stream($attributes = array()) { return $this->nest(new Stream($attributes)); } /** * Add Action attribute. * * @param string $action Action URL * @return static $this. */ public function setAction($action) { return $this->setAttribute('action', $action); } /** * Add Method attribute. * * @param string $method Action URL method * @return static $this. */ public function setMethod($method) { return $this->setAttribute('method', $method); } } sdk/src/Twilio/TwiML/Voice/Conference.php 0000644 00000013051 15002236443 0014203 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\TwiML\Voice; use Twilio\TwiML\TwiML; class Conference extends TwiML { /** * Conference constructor. * * @param string $name Conference name * @param array $attributes Optional attributes */ public function __construct($name, $attributes = array()) { parent::__construct('Conference', $name, $attributes); } /** * Add Muted attribute. * * @param bool $muted Join the conference muted * @return static $this. */ public function setMuted($muted) { return $this->setAttribute('muted', $muted); } /** * Add Beep attribute. * * @param string $beep Play beep when joining * @return static $this. */ public function setBeep($beep) { return $this->setAttribute('beep', $beep); } /** * Add StartConferenceOnEnter attribute. * * @param bool $startConferenceOnEnter Start the conference on enter * @return static $this. */ public function setStartConferenceOnEnter($startConferenceOnEnter) { return $this->setAttribute('startConferenceOnEnter', $startConferenceOnEnter); } /** * Add EndConferenceOnExit attribute. * * @param bool $endConferenceOnExit End the conferenceon exit * @return static $this. */ public function setEndConferenceOnExit($endConferenceOnExit) { return $this->setAttribute('endConferenceOnExit', $endConferenceOnExit); } /** * Add WaitUrl attribute. * * @param string $waitUrl Wait URL * @return static $this. */ public function setWaitUrl($waitUrl) { return $this->setAttribute('waitUrl', $waitUrl); } /** * Add WaitMethod attribute. * * @param string $waitMethod Wait URL method * @return static $this. */ public function setWaitMethod($waitMethod) { return $this->setAttribute('waitMethod', $waitMethod); } /** * Add MaxParticipants attribute. * * @param int $maxParticipants Maximum number of participants * @return static $this. */ public function setMaxParticipants($maxParticipants) { return $this->setAttribute('maxParticipants', $maxParticipants); } /** * Add Record attribute. * * @param string $record Record the conference * @return static $this. */ public function setRecord($record) { return $this->setAttribute('record', $record); } /** * Add Region attribute. * * @param string $region Conference region * @return static $this. */ public function setRegion($region) { return $this->setAttribute('region', $region); } /** * Add Coach attribute. * * @param string $coach Call coach * @return static $this. */ public function setCoach($coach) { return $this->setAttribute('coach', $coach); } /** * Add Trim attribute. * * @param string $trim Trim the conference recording * @return static $this. */ public function setTrim($trim) { return $this->setAttribute('trim', $trim); } /** * Add StatusCallbackEvent attribute. * * @param string $statusCallbackEvent Events to call status callback URL * @return static $this. */ public function setStatusCallbackEvent($statusCallbackEvent) { return $this->setAttribute('statusCallbackEvent', $statusCallbackEvent); } /** * Add StatusCallback attribute. * * @param string $statusCallback Status callback URL * @return static $this. */ public function setStatusCallback($statusCallback) { return $this->setAttribute('statusCallback', $statusCallback); } /** * Add StatusCallbackMethod attribute. * * @param string $statusCallbackMethod Status callback URL method * @return static $this. */ public function setStatusCallbackMethod($statusCallbackMethod) { return $this->setAttribute('statusCallbackMethod', $statusCallbackMethod); } /** * Add RecordingStatusCallback attribute. * * @param string $recordingStatusCallback Recording status callback URL * @return static $this. */ public function setRecordingStatusCallback($recordingStatusCallback) { return $this->setAttribute('recordingStatusCallback', $recordingStatusCallback); } /** * Add RecordingStatusCallbackMethod attribute. * * @param string $recordingStatusCallbackMethod Recording status callback URL * method * @return static $this. */ public function setRecordingStatusCallbackMethod($recordingStatusCallbackMethod) { return $this->setAttribute('recordingStatusCallbackMethod', $recordingStatusCallbackMethod); } /** * Add RecordingStatusCallbackEvent attribute. * * @param string $recordingStatusCallbackEvent Recording status callback events * @return static $this. */ public function setRecordingStatusCallbackEvent($recordingStatusCallbackEvent) { return $this->setAttribute('recordingStatusCallbackEvent', $recordingStatusCallbackEvent); } /** * Add EventCallbackUrl attribute. * * @param string $eventCallbackUrl Event callback URL * @return static $this. */ public function setEventCallbackUrl($eventCallbackUrl) { return $this->setAttribute('eventCallbackUrl', $eventCallbackUrl); } } sdk/src/Twilio/TwiML/Voice/SsmlEmphasis.php 0000644 00000001337 15002236443 0014550 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\TwiML\Voice; use Twilio\TwiML\TwiML; class SsmlEmphasis extends TwiML { /** * SsmlEmphasis constructor. * * @param string $words Words to emphasize * @param array $attributes Optional attributes */ public function __construct($words, $attributes = array()) { parent::__construct('emphasis', $words, $attributes); } /** * Add Level attribute. * * @param string $level Specify the degree of emphasis * @return static $this. */ public function setLevel($level) { return $this->setAttribute('level', $level); } } sdk/src/Twilio/TwiML/Voice/Queue.php 0000644 00000002745 15002236443 0013230 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\TwiML\Voice; use Twilio\TwiML\TwiML; class Queue extends TwiML { /** * Queue constructor. * * @param string $name Queue name * @param array $attributes Optional attributes */ public function __construct($name, $attributes = array()) { parent::__construct('Queue', $name, $attributes); } /** * Add Url attribute. * * @param string $url Action URL * @return static $this. */ public function setUrl($url) { return $this->setAttribute('url', $url); } /** * Add Method attribute. * * @param string $method Action URL method * @return static $this. */ public function setMethod($method) { return $this->setAttribute('method', $method); } /** * Add ReservationSid attribute. * * @param string $reservationSid TaskRouter Reservation SID * @return static $this. */ public function setReservationSid($reservationSid) { return $this->setAttribute('reservationSid', $reservationSid); } /** * Add PostWorkActivitySid attribute. * * @param string $postWorkActivitySid TaskRouter Activity SID * @return static $this. */ public function setPostWorkActivitySid($postWorkActivitySid) { return $this->setAttribute('postWorkActivitySid', $postWorkActivitySid); } } sdk/src/Twilio/TwiML/Voice/ReferSip.php 0000644 00000000604 15002236443 0013653 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\TwiML\Voice; use Twilio\TwiML\TwiML; class ReferSip extends TwiML { /** * ReferSip constructor. * * @param string $sipUrl SIP URL */ public function __construct($sipUrl) { parent::__construct('Sip', $sipUrl); } } sdk/src/Twilio/TwiML/Voice/Parameter.php 0000644 00000001616 15002236443 0014060 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\TwiML\Voice; use Twilio\TwiML\TwiML; class Parameter extends TwiML { /** * Parameter constructor. * * @param array $attributes Optional attributes */ public function __construct($attributes = array()) { parent::__construct('Parameter', null, $attributes); } /** * Add Name attribute. * * @param string $name The name of the custom parameter * @return static $this. */ public function setName($name) { return $this->setAttribute('name', $name); } /** * Add Value attribute. * * @param string $value The value of the custom parameter * @return static $this. */ public function setValue($value) { return $this->setAttribute('value', $value); } } sdk/src/Twilio/TwiML/Voice/Pay.php 0000644 00000014362 15002236443 0012673 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\TwiML\Voice; use Twilio\TwiML\TwiML; class Pay extends TwiML { /** * Pay constructor. * * @param array $attributes Optional attributes */ public function __construct($attributes = array()) { parent::__construct('Pay', null, $attributes); } /** * Add Prompt child. * * @param array $attributes Optional attributes * @return Prompt Child element. */ public function prompt($attributes = array()) { return $this->nest(new Prompt($attributes)); } /** * Add Parameter child. * * @param array $attributes Optional attributes * @return Parameter Child element. */ public function parameter($attributes = array()) { return $this->nest(new Parameter($attributes)); } /** * Add Input attribute. * * @param string $input Input type Twilio should accept * @return static $this. */ public function setInput($input) { return $this->setAttribute('input', $input); } /** * Add Action attribute. * * @param string $action Action URL * @return static $this. */ public function setAction($action) { return $this->setAttribute('action', $action); } /** * Add BankAccountType attribute. * * @param string $bankAccountType Bank account type for ach transactions. If * set, payment method attribute must be * provided and value should be set to * ach-debit. defaults to consumer-checking * @return static $this. */ public function setBankAccountType($bankAccountType) { return $this->setAttribute('bankAccountType', $bankAccountType); } /** * Add StatusCallback attribute. * * @param string $statusCallback Status callback URL * @return static $this. */ public function setStatusCallback($statusCallback) { return $this->setAttribute('statusCallback', $statusCallback); } /** * Add StatusCallbackMethod attribute. * * @param string $statusCallbackMethod Status callback method * @return static $this. */ public function setStatusCallbackMethod($statusCallbackMethod) { return $this->setAttribute('statusCallbackMethod', $statusCallbackMethod); } /** * Add Timeout attribute. * * @param int $timeout Time to wait to gather input * @return static $this. */ public function setTimeout($timeout) { return $this->setAttribute('timeout', $timeout); } /** * Add MaxAttempts attribute. * * @param int $maxAttempts Maximum number of allowed retries when gathering * input * @return static $this. */ public function setMaxAttempts($maxAttempts) { return $this->setAttribute('maxAttempts', $maxAttempts); } /** * Add SecurityCode attribute. * * @param bool $securityCode Prompt for security code * @return static $this. */ public function setSecurityCode($securityCode) { return $this->setAttribute('securityCode', $securityCode); } /** * Add PostalCode attribute. * * @param string $postalCode Prompt for postal code and it should be true/false * or default postal code * @return static $this. */ public function setPostalCode($postalCode) { return $this->setAttribute('postalCode', $postalCode); } /** * Add MinPostalCodeLength attribute. * * @param int $minPostalCodeLength Prompt for minimum postal code length * @return static $this. */ public function setMinPostalCodeLength($minPostalCodeLength) { return $this->setAttribute('minPostalCodeLength', $minPostalCodeLength); } /** * Add PaymentConnector attribute. * * @param string $paymentConnector Unique name for payment connector * @return static $this. */ public function setPaymentConnector($paymentConnector) { return $this->setAttribute('paymentConnector', $paymentConnector); } /** * Add PaymentMethod attribute. * * @param string $paymentMethod Payment method to be used. defaults to * credit-card * @return static $this. */ public function setPaymentMethod($paymentMethod) { return $this->setAttribute('paymentMethod', $paymentMethod); } /** * Add TokenType attribute. * * @param string $tokenType Type of token * @return static $this. */ public function setTokenType($tokenType) { return $this->setAttribute('tokenType', $tokenType); } /** * Add ChargeAmount attribute. * * @param string $chargeAmount Amount to process. If value is greater than 0 * then make the payment else create a payment token * @return static $this. */ public function setChargeAmount($chargeAmount) { return $this->setAttribute('chargeAmount', $chargeAmount); } /** * Add Currency attribute. * * @param string $currency Currency of the amount attribute * @return static $this. */ public function setCurrency($currency) { return $this->setAttribute('currency', $currency); } /** * Add Description attribute. * * @param string $description Details regarding the payment * @return static $this. */ public function setDescription($description) { return $this->setAttribute('description', $description); } /** * Add ValidCardTypes attribute. * * @param string $validCardTypes Comma separated accepted card types * @return static $this. */ public function setValidCardTypes($validCardTypes) { return $this->setAttribute('validCardTypes', $validCardTypes); } /** * Add Language attribute. * * @param string $language Language to use * @return static $this. */ public function setLanguage($language) { return $this->setAttribute('language', $language); } } sdk/src/Twilio/TwiML/Voice/Play.php 0000644 00000001637 15002236443 0013050 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\TwiML\Voice; use Twilio\TwiML\TwiML; class Play extends TwiML { /** * Play constructor. * * @param string $url Media URL * @param array $attributes Optional attributes */ public function __construct($url = null, $attributes = array()) { parent::__construct('Play', $url, $attributes); } /** * Add Loop attribute. * * @param int $loop Times to loop media * @return static $this. */ public function setLoop($loop) { return $this->setAttribute('loop', $loop); } /** * Add Digits attribute. * * @param string $digits Play DTMF tones for digits * @return static $this. */ public function setDigits($digits) { return $this->setAttribute('digits', $digits); } } sdk/src/Twilio/TwiML/Voice/Sip.php 0000644 00000004372 15002236443 0012675 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\TwiML\Voice; use Twilio\TwiML\TwiML; class Sip extends TwiML { /** * Sip constructor. * * @param string $sipUrl SIP URL * @param array $attributes Optional attributes */ public function __construct($sipUrl, $attributes = array()) { parent::__construct('Sip', $sipUrl, $attributes); } /** * Add Username attribute. * * @param string $username SIP Username * @return static $this. */ public function setUsername($username) { return $this->setAttribute('username', $username); } /** * Add Password attribute. * * @param string $password SIP Password * @return static $this. */ public function setPassword($password) { return $this->setAttribute('password', $password); } /** * Add Url attribute. * * @param string $url Action URL * @return static $this. */ public function setUrl($url) { return $this->setAttribute('url', $url); } /** * Add Method attribute. * * @param string $method Action URL method * @return static $this. */ public function setMethod($method) { return $this->setAttribute('method', $method); } /** * Add StatusCallbackEvent attribute. * * @param string $statusCallbackEvent Status callback events * @return static $this. */ public function setStatusCallbackEvent($statusCallbackEvent) { return $this->setAttribute('statusCallbackEvent', $statusCallbackEvent); } /** * Add StatusCallback attribute. * * @param string $statusCallback Status callback URL * @return static $this. */ public function setStatusCallback($statusCallback) { return $this->setAttribute('statusCallback', $statusCallback); } /** * Add StatusCallbackMethod attribute. * * @param string $statusCallbackMethod Status callback URL method * @return static $this. */ public function setStatusCallbackMethod($statusCallbackMethod) { return $this->setAttribute('statusCallbackMethod', $statusCallbackMethod); } } sdk/src/Twilio/TwiML/Voice/SsmlBreak.php 0000644 00000001777 15002236443 0014033 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\TwiML\Voice; use Twilio\TwiML\TwiML; class SsmlBreak extends TwiML { /** * SsmlBreak constructor. * * @param array $attributes Optional attributes */ public function __construct($attributes = array()) { parent::__construct('break', null, $attributes); } /** * Add Strength attribute. * * @param string $strength Set a pause based on strength * @return static $this. */ public function setStrength($strength) { return $this->setAttribute('strength', $strength); } /** * Add Time attribute. * * @param string $time Set a pause to a specific length of time in seconds or * milliseconds, available values: [number]s, [number]ms * @return static $this. */ public function setTime($time) { return $this->setAttribute('time', $time); } } sdk/src/Twilio/TwiML/Voice/Sms.php 0000644 00000003166 15002236443 0012704 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\TwiML\Voice; use Twilio\TwiML\TwiML; class Sms extends TwiML { /** * Sms constructor. * * @param string $message Message body * @param array $attributes Optional attributes */ public function __construct($message, $attributes = array()) { parent::__construct('Sms', $message, $attributes); } /** * Add To attribute. * * @param string $to Number to send message to * @return static $this. */ public function setTo($to) { return $this->setAttribute('to', $to); } /** * Add From attribute. * * @param string $from Number to send message from * @return static $this. */ public function setFrom($from) { return $this->setAttribute('from', $from); } /** * Add Action attribute. * * @param string $action Action URL * @return static $this. */ public function setAction($action) { return $this->setAttribute('action', $action); } /** * Add Method attribute. * * @param string $method Action URL method * @return static $this. */ public function setMethod($method) { return $this->setAttribute('method', $method); } /** * Add StatusCallback attribute. * * @param string $statusCallback Status callback URL * @return static $this. */ public function setStatusCallback($statusCallback) { return $this->setAttribute('statusCallback', $statusCallback); } } sdk/src/Twilio/TwiML/Voice/SsmlSub.php 0000644 00000001466 15002236443 0013533 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\TwiML\Voice; use Twilio\TwiML\TwiML; class SsmlSub extends TwiML { /** * SsmlSub constructor. * * @param string $words Words to be substituted * @param array $attributes Optional attributes */ public function __construct($words, $attributes = array()) { parent::__construct('sub', $words, $attributes); } /** * Add Alias attribute. * * @param string $alias Substitute a different word (or pronunciation) for * selected text such as an acronym or abbreviation * @return static $this. */ public function setAlias($alias) { return $this->setAttribute('alias', $alias); } } sdk/src/Twilio/TwiML/MessagingResponse.php 0000644 00000001725 15002236443 0014530 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\TwiML; class MessagingResponse extends TwiML { /** * MessagingResponse constructor. */ public function __construct() { parent::__construct('Response', null); } /** * Add Message child. * * @param string $body Message Body * @param array $attributes Optional attributes * @return Messaging\Message Child element. */ public function message($body, $attributes = array()) { return $this->nest(new Messaging\Message($body, $attributes)); } /** * Add Redirect child. * * @param string $url Redirect URL * @param array $attributes Optional attributes * @return Messaging\Redirect Child element. */ public function redirect($url, $attributes = array()) { return $this->nest(new Messaging\Redirect($url, $attributes)); } } sdk/src/Twilio/TwiML/TwiML.php 0000644 00000006477 15002236443 0012101 0 ustar 00 <?php namespace Twilio\TwiML; use DOMDocument; use DOMElement; /** * @property $name string XML element name * @property $attributes array XML attributes * @property $value string XML body * @property $children TwiML[] nested TwiML elements */ abstract class TwiML { protected $name; protected $attributes; protected $children; /** * TwiML constructor. * * @param string $name XML element name * @param string $value XML value * @param array $attributes XML attributes */ public function __construct($name, $value = null, $attributes = []) { $this->name = $name; $this->attributes = $attributes; $this->children = []; if ($value !== null) { $this->children[] = $value; } } /** * Add a TwiML element. * * @param TwiML|string $twiml TwiML element to add * @return TwiML $this */ public function append($twiml) { $this->children[] = $twiml; return $this; } /** * Add a TwiML element. * * @param TwiML $twiml TwiML element to add * @return TwiML added TwiML element */ public function nest($twiml) { $this->children[] = $twiml; return $twiml; } /** * Set TwiML attribute. * * @param string $key name of attribute * @param string $value value of attribute * @return static $this */ public function setAttribute($key, $value) { $this->attributes[$key] = $value; return $this; } /** * @param string $name XML element name * @param string $value XML value * @param array $attributes XML attributes * @return GenericNode */ public function addChild($name, $value = null, $attributes = []) { return $this->nest(new GenericNode($name, $value, $attributes)); } /** * Convert TwiML to XML string. * * @return string TwiML XML representation */ public function asXML() { return $this->__toString(); } /** * Convert TwiML to XML string. * * @return string TwiML XML representation */ public function __toString() { return $this->xml()->saveXML(); } /** * Build TwiML element. * * @param TwiML $twiml TwiML element to convert to XML * @param DOMDocument $document XML document for the element * @return DOMElement $element */ private function buildElement($twiml, $document) { $element = $document->createElement($twiml->name); foreach ($twiml->attributes as $name => $value) { if (\is_bool($value)) { $value = ($value === true) ? 'true' : 'false'; } $element->setAttribute($name, $value); } foreach ($twiml->children as $child) { if (\is_string($child)) { $element->appendChild($document->createTextNode($child)); } else { $element->appendChild($this->buildElement($child, $document)); } } return $element; } /** * Build XML element. * * @return DOMDocument Build TwiML element */ private function xml() { $document = new DOMDocument('1.0', 'UTF-8'); $document->appendChild($this->buildElement($this, $document)); return $document; } } sdk/src/Twilio/TwiML/GenericNode.php 0000644 00000000610 15002236443 0013246 0 ustar 00 <?php namespace Twilio\TwiML; class GenericNode extends TwiML { /** * GenericNode constructor. * * @param string $name XML element name * @param string $value XML value * @param array $attributes XML attributes */ public function __construct($name, $value, $attributes) { parent::__construct($name, $value, $attributes); $this->name = $name; $this->value = $value; }} sdk/src/Twilio/TwiML/Messaging/Redirect.php 0000644 00000001312 15002236443 0014542 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\TwiML\Messaging; use Twilio\TwiML\TwiML; class Redirect extends TwiML { /** * Redirect constructor. * * @param string $url Redirect URL * @param array $attributes Optional attributes */ public function __construct($url, $attributes = array()) { parent::__construct('Redirect', $url, $attributes); } /** * Add Method attribute. * * @param string $method Redirect URL method * @return static $this. */ public function setMethod($method) { return $this->setAttribute('method', $method); } } sdk/src/Twilio/TwiML/Messaging/Message.php 0000644 00000004163 15002236443 0014374 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\TwiML\Messaging; use Twilio\TwiML\TwiML; class Message extends TwiML { /** * Message constructor. * * @param string $body Message Body * @param array $attributes Optional attributes */ public function __construct($body, $attributes = array()) { parent::__construct('Message', $body, $attributes); } /** * Add Body child. * * @param string $message Message Body * @return Body Child element. */ public function body($message) { return $this->nest(new Body($message)); } /** * Add Media child. * * @param string $url Media URL * @return Media Child element. */ public function media($url) { return $this->nest(new Media($url)); } /** * Add To attribute. * * @param string $to Phone Number to send Message to * @return static $this. */ public function setTo($to) { return $this->setAttribute('to', $to); } /** * Add From attribute. * * @param string $from Phone Number to send Message from * @return static $this. */ public function setFrom($from) { return $this->setAttribute('from', $from); } /** * Add Action attribute. * * @param string $action Action URL * @return static $this. */ public function setAction($action) { return $this->setAttribute('action', $action); } /** * Add Method attribute. * * @param string $method Action URL Method * @return static $this. */ public function setMethod($method) { return $this->setAttribute('method', $method); } /** * Add StatusCallback attribute. * * @param string $statusCallback Status callback URL. Deprecated in favor of * action. * @return static $this. */ public function setStatusCallback($statusCallback) { return $this->setAttribute('statusCallback', $statusCallback); } } sdk/src/Twilio/TwiML/Messaging/Media.php 0000644 00000000575 15002236443 0014032 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\TwiML\Messaging; use Twilio\TwiML\TwiML; class Media extends TwiML { /** * Media constructor. * * @param string $url Media URL */ public function __construct($url) { parent::__construct('Media', $url); } } sdk/src/Twilio/TwiML/Messaging/Body.php 0000644 00000000611 15002236443 0013677 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\TwiML\Messaging; use Twilio\TwiML\TwiML; class Body extends TwiML { /** * Body constructor. * * @param string $message Message Body */ public function __construct($message) { parent::__construct('Body', $message); } } sdk/src/Twilio/TwiML/VoiceResponse.php 0000644 00000012664 15002236443 0013664 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\TwiML; class VoiceResponse extends TwiML { /** * VoiceResponse constructor. */ public function __construct() { parent::__construct('Response', null); } /** * Add Connect child. * * @param array $attributes Optional attributes * @return Voice\Connect Child element. */ public function connect($attributes = array()) { return $this->nest(new Voice\Connect($attributes)); } /** * Add Dial child. * * @param string $number Phone number to dial * @param array $attributes Optional attributes * @return Voice\Dial Child element. */ public function dial($number = null, $attributes = array()) { return $this->nest(new Voice\Dial($number, $attributes)); } /** * Add Echo child. * * @return Voice\Echo_ Child element. */ public function echo_() { return $this->nest(new Voice\Echo_()); } /** * Add Enqueue child. * * @param string $name Friendly name * @param array $attributes Optional attributes * @return Voice\Enqueue Child element. */ public function enqueue($name = null, $attributes = array()) { return $this->nest(new Voice\Enqueue($name, $attributes)); } /** * Add Gather child. * * @param array $attributes Optional attributes * @return Voice\Gather Child element. */ public function gather($attributes = array()) { return $this->nest(new Voice\Gather($attributes)); } /** * Add Hangup child. * * @return Voice\Hangup Child element. */ public function hangup() { return $this->nest(new Voice\Hangup()); } /** * Add Leave child. * * @return Voice\Leave Child element. */ public function leave() { return $this->nest(new Voice\Leave()); } /** * Add Pause child. * * @param array $attributes Optional attributes * @return Voice\Pause Child element. */ public function pause($attributes = array()) { return $this->nest(new Voice\Pause($attributes)); } /** * Add Play child. * * @param string $url Media URL * @param array $attributes Optional attributes * @return Voice\Play Child element. */ public function play($url = null, $attributes = array()) { return $this->nest(new Voice\Play($url, $attributes)); } /** * Add Queue child. * * @param string $name Queue name * @param array $attributes Optional attributes * @return Voice\Queue Child element. */ public function queue($name, $attributes = array()) { return $this->nest(new Voice\Queue($name, $attributes)); } /** * Add Record child. * * @param array $attributes Optional attributes * @return Voice\Record Child element. */ public function record($attributes = array()) { return $this->nest(new Voice\Record($attributes)); } /** * Add Redirect child. * * @param string $url Redirect URL * @param array $attributes Optional attributes * @return Voice\Redirect Child element. */ public function redirect($url, $attributes = array()) { return $this->nest(new Voice\Redirect($url, $attributes)); } /** * Add Reject child. * * @param array $attributes Optional attributes * @return Voice\Reject Child element. */ public function reject($attributes = array()) { return $this->nest(new Voice\Reject($attributes)); } /** * Add Say child. * * @param string $message Message to say * @param array $attributes Optional attributes * @return Voice\Say Child element. */ public function say($message, $attributes = array()) { return $this->nest(new Voice\Say($message, $attributes)); } /** * Add Sms child. * * @param string $message Message body * @param array $attributes Optional attributes * @return Voice\Sms Child element. */ public function sms($message, $attributes = array()) { return $this->nest(new Voice\Sms($message, $attributes)); } /** * Add Pay child. * * @param array $attributes Optional attributes * @return Voice\Pay Child element. */ public function pay($attributes = array()) { return $this->nest(new Voice\Pay($attributes)); } /** * Add Prompt child. * * @param array $attributes Optional attributes * @return Voice\Prompt Child element. */ public function prompt($attributes = array()) { return $this->nest(new Voice\Prompt($attributes)); } /** * Add Start child. * * @param array $attributes Optional attributes * @return Voice\Start Child element. */ public function start($attributes = array()) { return $this->nest(new Voice\Start($attributes)); } /** * Add Stop child. * * @return Voice\Stop Child element. */ public function stop() { return $this->nest(new Voice\Stop()); } /** * Add Refer child. * * @param array $attributes Optional attributes * @return Voice\Refer Child element. */ public function refer($attributes = array()) { return $this->nest(new Voice\Refer($attributes)); } } sdk/src/Twilio/TwiML/Video/Room.php 0000644 00000000572 15002236443 0013055 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\TwiML\Video; use Twilio\TwiML\TwiML; class Room extends TwiML { /** * Room constructor. * * @param string $name Room name */ public function __construct($name) { parent::__construct('Room', $name); } } sdk/src/Twilio/TwiML/Fax/Receive.php 0000644 00000003425 15002236443 0013173 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\TwiML\Fax; use Twilio\TwiML\TwiML; class Receive extends TwiML { /** * Receive constructor. * * @param array $attributes Optional attributes */ public function __construct($attributes = array()) { parent::__construct('Receive', null, $attributes); } /** * Add Action attribute. * * @param string $action Receive action URL * @return static $this. */ public function setAction($action) { return $this->setAttribute('action', $action); } /** * Add Method attribute. * * @param string $method Receive action URL method * @return static $this. */ public function setMethod($method) { return $this->setAttribute('method', $method); } /** * Add MediaType attribute. * * @param string $mediaType The media type used to store media in the fax media * store * @return static $this. */ public function setMediaType($mediaType) { return $this->setAttribute('mediaType', $mediaType); } /** * Add PageSize attribute. * * @param string $pageSize What size to interpret received pages as * @return static $this. */ public function setPageSize($pageSize) { return $this->setAttribute('pageSize', $pageSize); } /** * Add StoreMedia attribute. * * @param bool $storeMedia Whether or not to store received media in the fax * media store * @return static $this. */ public function setStoreMedia($storeMedia) { return $this->setAttribute('storeMedia', $storeMedia); } } sdk/src/Twilio/TwiML/FaxResponse.php 0000644 00000001077 15002236443 0013331 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\TwiML; class FaxResponse extends TwiML { /** * FaxResponse constructor. */ public function __construct() { parent::__construct('Response', null); } /** * Add Receive child. * * @param array $attributes Optional attributes * @return Fax\Receive Child element. */ public function receive($attributes = array()) { return $this->nest(new Fax\Receive($attributes)); } } sdk/src/Twilio/Deserialize.php 0000644 00000001102 15002236443 0012325 0 ustar 00 <?php namespace Twilio; class Deserialize { /** * Deserialize a string date into a DateTime object * * @param string $s A date or date and time, can be iso8601, rfc2822, * YYYY-MM-DD format. * @return \DateTime DateTime corresponding to the input string, in UTC time. */ public static function dateTime($s) { try { if ($s) { return new \DateTime($s, new \DateTimeZone('UTC')); } } catch (\Exception $e) { // no-op } return $s; } } sdk/src/Twilio/Rest/Taskrouter.php 0000644 00000005303 15002236443 0013154 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\Rest\Taskrouter\V1; /** * @property \Twilio\Rest\Taskrouter\V1 $v1 * @property \Twilio\Rest\Taskrouter\V1\WorkspaceList $workspaces * @method \Twilio\Rest\Taskrouter\V1\WorkspaceContext workspaces(string $sid) */ class Taskrouter extends Domain { protected $_v1 = null; /** * Construct the Taskrouter Domain * * @param \Twilio\Rest\Client $client Twilio\Rest\Client to communicate with * Twilio * @return \Twilio\Rest\Taskrouter Domain for Taskrouter */ public function __construct(Client $client) { parent::__construct($client); $this->baseUrl = 'https://taskrouter.twilio.com'; } /** * @return \Twilio\Rest\Taskrouter\V1 Version v1 of taskrouter */ protected function getV1() { if (!$this->_v1) { $this->_v1 = new V1($this); } return $this->_v1; } /** * Magic getter to lazy load version * * @param string $name Version to return * @return \Twilio\Version The requested version * @throws TwilioException For unknown versions */ public function __get($name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown version ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $method = 'context' . \ucfirst($name); if (\method_exists($this, $method)) { return \call_user_func_array(array($this, $method), $arguments); } throw new TwilioException('Unknown context ' . $name); } /** * @return \Twilio\Rest\Taskrouter\V1\WorkspaceList */ protected function getWorkspaces() { return $this->v1->workspaces; } /** * @param string $sid The SID of the resource to fetch * @return \Twilio\Rest\Taskrouter\V1\WorkspaceContext */ protected function contextWorkspaces($sid) { return $this->v1->workspaces($sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Taskrouter]'; } } sdk/src/Twilio/Rest/Accounts/V1.php 0000644 00000004334 15002236443 0013061 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Accounts; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\Rest\Accounts\V1\CredentialList; use Twilio\Version; /** * @property \Twilio\Rest\Accounts\V1\CredentialList $credentials */ class V1 extends Version { protected $_credentials = null; /** * Construct the V1 version of Accounts * * @param \Twilio\Domain $domain Domain that contains the version * @return \Twilio\Rest\Accounts\V1 V1 version of Accounts */ public function __construct(Domain $domain) { parent::__construct($domain); $this->version = 'v1'; } /** * @return \Twilio\Rest\Accounts\V1\CredentialList */ protected function getCredentials() { if (!$this->_credentials) { $this->_credentials = new CredentialList($this); } return $this->_credentials; } /** * Magic getter to lazy load root resources * * @param string $name Resource to return * @return \Twilio\ListResource The requested resource * @throws TwilioException For unknown resource */ public function __get($name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown resource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Accounts.V1]'; } } sdk/src/Twilio/Rest/Accounts/V1/CredentialInstance.php 0000644 00000002743 15002236443 0016622 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Accounts\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; class CredentialInstance extends InstanceResource { /** * Initialize the CredentialInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @return \Twilio\Rest\Accounts\V1\CredentialInstance */ public function __construct(Version $version, array $payload) { parent::__construct($version); $this->solution = array(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Accounts.V1.CredentialInstance]'; } } sdk/src/Twilio/Rest/Accounts/V1/CredentialList.php 0000644 00000005422 15002236443 0015766 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Accounts\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Rest\Accounts\V1\Credential\AwsList; use Twilio\Rest\Accounts\V1\Credential\PublicKeyList; use Twilio\Version; /** * @property \Twilio\Rest\Accounts\V1\Credential\PublicKeyList $publicKey * @property \Twilio\Rest\Accounts\V1\Credential\AwsList $aws * @method \Twilio\Rest\Accounts\V1\Credential\PublicKeyContext publicKey(string $sid) * @method \Twilio\Rest\Accounts\V1\Credential\AwsContext aws(string $sid) */ class CredentialList extends ListResource { protected $_publicKey = null; protected $_aws = null; /** * Construct the CredentialList * * @param Version $version Version that contains the resource * @return \Twilio\Rest\Accounts\V1\CredentialList */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = array(); } /** * Access the publicKey */ protected function getPublicKey() { if (!$this->_publicKey) { $this->_publicKey = new PublicKeyList($this->version); } return $this->_publicKey; } /** * Access the aws */ protected function getAws() { if (!$this->_aws) { $this->_aws = new AwsList($this->version); } return $this->_aws; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get($name) { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Accounts.V1.CredentialList]'; } } sdk/src/Twilio/Rest/Accounts/V1/Credential/PublicKeyContext.php 0000644 00000005104 15002236443 0020363 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Accounts\V1\Credential; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Values; use Twilio\Version; class PublicKeyContext extends InstanceContext { /** * Initialize the PublicKeyContext * * @param \Twilio\Version $version Version that contains the resource * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Accounts\V1\Credential\PublicKeyContext */ public function __construct(Version $version, $sid) { parent::__construct($version); // Path Solution $this->solution = array('sid' => $sid, ); $this->uri = '/Credentials/PublicKeys/' . \rawurlencode($sid) . ''; } /** * Fetch a PublicKeyInstance * * @return PublicKeyInstance Fetched PublicKeyInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new PublicKeyInstance($this->version, $payload, $this->solution['sid']); } /** * Update the PublicKeyInstance * * @param array|Options $options Optional Arguments * @return PublicKeyInstance Updated PublicKeyInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { $options = new Values($options); $data = Values::of(array('FriendlyName' => $options['friendlyName'], )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new PublicKeyInstance($this->version, $payload, $this->solution['sid']); } /** * Deletes the PublicKeyInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Accounts.V1.PublicKeyContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Accounts/V1/Credential/AwsOptions.php 0000644 00000007172 15002236443 0017244 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Accounts\V1\Credential; use Twilio\Options; use Twilio\Values; abstract class AwsOptions { /** * @param string $friendlyName A string to describe the resource * @param string $accountSid The Subaccount this Credential should be * associated with. * @return CreateAwsOptions Options builder */ public static function create($friendlyName = Values::NONE, $accountSid = Values::NONE) { return new CreateAwsOptions($friendlyName, $accountSid); } /** * @param string $friendlyName A string to describe the resource * @return UpdateAwsOptions Options builder */ public static function update($friendlyName = Values::NONE) { return new UpdateAwsOptions($friendlyName); } } class CreateAwsOptions extends Options { /** * @param string $friendlyName A string to describe the resource * @param string $accountSid The Subaccount this Credential should be * associated with. */ public function __construct($friendlyName = Values::NONE, $accountSid = Values::NONE) { $this->options['friendlyName'] = $friendlyName; $this->options['accountSid'] = $accountSid; } /** * A descriptive string that you create to describe the resource. It can be up to 64 characters long. * * @param string $friendlyName A string to describe the resource * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The SID of the Subaccount that this Credential should be associated with. Must be a valid Subaccount of the account issuing the request. * * @param string $accountSid The Subaccount this Credential should be * associated with. * @return $this Fluent Builder */ public function setAccountSid($accountSid) { $this->options['accountSid'] = $accountSid; 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.Accounts.V1.CreateAwsOptions ' . \implode(' ', $options) . ']'; } } class UpdateAwsOptions extends Options { /** * @param string $friendlyName A string to describe the resource */ public function __construct($friendlyName = Values::NONE) { $this->options['friendlyName'] = $friendlyName; } /** * A descriptive string that you create to describe the resource. It can be up to 64 characters long. * * @param string $friendlyName A string to describe the resource * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; 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.Accounts.V1.UpdateAwsOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Accounts/V1/Credential/AwsList.php 0000644 00000013066 15002236443 0016523 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Accounts\V1\Credential; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; class AwsList extends ListResource { /** * Construct the AwsList * * @param Version $version Version that contains the resource * @return \Twilio\Rest\Accounts\V1\Credential\AwsList */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = array(); $this->uri = '/Credentials/AWS'; } /** * Streams AwsInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads AwsInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return AwsInstance[] Array of results */ public function read($limit = null, $pageSize = null) { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of AwsInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of AwsInstance */ public function page($pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $params = Values::of(array( 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new AwsPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of AwsInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of AwsInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new AwsPage($this->version, $response, $this->solution); } /** * Create a new AwsInstance * * @param string $credentials A string that contains the AWS access credentials * in the format * <AWS_ACCESS_KEY_ID>:<AWS_SECRET_ACCESS_KEY> * @param array|Options $options Optional Arguments * @return AwsInstance Newly created AwsInstance * @throws TwilioException When an HTTP error occurs. */ public function create($credentials, $options = array()) { $options = new Values($options); $data = Values::of(array( 'Credentials' => $credentials, 'FriendlyName' => $options['friendlyName'], 'AccountSid' => $options['accountSid'], )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new AwsInstance($this->version, $payload); } /** * Constructs a AwsContext * * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Accounts\V1\Credential\AwsContext */ public function getContext($sid) { return new AwsContext($this->version, $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Accounts.V1.AwsList]'; } } sdk/src/Twilio/Rest/Accounts/V1/Credential/AwsContext.php 0000644 00000004757 15002236443 0017243 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Accounts\V1\Credential; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Values; use Twilio\Version; class AwsContext extends InstanceContext { /** * Initialize the AwsContext * * @param \Twilio\Version $version Version that contains the resource * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Accounts\V1\Credential\AwsContext */ public function __construct(Version $version, $sid) { parent::__construct($version); // Path Solution $this->solution = array('sid' => $sid, ); $this->uri = '/Credentials/AWS/' . \rawurlencode($sid) . ''; } /** * Fetch a AwsInstance * * @return AwsInstance Fetched AwsInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new AwsInstance($this->version, $payload, $this->solution['sid']); } /** * Update the AwsInstance * * @param array|Options $options Optional Arguments * @return AwsInstance Updated AwsInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { $options = new Values($options); $data = Values::of(array('FriendlyName' => $options['friendlyName'], )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new AwsInstance($this->version, $payload, $this->solution['sid']); } /** * Deletes the AwsInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Accounts.V1.AwsContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Accounts/V1/Credential/PublicKeyOptions.php 0000644 00000007257 15002236443 0020405 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Accounts\V1\Credential; use Twilio\Options; use Twilio\Values; abstract class PublicKeyOptions { /** * @param string $friendlyName A string to describe the resource * @param string $accountSid The Subaccount this Credential should be * associated with. * @return CreatePublicKeyOptions Options builder */ public static function create($friendlyName = Values::NONE, $accountSid = Values::NONE) { return new CreatePublicKeyOptions($friendlyName, $accountSid); } /** * @param string $friendlyName A string to describe the resource * @return UpdatePublicKeyOptions Options builder */ public static function update($friendlyName = Values::NONE) { return new UpdatePublicKeyOptions($friendlyName); } } class CreatePublicKeyOptions extends Options { /** * @param string $friendlyName A string to describe the resource * @param string $accountSid The Subaccount this Credential should be * associated with. */ public function __construct($friendlyName = Values::NONE, $accountSid = Values::NONE) { $this->options['friendlyName'] = $friendlyName; $this->options['accountSid'] = $accountSid; } /** * A descriptive string that you create to describe the resource. It can be up to 64 characters long. * * @param string $friendlyName A string to describe the resource * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The SID of the Subaccount that this Credential should be associated with. Must be a valid Subaccount of the account issuing the request * * @param string $accountSid The Subaccount this Credential should be * associated with. * @return $this Fluent Builder */ public function setAccountSid($accountSid) { $this->options['accountSid'] = $accountSid; 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.Accounts.V1.CreatePublicKeyOptions ' . \implode(' ', $options) . ']'; } } class UpdatePublicKeyOptions extends Options { /** * @param string $friendlyName A string to describe the resource */ public function __construct($friendlyName = Values::NONE) { $this->options['friendlyName'] = $friendlyName; } /** * A descriptive string that you create to describe the resource. It can be up to 64 characters long. * * @param string $friendlyName A string to describe the resource * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; 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.Accounts.V1.UpdatePublicKeyOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Accounts/V1/Credential/PublicKeyList.php 0000644 00000013054 15002236443 0017655 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Accounts\V1\Credential; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; class PublicKeyList extends ListResource { /** * Construct the PublicKeyList * * @param Version $version Version that contains the resource * @return \Twilio\Rest\Accounts\V1\Credential\PublicKeyList */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = array(); $this->uri = '/Credentials/PublicKeys'; } /** * Streams PublicKeyInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads PublicKeyInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return PublicKeyInstance[] Array of results */ public function read($limit = null, $pageSize = null) { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of PublicKeyInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of PublicKeyInstance */ public function page($pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $params = Values::of(array( 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new PublicKeyPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of PublicKeyInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of PublicKeyInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new PublicKeyPage($this->version, $response, $this->solution); } /** * Create a new PublicKeyInstance * * @param string $publicKey A URL encoded representation of the public key * @param array|Options $options Optional Arguments * @return PublicKeyInstance Newly created PublicKeyInstance * @throws TwilioException When an HTTP error occurs. */ public function create($publicKey, $options = array()) { $options = new Values($options); $data = Values::of(array( 'PublicKey' => $publicKey, 'FriendlyName' => $options['friendlyName'], 'AccountSid' => $options['accountSid'], )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new PublicKeyInstance($this->version, $payload); } /** * Constructs a PublicKeyContext * * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Accounts\V1\Credential\PublicKeyContext */ public function getContext($sid) { return new PublicKeyContext($this->version, $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Accounts.V1.PublicKeyList]'; } } sdk/src/Twilio/Rest/Accounts/V1/Credential/PublicKeyInstance.php 0000644 00000007747 15002236443 0020522 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Accounts\V1\Credential; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $accountSid * @property string $friendlyName * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $url */ class PublicKeyInstance extends InstanceResource { /** * Initialize the PublicKeyInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Accounts\V1\Credential\PublicKeyInstance */ public function __construct(Version $version, array $payload, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), ); $this->solution = array('sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Accounts\V1\Credential\PublicKeyContext Context for * this * PublicKeyInstance */ protected function proxy() { if (!$this->context) { $this->context = new PublicKeyContext($this->version, $this->solution['sid']); } return $this->context; } /** * Fetch a PublicKeyInstance * * @return PublicKeyInstance Fetched PublicKeyInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Update the PublicKeyInstance * * @param array|Options $options Optional Arguments * @return PublicKeyInstance Updated PublicKeyInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Deletes the PublicKeyInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Accounts.V1.PublicKeyInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Accounts/V1/Credential/PublicKeyPage.php 0000644 00000001343 15002236443 0017614 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Accounts\V1\Credential; use Twilio\Page; class PublicKeyPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new PublicKeyInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Accounts.V1.PublicKeyPage]'; } } sdk/src/Twilio/Rest/Accounts/V1/Credential/AwsPage.php 0000644 00000001321 15002236443 0016453 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Accounts\V1\Credential; use Twilio\Page; class AwsPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new AwsInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Accounts.V1.AwsPage]'; } } sdk/src/Twilio/Rest/Accounts/V1/Credential/AwsInstance.php 0000644 00000007511 15002236443 0017352 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Accounts\V1\Credential; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $accountSid * @property string $friendlyName * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $url */ class AwsInstance extends InstanceResource { /** * Initialize the AwsInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Accounts\V1\Credential\AwsInstance */ public function __construct(Version $version, array $payload, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), ); $this->solution = array('sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Accounts\V1\Credential\AwsContext Context for this * AwsInstance */ protected function proxy() { if (!$this->context) { $this->context = new AwsContext($this->version, $this->solution['sid']); } return $this->context; } /** * Fetch a AwsInstance * * @return AwsInstance Fetched AwsInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Update the AwsInstance * * @param array|Options $options Optional Arguments * @return AwsInstance Updated AwsInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Deletes the AwsInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Accounts.V1.AwsInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Accounts/V1/CredentialPage.php 0000644 00000001333 15002236443 0015724 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Accounts\V1; use Twilio\Page; class CredentialPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new CredentialInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Accounts.V1.CredentialPage]'; } } sdk/src/Twilio/Rest/Serverless/V1.php 0000644 00000004431 15002236443 0013435 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Serverless; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\Rest\Serverless\V1\ServiceList; use Twilio\Version; /** * @property \Twilio\Rest\Serverless\V1\ServiceList $services * @method \Twilio\Rest\Serverless\V1\ServiceContext services(string $sid) */ class V1 extends Version { protected $_services = null; /** * Construct the V1 version of Serverless * * @param \Twilio\Domain $domain Domain that contains the version * @return \Twilio\Rest\Serverless\V1 V1 version of Serverless */ public function __construct(Domain $domain) { parent::__construct($domain); $this->version = 'v1'; } /** * @return \Twilio\Rest\Serverless\V1\ServiceList */ protected function getServices() { if (!$this->_services) { $this->_services = new ServiceList($this); } return $this->_services; } /** * Magic getter to lazy load root resources * * @param string $name Resource to return * @return \Twilio\ListResource The requested resource * @throws TwilioException For unknown resource */ public function __get($name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown resource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Serverless.V1]'; } } sdk/src/Twilio/Rest/Serverless/V1/ServiceOptions.php 0000644 00000010420 15002236443 0016404 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Serverless\V1; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ abstract class ServiceOptions { /** * @param bool $includeCredentials Whether to inject Account credentials into a * function invocation context * @return CreateServiceOptions Options builder */ public static function create($includeCredentials = Values::NONE) { return new CreateServiceOptions($includeCredentials); } /** * @param bool $includeCredentials Whether to inject Account credentials into a * function invocation context * @param string $friendlyName A string to describe the Service resource * @return UpdateServiceOptions Options builder */ public static function update($includeCredentials = Values::NONE, $friendlyName = Values::NONE) { return new UpdateServiceOptions($includeCredentials, $friendlyName); } } class CreateServiceOptions extends Options { /** * @param bool $includeCredentials Whether to inject Account credentials into a * function invocation context */ public function __construct($includeCredentials = Values::NONE) { $this->options['includeCredentials'] = $includeCredentials; } /** * Whether to inject Account credentials into a function invocation context. The default value is `false`. * * @param bool $includeCredentials Whether to inject Account credentials into a * function invocation context * @return $this Fluent Builder */ public function setIncludeCredentials($includeCredentials) { $this->options['includeCredentials'] = $includeCredentials; 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.Serverless.V1.CreateServiceOptions ' . \implode(' ', $options) . ']'; } } class UpdateServiceOptions extends Options { /** * @param bool $includeCredentials Whether to inject Account credentials into a * function invocation context * @param string $friendlyName A string to describe the Service resource */ public function __construct($includeCredentials = Values::NONE, $friendlyName = Values::NONE) { $this->options['includeCredentials'] = $includeCredentials; $this->options['friendlyName'] = $friendlyName; } /** * Whether to inject Account credentials into a function invocation context. * * @param bool $includeCredentials Whether to inject Account credentials into a * function invocation context * @return $this Fluent Builder */ public function setIncludeCredentials($includeCredentials) { $this->options['includeCredentials'] = $includeCredentials; return $this; } /** * A descriptive string that you create to describe the Service resource. It can be up to 255 characters long. * * @param string $friendlyName A string to describe the Service resource * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; 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.Serverless.V1.UpdateServiceOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Serverless/V1/ServiceList.php 0000644 00000013567 15002236443 0015703 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Serverless\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class ServiceList extends ListResource { /** * Construct the ServiceList * * @param Version $version Version that contains the resource * @return \Twilio\Rest\Serverless\V1\ServiceList */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = array(); $this->uri = '/Services'; } /** * Streams ServiceInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads ServiceInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return ServiceInstance[] Array of results */ public function read($limit = null, $pageSize = null) { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of ServiceInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of ServiceInstance */ public function page($pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $params = Values::of(array( 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new ServicePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of ServiceInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of ServiceInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new ServicePage($this->version, $response, $this->solution); } /** * Create a new ServiceInstance * * @param string $uniqueName An application-defined string that uniquely * identifies the Service resource * @param string $friendlyName A string to describe the Service resource * @param array|Options $options Optional Arguments * @return ServiceInstance Newly created ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function create($uniqueName, $friendlyName, $options = array()) { $options = new Values($options); $data = Values::of(array( 'UniqueName' => $uniqueName, 'FriendlyName' => $friendlyName, 'IncludeCredentials' => Serialize::booleanToString($options['includeCredentials']), )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new ServiceInstance($this->version, $payload); } /** * Constructs a ServiceContext * * @param string $sid The SID of the Service resource to fetch * @return \Twilio\Rest\Serverless\V1\ServiceContext */ public function getContext($sid) { return new ServiceContext($this->version, $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Serverless.V1.ServiceList]'; } } sdk/src/Twilio/Rest/Serverless/V1/ServicePage.php 0000644 00000001641 15002236443 0015632 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Serverless\V1; use Twilio\Page; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class ServicePage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new ServiceInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Serverless.V1.ServicePage]'; } } sdk/src/Twilio/Rest/Serverless/V1/ServiceInstance.php 0000644 00000012406 15002236443 0016523 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Serverless\V1; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $sid * @property string $accountSid * @property string $friendlyName * @property string $uniqueName * @property bool $includeCredentials * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $url * @property array $links */ class ServiceInstance extends InstanceResource { protected $_environments = null; protected $_functions = null; protected $_assets = null; protected $_builds = null; /** * Initialize the ServiceInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The SID of the Service resource to fetch * @return \Twilio\Rest\Serverless\V1\ServiceInstance */ public function __construct(Version $version, array $payload, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'uniqueName' => Values::array_get($payload, 'unique_name'), 'includeCredentials' => Values::array_get($payload, 'include_credentials'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ); $this->solution = array('sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Serverless\V1\ServiceContext Context for this * ServiceInstance */ protected function proxy() { if (!$this->context) { $this->context = new ServiceContext($this->version, $this->solution['sid']); } return $this->context; } /** * Fetch a ServiceInstance * * @return ServiceInstance Fetched ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the ServiceInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Update the ServiceInstance * * @param array|Options $options Optional Arguments * @return ServiceInstance Updated ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Access the environments * * @return \Twilio\Rest\Serverless\V1\Service\EnvironmentList */ protected function getEnvironments() { return $this->proxy()->environments; } /** * Access the functions * * @return \Twilio\Rest\Serverless\V1\Service\FunctionList */ protected function getFunctions() { return $this->proxy()->functions; } /** * Access the assets * * @return \Twilio\Rest\Serverless\V1\Service\AssetList */ protected function getAssets() { return $this->proxy()->assets; } /** * Access the builds * * @return \Twilio\Rest\Serverless\V1\Service\BuildList */ protected function getBuilds() { return $this->proxy()->builds; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Serverless.V1.ServiceInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Serverless/V1/Service/EnvironmentList.php 0000644 00000014041 15002236443 0020173 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Serverless\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class EnvironmentList extends ListResource { /** * Construct the EnvironmentList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Service that the Environment * resource is associated with * @return \Twilio\Rest\Serverless\V1\Service\EnvironmentList */ public function __construct(Version $version, $serviceSid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Environments'; } /** * Streams EnvironmentInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads EnvironmentInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return EnvironmentInstance[] Array of results */ public function read($limit = null, $pageSize = null) { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of EnvironmentInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of EnvironmentInstance */ public function page($pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $params = Values::of(array( 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new EnvironmentPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of EnvironmentInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of EnvironmentInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new EnvironmentPage($this->version, $response, $this->solution); } /** * Create a new EnvironmentInstance * * @param string $uniqueName An application-defined string that uniquely * identifies the Environment resource * @param array|Options $options Optional Arguments * @return EnvironmentInstance Newly created EnvironmentInstance * @throws TwilioException When an HTTP error occurs. */ public function create($uniqueName, $options = array()) { $options = new Values($options); $data = Values::of(array('UniqueName' => $uniqueName, 'DomainSuffix' => $options['domainSuffix'], )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new EnvironmentInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Constructs a EnvironmentContext * * @param string $sid The SID of the Environment resource to fetch * @return \Twilio\Rest\Serverless\V1\Service\EnvironmentContext */ public function getContext($sid) { return new EnvironmentContext($this->version, $this->solution['serviceSid'], $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Serverless.V1.EnvironmentList]'; } } sdk/src/Twilio/Rest/Serverless/V1/Service/AssetPage.php 0000644 00000001702 15002236443 0016707 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Serverless\V1\Service; use Twilio\Page; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class AssetPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new AssetInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Serverless.V1.AssetPage]'; } } sdk/src/Twilio/Rest/Serverless/V1/Service/FunctionInstance.php 0000644 00000011502 15002236443 0020304 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Serverless\V1\Service; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $sid * @property string $accountSid * @property string $serviceSid * @property string $friendlyName * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $url * @property array $links */ class FunctionInstance extends InstanceResource { protected $_functionVersions = null; /** * Initialize the FunctionInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the Service that the Function resource * is associated with * @param string $sid The SID of the Function resource to fetch * @return \Twilio\Rest\Serverless\V1\Service\FunctionInstance */ public function __construct(Version $version, array $payload, $serviceSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ); $this->solution = array('serviceSid' => $serviceSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Serverless\V1\Service\FunctionContext Context for this * FunctionInstance */ protected function proxy() { if (!$this->context) { $this->context = new FunctionContext( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch a FunctionInstance * * @return FunctionInstance Fetched FunctionInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the FunctionInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Update the FunctionInstance * * @param string $friendlyName A string to describe the Function resource * @return FunctionInstance Updated FunctionInstance * @throws TwilioException When an HTTP error occurs. */ public function update($friendlyName) { return $this->proxy()->update($friendlyName); } /** * Access the functionVersions * * @return \Twilio\Rest\Serverless\V1\Service\TwilioFunction\FunctionVersionList */ protected function getFunctionVersions() { return $this->proxy()->functionVersions; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Serverless.V1.FunctionInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Serverless/V1/Service/BuildList.php 0000644 00000013732 15002236443 0016734 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Serverless\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class BuildList extends ListResource { /** * Construct the BuildList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Service that the Build resource is * associated with * @return \Twilio\Rest\Serverless\V1\Service\BuildList */ public function __construct(Version $version, $serviceSid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Builds'; } /** * Streams BuildInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads BuildInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return BuildInstance[] Array of results */ public function read($limit = null, $pageSize = null) { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of BuildInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of BuildInstance */ public function page($pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $params = Values::of(array( 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new BuildPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of BuildInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of BuildInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new BuildPage($this->version, $response, $this->solution); } /** * Create a new BuildInstance * * @param array|Options $options Optional Arguments * @return BuildInstance Newly created BuildInstance * @throws TwilioException When an HTTP error occurs. */ public function create($options = array()) { $options = new Values($options); $data = Values::of(array( 'AssetVersions' => Serialize::map($options['assetVersions'], function($e) { return $e; }), 'FunctionVersions' => Serialize::map($options['functionVersions'], function($e) { return $e; }), 'Dependencies' => $options['dependencies'], )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new BuildInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Constructs a BuildContext * * @param string $sid The SID of the Build resource to fetch * @return \Twilio\Rest\Serverless\V1\Service\BuildContext */ public function getContext($sid) { return new BuildContext($this->version, $this->solution['serviceSid'], $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Serverless.V1.BuildList]'; } } sdk/src/Twilio/Rest/Serverless/V1/Service/FunctionPage.php 0000644 00000001713 15002236443 0017417 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Serverless\V1\Service; use Twilio\Page; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class FunctionPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new FunctionInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Serverless.V1.FunctionPage]'; } } sdk/src/Twilio/Rest/Serverless/V1/Service/Asset/AssetVersionPage.php 0000644 00000002064 15002236443 0021336 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Serverless\V1\Service\Asset; use Twilio\Page; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class AssetVersionPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new AssetVersionInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['assetSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Serverless.V1.AssetVersionPage]'; } } sdk/src/Twilio/Rest/Serverless/V1/Service/Asset/AssetVersionContext.php 0000644 00000004735 15002236443 0022115 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Serverless\V1\Service\Asset; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class AssetVersionContext extends InstanceContext { /** * Initialize the AssetVersionContext * * @param \Twilio\Version $version Version that contains the resource * @param string $serviceSid The SID of the Service to fetch the Asset Version * resource from * @param string $assetSid The SID of the Asset resource that is the parent of * the Asset Version resource to fetch * @param string $sid The SID that identifies the Asset Version resource to * fetch * @return \Twilio\Rest\Serverless\V1\Service\Asset\AssetVersionContext */ public function __construct(Version $version, $serviceSid, $assetSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, 'assetSid' => $assetSid, 'sid' => $sid, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Assets/' . \rawurlencode($assetSid) . '/Versions/' . \rawurlencode($sid) . ''; } /** * Fetch a AssetVersionInstance * * @return AssetVersionInstance Fetched AssetVersionInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new AssetVersionInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['assetSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Serverless.V1.AssetVersionContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Serverless/V1/Service/Asset/AssetVersionList.php 0000644 00000013005 15002236443 0021372 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Serverless\V1\Service\Asset; use Twilio\ListResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class AssetVersionList extends ListResource { /** * Construct the AssetVersionList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Service that the Asset Version * resource is associated with * @param string $assetSid The SID of the Asset resource that is the parent of * the asset version * @return \Twilio\Rest\Serverless\V1\Service\Asset\AssetVersionList */ public function __construct(Version $version, $serviceSid, $assetSid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, 'assetSid' => $assetSid, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Assets/' . \rawurlencode($assetSid) . '/Versions'; } /** * Streams AssetVersionInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads AssetVersionInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return AssetVersionInstance[] Array of results */ public function read($limit = null, $pageSize = null) { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of AssetVersionInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of AssetVersionInstance */ public function page($pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $params = Values::of(array( 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new AssetVersionPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of AssetVersionInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of AssetVersionInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new AssetVersionPage($this->version, $response, $this->solution); } /** * Constructs a AssetVersionContext * * @param string $sid The SID that identifies the Asset Version resource to * fetch * @return \Twilio\Rest\Serverless\V1\Service\Asset\AssetVersionContext */ public function getContext($sid) { return new AssetVersionContext( $this->version, $this->solution['serviceSid'], $this->solution['assetSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Serverless.V1.AssetVersionList]'; } } sdk/src/Twilio/Rest/Serverless/V1/Service/Asset/AssetVersionInstance.php 0000644 00000010635 15002236443 0022231 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Serverless\V1\Service\Asset; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $sid * @property string $accountSid * @property string $serviceSid * @property string $assetSid * @property string $path * @property string $visibility * @property \DateTime $dateCreated * @property string $url */ class AssetVersionInstance extends InstanceResource { /** * Initialize the AssetVersionInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the Service that the Asset Version * resource is associated with * @param string $assetSid The SID of the Asset resource that is the parent of * the asset version * @param string $sid The SID that identifies the Asset Version resource to * fetch * @return \Twilio\Rest\Serverless\V1\Service\Asset\AssetVersionInstance */ public function __construct(Version $version, array $payload, $serviceSid, $assetSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'assetSid' => Values::array_get($payload, 'asset_sid'), 'path' => Values::array_get($payload, 'path'), 'visibility' => Values::array_get($payload, 'visibility'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'url' => Values::array_get($payload, 'url'), ); $this->solution = array( 'serviceSid' => $serviceSid, 'assetSid' => $assetSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Serverless\V1\Service\Asset\AssetVersionContext Context * for * this * AssetVersionInstance */ protected function proxy() { if (!$this->context) { $this->context = new AssetVersionContext( $this->version, $this->solution['serviceSid'], $this->solution['assetSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch a AssetVersionInstance * * @return AssetVersionInstance Fetched AssetVersionInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Serverless.V1.AssetVersionInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Serverless/V1/Service/AssetContext.php 0000644 00000011503 15002236443 0017457 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Serverless\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Rest\Serverless\V1\Service\Asset\AssetVersionList; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property \Twilio\Rest\Serverless\V1\Service\Asset\AssetVersionList $assetVersions * @method \Twilio\Rest\Serverless\V1\Service\Asset\AssetVersionContext assetVersions(string $sid) */ class AssetContext extends InstanceContext { protected $_assetVersions = null; /** * Initialize the AssetContext * * @param \Twilio\Version $version Version that contains the resource * @param string $serviceSid The SID of the Service to fetch the Asset resource * from * @param string $sid The SID that identifies the Asset resource to fetch * @return \Twilio\Rest\Serverless\V1\Service\AssetContext */ public function __construct(Version $version, $serviceSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, 'sid' => $sid, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Assets/' . \rawurlencode($sid) . ''; } /** * Fetch a AssetInstance * * @return AssetInstance Fetched AssetInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new AssetInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Deletes the AssetInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Update the AssetInstance * * @param string $friendlyName A string to describe the Asset resource * @return AssetInstance Updated AssetInstance * @throws TwilioException When an HTTP error occurs. */ public function update($friendlyName) { $data = Values::of(array('FriendlyName' => $friendlyName, )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new AssetInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Access the assetVersions * * @return \Twilio\Rest\Serverless\V1\Service\Asset\AssetVersionList */ protected function getAssetVersions() { if (!$this->_assetVersions) { $this->_assetVersions = new AssetVersionList( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->_assetVersions; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get($name) { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Serverless.V1.AssetContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Serverless/V1/Service/AssetList.php 0000644 00000013255 15002236443 0016754 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Serverless\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class AssetList extends ListResource { /** * Construct the AssetList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Service that the Asset resource is * associated with * @return \Twilio\Rest\Serverless\V1\Service\AssetList */ public function __construct(Version $version, $serviceSid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Assets'; } /** * Streams AssetInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads AssetInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return AssetInstance[] Array of results */ public function read($limit = null, $pageSize = null) { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of AssetInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of AssetInstance */ public function page($pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $params = Values::of(array( 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new AssetPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of AssetInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of AssetInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new AssetPage($this->version, $response, $this->solution); } /** * Create a new AssetInstance * * @param string $friendlyName A string to describe the Asset resource * @return AssetInstance Newly created AssetInstance * @throws TwilioException When an HTTP error occurs. */ public function create($friendlyName) { $data = Values::of(array('FriendlyName' => $friendlyName, )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new AssetInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Constructs a AssetContext * * @param string $sid The SID that identifies the Asset resource to fetch * @return \Twilio\Rest\Serverless\V1\Service\AssetContext */ public function getContext($sid) { return new AssetContext($this->version, $this->solution['serviceSid'], $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Serverless.V1.AssetList]'; } } sdk/src/Twilio/Rest/Serverless/V1/Service/BuildInstance.php 0000644 00000010577 15002236443 0017571 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Serverless\V1\Service; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $sid * @property string $accountSid * @property string $serviceSid * @property string $status * @property array $assetVersions * @property array $functionVersions * @property array $dependencies * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $url */ class BuildInstance extends InstanceResource { /** * Initialize the BuildInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the Service that the Build resource is * associated with * @param string $sid The SID of the Build resource to fetch * @return \Twilio\Rest\Serverless\V1\Service\BuildInstance */ public function __construct(Version $version, array $payload, $serviceSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'status' => Values::array_get($payload, 'status'), 'assetVersions' => Values::array_get($payload, 'asset_versions'), 'functionVersions' => Values::array_get($payload, 'function_versions'), 'dependencies' => Values::array_get($payload, 'dependencies'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), ); $this->solution = array('serviceSid' => $serviceSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Serverless\V1\Service\BuildContext Context for this * BuildInstance */ protected function proxy() { if (!$this->context) { $this->context = new BuildContext( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch a BuildInstance * * @return BuildInstance Fetched BuildInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the BuildInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Serverless.V1.BuildInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Serverless/V1/Service/BuildOptions.php 0000644 00000007163 15002236443 0017455 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Serverless\V1\Service; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ abstract class BuildOptions { /** * @param string $assetVersions The list of Asset Version resource SIDs to * include in the build * @param string $functionVersions The list of the Variable resource SIDs to * include in the build * @param string $dependencies A list of objects that describe the Dependencies * included in the build * @return CreateBuildOptions Options builder */ public static function create($assetVersions = Values::NONE, $functionVersions = Values::NONE, $dependencies = Values::NONE) { return new CreateBuildOptions($assetVersions, $functionVersions, $dependencies); } } class CreateBuildOptions extends Options { /** * @param string $assetVersions The list of Asset Version resource SIDs to * include in the build * @param string $functionVersions The list of the Variable resource SIDs to * include in the build * @param string $dependencies A list of objects that describe the Dependencies * included in the build */ public function __construct($assetVersions = Values::NONE, $functionVersions = Values::NONE, $dependencies = Values::NONE) { $this->options['assetVersions'] = $assetVersions; $this->options['functionVersions'] = $functionVersions; $this->options['dependencies'] = $dependencies; } /** * The list of Asset Version resource SIDs to include in the build. * * @param string $assetVersions The list of Asset Version resource SIDs to * include in the build * @return $this Fluent Builder */ public function setAssetVersions($assetVersions) { $this->options['assetVersions'] = $assetVersions; return $this; } /** * The list of the Variable resource SIDs to include in the build. * * @param string $functionVersions The list of the Variable resource SIDs to * include in the build * @return $this Fluent Builder */ public function setFunctionVersions($functionVersions) { $this->options['functionVersions'] = $functionVersions; return $this; } /** * A list of objects that describe the Dependencies included in the build. Each object contains the `name` and `version` of the dependency. * * @param string $dependencies A list of objects that describe the Dependencies * included in the build * @return $this Fluent Builder */ public function setDependencies($dependencies) { $this->options['dependencies'] = $dependencies; 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.Serverless.V1.CreateBuildOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Serverless/V1/Service/EnvironmentOptions.php 0000644 00000003677 15002236443 0020730 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Serverless\V1\Service; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ abstract class EnvironmentOptions { /** * @param string $domainSuffix A URL-friendly name that represents the * environment * @return CreateEnvironmentOptions Options builder */ public static function create($domainSuffix = Values::NONE) { return new CreateEnvironmentOptions($domainSuffix); } } class CreateEnvironmentOptions extends Options { /** * @param string $domainSuffix A URL-friendly name that represents the * environment */ public function __construct($domainSuffix = Values::NONE) { $this->options['domainSuffix'] = $domainSuffix; } /** * A URL-friendly name that represents the environment and forms part of the domain name. Must have fewer than 32 characters. * * @param string $domainSuffix A URL-friendly name that represents the * environment * @return $this Fluent Builder */ public function setDomainSuffix($domainSuffix) { $this->options['domainSuffix'] = $domainSuffix; 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.Serverless.V1.CreateEnvironmentOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Serverless/V1/Service/AssetInstance.php 0000644 00000011401 15002236443 0017574 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Serverless\V1\Service; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $sid * @property string $accountSid * @property string $serviceSid * @property string $friendlyName * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $url * @property array $links */ class AssetInstance extends InstanceResource { protected $_assetVersions = null; /** * Initialize the AssetInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the Service that the Asset resource is * associated with * @param string $sid The SID that identifies the Asset resource to fetch * @return \Twilio\Rest\Serverless\V1\Service\AssetInstance */ public function __construct(Version $version, array $payload, $serviceSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ); $this->solution = array('serviceSid' => $serviceSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Serverless\V1\Service\AssetContext Context for this * AssetInstance */ protected function proxy() { if (!$this->context) { $this->context = new AssetContext( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch a AssetInstance * * @return AssetInstance Fetched AssetInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the AssetInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Update the AssetInstance * * @param string $friendlyName A string to describe the Asset resource * @return AssetInstance Updated AssetInstance * @throws TwilioException When an HTTP error occurs. */ public function update($friendlyName) { return $this->proxy()->update($friendlyName); } /** * Access the assetVersions * * @return \Twilio\Rest\Serverless\V1\Service\Asset\AssetVersionList */ protected function getAssetVersions() { return $this->proxy()->assetVersions; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Serverless.V1.AssetInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Serverless/V1/Service/Environment/LogContext.php 0000644 00000004656 15002236443 0021440 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Serverless\V1\Service\Environment; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class LogContext extends InstanceContext { /** * Initialize the LogContext * * @param \Twilio\Version $version Version that contains the resource * @param string $serviceSid The SID of the Service to fetch the Log resource * from * @param string $environmentSid The SID of the environment with the Log * resource to fetch * @param string $sid The SID that identifies the Log resource to fetch * @return \Twilio\Rest\Serverless\V1\Service\Environment\LogContext */ public function __construct(Version $version, $serviceSid, $environmentSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array( 'serviceSid' => $serviceSid, 'environmentSid' => $environmentSid, 'sid' => $sid, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Environments/' . \rawurlencode($environmentSid) . '/Logs/' . \rawurlencode($sid) . ''; } /** * Fetch a LogInstance * * @return LogInstance Fetched LogInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new LogInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['environmentSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Serverless.V1.LogContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Serverless/V1/Service/Environment/LogList.php 0000644 00000013337 15002236443 0020723 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Serverless\V1\Service\Environment; use Twilio\ListResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class LogList extends ListResource { /** * Construct the LogList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Service that the Log resource is * associated with * @param string $environmentSid The SID of the environment in which the log * occurred * @return \Twilio\Rest\Serverless\V1\Service\Environment\LogList */ public function __construct(Version $version, $serviceSid, $environmentSid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, 'environmentSid' => $environmentSid, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Environments/' . \rawurlencode($environmentSid) . '/Logs'; } /** * Streams LogInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($options = array(), $limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads LogInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return LogInstance[] Array of results */ public function read($options = array(), $limit = null, $pageSize = null) { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Retrieve a single page of LogInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of LogInstance */ public function page($options = array(), $pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $options = new Values($options); $params = Values::of(array( 'FunctionSid' => $options['functionSid'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new LogPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of LogInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of LogInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new LogPage($this->version, $response, $this->solution); } /** * Constructs a LogContext * * @param string $sid The SID that identifies the Log resource to fetch * @return \Twilio\Rest\Serverless\V1\Service\Environment\LogContext */ public function getContext($sid) { return new LogContext( $this->version, $this->solution['serviceSid'], $this->solution['environmentSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Serverless.V1.LogList]'; } } sdk/src/Twilio/Rest/Serverless/V1/Service/Environment/LogOptions.php 0000644 00000003644 15002236443 0021443 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Serverless\V1\Service\Environment; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ abstract class LogOptions { /** * @param string $functionSid The SID of the function whose invocation produced * the Log resources to read * @return ReadLogOptions Options builder */ public static function read($functionSid = Values::NONE) { return new ReadLogOptions($functionSid); } } class ReadLogOptions extends Options { /** * @param string $functionSid The SID of the function whose invocation produced * the Log resources to read */ public function __construct($functionSid = Values::NONE) { $this->options['functionSid'] = $functionSid; } /** * The SID of the function whose invocation produced the Log resources to read. * * @param string $functionSid The SID of the function whose invocation produced * the Log resources to read * @return $this Fluent Builder */ public function setFunctionSid($functionSid) { $this->options['functionSid'] = $functionSid; 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.Serverless.V1.ReadLogOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Serverless/V1/Service/Environment/VariableInstance.php 0000644 00000011563 15002236443 0022557 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Serverless\V1\Service\Environment; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $sid * @property string $accountSid * @property string $serviceSid * @property string $environmentSid * @property string $key * @property string $value * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $url */ class VariableInstance extends InstanceResource { /** * Initialize the VariableInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the Service that the Variable resource * is associated with * @param string $environmentSid The SID of the environment in which the * variable exists * @param string $sid The SID of the Variable resource to fetch * @return \Twilio\Rest\Serverless\V1\Service\Environment\VariableInstance */ public function __construct(Version $version, array $payload, $serviceSid, $environmentSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'environmentSid' => Values::array_get($payload, 'environment_sid'), 'key' => Values::array_get($payload, 'key'), 'value' => Values::array_get($payload, 'value'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), ); $this->solution = array( 'serviceSid' => $serviceSid, 'environmentSid' => $environmentSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Serverless\V1\Service\Environment\VariableContext Context for this VariableInstance */ protected function proxy() { if (!$this->context) { $this->context = new VariableContext( $this->version, $this->solution['serviceSid'], $this->solution['environmentSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch a VariableInstance * * @return VariableInstance Fetched VariableInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Update the VariableInstance * * @param array|Options $options Optional Arguments * @return VariableInstance Updated VariableInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Deletes the VariableInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Serverless.V1.VariableInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Serverless/V1/Service/Environment/DeploymentInstance.php 0000644 00000010273 15002236443 0023147 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Serverless\V1\Service\Environment; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $sid * @property string $accountSid * @property string $serviceSid * @property string $environmentSid * @property string $buildSid * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $url */ class DeploymentInstance extends InstanceResource { /** * Initialize the DeploymentInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the Service that the Deployment * resource is associated with * @param string $environmentSid The SID of the environment for the deployment * @param string $sid The SID that identifies the Deployment resource to fetch * @return \Twilio\Rest\Serverless\V1\Service\Environment\DeploymentInstance */ public function __construct(Version $version, array $payload, $serviceSid, $environmentSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'environmentSid' => Values::array_get($payload, 'environment_sid'), 'buildSid' => Values::array_get($payload, 'build_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), ); $this->solution = array( 'serviceSid' => $serviceSid, 'environmentSid' => $environmentSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Serverless\V1\Service\Environment\DeploymentContext Context for this DeploymentInstance */ protected function proxy() { if (!$this->context) { $this->context = new DeploymentContext( $this->version, $this->solution['serviceSid'], $this->solution['environmentSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch a DeploymentInstance * * @return DeploymentInstance Fetched DeploymentInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Serverless.V1.DeploymentInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Serverless/V1/Service/Environment/DeploymentList.php 0000644 00000014253 15002236443 0022320 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Serverless\V1\Service\Environment; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class DeploymentList extends ListResource { /** * Construct the DeploymentList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Service that the Deployment * resource is associated with * @param string $environmentSid The SID of the environment for the deployment * @return \Twilio\Rest\Serverless\V1\Service\Environment\DeploymentList */ public function __construct(Version $version, $serviceSid, $environmentSid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, 'environmentSid' => $environmentSid, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Environments/' . \rawurlencode($environmentSid) . '/Deployments'; } /** * Streams DeploymentInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads DeploymentInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return DeploymentInstance[] Array of results */ public function read($limit = null, $pageSize = null) { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of DeploymentInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of DeploymentInstance */ public function page($pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $params = Values::of(array( 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new DeploymentPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of DeploymentInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of DeploymentInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new DeploymentPage($this->version, $response, $this->solution); } /** * Create a new DeploymentInstance * * @param string $buildSid The SID of the build for the deployment * @return DeploymentInstance Newly created DeploymentInstance * @throws TwilioException When an HTTP error occurs. */ public function create($buildSid) { $data = Values::of(array('BuildSid' => $buildSid, )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new DeploymentInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['environmentSid'] ); } /** * Constructs a DeploymentContext * * @param string $sid The SID that identifies the Deployment resource to fetch * @return \Twilio\Rest\Serverless\V1\Service\Environment\DeploymentContext */ public function getContext($sid) { return new DeploymentContext( $this->version, $this->solution['serviceSid'], $this->solution['environmentSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Serverless.V1.DeploymentList]'; } } sdk/src/Twilio/Rest/Serverless/V1/Service/Environment/LogInstance.php 0000644 00000011070 15002236443 0021544 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Serverless\V1\Service\Environment; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $sid * @property string $accountSid * @property string $serviceSid * @property string $environmentSid * @property string $deploymentSid * @property string $functionSid * @property string $requestSid * @property string $level * @property string $message * @property \DateTime $dateCreated * @property string $url */ class LogInstance extends InstanceResource { /** * Initialize the LogInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the Service that the Log resource is * associated with * @param string $environmentSid The SID of the environment in which the log * occurred * @param string $sid The SID that identifies the Log resource to fetch * @return \Twilio\Rest\Serverless\V1\Service\Environment\LogInstance */ public function __construct(Version $version, array $payload, $serviceSid, $environmentSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'environmentSid' => Values::array_get($payload, 'environment_sid'), 'deploymentSid' => Values::array_get($payload, 'deployment_sid'), 'functionSid' => Values::array_get($payload, 'function_sid'), 'requestSid' => Values::array_get($payload, 'request_sid'), 'level' => Values::array_get($payload, 'level'), 'message' => Values::array_get($payload, 'message'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'url' => Values::array_get($payload, 'url'), ); $this->solution = array( 'serviceSid' => $serviceSid, 'environmentSid' => $environmentSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Serverless\V1\Service\Environment\LogContext Context * for this * LogInstance */ protected function proxy() { if (!$this->context) { $this->context = new LogContext( $this->version, $this->solution['serviceSid'], $this->solution['environmentSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch a LogInstance * * @return LogInstance Fetched LogInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Serverless.V1.LogInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Serverless/V1/Service/Environment/DeploymentPage.php 0000644 00000002072 15002236443 0022255 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Serverless\V1\Service\Environment; use Twilio\Page; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class DeploymentPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new DeploymentInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['environmentSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Serverless.V1.DeploymentPage]'; } } sdk/src/Twilio/Rest/Serverless/V1/Service/Environment/VariableList.php 0000644 00000014414 15002236443 0021724 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Serverless\V1\Service\Environment; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class VariableList extends ListResource { /** * Construct the VariableList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Service that the Variable resource * is associated with * @param string $environmentSid The SID of the environment in which the * variable exists * @return \Twilio\Rest\Serverless\V1\Service\Environment\VariableList */ public function __construct(Version $version, $serviceSid, $environmentSid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, 'environmentSid' => $environmentSid, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Environments/' . \rawurlencode($environmentSid) . '/Variables'; } /** * Streams VariableInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads VariableInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return VariableInstance[] Array of results */ public function read($limit = null, $pageSize = null) { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of VariableInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of VariableInstance */ public function page($pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $params = Values::of(array( 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new VariablePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of VariableInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of VariableInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new VariablePage($this->version, $response, $this->solution); } /** * Create a new VariableInstance * * @param string $key A string by which the Variable resource can be referenced * @param string $value A string that contains the actual value of the variable * @return VariableInstance Newly created VariableInstance * @throws TwilioException When an HTTP error occurs. */ public function create($key, $value) { $data = Values::of(array('Key' => $key, 'Value' => $value, )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new VariableInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['environmentSid'] ); } /** * Constructs a VariableContext * * @param string $sid The SID of the Variable resource to fetch * @return \Twilio\Rest\Serverless\V1\Service\Environment\VariableContext */ public function getContext($sid) { return new VariableContext( $this->version, $this->solution['serviceSid'], $this->solution['environmentSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Serverless.V1.VariableList]'; } } sdk/src/Twilio/Rest/Serverless/V1/Service/Environment/VariablePage.php 0000644 00000002064 15002236443 0021663 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Serverless\V1\Service\Environment; use Twilio\Page; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class VariablePage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new VariableInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['environmentSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Serverless.V1.VariablePage]'; } } sdk/src/Twilio/Rest/Serverless/V1/Service/Environment/LogPage.php 0000644 00000002045 15002236443 0020656 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Serverless\V1\Service\Environment; use Twilio\Page; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class LogPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new LogInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['environmentSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Serverless.V1.LogPage]'; } } sdk/src/Twilio/Rest/Serverless/V1/Service/Environment/DeploymentContext.php 0000644 00000004774 15002236443 0023040 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Serverless\V1\Service\Environment; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class DeploymentContext extends InstanceContext { /** * Initialize the DeploymentContext * * @param \Twilio\Version $version Version that contains the resource * @param string $serviceSid The SID of the Service to fetch the Deployment * resource from * @param string $environmentSid The SID of the environment used by the * Deployment to fetch * @param string $sid The SID that identifies the Deployment resource to fetch * @return \Twilio\Rest\Serverless\V1\Service\Environment\DeploymentContext */ public function __construct(Version $version, $serviceSid, $environmentSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array( 'serviceSid' => $serviceSid, 'environmentSid' => $environmentSid, 'sid' => $sid, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Environments/' . \rawurlencode($environmentSid) . '/Deployments/' . \rawurlencode($sid) . ''; } /** * Fetch a DeploymentInstance * * @return DeploymentInstance Fetched DeploymentInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new DeploymentInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['environmentSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Serverless.V1.DeploymentContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Serverless/V1/Service/Environment/VariableContext.php 0000644 00000007027 15002236443 0022437 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Serverless\V1\Service\Environment; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class VariableContext extends InstanceContext { /** * Initialize the VariableContext * * @param \Twilio\Version $version Version that contains the resource * @param string $serviceSid The SID of the Service to fetch the Variable * resource from * @param string $environmentSid The SID of the environment with the Variable * resource to fetch * @param string $sid The SID of the Variable resource to fetch * @return \Twilio\Rest\Serverless\V1\Service\Environment\VariableContext */ public function __construct(Version $version, $serviceSid, $environmentSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array( 'serviceSid' => $serviceSid, 'environmentSid' => $environmentSid, 'sid' => $sid, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Environments/' . \rawurlencode($environmentSid) . '/Variables/' . \rawurlencode($sid) . ''; } /** * Fetch a VariableInstance * * @return VariableInstance Fetched VariableInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new VariableInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['environmentSid'], $this->solution['sid'] ); } /** * Update the VariableInstance * * @param array|Options $options Optional Arguments * @return VariableInstance Updated VariableInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { $options = new Values($options); $data = Values::of(array('Key' => $options['key'], 'Value' => $options['value'], )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new VariableInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['environmentSid'], $this->solution['sid'] ); } /** * Deletes the VariableInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Serverless.V1.VariableContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Serverless/V1/Service/Environment/VariableOptions.php 0000644 00000004504 15002236443 0022443 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Serverless\V1\Service\Environment; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ abstract class VariableOptions { /** * @param string $key A string by which the Variable resource can be referenced * @param string $value A string that contains the actual value of the variable * @return UpdateVariableOptions Options builder */ public static function update($key = Values::NONE, $value = Values::NONE) { return new UpdateVariableOptions($key, $value); } } class UpdateVariableOptions extends Options { /** * @param string $key A string by which the Variable resource can be referenced * @param string $value A string that contains the actual value of the variable */ public function __construct($key = Values::NONE, $value = Values::NONE) { $this->options['key'] = $key; $this->options['value'] = $value; } /** * A string by which the Variable resource can be referenced. Must be less than 128 characters long. * * @param string $key A string by which the Variable resource can be referenced * @return $this Fluent Builder */ public function setKey($key) { $this->options['key'] = $key; return $this; } /** * A string that contains the actual value of the variable. Must have less than 450 bytes. * * @param string $value A string that contains the actual value of the variable * @return $this Fluent Builder */ public function setValue($value) { $this->options['value'] = $value; 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.Serverless.V1.UpdateVariableOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Serverless/V1/Service/FunctionContext.php 0000644 00000011664 15002236443 0020175 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Serverless\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Rest\Serverless\V1\Service\TwilioFunction\FunctionVersionList; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property \Twilio\Rest\Serverless\V1\Service\TwilioFunction\FunctionVersionList $functionVersions * @method \Twilio\Rest\Serverless\V1\Service\TwilioFunction\FunctionVersionContext functionVersions(string $sid) */ class FunctionContext extends InstanceContext { protected $_functionVersions = null; /** * Initialize the FunctionContext * * @param \Twilio\Version $version Version that contains the resource * @param string $serviceSid The SID of the Service to fetch the Function * resource from * @param string $sid The SID of the Function resource to fetch * @return \Twilio\Rest\Serverless\V1\Service\FunctionContext */ public function __construct(Version $version, $serviceSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, 'sid' => $sid, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Functions/' . \rawurlencode($sid) . ''; } /** * Fetch a FunctionInstance * * @return FunctionInstance Fetched FunctionInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new FunctionInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Deletes the FunctionInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Update the FunctionInstance * * @param string $friendlyName A string to describe the Function resource * @return FunctionInstance Updated FunctionInstance * @throws TwilioException When an HTTP error occurs. */ public function update($friendlyName) { $data = Values::of(array('FriendlyName' => $friendlyName, )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new FunctionInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Access the functionVersions * * @return \Twilio\Rest\Serverless\V1\Service\TwilioFunction\FunctionVersionList */ protected function getFunctionVersions() { if (!$this->_functionVersions) { $this->_functionVersions = new FunctionVersionList( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->_functionVersions; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get($name) { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Serverless.V1.FunctionContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Serverless/V1/Service/EnvironmentContext.php 0000644 00000012761 15002236443 0020713 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Serverless\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Rest\Serverless\V1\Service\Environment\DeploymentList; use Twilio\Rest\Serverless\V1\Service\Environment\LogList; use Twilio\Rest\Serverless\V1\Service\Environment\VariableList; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property \Twilio\Rest\Serverless\V1\Service\Environment\VariableList $variables * @property \Twilio\Rest\Serverless\V1\Service\Environment\DeploymentList $deployments * @property \Twilio\Rest\Serverless\V1\Service\Environment\LogList $logs * @method \Twilio\Rest\Serverless\V1\Service\Environment\VariableContext variables(string $sid) * @method \Twilio\Rest\Serverless\V1\Service\Environment\DeploymentContext deployments(string $sid) * @method \Twilio\Rest\Serverless\V1\Service\Environment\LogContext logs(string $sid) */ class EnvironmentContext extends InstanceContext { protected $_variables = null; protected $_deployments = null; protected $_logs = null; /** * Initialize the EnvironmentContext * * @param \Twilio\Version $version Version that contains the resource * @param string $serviceSid The SID of the Service to fetch the Environment * resource from * @param string $sid The SID of the Environment resource to fetch * @return \Twilio\Rest\Serverless\V1\Service\EnvironmentContext */ public function __construct(Version $version, $serviceSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, 'sid' => $sid, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Environments/' . \rawurlencode($sid) . ''; } /** * Fetch a EnvironmentInstance * * @return EnvironmentInstance Fetched EnvironmentInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new EnvironmentInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Deletes the EnvironmentInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Access the variables * * @return \Twilio\Rest\Serverless\V1\Service\Environment\VariableList */ protected function getVariables() { if (!$this->_variables) { $this->_variables = new VariableList( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->_variables; } /** * Access the deployments * * @return \Twilio\Rest\Serverless\V1\Service\Environment\DeploymentList */ protected function getDeployments() { if (!$this->_deployments) { $this->_deployments = new DeploymentList( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->_deployments; } /** * Access the logs * * @return \Twilio\Rest\Serverless\V1\Service\Environment\LogList */ protected function getLogs() { if (!$this->_logs) { $this->_logs = new LogList($this->version, $this->solution['serviceSid'], $this->solution['sid']); } return $this->_logs; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get($name) { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Serverless.V1.EnvironmentContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Serverless/V1/Service/BuildPage.php 0000644 00000001702 15002236443 0016667 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Serverless\V1\Service; use Twilio\Page; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class BuildPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new BuildInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Serverless.V1.BuildPage]'; } } sdk/src/Twilio/Rest/Serverless/V1/Service/FunctionList.php 0000644 00000013350 15002236443 0017456 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Serverless\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class FunctionList extends ListResource { /** * Construct the FunctionList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Service that the Function resource * is associated with * @return \Twilio\Rest\Serverless\V1\Service\FunctionList */ public function __construct(Version $version, $serviceSid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Functions'; } /** * Streams FunctionInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads FunctionInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return FunctionInstance[] Array of results */ public function read($limit = null, $pageSize = null) { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of FunctionInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of FunctionInstance */ public function page($pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $params = Values::of(array( 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new FunctionPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of FunctionInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of FunctionInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new FunctionPage($this->version, $response, $this->solution); } /** * Create a new FunctionInstance * * @param string $friendlyName A string to describe the Function resource * @return FunctionInstance Newly created FunctionInstance * @throws TwilioException When an HTTP error occurs. */ public function create($friendlyName) { $data = Values::of(array('FriendlyName' => $friendlyName, )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new FunctionInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Constructs a FunctionContext * * @param string $sid The SID of the Function resource to fetch * @return \Twilio\Rest\Serverless\V1\Service\FunctionContext */ public function getContext($sid) { return new FunctionContext($this->version, $this->solution['serviceSid'], $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Serverless.V1.FunctionList]'; } } sdk/src/Twilio/Rest/Serverless/V1/Service/TwilioFunction/FunctionVersionContext.php 0000644 00000005042 15002236443 0024511 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Serverless\V1\Service\TwilioFunction; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class FunctionVersionContext extends InstanceContext { /** * Initialize the FunctionVersionContext * * @param \Twilio\Version $version Version that contains the resource * @param string $serviceSid The SID of the Service to fetch the Function * Version resource from * @param string $functionSid The SID of the function that is the parent of the * Function Version resource to fetch * @param string $sid The SID that identifies the Function Version resource to * fetch * @return \Twilio\Rest\Serverless\V1\Service\TwilioFunction\FunctionVersionContext */ public function __construct(Version $version, $serviceSid, $functionSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, 'functionSid' => $functionSid, 'sid' => $sid, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Functions/' . \rawurlencode($functionSid) . '/Versions/' . \rawurlencode($sid) . ''; } /** * Fetch a FunctionVersionInstance * * @return FunctionVersionInstance Fetched FunctionVersionInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new FunctionVersionInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['functionSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Serverless.V1.FunctionVersionContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Serverless/V1/Service/TwilioFunction/FunctionVersionPage.php 0000644 00000002111 15002236443 0023733 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Serverless\V1\Service\TwilioFunction; use Twilio\Page; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class FunctionVersionPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new FunctionVersionInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['functionSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Serverless.V1.FunctionVersionPage]'; } } sdk/src/Twilio/Rest/Serverless/V1/Service/TwilioFunction/FunctionVersionList.php 0000644 00000013153 15002236443 0024002 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Serverless\V1\Service\TwilioFunction; use Twilio\ListResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class FunctionVersionList extends ListResource { /** * Construct the FunctionVersionList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Service that the Function Version * resource is associated with * @param string $functionSid The SID of the function that is the parent of the * function version * @return \Twilio\Rest\Serverless\V1\Service\TwilioFunction\FunctionVersionList */ public function __construct(Version $version, $serviceSid, $functionSid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, 'functionSid' => $functionSid, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Functions/' . \rawurlencode($functionSid) . '/Versions'; } /** * Streams FunctionVersionInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads FunctionVersionInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return FunctionVersionInstance[] Array of results */ public function read($limit = null, $pageSize = null) { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of FunctionVersionInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of FunctionVersionInstance */ public function page($pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $params = Values::of(array( 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new FunctionVersionPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of FunctionVersionInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of FunctionVersionInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new FunctionVersionPage($this->version, $response, $this->solution); } /** * Constructs a FunctionVersionContext * * @param string $sid The SID that identifies the Function Version resource to * fetch * @return \Twilio\Rest\Serverless\V1\Service\TwilioFunction\FunctionVersionContext */ public function getContext($sid) { return new FunctionVersionContext( $this->version, $this->solution['serviceSid'], $this->solution['functionSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Serverless.V1.FunctionVersionList]'; } } sdk/src/Twilio/Rest/Serverless/V1/Service/TwilioFunction/FunctionVersionInstance.php 0000644 00000010550 15002236443 0024631 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Serverless\V1\Service\TwilioFunction; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $sid * @property string $accountSid * @property string $serviceSid * @property string $functionSid * @property string $path * @property string $visibility * @property \DateTime $dateCreated * @property string $url */ class FunctionVersionInstance extends InstanceResource { /** * Initialize the FunctionVersionInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the Service that the Function Version * resource is associated with * @param string $functionSid The SID of the function that is the parent of the * function version * @param string $sid The SID that identifies the Function Version resource to * fetch * @return \Twilio\Rest\Serverless\V1\Service\TwilioFunction\FunctionVersionInstance */ public function __construct(Version $version, array $payload, $serviceSid, $functionSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'functionSid' => Values::array_get($payload, 'function_sid'), 'path' => Values::array_get($payload, 'path'), 'visibility' => Values::array_get($payload, 'visibility'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'url' => Values::array_get($payload, 'url'), ); $this->solution = array( 'serviceSid' => $serviceSid, 'functionSid' => $functionSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Serverless\V1\Service\TwilioFunction\FunctionVersionContext Context for this * FunctionVersionInstance */ protected function proxy() { if (!$this->context) { $this->context = new FunctionVersionContext( $this->version, $this->solution['serviceSid'], $this->solution['functionSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch a FunctionVersionInstance * * @return FunctionVersionInstance Fetched FunctionVersionInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Serverless.V1.FunctionVersionInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Serverless/V1/Service/BuildContext.php 0000644 00000004552 15002236443 0017445 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Serverless\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class BuildContext extends InstanceContext { /** * Initialize the BuildContext * * @param \Twilio\Version $version Version that contains the resource * @param string $serviceSid The SID of the Service to fetch the Build resource * from * @param string $sid The SID of the Build resource to fetch * @return \Twilio\Rest\Serverless\V1\Service\BuildContext */ public function __construct(Version $version, $serviceSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, 'sid' => $sid, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Builds/' . \rawurlencode($sid) . ''; } /** * Fetch a BuildInstance * * @return BuildInstance Fetched BuildInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new BuildInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Deletes the BuildInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Serverless.V1.BuildContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Serverless/V1/Service/EnvironmentInstance.php 0000644 00000012474 15002236443 0021034 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Serverless\V1\Service; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $sid * @property string $accountSid * @property string $serviceSid * @property string $buildSid * @property string $uniqueName * @property string $domainSuffix * @property string $domainName * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $url * @property array $links */ class EnvironmentInstance extends InstanceResource { protected $_variables = null; protected $_deployments = null; protected $_logs = null; /** * Initialize the EnvironmentInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the Service that the Environment * resource is associated with * @param string $sid The SID of the Environment resource to fetch * @return \Twilio\Rest\Serverless\V1\Service\EnvironmentInstance */ public function __construct(Version $version, array $payload, $serviceSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'buildSid' => Values::array_get($payload, 'build_sid'), 'uniqueName' => Values::array_get($payload, 'unique_name'), 'domainSuffix' => Values::array_get($payload, 'domain_suffix'), 'domainName' => Values::array_get($payload, 'domain_name'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ); $this->solution = array('serviceSid' => $serviceSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Serverless\V1\Service\EnvironmentContext Context for * this * EnvironmentInstance */ protected function proxy() { if (!$this->context) { $this->context = new EnvironmentContext( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch a EnvironmentInstance * * @return EnvironmentInstance Fetched EnvironmentInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the EnvironmentInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Access the variables * * @return \Twilio\Rest\Serverless\V1\Service\Environment\VariableList */ protected function getVariables() { return $this->proxy()->variables; } /** * Access the deployments * * @return \Twilio\Rest\Serverless\V1\Service\Environment\DeploymentList */ protected function getDeployments() { return $this->proxy()->deployments; } /** * Access the logs * * @return \Twilio\Rest\Serverless\V1\Service\Environment\LogList */ protected function getLogs() { return $this->proxy()->logs; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Serverless.V1.EnvironmentInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Serverless/V1/Service/EnvironmentPage.php 0000644 00000001724 15002236443 0020140 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Serverless\V1\Service; use Twilio\Page; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class EnvironmentPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new EnvironmentInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Serverless.V1.EnvironmentPage]'; } } sdk/src/Twilio/Rest/Serverless/V1/ServiceContext.php 0000644 00000014157 15002236443 0016410 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Serverless\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Rest\Serverless\V1\Service\AssetList; use Twilio\Rest\Serverless\V1\Service\BuildList; use Twilio\Rest\Serverless\V1\Service\EnvironmentList; use Twilio\Rest\Serverless\V1\Service\FunctionList; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property \Twilio\Rest\Serverless\V1\Service\EnvironmentList $environments * @property \Twilio\Rest\Serverless\V1\Service\FunctionList $functions * @property \Twilio\Rest\Serverless\V1\Service\AssetList $assets * @property \Twilio\Rest\Serverless\V1\Service\BuildList $builds * @method \Twilio\Rest\Serverless\V1\Service\EnvironmentContext environments(string $sid) * @method \Twilio\Rest\Serverless\V1\Service\FunctionContext functions(string $sid) * @method \Twilio\Rest\Serverless\V1\Service\AssetContext assets(string $sid) * @method \Twilio\Rest\Serverless\V1\Service\BuildContext builds(string $sid) */ class ServiceContext extends InstanceContext { protected $_environments = null; protected $_functions = null; protected $_assets = null; protected $_builds = null; /** * Initialize the ServiceContext * * @param \Twilio\Version $version Version that contains the resource * @param string $sid The SID of the Service resource to fetch * @return \Twilio\Rest\Serverless\V1\ServiceContext */ public function __construct(Version $version, $sid) { parent::__construct($version); // Path Solution $this->solution = array('sid' => $sid, ); $this->uri = '/Services/' . \rawurlencode($sid) . ''; } /** * Fetch a ServiceInstance * * @return ServiceInstance Fetched ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new ServiceInstance($this->version, $payload, $this->solution['sid']); } /** * Deletes the ServiceInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Update the ServiceInstance * * @param array|Options $options Optional Arguments * @return ServiceInstance Updated ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { $options = new Values($options); $data = Values::of(array( 'IncludeCredentials' => Serialize::booleanToString($options['includeCredentials']), 'FriendlyName' => $options['friendlyName'], )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new ServiceInstance($this->version, $payload, $this->solution['sid']); } /** * Access the environments * * @return \Twilio\Rest\Serverless\V1\Service\EnvironmentList */ protected function getEnvironments() { if (!$this->_environments) { $this->_environments = new EnvironmentList($this->version, $this->solution['sid']); } return $this->_environments; } /** * Access the functions * * @return \Twilio\Rest\Serverless\V1\Service\FunctionList */ protected function getFunctions() { if (!$this->_functions) { $this->_functions = new FunctionList($this->version, $this->solution['sid']); } return $this->_functions; } /** * Access the assets * * @return \Twilio\Rest\Serverless\V1\Service\AssetList */ protected function getAssets() { if (!$this->_assets) { $this->_assets = new AssetList($this->version, $this->solution['sid']); } return $this->_assets; } /** * Access the builds * * @return \Twilio\Rest\Serverless\V1\Service\BuildList */ protected function getBuilds() { if (!$this->_builds) { $this->_builds = new BuildList($this->version, $this->solution['sid']); } return $this->_builds; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get($name) { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Serverless.V1.ServiceContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Monitor/V1.php 0000644 00000005216 15002236443 0012731 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Monitor; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\Rest\Monitor\V1\AlertList; use Twilio\Rest\Monitor\V1\EventList; use Twilio\Version; /** * @property \Twilio\Rest\Monitor\V1\AlertList $alerts * @property \Twilio\Rest\Monitor\V1\EventList $events * @method \Twilio\Rest\Monitor\V1\AlertContext alerts(string $sid) * @method \Twilio\Rest\Monitor\V1\EventContext events(string $sid) */ class V1 extends Version { protected $_alerts = null; protected $_events = null; /** * Construct the V1 version of Monitor * * @param \Twilio\Domain $domain Domain that contains the version * @return \Twilio\Rest\Monitor\V1 V1 version of Monitor */ public function __construct(Domain $domain) { parent::__construct($domain); $this->version = 'v1'; } /** * @return \Twilio\Rest\Monitor\V1\AlertList */ protected function getAlerts() { if (!$this->_alerts) { $this->_alerts = new AlertList($this); } return $this->_alerts; } /** * @return \Twilio\Rest\Monitor\V1\EventList */ protected function getEvents() { if (!$this->_events) { $this->_events = new EventList($this); } return $this->_events; } /** * Magic getter to lazy load root resources * * @param string $name Resource to return * @return \Twilio\ListResource The requested resource * @throws TwilioException For unknown resource */ public function __get($name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown resource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Monitor.V1]'; } } sdk/src/Twilio/Rest/Monitor/V1/AlertPage.php 0000644 00000001312 15002236443 0014566 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Monitor\V1; use Twilio\Page; class AlertPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new AlertInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Monitor.V1.AlertPage]'; } } sdk/src/Twilio/Rest/Monitor/V1/EventOptions.php 0000644 00000012415 15002236443 0015365 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Monitor\V1; use Twilio\Options; use Twilio\Values; abstract class EventOptions { /** * @param string $actorSid Only include events initiated by this Actor * @param string $eventType Only include events of this Event Type * @param string $resourceSid Only include events that refer to this resource * @param string $sourceIpAddress Only include events that originated from this * IP address * @param \DateTime $startDate Only include events that occurred on or after * this date * @param \DateTime $endDate Only include events that occurred on or before * this date * @return ReadEventOptions Options builder */ public static function read($actorSid = Values::NONE, $eventType = Values::NONE, $resourceSid = Values::NONE, $sourceIpAddress = Values::NONE, $startDate = Values::NONE, $endDate = Values::NONE) { return new ReadEventOptions($actorSid, $eventType, $resourceSid, $sourceIpAddress, $startDate, $endDate); } } class ReadEventOptions extends Options { /** * @param string $actorSid Only include events initiated by this Actor * @param string $eventType Only include events of this Event Type * @param string $resourceSid Only include events that refer to this resource * @param string $sourceIpAddress Only include events that originated from this * IP address * @param \DateTime $startDate Only include events that occurred on or after * this date * @param \DateTime $endDate Only include events that occurred on or before * this date */ public function __construct($actorSid = Values::NONE, $eventType = Values::NONE, $resourceSid = Values::NONE, $sourceIpAddress = Values::NONE, $startDate = Values::NONE, $endDate = Values::NONE) { $this->options['actorSid'] = $actorSid; $this->options['eventType'] = $eventType; $this->options['resourceSid'] = $resourceSid; $this->options['sourceIpAddress'] = $sourceIpAddress; $this->options['startDate'] = $startDate; $this->options['endDate'] = $endDate; } /** * Only include events initiated by this Actor. Useful for auditing actions taken by specific users or API credentials. * * @param string $actorSid Only include events initiated by this Actor * @return $this Fluent Builder */ public function setActorSid($actorSid) { $this->options['actorSid'] = $actorSid; return $this; } /** * Only include events of this [Event Type](https://www.twilio.com/docs/usage/monitor-events#event-types). * * @param string $eventType Only include events of this Event Type * @return $this Fluent Builder */ public function setEventType($eventType) { $this->options['eventType'] = $eventType; return $this; } /** * Only include events that refer to this resource. Useful for discovering the history of a specific resource. * * @param string $resourceSid Only include events that refer to this resource * @return $this Fluent Builder */ public function setResourceSid($resourceSid) { $this->options['resourceSid'] = $resourceSid; return $this; } /** * Only include events that originated from this IP address. Useful for tracking suspicious activity originating from the API or the Twilio Console. * * @param string $sourceIpAddress Only include events that originated from this * IP address * @return $this Fluent Builder */ public function setSourceIpAddress($sourceIpAddress) { $this->options['sourceIpAddress'] = $sourceIpAddress; return $this; } /** * Only include events that occurred on or after this date. Specify the date in GMT and [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. * * @param \DateTime $startDate Only include events that occurred on or after * this date * @return $this Fluent Builder */ public function setStartDate($startDate) { $this->options['startDate'] = $startDate; return $this; } /** * Only include events that occurred on or before this date. Specify the date in GMT and [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. * * @param \DateTime $endDate Only include events that occurred on or before * this date * @return $this Fluent Builder */ public function setEndDate($endDate) { $this->options['endDate'] = $endDate; 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.Monitor.V1.ReadEventOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Monitor/V1/AlertInstance.php 0000644 00000011071 15002236443 0015461 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Monitor\V1; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property string $alertText * @property string $apiVersion * @property \DateTime $dateCreated * @property \DateTime $dateGenerated * @property \DateTime $dateUpdated * @property string $errorCode * @property string $logLevel * @property string $moreInfo * @property string $requestMethod * @property string $requestUrl * @property string $requestVariables * @property string $resourceSid * @property string $responseBody * @property string $responseHeaders * @property string $sid * @property string $url * @property string $requestHeaders * @property string $serviceSid */ class AlertInstance extends InstanceResource { /** * Initialize the AlertInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The SID that identifies the resource to fetch * @return \Twilio\Rest\Monitor\V1\AlertInstance */ public function __construct(Version $version, array $payload, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'accountSid' => Values::array_get($payload, 'account_sid'), 'alertText' => Values::array_get($payload, 'alert_text'), 'apiVersion' => Values::array_get($payload, 'api_version'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateGenerated' => Deserialize::dateTime(Values::array_get($payload, 'date_generated')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'errorCode' => Values::array_get($payload, 'error_code'), 'logLevel' => Values::array_get($payload, 'log_level'), 'moreInfo' => Values::array_get($payload, 'more_info'), 'requestMethod' => Values::array_get($payload, 'request_method'), 'requestUrl' => Values::array_get($payload, 'request_url'), 'requestVariables' => Values::array_get($payload, 'request_variables'), 'resourceSid' => Values::array_get($payload, 'resource_sid'), 'responseBody' => Values::array_get($payload, 'response_body'), 'responseHeaders' => Values::array_get($payload, 'response_headers'), 'sid' => Values::array_get($payload, 'sid'), 'url' => Values::array_get($payload, 'url'), 'requestHeaders' => Values::array_get($payload, 'request_headers'), 'serviceSid' => Values::array_get($payload, 'service_sid'), ); $this->solution = array('sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Monitor\V1\AlertContext Context for this AlertInstance */ protected function proxy() { if (!$this->context) { $this->context = new AlertContext($this->version, $this->solution['sid']); } return $this->context; } /** * Fetch a AlertInstance * * @return AlertInstance Fetched AlertInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Monitor.V1.AlertInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Monitor/V1/EventList.php 0000644 00000012373 15002236443 0014650 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Monitor\V1; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class EventList extends ListResource { /** * Construct the EventList * * @param Version $version Version that contains the resource * @return \Twilio\Rest\Monitor\V1\EventList */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = array(); $this->uri = '/Events'; } /** * Streams EventInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($options = array(), $limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads EventInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return EventInstance[] Array of results */ public function read($options = array(), $limit = null, $pageSize = null) { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Retrieve a single page of EventInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of EventInstance */ public function page($options = array(), $pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $options = new Values($options); $params = Values::of(array( 'ActorSid' => $options['actorSid'], 'EventType' => $options['eventType'], 'ResourceSid' => $options['resourceSid'], 'SourceIpAddress' => $options['sourceIpAddress'], 'StartDate' => Serialize::iso8601DateTime($options['startDate']), 'EndDate' => Serialize::iso8601DateTime($options['endDate']), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new EventPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of EventInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of EventInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new EventPage($this->version, $response, $this->solution); } /** * Constructs a EventContext * * @param string $sid The SID that identifies the resource to fetch * @return \Twilio\Rest\Monitor\V1\EventContext */ public function getContext($sid) { return new EventContext($this->version, $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Monitor.V1.EventList]'; } } sdk/src/Twilio/Rest/Monitor/V1/EventInstance.php 0000644 00000007653 15002236443 0015506 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Monitor\V1; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property string $actorSid * @property string $actorType * @property string $description * @property array $eventData * @property \DateTime $eventDate * @property string $eventType * @property string $resourceSid * @property string $resourceType * @property string $sid * @property string $source * @property string $sourceIpAddress * @property string $url * @property array $links */ class EventInstance extends InstanceResource { /** * Initialize the EventInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The SID that identifies the resource to fetch * @return \Twilio\Rest\Monitor\V1\EventInstance */ public function __construct(Version $version, array $payload, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'accountSid' => Values::array_get($payload, 'account_sid'), 'actorSid' => Values::array_get($payload, 'actor_sid'), 'actorType' => Values::array_get($payload, 'actor_type'), 'description' => Values::array_get($payload, 'description'), 'eventData' => Values::array_get($payload, 'event_data'), 'eventDate' => Deserialize::dateTime(Values::array_get($payload, 'event_date')), 'eventType' => Values::array_get($payload, 'event_type'), 'resourceSid' => Values::array_get($payload, 'resource_sid'), 'resourceType' => Values::array_get($payload, 'resource_type'), 'sid' => Values::array_get($payload, 'sid'), 'source' => Values::array_get($payload, 'source'), 'sourceIpAddress' => Values::array_get($payload, 'source_ip_address'), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ); $this->solution = array('sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Monitor\V1\EventContext Context for this EventInstance */ protected function proxy() { if (!$this->context) { $this->context = new EventContext($this->version, $this->solution['sid']); } return $this->context; } /** * Fetch a EventInstance * * @return EventInstance Fetched EventInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Monitor.V1.EventInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Monitor/V1/EventContext.php 0000644 00000003117 15002236443 0015355 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Monitor\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; class EventContext extends InstanceContext { /** * Initialize the EventContext * * @param \Twilio\Version $version Version that contains the resource * @param string $sid The SID that identifies the resource to fetch * @return \Twilio\Rest\Monitor\V1\EventContext */ public function __construct(Version $version, $sid) { parent::__construct($version); // Path Solution $this->solution = array('sid' => $sid, ); $this->uri = '/Events/' . \rawurlencode($sid) . ''; } /** * Fetch a EventInstance * * @return EventInstance Fetched EventInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new EventInstance($this->version, $payload, $this->solution['sid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Monitor.V1.EventContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Monitor/V1/AlertContext.php 0000644 00000003117 15002236443 0015343 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Monitor\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; class AlertContext extends InstanceContext { /** * Initialize the AlertContext * * @param \Twilio\Version $version Version that contains the resource * @param string $sid The SID that identifies the resource to fetch * @return \Twilio\Rest\Monitor\V1\AlertContext */ public function __construct(Version $version, $sid) { parent::__construct($version); // Path Solution $this->solution = array('sid' => $sid, ); $this->uri = '/Alerts/' . \rawurlencode($sid) . ''; } /** * Fetch a AlertInstance * * @return AlertInstance Fetched AlertInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new AlertInstance($this->version, $payload, $this->solution['sid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Monitor.V1.AlertContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Monitor/V1/AlertOptions.php 0000644 00000006140 15002236443 0015351 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Monitor\V1; use Twilio\Options; use Twilio\Values; abstract class AlertOptions { /** * @param string $logLevel Only show alerts for this log-level * @param \DateTime $startDate Only include alerts that occurred on or after * this date * @param \DateTime $endDate Only include alerts that occurred on or before * this date * @return ReadAlertOptions Options builder */ public static function read($logLevel = Values::NONE, $startDate = Values::NONE, $endDate = Values::NONE) { return new ReadAlertOptions($logLevel, $startDate, $endDate); } } class ReadAlertOptions extends Options { /** * @param string $logLevel Only show alerts for this log-level * @param \DateTime $startDate Only include alerts that occurred on or after * this date * @param \DateTime $endDate Only include alerts that occurred on or before * this date */ public function __construct($logLevel = Values::NONE, $startDate = Values::NONE, $endDate = Values::NONE) { $this->options['logLevel'] = $logLevel; $this->options['startDate'] = $startDate; $this->options['endDate'] = $endDate; } /** * Only show alerts for this log-level. Can be: `error`, `warning`, `notice`, or `debug`. * * @param string $logLevel Only show alerts for this log-level * @return $this Fluent Builder */ public function setLogLevel($logLevel) { $this->options['logLevel'] = $logLevel; return $this; } /** * Only include alerts that occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. Queries for alerts older than 30 days are not supported. * * @param \DateTime $startDate Only include alerts that occurred on or after * this date * @return $this Fluent Builder */ public function setStartDate($startDate) { $this->options['startDate'] = $startDate; return $this; } /** * Only include alerts that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. Queries for alerts older than 30 days are not supported. * * @param \DateTime $endDate Only include alerts that occurred on or before * this date * @return $this Fluent Builder */ public function setEndDate($endDate) { $this->options['endDate'] = $endDate; 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.Monitor.V1.ReadAlertOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Monitor/V1/AlertList.php 0000644 00000012115 15002236443 0014630 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Monitor\V1; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class AlertList extends ListResource { /** * Construct the AlertList * * @param Version $version Version that contains the resource * @return \Twilio\Rest\Monitor\V1\AlertList */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = array(); $this->uri = '/Alerts'; } /** * Streams AlertInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($options = array(), $limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads AlertInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return AlertInstance[] Array of results */ public function read($options = array(), $limit = null, $pageSize = null) { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Retrieve a single page of AlertInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of AlertInstance */ public function page($options = array(), $pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $options = new Values($options); $params = Values::of(array( 'LogLevel' => $options['logLevel'], 'StartDate' => Serialize::iso8601Date($options['startDate']), 'EndDate' => Serialize::iso8601Date($options['endDate']), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new AlertPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of AlertInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of AlertInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new AlertPage($this->version, $response, $this->solution); } /** * Constructs a AlertContext * * @param string $sid The SID that identifies the resource to fetch * @return \Twilio\Rest\Monitor\V1\AlertContext */ public function getContext($sid) { return new AlertContext($this->version, $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Monitor.V1.AlertList]'; } } sdk/src/Twilio/Rest/Monitor/V1/EventPage.php 0000644 00000001312 15002236443 0014600 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Monitor\V1; use Twilio\Page; class EventPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new EventInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Monitor.V1.EventPage]'; } } sdk/src/Twilio/Rest/Notify/V1.php 0000644 00000005325 15002236443 0012553 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Notify; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\Rest\Notify\V1\CredentialList; use Twilio\Rest\Notify\V1\ServiceList; use Twilio\Version; /** * @property \Twilio\Rest\Notify\V1\CredentialList $credentials * @property \Twilio\Rest\Notify\V1\ServiceList $services * @method \Twilio\Rest\Notify\V1\CredentialContext credentials(string $sid) * @method \Twilio\Rest\Notify\V1\ServiceContext services(string $sid) */ class V1 extends Version { protected $_credentials = null; protected $_services = null; /** * Construct the V1 version of Notify * * @param \Twilio\Domain $domain Domain that contains the version * @return \Twilio\Rest\Notify\V1 V1 version of Notify */ public function __construct(Domain $domain) { parent::__construct($domain); $this->version = 'v1'; } /** * @return \Twilio\Rest\Notify\V1\CredentialList */ protected function getCredentials() { if (!$this->_credentials) { $this->_credentials = new CredentialList($this); } return $this->_credentials; } /** * @return \Twilio\Rest\Notify\V1\ServiceList */ protected function getServices() { if (!$this->_services) { $this->_services = new ServiceList($this); } return $this->_services; } /** * Magic getter to lazy load root resources * * @param string $name Resource to return * @return \Twilio\ListResource The requested resource * @throws TwilioException For unknown resource */ public function __get($name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown resource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Notify.V1]'; } } sdk/src/Twilio/Rest/Notify/V1/CredentialInstance.php 0000644 00000010233 15002236443 0016304 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Notify\V1; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * * @property string $sid * @property string $accountSid * @property string $friendlyName * @property string $type * @property string $sandbox * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $url */ class CredentialInstance extends InstanceResource { /** * Initialize the CredentialInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Notify\V1\CredentialInstance */ public function __construct(Version $version, array $payload, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'type' => Values::array_get($payload, 'type'), 'sandbox' => Values::array_get($payload, 'sandbox'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), ); $this->solution = array('sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Notify\V1\CredentialContext Context for this * CredentialInstance */ protected function proxy() { if (!$this->context) { $this->context = new CredentialContext($this->version, $this->solution['sid']); } return $this->context; } /** * Fetch a CredentialInstance * * @return CredentialInstance Fetched CredentialInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Update the CredentialInstance * * @param array|Options $options Optional Arguments * @return CredentialInstance Updated CredentialInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Deletes the CredentialInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Notify.V1.CredentialInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Notify/V1/ServiceOptions.php 0000644 00000064337 15002236443 0015537 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Notify\V1; 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 ServiceOptions { /** * @param string $friendlyName A string to describe the resource * @param string $apnCredentialSid The SID of the Credential to use for APN * Bindings * @param string $gcmCredentialSid The SID of the Credential to use for GCM * Bindings * @param string $messagingServiceSid The SID of the Messaging Service to use * for SMS Bindings * @param string $facebookMessengerPageId Deprecated * @param string $defaultApnNotificationProtocolVersion The protocol version to * use for sending APNS * notifications * @param string $defaultGcmNotificationProtocolVersion The protocol version to * use for sending GCM * notifications * @param string $fcmCredentialSid The SID of the Credential to use for FCM * Bindings * @param string $defaultFcmNotificationProtocolVersion The protocol version to * use for sending FCM * notifications * @param bool $logEnabled Whether to log notifications * @param string $alexaSkillId Deprecated * @param string $defaultAlexaNotificationProtocolVersion Deprecated * @return CreateServiceOptions Options builder */ public static function create($friendlyName = Values::NONE, $apnCredentialSid = Values::NONE, $gcmCredentialSid = Values::NONE, $messagingServiceSid = Values::NONE, $facebookMessengerPageId = Values::NONE, $defaultApnNotificationProtocolVersion = Values::NONE, $defaultGcmNotificationProtocolVersion = Values::NONE, $fcmCredentialSid = Values::NONE, $defaultFcmNotificationProtocolVersion = Values::NONE, $logEnabled = Values::NONE, $alexaSkillId = Values::NONE, $defaultAlexaNotificationProtocolVersion = Values::NONE) { return new CreateServiceOptions($friendlyName, $apnCredentialSid, $gcmCredentialSid, $messagingServiceSid, $facebookMessengerPageId, $defaultApnNotificationProtocolVersion, $defaultGcmNotificationProtocolVersion, $fcmCredentialSid, $defaultFcmNotificationProtocolVersion, $logEnabled, $alexaSkillId, $defaultAlexaNotificationProtocolVersion); } /** * @param string $friendlyName The string that identifies the Service resources * to read * @return ReadServiceOptions Options builder */ public static function read($friendlyName = Values::NONE) { return new ReadServiceOptions($friendlyName); } /** * @param string $friendlyName A string to describe the resource * @param string $apnCredentialSid The SID of the Credential to use for APN * Bindings * @param string $gcmCredentialSid The SID of the Credential to use for GCM * Bindings * @param string $messagingServiceSid The SID of the Messaging Service to use * for SMS Bindings * @param string $facebookMessengerPageId Deprecated * @param string $defaultApnNotificationProtocolVersion The protocol version to * use for sending APNS * notifications * @param string $defaultGcmNotificationProtocolVersion The protocol version to * use for sending GCM * notifications * @param string $fcmCredentialSid The SID of the Credential to use for FCM * Bindings * @param string $defaultFcmNotificationProtocolVersion The protocol version to * use for sending FCM * notifications * @param bool $logEnabled Whether to log notifications * @param string $alexaSkillId Deprecated * @param string $defaultAlexaNotificationProtocolVersion Deprecated * @param string $deliveryCallbackUrl Webhook URL * @param bool $deliveryCallbackEnabled Enable delivery callbacks * @return UpdateServiceOptions Options builder */ public static function update($friendlyName = Values::NONE, $apnCredentialSid = Values::NONE, $gcmCredentialSid = Values::NONE, $messagingServiceSid = Values::NONE, $facebookMessengerPageId = Values::NONE, $defaultApnNotificationProtocolVersion = Values::NONE, $defaultGcmNotificationProtocolVersion = Values::NONE, $fcmCredentialSid = Values::NONE, $defaultFcmNotificationProtocolVersion = Values::NONE, $logEnabled = Values::NONE, $alexaSkillId = Values::NONE, $defaultAlexaNotificationProtocolVersion = Values::NONE, $deliveryCallbackUrl = Values::NONE, $deliveryCallbackEnabled = Values::NONE) { return new UpdateServiceOptions($friendlyName, $apnCredentialSid, $gcmCredentialSid, $messagingServiceSid, $facebookMessengerPageId, $defaultApnNotificationProtocolVersion, $defaultGcmNotificationProtocolVersion, $fcmCredentialSid, $defaultFcmNotificationProtocolVersion, $logEnabled, $alexaSkillId, $defaultAlexaNotificationProtocolVersion, $deliveryCallbackUrl, $deliveryCallbackEnabled); } } class CreateServiceOptions extends Options { /** * @param string $friendlyName A string to describe the resource * @param string $apnCredentialSid The SID of the Credential to use for APN * Bindings * @param string $gcmCredentialSid The SID of the Credential to use for GCM * Bindings * @param string $messagingServiceSid The SID of the Messaging Service to use * for SMS Bindings * @param string $facebookMessengerPageId Deprecated * @param string $defaultApnNotificationProtocolVersion The protocol version to * use for sending APNS * notifications * @param string $defaultGcmNotificationProtocolVersion The protocol version to * use for sending GCM * notifications * @param string $fcmCredentialSid The SID of the Credential to use for FCM * Bindings * @param string $defaultFcmNotificationProtocolVersion The protocol version to * use for sending FCM * notifications * @param bool $logEnabled Whether to log notifications * @param string $alexaSkillId Deprecated * @param string $defaultAlexaNotificationProtocolVersion Deprecated */ public function __construct($friendlyName = Values::NONE, $apnCredentialSid = Values::NONE, $gcmCredentialSid = Values::NONE, $messagingServiceSid = Values::NONE, $facebookMessengerPageId = Values::NONE, $defaultApnNotificationProtocolVersion = Values::NONE, $defaultGcmNotificationProtocolVersion = Values::NONE, $fcmCredentialSid = Values::NONE, $defaultFcmNotificationProtocolVersion = Values::NONE, $logEnabled = Values::NONE, $alexaSkillId = Values::NONE, $defaultAlexaNotificationProtocolVersion = Values::NONE) { $this->options['friendlyName'] = $friendlyName; $this->options['apnCredentialSid'] = $apnCredentialSid; $this->options['gcmCredentialSid'] = $gcmCredentialSid; $this->options['messagingServiceSid'] = $messagingServiceSid; $this->options['facebookMessengerPageId'] = $facebookMessengerPageId; $this->options['defaultApnNotificationProtocolVersion'] = $defaultApnNotificationProtocolVersion; $this->options['defaultGcmNotificationProtocolVersion'] = $defaultGcmNotificationProtocolVersion; $this->options['fcmCredentialSid'] = $fcmCredentialSid; $this->options['defaultFcmNotificationProtocolVersion'] = $defaultFcmNotificationProtocolVersion; $this->options['logEnabled'] = $logEnabled; $this->options['alexaSkillId'] = $alexaSkillId; $this->options['defaultAlexaNotificationProtocolVersion'] = $defaultAlexaNotificationProtocolVersion; } /** * A descriptive string that you create to describe the resource. It can be up to 64 characters long. * * @param string $friendlyName A string to describe the resource * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The SID of the [Credential](https://www.twilio.com/docs/notify/api/credential-resource) to use for APN Bindings. * * @param string $apnCredentialSid The SID of the Credential to use for APN * Bindings * @return $this Fluent Builder */ public function setApnCredentialSid($apnCredentialSid) { $this->options['apnCredentialSid'] = $apnCredentialSid; return $this; } /** * The SID of the [Credential](https://www.twilio.com/docs/notify/api/credential-resource) to use for GCM Bindings. * * @param string $gcmCredentialSid The SID of the Credential to use for GCM * Bindings * @return $this Fluent Builder */ public function setGcmCredentialSid($gcmCredentialSid) { $this->options['gcmCredentialSid'] = $gcmCredentialSid; return $this; } /** * The SID of the [Messaging Service](https://www.twilio.com/docs/sms/send-messages#messaging-services) to use for SMS Bindings. This parameter must be set in order to send SMS notifications. * * @param string $messagingServiceSid The SID of the Messaging Service to use * for SMS Bindings * @return $this Fluent Builder */ public function setMessagingServiceSid($messagingServiceSid) { $this->options['messagingServiceSid'] = $messagingServiceSid; return $this; } /** * Deprecated. * * @param string $facebookMessengerPageId Deprecated * @return $this Fluent Builder */ public function setFacebookMessengerPageId($facebookMessengerPageId) { $this->options['facebookMessengerPageId'] = $facebookMessengerPageId; return $this; } /** * The protocol version to use for sending APNS notifications. Can be overridden on a Binding by Binding basis when creating a [Binding](https://www.twilio.com/docs/notify/api/binding-resource) resource. * * @param string $defaultApnNotificationProtocolVersion The protocol version to * use for sending APNS * notifications * @return $this Fluent Builder */ public function setDefaultApnNotificationProtocolVersion($defaultApnNotificationProtocolVersion) { $this->options['defaultApnNotificationProtocolVersion'] = $defaultApnNotificationProtocolVersion; return $this; } /** * The protocol version to use for sending GCM notifications. Can be overridden on a Binding by Binding basis when creating a [Binding](https://www.twilio.com/docs/notify/api/binding-resource) resource. * * @param string $defaultGcmNotificationProtocolVersion The protocol version to * use for sending GCM * notifications * @return $this Fluent Builder */ public function setDefaultGcmNotificationProtocolVersion($defaultGcmNotificationProtocolVersion) { $this->options['defaultGcmNotificationProtocolVersion'] = $defaultGcmNotificationProtocolVersion; return $this; } /** * The SID of the [Credential](https://www.twilio.com/docs/notify/api/credential-resource) to use for FCM Bindings. * * @param string $fcmCredentialSid The SID of the Credential to use for FCM * Bindings * @return $this Fluent Builder */ public function setFcmCredentialSid($fcmCredentialSid) { $this->options['fcmCredentialSid'] = $fcmCredentialSid; return $this; } /** * The protocol version to use for sending FCM notifications. Can be overridden on a Binding by Binding basis when creating a [Binding](https://www.twilio.com/docs/notify/api/binding-resource) resource. * * @param string $defaultFcmNotificationProtocolVersion The protocol version to * use for sending FCM * notifications * @return $this Fluent Builder */ public function setDefaultFcmNotificationProtocolVersion($defaultFcmNotificationProtocolVersion) { $this->options['defaultFcmNotificationProtocolVersion'] = $defaultFcmNotificationProtocolVersion; return $this; } /** * Whether to log notifications. Can be: `true` or `false` and the default is `true`. * * @param bool $logEnabled Whether to log notifications * @return $this Fluent Builder */ public function setLogEnabled($logEnabled) { $this->options['logEnabled'] = $logEnabled; return $this; } /** * Deprecated. * * @param string $alexaSkillId Deprecated * @return $this Fluent Builder */ public function setAlexaSkillId($alexaSkillId) { $this->options['alexaSkillId'] = $alexaSkillId; return $this; } /** * Deprecated. * * @param string $defaultAlexaNotificationProtocolVersion Deprecated * @return $this Fluent Builder */ public function setDefaultAlexaNotificationProtocolVersion($defaultAlexaNotificationProtocolVersion) { $this->options['defaultAlexaNotificationProtocolVersion'] = $defaultAlexaNotificationProtocolVersion; 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.Notify.V1.CreateServiceOptions ' . \implode(' ', $options) . ']'; } } class ReadServiceOptions extends Options { /** * @param string $friendlyName The string that identifies the Service resources * to read */ public function __construct($friendlyName = Values::NONE) { $this->options['friendlyName'] = $friendlyName; } /** * The string that identifies the Service resources to read. * * @param string $friendlyName The string that identifies the Service resources * to read * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; 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.Notify.V1.ReadServiceOptions ' . \implode(' ', $options) . ']'; } } class UpdateServiceOptions extends Options { /** * @param string $friendlyName A string to describe the resource * @param string $apnCredentialSid The SID of the Credential to use for APN * Bindings * @param string $gcmCredentialSid The SID of the Credential to use for GCM * Bindings * @param string $messagingServiceSid The SID of the Messaging Service to use * for SMS Bindings * @param string $facebookMessengerPageId Deprecated * @param string $defaultApnNotificationProtocolVersion The protocol version to * use for sending APNS * notifications * @param string $defaultGcmNotificationProtocolVersion The protocol version to * use for sending GCM * notifications * @param string $fcmCredentialSid The SID of the Credential to use for FCM * Bindings * @param string $defaultFcmNotificationProtocolVersion The protocol version to * use for sending FCM * notifications * @param bool $logEnabled Whether to log notifications * @param string $alexaSkillId Deprecated * @param string $defaultAlexaNotificationProtocolVersion Deprecated * @param string $deliveryCallbackUrl Webhook URL * @param bool $deliveryCallbackEnabled Enable delivery callbacks */ public function __construct($friendlyName = Values::NONE, $apnCredentialSid = Values::NONE, $gcmCredentialSid = Values::NONE, $messagingServiceSid = Values::NONE, $facebookMessengerPageId = Values::NONE, $defaultApnNotificationProtocolVersion = Values::NONE, $defaultGcmNotificationProtocolVersion = Values::NONE, $fcmCredentialSid = Values::NONE, $defaultFcmNotificationProtocolVersion = Values::NONE, $logEnabled = Values::NONE, $alexaSkillId = Values::NONE, $defaultAlexaNotificationProtocolVersion = Values::NONE, $deliveryCallbackUrl = Values::NONE, $deliveryCallbackEnabled = Values::NONE) { $this->options['friendlyName'] = $friendlyName; $this->options['apnCredentialSid'] = $apnCredentialSid; $this->options['gcmCredentialSid'] = $gcmCredentialSid; $this->options['messagingServiceSid'] = $messagingServiceSid; $this->options['facebookMessengerPageId'] = $facebookMessengerPageId; $this->options['defaultApnNotificationProtocolVersion'] = $defaultApnNotificationProtocolVersion; $this->options['defaultGcmNotificationProtocolVersion'] = $defaultGcmNotificationProtocolVersion; $this->options['fcmCredentialSid'] = $fcmCredentialSid; $this->options['defaultFcmNotificationProtocolVersion'] = $defaultFcmNotificationProtocolVersion; $this->options['logEnabled'] = $logEnabled; $this->options['alexaSkillId'] = $alexaSkillId; $this->options['defaultAlexaNotificationProtocolVersion'] = $defaultAlexaNotificationProtocolVersion; $this->options['deliveryCallbackUrl'] = $deliveryCallbackUrl; $this->options['deliveryCallbackEnabled'] = $deliveryCallbackEnabled; } /** * A descriptive string that you create to describe the resource. It can be up to 64 characters long. * * @param string $friendlyName A string to describe the resource * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The SID of the [Credential](https://www.twilio.com/docs/notify/api/credential-resource) to use for APN Bindings. * * @param string $apnCredentialSid The SID of the Credential to use for APN * Bindings * @return $this Fluent Builder */ public function setApnCredentialSid($apnCredentialSid) { $this->options['apnCredentialSid'] = $apnCredentialSid; return $this; } /** * The SID of the [Credential](https://www.twilio.com/docs/notify/api/credential-resource) to use for GCM Bindings. * * @param string $gcmCredentialSid The SID of the Credential to use for GCM * Bindings * @return $this Fluent Builder */ public function setGcmCredentialSid($gcmCredentialSid) { $this->options['gcmCredentialSid'] = $gcmCredentialSid; return $this; } /** * The SID of the [Messaging Service](https://www.twilio.com/docs/sms/send-messages#messaging-services) to use for SMS Bindings. This parameter must be set in order to send SMS notifications. * * @param string $messagingServiceSid The SID of the Messaging Service to use * for SMS Bindings * @return $this Fluent Builder */ public function setMessagingServiceSid($messagingServiceSid) { $this->options['messagingServiceSid'] = $messagingServiceSid; return $this; } /** * Deprecated. * * @param string $facebookMessengerPageId Deprecated * @return $this Fluent Builder */ public function setFacebookMessengerPageId($facebookMessengerPageId) { $this->options['facebookMessengerPageId'] = $facebookMessengerPageId; return $this; } /** * The protocol version to use for sending APNS notifications. Can be overridden on a Binding by Binding basis when creating a [Binding](https://www.twilio.com/docs/notify/api/binding-resource) resource. * * @param string $defaultApnNotificationProtocolVersion The protocol version to * use for sending APNS * notifications * @return $this Fluent Builder */ public function setDefaultApnNotificationProtocolVersion($defaultApnNotificationProtocolVersion) { $this->options['defaultApnNotificationProtocolVersion'] = $defaultApnNotificationProtocolVersion; return $this; } /** * The protocol version to use for sending GCM notifications. Can be overridden on a Binding by Binding basis when creating a [Binding](https://www.twilio.com/docs/notify/api/binding-resource) resource. * * @param string $defaultGcmNotificationProtocolVersion The protocol version to * use for sending GCM * notifications * @return $this Fluent Builder */ public function setDefaultGcmNotificationProtocolVersion($defaultGcmNotificationProtocolVersion) { $this->options['defaultGcmNotificationProtocolVersion'] = $defaultGcmNotificationProtocolVersion; return $this; } /** * The SID of the [Credential](https://www.twilio.com/docs/notify/api/credential-resource) to use for FCM Bindings. * * @param string $fcmCredentialSid The SID of the Credential to use for FCM * Bindings * @return $this Fluent Builder */ public function setFcmCredentialSid($fcmCredentialSid) { $this->options['fcmCredentialSid'] = $fcmCredentialSid; return $this; } /** * The protocol version to use for sending FCM notifications. Can be overridden on a Binding by Binding basis when creating a [Binding](https://www.twilio.com/docs/notify/api/binding-resource) resource. * * @param string $defaultFcmNotificationProtocolVersion The protocol version to * use for sending FCM * notifications * @return $this Fluent Builder */ public function setDefaultFcmNotificationProtocolVersion($defaultFcmNotificationProtocolVersion) { $this->options['defaultFcmNotificationProtocolVersion'] = $defaultFcmNotificationProtocolVersion; return $this; } /** * Whether to log notifications. Can be: `true` or `false` and the default is `true`. * * @param bool $logEnabled Whether to log notifications * @return $this Fluent Builder */ public function setLogEnabled($logEnabled) { $this->options['logEnabled'] = $logEnabled; return $this; } /** * Deprecated. * * @param string $alexaSkillId Deprecated * @return $this Fluent Builder */ public function setAlexaSkillId($alexaSkillId) { $this->options['alexaSkillId'] = $alexaSkillId; return $this; } /** * Deprecated. * * @param string $defaultAlexaNotificationProtocolVersion Deprecated * @return $this Fluent Builder */ public function setDefaultAlexaNotificationProtocolVersion($defaultAlexaNotificationProtocolVersion) { $this->options['defaultAlexaNotificationProtocolVersion'] = $defaultAlexaNotificationProtocolVersion; return $this; } /** * URL to send delivery status callback. * * @param string $deliveryCallbackUrl Webhook URL * @return $this Fluent Builder */ public function setDeliveryCallbackUrl($deliveryCallbackUrl) { $this->options['deliveryCallbackUrl'] = $deliveryCallbackUrl; return $this; } /** * Callback configuration that enables delivery callbacks, default false * * @param bool $deliveryCallbackEnabled Enable delivery callbacks * @return $this Fluent Builder */ public function setDeliveryCallbackEnabled($deliveryCallbackEnabled) { $this->options['deliveryCallbackEnabled'] = $deliveryCallbackEnabled; 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.Notify.V1.UpdateServiceOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Notify/V1/CredentialContext.php 0000644 00000005722 15002236443 0016173 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Notify\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class CredentialContext extends InstanceContext { /** * Initialize the CredentialContext * * @param \Twilio\Version $version Version that contains the resource * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Notify\V1\CredentialContext */ public function __construct(Version $version, $sid) { parent::__construct($version); // Path Solution $this->solution = array('sid' => $sid, ); $this->uri = '/Credentials/' . \rawurlencode($sid) . ''; } /** * Fetch a CredentialInstance * * @return CredentialInstance Fetched CredentialInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new CredentialInstance($this->version, $payload, $this->solution['sid']); } /** * Update the CredentialInstance * * @param array|Options $options Optional Arguments * @return CredentialInstance Updated CredentialInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { $options = new Values($options); $data = Values::of(array( 'FriendlyName' => $options['friendlyName'], 'Certificate' => $options['certificate'], 'PrivateKey' => $options['privateKey'], 'Sandbox' => Serialize::booleanToString($options['sandbox']), 'ApiKey' => $options['apiKey'], 'Secret' => $options['secret'], )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new CredentialInstance($this->version, $payload, $this->solution['sid']); } /** * Deletes the CredentialInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Notify.V1.CredentialContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Notify/V1/CredentialOptions.php 0000644 00000026705 15002236443 0016206 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Notify\V1; 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 CredentialOptions { /** * @param string $friendlyName A string to describe the resource * @param string $certificate [APN only] The URL-encoded representation of the * certificate * @param string $privateKey [APN only] URL-encoded representation of the * private key * @param bool $sandbox [APN only] Whether to send the credential to sandbox * APNs * @param string $apiKey [GCM only] The `Server key` of your project from * Firebase console under Settings / Cloud messaging * @param string $secret [FCM only] The `Server key` of your project from * Firebase console under Settings / Cloud messaging * @return CreateCredentialOptions Options builder */ public static function create($friendlyName = Values::NONE, $certificate = Values::NONE, $privateKey = Values::NONE, $sandbox = Values::NONE, $apiKey = Values::NONE, $secret = Values::NONE) { return new CreateCredentialOptions($friendlyName, $certificate, $privateKey, $sandbox, $apiKey, $secret); } /** * @param string $friendlyName A string to describe the resource * @param string $certificate [APN only] The URL-encoded representation of the * certificate * @param string $privateKey [APN only] URL-encoded representation of the * private key * @param bool $sandbox [APN only] Whether to send the credential to sandbox * APNs * @param string $apiKey [GCM only] The `Server key` of your project from * Firebase console under Settings / Cloud messaging * @param string $secret [FCM only] The `Server key` of your project from * Firebase console under Settings / Cloud messaging * @return UpdateCredentialOptions Options builder */ public static function update($friendlyName = Values::NONE, $certificate = Values::NONE, $privateKey = Values::NONE, $sandbox = Values::NONE, $apiKey = Values::NONE, $secret = Values::NONE) { return new UpdateCredentialOptions($friendlyName, $certificate, $privateKey, $sandbox, $apiKey, $secret); } } class CreateCredentialOptions extends Options { /** * @param string $friendlyName A string to describe the resource * @param string $certificate [APN only] The URL-encoded representation of the * certificate * @param string $privateKey [APN only] URL-encoded representation of the * private key * @param bool $sandbox [APN only] Whether to send the credential to sandbox * APNs * @param string $apiKey [GCM only] The `Server key` of your project from * Firebase console under Settings / Cloud messaging * @param string $secret [FCM only] The `Server key` of your project from * Firebase console under Settings / Cloud messaging */ public function __construct($friendlyName = Values::NONE, $certificate = Values::NONE, $privateKey = Values::NONE, $sandbox = Values::NONE, $apiKey = Values::NONE, $secret = Values::NONE) { $this->options['friendlyName'] = $friendlyName; $this->options['certificate'] = $certificate; $this->options['privateKey'] = $privateKey; $this->options['sandbox'] = $sandbox; $this->options['apiKey'] = $apiKey; $this->options['secret'] = $secret; } /** * A descriptive string that you create to describe the resource. It can be up to 64 characters long. * * @param string $friendlyName A string to describe the resource * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * [APN only] The URL-encoded representation of the certificate. Strip everything outside of the headers, e.g. `-----BEGIN CERTIFICATE-----MIIFnTCCBIWgAwIBAgIIAjy9H849+E8wDQYJKoZIhvcNAQEFBQAwgZYxCzAJBgNV.....A==-----END CERTIFICATE-----` * * @param string $certificate [APN only] The URL-encoded representation of the * certificate * @return $this Fluent Builder */ public function setCertificate($certificate) { $this->options['certificate'] = $certificate; return $this; } /** * [APN only] The URL-encoded representation of the private key. Strip everything outside of the headers, e.g. `-----BEGIN RSA PRIVATE KEY-----MIIEpQIBAAKCAQEAuyf/lNrH9ck8DmNyo3fGgvCI1l9s+cmBY3WIz+cUDqmxiieR\n.-----END RSA PRIVATE KEY-----` * * @param string $privateKey [APN only] URL-encoded representation of the * private key * @return $this Fluent Builder */ public function setPrivateKey($privateKey) { $this->options['privateKey'] = $privateKey; return $this; } /** * [APN only] Whether to send the credential to sandbox APNs. Can be `true` to send to sandbox APNs or `false` to send to production. * * @param bool $sandbox [APN only] Whether to send the credential to sandbox * APNs * @return $this Fluent Builder */ public function setSandbox($sandbox) { $this->options['sandbox'] = $sandbox; return $this; } /** * [GCM only] The `Server key` of your project from Firebase console under Settings / Cloud messaging. * * @param string $apiKey [GCM only] The `Server key` of your project from * Firebase console under Settings / Cloud messaging * @return $this Fluent Builder */ public function setApiKey($apiKey) { $this->options['apiKey'] = $apiKey; return $this; } /** * [FCM only] The `Server key` of your project from Firebase console under Settings / Cloud messaging. * * @param string $secret [FCM only] The `Server key` of your project from * Firebase console under Settings / Cloud messaging * @return $this Fluent Builder */ public function setSecret($secret) { $this->options['secret'] = $secret; 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.Notify.V1.CreateCredentialOptions ' . \implode(' ', $options) . ']'; } } class UpdateCredentialOptions extends Options { /** * @param string $friendlyName A string to describe the resource * @param string $certificate [APN only] The URL-encoded representation of the * certificate * @param string $privateKey [APN only] URL-encoded representation of the * private key * @param bool $sandbox [APN only] Whether to send the credential to sandbox * APNs * @param string $apiKey [GCM only] The `Server key` of your project from * Firebase console under Settings / Cloud messaging * @param string $secret [FCM only] The `Server key` of your project from * Firebase console under Settings / Cloud messaging */ public function __construct($friendlyName = Values::NONE, $certificate = Values::NONE, $privateKey = Values::NONE, $sandbox = Values::NONE, $apiKey = Values::NONE, $secret = Values::NONE) { $this->options['friendlyName'] = $friendlyName; $this->options['certificate'] = $certificate; $this->options['privateKey'] = $privateKey; $this->options['sandbox'] = $sandbox; $this->options['apiKey'] = $apiKey; $this->options['secret'] = $secret; } /** * A descriptive string that you create to describe the resource. It can be up to 64 characters long. * * @param string $friendlyName A string to describe the resource * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * [APN only] The URL-encoded representation of the certificate. Strip everything outside of the headers, e.g. `-----BEGIN CERTIFICATE-----MIIFnTCCBIWgAwIBAgIIAjy9H849+E8wDQYJKoZIhvcNAQEFBQAwgZYxCzAJBgNV.....A==-----END CERTIFICATE-----` * * @param string $certificate [APN only] The URL-encoded representation of the * certificate * @return $this Fluent Builder */ public function setCertificate($certificate) { $this->options['certificate'] = $certificate; return $this; } /** * [APN only] The URL-encoded representation of the private key. Strip everything outside of the headers, e.g. `-----BEGIN RSA PRIVATE KEY-----MIIEpQIBAAKCAQEAuyf/lNrH9ck8DmNyo3fGgvCI1l9s+cmBY3WIz+cUDqmxiieR\n.-----END RSA PRIVATE KEY-----` * * @param string $privateKey [APN only] URL-encoded representation of the * private key * @return $this Fluent Builder */ public function setPrivateKey($privateKey) { $this->options['privateKey'] = $privateKey; return $this; } /** * [APN only] Whether to send the credential to sandbox APNs. Can be `true` to send to sandbox APNs or `false` to send to production. * * @param bool $sandbox [APN only] Whether to send the credential to sandbox * APNs * @return $this Fluent Builder */ public function setSandbox($sandbox) { $this->options['sandbox'] = $sandbox; return $this; } /** * [GCM only] The `Server key` of your project from Firebase console under Settings / Cloud messaging. * * @param string $apiKey [GCM only] The `Server key` of your project from * Firebase console under Settings / Cloud messaging * @return $this Fluent Builder */ public function setApiKey($apiKey) { $this->options['apiKey'] = $apiKey; return $this; } /** * [FCM only] The `Server key` of your project from Firebase console under Settings / Cloud messaging. * * @param string $secret [FCM only] The `Server key` of your project from * Firebase console under Settings / Cloud messaging * @return $this Fluent Builder */ public function setSecret($secret) { $this->options['secret'] = $secret; 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.Notify.V1.UpdateCredentialOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Notify/V1/ServiceList.php 0000644 00000015177 15002236443 0015015 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Notify\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class ServiceList extends ListResource { /** * Construct the ServiceList * * @param Version $version Version that contains the resource * @return \Twilio\Rest\Notify\V1\ServiceList */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = array(); $this->uri = '/Services'; } /** * Create a new ServiceInstance * * @param array|Options $options Optional Arguments * @return ServiceInstance Newly created ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function create($options = array()) { $options = new Values($options); $data = Values::of(array( 'FriendlyName' => $options['friendlyName'], 'ApnCredentialSid' => $options['apnCredentialSid'], 'GcmCredentialSid' => $options['gcmCredentialSid'], 'MessagingServiceSid' => $options['messagingServiceSid'], 'FacebookMessengerPageId' => $options['facebookMessengerPageId'], 'DefaultApnNotificationProtocolVersion' => $options['defaultApnNotificationProtocolVersion'], 'DefaultGcmNotificationProtocolVersion' => $options['defaultGcmNotificationProtocolVersion'], 'FcmCredentialSid' => $options['fcmCredentialSid'], 'DefaultFcmNotificationProtocolVersion' => $options['defaultFcmNotificationProtocolVersion'], 'LogEnabled' => Serialize::booleanToString($options['logEnabled']), 'AlexaSkillId' => $options['alexaSkillId'], 'DefaultAlexaNotificationProtocolVersion' => $options['defaultAlexaNotificationProtocolVersion'], )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new ServiceInstance($this->version, $payload); } /** * Streams ServiceInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($options = array(), $limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads ServiceInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return ServiceInstance[] Array of results */ public function read($options = array(), $limit = null, $pageSize = null) { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Retrieve a single page of ServiceInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of ServiceInstance */ public function page($options = array(), $pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $options = new Values($options); $params = Values::of(array( 'FriendlyName' => $options['friendlyName'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new ServicePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of ServiceInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of ServiceInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new ServicePage($this->version, $response, $this->solution); } /** * Constructs a ServiceContext * * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Notify\V1\ServiceContext */ public function getContext($sid) { return new ServiceContext($this->version, $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Notify.V1.ServiceList]'; } } sdk/src/Twilio/Rest/Notify/V1/CredentialList.php 0000644 00000013474 15002236443 0015465 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Notify\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class CredentialList extends ListResource { /** * Construct the CredentialList * * @param Version $version Version that contains the resource * @return \Twilio\Rest\Notify\V1\CredentialList */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = array(); $this->uri = '/Credentials'; } /** * Streams CredentialInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads CredentialInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return CredentialInstance[] Array of results */ public function read($limit = null, $pageSize = null) { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of CredentialInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of CredentialInstance */ public function page($pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $params = Values::of(array( 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new CredentialPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of CredentialInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of CredentialInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new CredentialPage($this->version, $response, $this->solution); } /** * Create a new CredentialInstance * * @param string $type The Credential type * @param array|Options $options Optional Arguments * @return CredentialInstance Newly created CredentialInstance * @throws TwilioException When an HTTP error occurs. */ public function create($type, $options = array()) { $options = new Values($options); $data = Values::of(array( 'Type' => $type, 'FriendlyName' => $options['friendlyName'], 'Certificate' => $options['certificate'], 'PrivateKey' => $options['privateKey'], 'Sandbox' => Serialize::booleanToString($options['sandbox']), 'ApiKey' => $options['apiKey'], 'Secret' => $options['secret'], )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new CredentialInstance($this->version, $payload); } /** * Constructs a CredentialContext * * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Notify\V1\CredentialContext */ public function getContext($sid) { return new CredentialContext($this->version, $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Notify.V1.CredentialList]'; } } sdk/src/Twilio/Rest/Notify/V1/ServicePage.php 0000644 00000001477 15002236443 0014754 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Notify\V1; use Twilio\Page; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class ServicePage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new ServiceInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Notify.V1.ServicePage]'; } } sdk/src/Twilio/Rest/Notify/V1/CredentialPage.php 0000644 00000001510 15002236443 0015412 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Notify\V1; use Twilio\Page; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class CredentialPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new CredentialInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Notify.V1.CredentialPage]'; } } sdk/src/Twilio/Rest/Notify/V1/ServiceInstance.php 0000644 00000014105 15002236443 0015634 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Notify\V1; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * * @property string $sid * @property string $accountSid * @property string $friendlyName * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $apnCredentialSid * @property string $gcmCredentialSid * @property string $fcmCredentialSid * @property string $messagingServiceSid * @property string $facebookMessengerPageId * @property string $defaultApnNotificationProtocolVersion * @property string $defaultGcmNotificationProtocolVersion * @property string $defaultFcmNotificationProtocolVersion * @property bool $logEnabled * @property string $url * @property array $links * @property string $alexaSkillId * @property string $defaultAlexaNotificationProtocolVersion */ class ServiceInstance extends InstanceResource { protected $_bindings = null; protected $_notifications = null; /** * Initialize the ServiceInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Notify\V1\ServiceInstance */ public function __construct(Version $version, array $payload, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'apnCredentialSid' => Values::array_get($payload, 'apn_credential_sid'), 'gcmCredentialSid' => Values::array_get($payload, 'gcm_credential_sid'), 'fcmCredentialSid' => Values::array_get($payload, 'fcm_credential_sid'), 'messagingServiceSid' => Values::array_get($payload, 'messaging_service_sid'), 'facebookMessengerPageId' => Values::array_get($payload, 'facebook_messenger_page_id'), 'defaultApnNotificationProtocolVersion' => Values::array_get($payload, 'default_apn_notification_protocol_version'), 'defaultGcmNotificationProtocolVersion' => Values::array_get($payload, 'default_gcm_notification_protocol_version'), 'defaultFcmNotificationProtocolVersion' => Values::array_get($payload, 'default_fcm_notification_protocol_version'), 'logEnabled' => Values::array_get($payload, 'log_enabled'), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), 'alexaSkillId' => Values::array_get($payload, 'alexa_skill_id'), 'defaultAlexaNotificationProtocolVersion' => Values::array_get($payload, 'default_alexa_notification_protocol_version'), ); $this->solution = array('sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Notify\V1\ServiceContext Context for this * ServiceInstance */ protected function proxy() { if (!$this->context) { $this->context = new ServiceContext($this->version, $this->solution['sid']); } return $this->context; } /** * Deletes the ServiceInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Fetch a ServiceInstance * * @return ServiceInstance Fetched ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Update the ServiceInstance * * @param array|Options $options Optional Arguments * @return ServiceInstance Updated ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Access the bindings * * @return \Twilio\Rest\Notify\V1\Service\BindingList */ protected function getBindings() { return $this->proxy()->bindings; } /** * Access the notifications * * @return \Twilio\Rest\Notify\V1\Service\NotificationList */ protected function getNotifications() { return $this->proxy()->notifications; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Notify.V1.ServiceInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Notify/V1/Service/BindingContext.php 0000644 00000004371 15002236443 0017072 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Notify\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class BindingContext extends InstanceContext { /** * Initialize the BindingContext * * @param \Twilio\Version $version Version that contains the resource * @param string $serviceSid The SID of the Service to fetch the resource from * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Notify\V1\Service\BindingContext */ public function __construct(Version $version, $serviceSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, 'sid' => $sid, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Bindings/' . \rawurlencode($sid) . ''; } /** * Fetch a BindingInstance * * @return BindingInstance Fetched BindingInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new BindingInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Deletes the BindingInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Notify.V1.BindingContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Notify/V1/Service/BindingPage.php 0000644 00000001546 15002236443 0016323 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Notify\V1\Service; use Twilio\Page; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class BindingPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new BindingInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Notify.V1.BindingPage]'; } } sdk/src/Twilio/Rest/Notify/V1/Service/NotificationInstance.php 0000644 00000007267 15002236443 0020275 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Notify\V1\Service; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * * @property string $sid * @property string $accountSid * @property string $serviceSid * @property \DateTime $dateCreated * @property string $identities * @property string $tags * @property string $segments * @property string $priority * @property int $ttl * @property string $title * @property string $body * @property string $sound * @property string $action * @property array $data * @property array $apn * @property array $gcm * @property array $fcm * @property array $sms * @property array $facebookMessenger * @property array $alexa */ class NotificationInstance extends InstanceResource { /** * Initialize the NotificationInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the Service that the resource is * associated with * @return \Twilio\Rest\Notify\V1\Service\NotificationInstance */ public function __construct(Version $version, array $payload, $serviceSid) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'identities' => Values::array_get($payload, 'identities'), 'tags' => Values::array_get($payload, 'tags'), 'segments' => Values::array_get($payload, 'segments'), 'priority' => Values::array_get($payload, 'priority'), 'ttl' => Values::array_get($payload, 'ttl'), 'title' => Values::array_get($payload, 'title'), 'body' => Values::array_get($payload, 'body'), 'sound' => Values::array_get($payload, 'sound'), 'action' => Values::array_get($payload, 'action'), 'data' => Values::array_get($payload, 'data'), 'apn' => Values::array_get($payload, 'apn'), 'gcm' => Values::array_get($payload, 'gcm'), 'fcm' => Values::array_get($payload, 'fcm'), 'sms' => Values::array_get($payload, 'sms'), 'facebookMessenger' => Values::array_get($payload, 'facebook_messenger'), 'alexa' => Values::array_get($payload, 'alexa'), ); $this->solution = array('serviceSid' => $serviceSid, ); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Notify.V1.NotificationInstance]'; } } sdk/src/Twilio/Rest/Notify/V1/Service/BindingInstance.php 0000644 00000011277 15002236443 0017215 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Notify\V1\Service; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * * @property string $sid * @property string $accountSid * @property string $serviceSid * @property string $credentialSid * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $notificationProtocolVersion * @property string $endpoint * @property string $identity * @property string $bindingType * @property string $address * @property string $tags * @property string $url * @property array $links */ class BindingInstance extends InstanceResource { /** * Initialize the BindingInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the Service that the resource is * associated with * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Notify\V1\Service\BindingInstance */ public function __construct(Version $version, array $payload, $serviceSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'credentialSid' => Values::array_get($payload, 'credential_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'notificationProtocolVersion' => Values::array_get($payload, 'notification_protocol_version'), 'endpoint' => Values::array_get($payload, 'endpoint'), 'identity' => Values::array_get($payload, 'identity'), 'bindingType' => Values::array_get($payload, 'binding_type'), 'address' => Values::array_get($payload, 'address'), 'tags' => Values::array_get($payload, 'tags'), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ); $this->solution = array('serviceSid' => $serviceSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Notify\V1\Service\BindingContext Context for this * BindingInstance */ protected function proxy() { if (!$this->context) { $this->context = new BindingContext( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch a BindingInstance * * @return BindingInstance Fetched BindingInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the BindingInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Notify.V1.BindingInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Notify/V1/Service/BindingOptions.php 0000644 00000017660 15002236443 0017106 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Notify\V1\Service; 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 BindingOptions { /** * @param string $tag A tag that can be used to select the Bindings to notify * @param string $notificationProtocolVersion The protocol version to use to * send the notification * @param string $credentialSid The SID of the Credential resource to be used * to send notifications to this Binding * @param string $endpoint Deprecated * @return CreateBindingOptions Options builder */ public static function create($tag = Values::NONE, $notificationProtocolVersion = Values::NONE, $credentialSid = Values::NONE, $endpoint = Values::NONE) { return new CreateBindingOptions($tag, $notificationProtocolVersion, $credentialSid, $endpoint); } /** * @param \DateTime $startDate Only include usage that has occurred on or after * this date * @param \DateTime $endDate Only include usage that occurred on or before this * date * @param string $identity The `identity` value of the resources to read * @param string $tag Only list Bindings that have all of the specified Tags * @return ReadBindingOptions Options builder */ public static function read($startDate = Values::NONE, $endDate = Values::NONE, $identity = Values::NONE, $tag = Values::NONE) { return new ReadBindingOptions($startDate, $endDate, $identity, $tag); } } class CreateBindingOptions extends Options { /** * @param string $tag A tag that can be used to select the Bindings to notify * @param string $notificationProtocolVersion The protocol version to use to * send the notification * @param string $credentialSid The SID of the Credential resource to be used * to send notifications to this Binding * @param string $endpoint Deprecated */ public function __construct($tag = Values::NONE, $notificationProtocolVersion = Values::NONE, $credentialSid = Values::NONE, $endpoint = Values::NONE) { $this->options['tag'] = $tag; $this->options['notificationProtocolVersion'] = $notificationProtocolVersion; $this->options['credentialSid'] = $credentialSid; $this->options['endpoint'] = $endpoint; } /** * A tag that can be used to select the Bindings to notify. Repeat this parameter to specify more than one tag, up to a total of 20 tags. * * @param string $tag A tag that can be used to select the Bindings to notify * @return $this Fluent Builder */ public function setTag($tag) { $this->options['tag'] = $tag; return $this; } /** * The protocol version to use to send the notification. This defaults to the value of `default_xxxx_notification_protocol_version` for the protocol in the [Service](https://www.twilio.com/docs/notify/api/service-resource). The current version is `"3"` for `apn`, `fcm`, and `gcm` type Bindings. The parameter is not applicable to `sms` and `facebook-messenger` type Bindings as the data format is fixed. * * @param string $notificationProtocolVersion The protocol version to use to * send the notification * @return $this Fluent Builder */ public function setNotificationProtocolVersion($notificationProtocolVersion) { $this->options['notificationProtocolVersion'] = $notificationProtocolVersion; return $this; } /** * The SID of the [Credential](https://www.twilio.com/docs/notify/api/credential-resource) resource to be used to send notifications to this Binding. If present, this overrides the Credential specified in the Service resource. Applies to only `apn`, `fcm`, and `gcm` type Bindings. * * @param string $credentialSid The SID of the Credential resource to be used * to send notifications to this Binding * @return $this Fluent Builder */ public function setCredentialSid($credentialSid) { $this->options['credentialSid'] = $credentialSid; return $this; } /** * Deprecated. * * @param string $endpoint Deprecated * @return $this Fluent Builder */ public function setEndpoint($endpoint) { $this->options['endpoint'] = $endpoint; 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.Notify.V1.CreateBindingOptions ' . \implode(' ', $options) . ']'; } } class ReadBindingOptions extends Options { /** * @param \DateTime $startDate Only include usage that has occurred on or after * this date * @param \DateTime $endDate Only include usage that occurred on or before this * date * @param string $identity The `identity` value of the resources to read * @param string $tag Only list Bindings that have all of the specified Tags */ public function __construct($startDate = Values::NONE, $endDate = Values::NONE, $identity = Values::NONE, $tag = Values::NONE) { $this->options['startDate'] = $startDate; $this->options['endDate'] = $endDate; $this->options['identity'] = $identity; $this->options['tag'] = $tag; } /** * Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. * * @param \DateTime $startDate Only include usage that has occurred on or after * this date * @return $this Fluent Builder */ public function setStartDate($startDate) { $this->options['startDate'] = $startDate; return $this; } /** * Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. * * @param \DateTime $endDate Only include usage that occurred on or before this * date * @return $this Fluent Builder */ public function setEndDate($endDate) { $this->options['endDate'] = $endDate; return $this; } /** * The [User](https://www.twilio.com/docs/chat/rest/user-resource)'s `identity` value of the resources to read. * * @param string $identity The `identity` value of the resources to read * @return $this Fluent Builder */ public function setIdentity($identity) { $this->options['identity'] = $identity; return $this; } /** * Only list Bindings that have all of the specified Tags. The following implicit tags are available: `all`, `apn`, `fcm`, `gcm`, `sms`, `facebook-messenger`. Up to 5 tags are allowed. * * @param string $tag Only list Bindings that have all of the specified Tags * @return $this Fluent Builder */ public function setTag($tag) { $this->options['tag'] = $tag; 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.Notify.V1.ReadBindingOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Notify/V1/Service/NotificationList.php 0000644 00000005760 15002236443 0017440 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Notify\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class NotificationList extends ListResource { /** * Construct the NotificationList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Service that the resource is * associated with * @return \Twilio\Rest\Notify\V1\Service\NotificationList */ public function __construct(Version $version, $serviceSid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Notifications'; } /** * Create a new NotificationInstance * * @param array|Options $options Optional Arguments * @return NotificationInstance Newly created NotificationInstance * @throws TwilioException When an HTTP error occurs. */ public function create($options = array()) { $options = new Values($options); $data = Values::of(array( 'Identity' => Serialize::map($options['identity'], function($e) { return $e; }), 'Tag' => Serialize::map($options['tag'], function($e) { return $e; }), 'Body' => $options['body'], 'Priority' => $options['priority'], 'Ttl' => $options['ttl'], 'Title' => $options['title'], 'Sound' => $options['sound'], 'Action' => $options['action'], 'Data' => Serialize::jsonObject($options['data']), 'Apn' => Serialize::jsonObject($options['apn']), 'Gcm' => Serialize::jsonObject($options['gcm']), 'Sms' => Serialize::jsonObject($options['sms']), 'FacebookMessenger' => Serialize::jsonObject($options['facebookMessenger']), 'Fcm' => Serialize::jsonObject($options['fcm']), 'Segment' => Serialize::map($options['segment'], function($e) { return $e; }), 'Alexa' => Serialize::jsonObject($options['alexa']), 'ToBinding' => Serialize::map($options['toBinding'], function($e) { return $e; }), 'DeliveryCallbackUrl' => $options['deliveryCallbackUrl'], )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new NotificationInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Notify.V1.NotificationList]'; } } sdk/src/Twilio/Rest/Notify/V1/Service/BindingList.php 0000644 00000015612 15002236443 0016361 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Notify\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class BindingList extends ListResource { /** * Construct the BindingList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Service that the resource is * associated with * @return \Twilio\Rest\Notify\V1\Service\BindingList */ public function __construct(Version $version, $serviceSid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Bindings'; } /** * Create a new BindingInstance * * @param string $identity The `identity` value that identifies the new * resource's User * @param string $bindingType The type of the Binding * @param string $address The channel-specific address * @param array|Options $options Optional Arguments * @return BindingInstance Newly created BindingInstance * @throws TwilioException When an HTTP error occurs. */ public function create($identity, $bindingType, $address, $options = array()) { $options = new Values($options); $data = Values::of(array( 'Identity' => $identity, 'BindingType' => $bindingType, 'Address' => $address, 'Tag' => Serialize::map($options['tag'], function($e) { return $e; }), 'NotificationProtocolVersion' => $options['notificationProtocolVersion'], 'CredentialSid' => $options['credentialSid'], 'Endpoint' => $options['endpoint'], )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new BindingInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Streams BindingInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($options = array(), $limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads BindingInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return BindingInstance[] Array of results */ public function read($options = array(), $limit = null, $pageSize = null) { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Retrieve a single page of BindingInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of BindingInstance */ public function page($options = array(), $pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $options = new Values($options); $params = Values::of(array( 'StartDate' => Serialize::iso8601Date($options['startDate']), 'EndDate' => Serialize::iso8601Date($options['endDate']), 'Identity' => Serialize::map($options['identity'], function($e) { return $e; }), 'Tag' => Serialize::map($options['tag'], function($e) { return $e; }), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new BindingPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of BindingInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of BindingInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new BindingPage($this->version, $response, $this->solution); } /** * Constructs a BindingContext * * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Notify\V1\Service\BindingContext */ public function getContext($sid) { return new BindingContext($this->version, $this->solution['serviceSid'], $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Notify.V1.BindingList]'; } } sdk/src/Twilio/Rest/Notify/V1/Service/NotificationPage.php 0000644 00000001565 15002236443 0017400 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Notify\V1\Service; use Twilio\Page; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class NotificationPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new NotificationInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Notify.V1.NotificationPage]'; } } sdk/src/Twilio/Rest/Notify/V1/Service/NotificationOptions.php 0000644 00000040633 15002236443 0020156 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Notify\V1\Service; 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 string $identity The `identity` value that identifies the new * resource's User * @param string $tag A tag that selects the Bindings to notify * @param string $body The notification body text * @param string $priority The priority of the notification * @param int $ttl How long, in seconds, the notification is valid * @param string $title The notification title * @param string $sound The name of the sound to be played for the notification * @param string $action The actions to display for the notification * @param array $data The custom key-value pairs of the notification's payload * @param array $apn The APNS-specific payload that overrides corresponding * attributes in a generic payload for APNS Bindings * @param array $gcm The GCM-specific payload that overrides corresponding * attributes in generic payload for GCM Bindings * @param array $sms The SMS-specific payload that overrides corresponding * attributes in generic payload for SMS Bindings * @param array $facebookMessenger Deprecated * @param array $fcm The FCM-specific payload that overrides corresponding * attributes in generic payload for FCM Bindings * @param string $segment A Segment to notify * @param array $alexa Deprecated * @param string $toBinding The destination address specified as a JSON string * @param string $deliveryCallbackUrl URL to send webhooks * @return CreateNotificationOptions Options builder */ public static function create($identity = Values::NONE, $tag = Values::NONE, $body = Values::NONE, $priority = Values::NONE, $ttl = Values::NONE, $title = Values::NONE, $sound = Values::NONE, $action = Values::NONE, $data = Values::NONE, $apn = Values::NONE, $gcm = Values::NONE, $sms = Values::NONE, $facebookMessenger = Values::NONE, $fcm = Values::NONE, $segment = Values::NONE, $alexa = Values::NONE, $toBinding = Values::NONE, $deliveryCallbackUrl = Values::NONE) { return new CreateNotificationOptions($identity, $tag, $body, $priority, $ttl, $title, $sound, $action, $data, $apn, $gcm, $sms, $facebookMessenger, $fcm, $segment, $alexa, $toBinding, $deliveryCallbackUrl); } } class CreateNotificationOptions extends Options { /** * @param string $identity The `identity` value that identifies the new * resource's User * @param string $tag A tag that selects the Bindings to notify * @param string $body The notification body text * @param string $priority The priority of the notification * @param int $ttl How long, in seconds, the notification is valid * @param string $title The notification title * @param string $sound The name of the sound to be played for the notification * @param string $action The actions to display for the notification * @param array $data The custom key-value pairs of the notification's payload * @param array $apn The APNS-specific payload that overrides corresponding * attributes in a generic payload for APNS Bindings * @param array $gcm The GCM-specific payload that overrides corresponding * attributes in generic payload for GCM Bindings * @param array $sms The SMS-specific payload that overrides corresponding * attributes in generic payload for SMS Bindings * @param array $facebookMessenger Deprecated * @param array $fcm The FCM-specific payload that overrides corresponding * attributes in generic payload for FCM Bindings * @param string $segment A Segment to notify * @param array $alexa Deprecated * @param string $toBinding The destination address specified as a JSON string * @param string $deliveryCallbackUrl URL to send webhooks */ public function __construct($identity = Values::NONE, $tag = Values::NONE, $body = Values::NONE, $priority = Values::NONE, $ttl = Values::NONE, $title = Values::NONE, $sound = Values::NONE, $action = Values::NONE, $data = Values::NONE, $apn = Values::NONE, $gcm = Values::NONE, $sms = Values::NONE, $facebookMessenger = Values::NONE, $fcm = Values::NONE, $segment = Values::NONE, $alexa = Values::NONE, $toBinding = Values::NONE, $deliveryCallbackUrl = Values::NONE) { $this->options['identity'] = $identity; $this->options['tag'] = $tag; $this->options['body'] = $body; $this->options['priority'] = $priority; $this->options['ttl'] = $ttl; $this->options['title'] = $title; $this->options['sound'] = $sound; $this->options['action'] = $action; $this->options['data'] = $data; $this->options['apn'] = $apn; $this->options['gcm'] = $gcm; $this->options['sms'] = $sms; $this->options['facebookMessenger'] = $facebookMessenger; $this->options['fcm'] = $fcm; $this->options['segment'] = $segment; $this->options['alexa'] = $alexa; $this->options['toBinding'] = $toBinding; $this->options['deliveryCallbackUrl'] = $deliveryCallbackUrl; } /** * The `identity` value that uniquely identifies the new resource's [User](https://www.twilio.com/docs/chat/rest/user-resource) within the [Service](https://www.twilio.com/docs/notify/api/service-resource). Delivery will be attempted only to Bindings with an Identity in this list. No more than 20 items are allowed in this list. * * @param string $identity The `identity` value that identifies the new * resource's User * @return $this Fluent Builder */ public function setIdentity($identity) { $this->options['identity'] = $identity; return $this; } /** * A tag that selects the Bindings to notify. Repeat this parameter to specify more than one tag, up to a total of 5 tags. The implicit tag `all` is available to notify all Bindings in a Service instance. Similarly, the implicit tags `apn`, `fcm`, `gcm`, `sms` and `facebook-messenger` are available to notify all Bindings in a specific channel. * * @param string $tag A tag that selects the Bindings to notify * @return $this Fluent Builder */ public function setTag($tag) { $this->options['tag'] = $tag; return $this; } /** * The notification text. For FCM and GCM, translates to `data.twi_body`. For APNS, translates to `aps.alert.body`. For SMS, translates to `body`. SMS requires either this `body` value, or `media_urls` attribute defined in the `sms` parameter of the notification. * * @param string $body The notification body text * @return $this Fluent Builder */ public function setBody($body) { $this->options['body'] = $body; return $this; } /** * The priority of the notification. Can be: `low` or `high` and the default is `high`. A value of `low` optimizes the client app's battery consumption; however, notifications may be delivered with unspecified delay. For FCM and GCM, `low` priority is the same as `Normal` priority. For APNS `low` priority is the same as `5`. A value of `high` sends the notification immediately, and can wake up a sleeping device. For FCM and GCM, `high` is the same as `High` priority. For APNS, `high` is a priority `10`. SMS does not support this property. * * @param string $priority The priority of the notification * @return $this Fluent Builder */ public function setPriority($priority) { $this->options['priority'] = $priority; return $this; } /** * How long, in seconds, the notification is valid. Can be an integer between 0 and 2,419,200, which is 4 weeks, the default and the maximum supported time to live (TTL). Delivery should be attempted if the device is offline until the TTL elapses. Zero means that the notification delivery is attempted immediately, only once, and is not stored for future delivery. SMS does not support this property. * * @param int $ttl How long, in seconds, the notification is valid * @return $this Fluent Builder */ public function setTtl($ttl) { $this->options['ttl'] = $ttl; return $this; } /** * The notification title. For FCM and GCM, this translates to the `data.twi_title` value. For APNS, this translates to the `aps.alert.title` value. SMS does not support this property. This field is not visible on iOS phones and tablets but appears on Apple Watch and Android devices. * * @param string $title The notification title * @return $this Fluent Builder */ public function setTitle($title) { $this->options['title'] = $title; return $this; } /** * The name of the sound to be played for the notification. For FCM and GCM, this Translates to `data.twi_sound`. For APNS, this translates to `aps.sound`. SMS does not support this property. * * @param string $sound The name of the sound to be played for the notification * @return $this Fluent Builder */ public function setSound($sound) { $this->options['sound'] = $sound; return $this; } /** * The actions to display for the notification. For APNS, translates to the `aps.category` value. For GCM, translates to the `data.twi_action` value. For SMS, this parameter is not supported and is omitted from deliveries to those channels. * * @param string $action The actions to display for the notification * @return $this Fluent Builder */ public function setAction($action) { $this->options['action'] = $action; return $this; } /** * The custom key-value pairs of the notification's payload. For FCM and GCM, this value translates to `data` in the FCM and GCM payloads. FCM and GCM [reserve certain keys](https://firebase.google.com/docs/cloud-messaging/http-server-ref) that cannot be used in those channels. For APNS, attributes of `data` are inserted into the APNS payload as custom properties outside of the `aps` dictionary. In all channels, we reserve keys that start with `twi_` for future use. Custom keys that start with `twi_` are not allowed and are rejected as 400 Bad request with no delivery attempted. For SMS, this parameter is not supported and is omitted from deliveries to those channels. * * @param array $data The custom key-value pairs of the notification's payload * @return $this Fluent Builder */ public function setData($data) { $this->options['data'] = $data; return $this; } /** * The APNS-specific payload that overrides corresponding attributes in the generic payload for APNS Bindings. This property maps to the APNS `Payload` item, therefore the `aps` key must be used to change standard attributes. Adds custom key-value pairs to the root of the dictionary. See the [APNS documentation](https://developer.apple.com/library/content/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/CommunicatingwithAPNs.html) for more details. We reserve keys that start with `twi_` for future use. Custom keys that start with `twi_` are not allowed. * * @param array $apn The APNS-specific payload that overrides corresponding * attributes in a generic payload for APNS Bindings * @return $this Fluent Builder */ public function setApn($apn) { $this->options['apn'] = $apn; return $this; } /** * The GCM-specific payload that overrides corresponding attributes in the generic payload for GCM Bindings. This property maps to the root JSON dictionary. See the [GCM documentation](https://firebase.google.com/docs/cloud-messaging/http-server-ref) for more details. Target parameters `to`, `registration_ids`, and `notification_key` are not allowed. We reserve keys that start with `twi_` for future use. Custom keys that start with `twi_` are not allowed. GCM also [reserves certain keys](https://firebase.google.com/docs/cloud-messaging/http-server-ref). * * @param array $gcm The GCM-specific payload that overrides corresponding * attributes in generic payload for GCM Bindings * @return $this Fluent Builder */ public function setGcm($gcm) { $this->options['gcm'] = $gcm; return $this; } /** * The SMS-specific payload that overrides corresponding attributes in the generic payload for SMS Bindings. Each attribute in this value maps to the corresponding `form` parameter of the Twilio [Message](https://www.twilio.com/docs/sms/send-messages) resource. These parameters of the Message resource are supported in snake case format: `body`, `media_urls`, `status_callback`, and `max_price`. The `status_callback` parameter overrides the corresponding parameter in the messaging service, if configured. The `media_urls` property expects a JSON array. * * @param array $sms The SMS-specific payload that overrides corresponding * attributes in generic payload for SMS Bindings * @return $this Fluent Builder */ public function setSms($sms) { $this->options['sms'] = $sms; return $this; } /** * Deprecated. * * @param array $facebookMessenger Deprecated * @return $this Fluent Builder */ public function setFacebookMessenger($facebookMessenger) { $this->options['facebookMessenger'] = $facebookMessenger; return $this; } /** * The FCM-specific payload that overrides corresponding attributes in the generic payload for FCM Bindings. This property maps to the root JSON dictionary. See the [FCM documentation](https://firebase.google.com/docs/cloud-messaging/http-server-ref#downstream) for more details. Target parameters `to`, `registration_ids`, `condition`, and `notification_key` are not allowed in this parameter. We reserve keys that start with `twi_` for future use. Custom keys that start with `twi_` are not allowed. FCM also [reserves certain keys](https://firebase.google.com/docs/cloud-messaging/http-server-ref), which cannot be used in that channel. * * @param array $fcm The FCM-specific payload that overrides corresponding * attributes in generic payload for FCM Bindings * @return $this Fluent Builder */ public function setFcm($fcm) { $this->options['fcm'] = $fcm; return $this; } /** * The Segment resource is deprecated. Use the `tag` parameter, instead. * * @param string $segment A Segment to notify * @return $this Fluent Builder */ public function setSegment($segment) { $this->options['segment'] = $segment; return $this; } /** * Deprecated. * * @param array $alexa Deprecated * @return $this Fluent Builder */ public function setAlexa($alexa) { $this->options['alexa'] = $alexa; return $this; } /** * The destination address specified as a JSON string. Multiple `to_binding` parameters can be included but the total size of the request entity should not exceed 1MB. This is typically sufficient for 10,000 phone numbers. * * @param string $toBinding The destination address specified as a JSON string * @return $this Fluent Builder */ public function setToBinding($toBinding) { $this->options['toBinding'] = $toBinding; return $this; } /** * URL to send webhooks. * * @param string $deliveryCallbackUrl URL to send webhooks * @return $this Fluent Builder */ public function setDeliveryCallbackUrl($deliveryCallbackUrl) { $this->options['deliveryCallbackUrl'] = $deliveryCallbackUrl; 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.Notify.V1.CreateNotificationOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Notify/V1/ServiceContext.php 0000644 00000013502 15002236443 0015514 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Notify\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Rest\Notify\V1\Service\BindingList; use Twilio\Rest\Notify\V1\Service\NotificationList; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * * @property \Twilio\Rest\Notify\V1\Service\BindingList $bindings * @property \Twilio\Rest\Notify\V1\Service\NotificationList $notifications * @method \Twilio\Rest\Notify\V1\Service\BindingContext bindings(string $sid) */ class ServiceContext extends InstanceContext { protected $_bindings = null; protected $_notifications = null; /** * Initialize the ServiceContext * * @param \Twilio\Version $version Version that contains the resource * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Notify\V1\ServiceContext */ public function __construct(Version $version, $sid) { parent::__construct($version); // Path Solution $this->solution = array('sid' => $sid, ); $this->uri = '/Services/' . \rawurlencode($sid) . ''; } /** * Deletes the ServiceInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Fetch a ServiceInstance * * @return ServiceInstance Fetched ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new ServiceInstance($this->version, $payload, $this->solution['sid']); } /** * Update the ServiceInstance * * @param array|Options $options Optional Arguments * @return ServiceInstance Updated ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { $options = new Values($options); $data = Values::of(array( 'FriendlyName' => $options['friendlyName'], 'ApnCredentialSid' => $options['apnCredentialSid'], 'GcmCredentialSid' => $options['gcmCredentialSid'], 'MessagingServiceSid' => $options['messagingServiceSid'], 'FacebookMessengerPageId' => $options['facebookMessengerPageId'], 'DefaultApnNotificationProtocolVersion' => $options['defaultApnNotificationProtocolVersion'], 'DefaultGcmNotificationProtocolVersion' => $options['defaultGcmNotificationProtocolVersion'], 'FcmCredentialSid' => $options['fcmCredentialSid'], 'DefaultFcmNotificationProtocolVersion' => $options['defaultFcmNotificationProtocolVersion'], 'LogEnabled' => Serialize::booleanToString($options['logEnabled']), 'AlexaSkillId' => $options['alexaSkillId'], 'DefaultAlexaNotificationProtocolVersion' => $options['defaultAlexaNotificationProtocolVersion'], 'DeliveryCallbackUrl' => $options['deliveryCallbackUrl'], 'DeliveryCallbackEnabled' => Serialize::booleanToString($options['deliveryCallbackEnabled']), )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new ServiceInstance($this->version, $payload, $this->solution['sid']); } /** * Access the bindings * * @return \Twilio\Rest\Notify\V1\Service\BindingList */ protected function getBindings() { if (!$this->_bindings) { $this->_bindings = new BindingList($this->version, $this->solution['sid']); } return $this->_bindings; } /** * Access the notifications * * @return \Twilio\Rest\Notify\V1\Service\NotificationList */ protected function getNotifications() { if (!$this->_notifications) { $this->_notifications = new NotificationList($this->version, $this->solution['sid']); } return $this->_notifications; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get($name) { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Notify.V1.ServiceContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Sync.php 0000644 00000005143 15002236443 0011727 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\Rest\Sync\V1; /** * @property \Twilio\Rest\Sync\V1 $v1 * @property \Twilio\Rest\Sync\V1\ServiceList $services * @method \Twilio\Rest\Sync\V1\ServiceContext services(string $sid) */ class Sync extends Domain { protected $_v1 = null; /** * Construct the Sync Domain * * @param \Twilio\Rest\Client $client Twilio\Rest\Client to communicate with * Twilio * @return \Twilio\Rest\Sync Domain for Sync */ public function __construct(Client $client) { parent::__construct($client); $this->baseUrl = 'https://sync.twilio.com'; } /** * @return \Twilio\Rest\Sync\V1 Version v1 of sync */ protected function getV1() { if (!$this->_v1) { $this->_v1 = new V1($this); } return $this->_v1; } /** * Magic getter to lazy load version * * @param string $name Version to return * @return \Twilio\Version The requested version * @throws TwilioException For unknown versions */ public function __get($name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown version ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $method = 'context' . \ucfirst($name); if (\method_exists($this, $method)) { return \call_user_func_array(array($this, $method), $arguments); } throw new TwilioException('Unknown context ' . $name); } /** * @return \Twilio\Rest\Sync\V1\ServiceList */ protected function getServices() { return $this->v1->services; } /** * @param string $sid The SID of the Service resource to fetch * @return \Twilio\Rest\Sync\V1\ServiceContext */ protected function contextServices($sid) { return $this->v1->services($sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Sync]'; } } sdk/src/Twilio/Rest/Voice/V1.php 0000644 00000004416 15002236443 0012350 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Voice; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\Rest\Voice\V1\DialingPermissionsList; use Twilio\Version; /** * @property \Twilio\Rest\Voice\V1\DialingPermissionsList $dialingPermissions */ class V1 extends Version { protected $_dialingPermissions = null; /** * Construct the V1 version of Voice * * @param \Twilio\Domain $domain Domain that contains the version * @return \Twilio\Rest\Voice\V1 V1 version of Voice */ public function __construct(Domain $domain) { parent::__construct($domain); $this->version = 'v1'; } /** * @return \Twilio\Rest\Voice\V1\DialingPermissionsList */ protected function getDialingPermissions() { if (!$this->_dialingPermissions) { $this->_dialingPermissions = new DialingPermissionsList($this); } return $this->_dialingPermissions; } /** * Magic getter to lazy load root resources * * @param string $name Resource to return * @return \Twilio\ListResource The requested resource * @throws TwilioException For unknown resource */ public function __get($name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown resource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Voice.V1]'; } } sdk/src/Twilio/Rest/Voice/V1/DialingPermissionsPage.php 0000644 00000001670 15002236443 0016747 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Voice\V1; use Twilio\Page; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class DialingPermissionsPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new DialingPermissionsInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Voice.V1.DialingPermissionsPage]'; } } sdk/src/Twilio/Rest/Voice/V1/DialingPermissions/CountryPage.php 0000644 00000001652 15002236443 0020412 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Voice\V1\DialingPermissions; use Twilio\Page; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class CountryPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new CountryInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Voice.V1.CountryPage]'; } } sdk/src/Twilio/Rest/Voice/V1/DialingPermissions/SettingsPage.php 0000644 00000001655 15002236443 0020552 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Voice\V1\DialingPermissions; use Twilio\Page; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class SettingsPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new SettingsInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Voice.V1.SettingsPage]'; } } sdk/src/Twilio/Rest/Voice/V1/DialingPermissions/SettingsInstance.php 0000644 00000006554 15002236443 0021445 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Voice\V1\DialingPermissions; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property bool $dialingPermissionsInheritance * @property string $url */ class SettingsInstance extends InstanceResource { /** * Initialize the SettingsInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @return \Twilio\Rest\Voice\V1\DialingPermissions\SettingsInstance */ public function __construct(Version $version, array $payload) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'dialingPermissionsInheritance' => Values::array_get($payload, 'dialing_permissions_inheritance'), 'url' => Values::array_get($payload, 'url'), ); $this->solution = array(); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Voice\V1\DialingPermissions\SettingsContext Context for * this * SettingsInstance */ protected function proxy() { if (!$this->context) { $this->context = new SettingsContext($this->version); } return $this->context; } /** * Fetch a SettingsInstance * * @return SettingsInstance Fetched SettingsInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Update the SettingsInstance * * @param array|Options $options Optional Arguments * @return SettingsInstance Updated SettingsInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Voice.V1.SettingsInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Voice/V1/DialingPermissions/SettingsList.php 0000644 00000002335 15002236443 0020605 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Voice\V1\DialingPermissions; use Twilio\ListResource; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class SettingsList extends ListResource { /** * Construct the SettingsList * * @param Version $version Version that contains the resource * @return \Twilio\Rest\Voice\V1\DialingPermissions\SettingsList */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = array(); } /** * Constructs a SettingsContext * * @return \Twilio\Rest\Voice\V1\DialingPermissions\SettingsContext */ public function getContext() { return new SettingsContext($this->version); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Voice.V1.SettingsList]'; } } sdk/src/Twilio/Rest/Voice/V1/DialingPermissions/CountryList.php 0000644 00000013236 15002236443 0020452 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Voice\V1\DialingPermissions; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class CountryList extends ListResource { /** * Construct the CountryList * * @param Version $version Version that contains the resource * @return \Twilio\Rest\Voice\V1\DialingPermissions\CountryList */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = array(); $this->uri = '/DialingPermissions/Countries'; } /** * Streams CountryInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($options = array(), $limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads CountryInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return CountryInstance[] Array of results */ public function read($options = array(), $limit = null, $pageSize = null) { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Retrieve a single page of CountryInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of CountryInstance */ public function page($options = array(), $pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $options = new Values($options); $params = Values::of(array( 'IsoCode' => $options['isoCode'], 'Continent' => $options['continent'], 'CountryCode' => $options['countryCode'], 'LowRiskNumbersEnabled' => Serialize::booleanToString($options['lowRiskNumbersEnabled']), 'HighRiskSpecialNumbersEnabled' => Serialize::booleanToString($options['highRiskSpecialNumbersEnabled']), 'HighRiskTollfraudNumbersEnabled' => Serialize::booleanToString($options['highRiskTollfraudNumbersEnabled']), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new CountryPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of CountryInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of CountryInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new CountryPage($this->version, $response, $this->solution); } /** * Constructs a CountryContext * * @param string $isoCode The ISO country code * @return \Twilio\Rest\Voice\V1\DialingPermissions\CountryContext */ public function getContext($isoCode) { return new CountryContext($this->version, $isoCode); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Voice.V1.CountryList]'; } } sdk/src/Twilio/Rest/Voice/V1/DialingPermissions/Country/HighriskSpecialPrefixList.php 0000644 00000011644 15002236443 0024702 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Voice\V1\DialingPermissions\Country; use Twilio\ListResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class HighriskSpecialPrefixList extends ListResource { /** * Construct the HighriskSpecialPrefixList * * @param Version $version Version that contains the resource * @param string $isoCode The ISO country code * @return \Twilio\Rest\Voice\V1\DialingPermissions\Country\HighriskSpecialPrefixList */ public function __construct(Version $version, $isoCode) { parent::__construct($version); // Path Solution $this->solution = array('isoCode' => $isoCode, ); $this->uri = '/DialingPermissions/Countries/' . \rawurlencode($isoCode) . '/HighRiskSpecialPrefixes'; } /** * Streams HighriskSpecialPrefixInstance records from the API as a generator * stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads HighriskSpecialPrefixInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return HighriskSpecialPrefixInstance[] Array of results */ public function read($limit = null, $pageSize = null) { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of HighriskSpecialPrefixInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of HighriskSpecialPrefixInstance */ public function page($pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $params = Values::of(array( 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new HighriskSpecialPrefixPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of HighriskSpecialPrefixInstance records from the * API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of HighriskSpecialPrefixInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new HighriskSpecialPrefixPage($this->version, $response, $this->solution); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Voice.V1.HighriskSpecialPrefixList]'; } } sdk/src/Twilio/Rest/Voice/V1/DialingPermissions/Country/HighriskSpecialPrefixInstance.php 0000644 00000003763 15002236443 0025536 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Voice\V1\DialingPermissions\Country; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $prefix */ class HighriskSpecialPrefixInstance extends InstanceResource { /** * Initialize the HighriskSpecialPrefixInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $isoCode The ISO country code * @return \Twilio\Rest\Voice\V1\DialingPermissions\Country\HighriskSpecialPrefixInstance */ public function __construct(Version $version, array $payload, $isoCode) { parent::__construct($version); // Marshaled Properties $this->properties = array('prefix' => Values::array_get($payload, 'prefix'), ); $this->solution = array('isoCode' => $isoCode, ); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Voice.V1.HighriskSpecialPrefixInstance]'; } } sdk/src/Twilio/Rest/Voice/V1/DialingPermissions/Country/HighriskSpecialPrefixPage.php 0000644 00000001770 15002236443 0024642 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Voice\V1\DialingPermissions\Country; use Twilio\Page; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class HighriskSpecialPrefixPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new HighriskSpecialPrefixInstance($this->version, $payload, $this->solution['isoCode']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Voice.V1.HighriskSpecialPrefixPage]'; } } sdk/src/Twilio/Rest/Voice/V1/DialingPermissions/BulkCountryUpdateList.php 0000644 00000003406 15002236443 0022431 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Voice\V1\DialingPermissions; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class BulkCountryUpdateList extends ListResource { /** * Construct the BulkCountryUpdateList * * @param Version $version Version that contains the resource * @return \Twilio\Rest\Voice\V1\DialingPermissions\BulkCountryUpdateList */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = array(); $this->uri = '/DialingPermissions/BulkCountryUpdates'; } /** * Create a new BulkCountryUpdateInstance * * @param string $updateRequest URL encoded JSON array of update objects * @return BulkCountryUpdateInstance Newly created BulkCountryUpdateInstance * @throws TwilioException When an HTTP error occurs. */ public function create($updateRequest) { $data = Values::of(array('UpdateRequest' => $updateRequest, )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new BulkCountryUpdateInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Voice.V1.BulkCountryUpdateList]'; } } sdk/src/Twilio/Rest/Voice/V1/DialingPermissions/SettingsOptions.php 0000644 00000005146 15002236443 0021330 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Voice\V1\DialingPermissions; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ abstract class SettingsOptions { /** * @param bool $dialingPermissionsInheritance `true` for the sub-account to * inherit voice dialing permissions * from the Master Project; * otherwise `false` * @return UpdateSettingsOptions Options builder */ public static function update($dialingPermissionsInheritance = Values::NONE) { return new UpdateSettingsOptions($dialingPermissionsInheritance); } } class UpdateSettingsOptions extends Options { /** * @param bool $dialingPermissionsInheritance `true` for the sub-account to * inherit voice dialing permissions * from the Master Project; * otherwise `false` */ public function __construct($dialingPermissionsInheritance = Values::NONE) { $this->options['dialingPermissionsInheritance'] = $dialingPermissionsInheritance; } /** * `true` for the sub-account to inherit voice dialing permissions from the Master Project; otherwise `false`. * * @param bool $dialingPermissionsInheritance `true` for the sub-account to * inherit voice dialing permissions * from the Master Project; * otherwise `false` * @return $this Fluent Builder */ public function setDialingPermissionsInheritance($dialingPermissionsInheritance) { $this->options['dialingPermissionsInheritance'] = $dialingPermissionsInheritance; 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.Voice.V1.UpdateSettingsOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Voice/V1/DialingPermissions/BulkCountryUpdateInstance.php 0000644 00000004022 15002236443 0023255 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Voice\V1\DialingPermissions; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property int $updateCount * @property string $updateRequest */ class BulkCountryUpdateInstance extends InstanceResource { /** * Initialize the BulkCountryUpdateInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @return \Twilio\Rest\Voice\V1\DialingPermissions\BulkCountryUpdateInstance */ public function __construct(Version $version, array $payload) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'updateCount' => Values::array_get($payload, 'update_count'), 'updateRequest' => Values::array_get($payload, 'update_request'), ); $this->solution = array(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Voice.V1.BulkCountryUpdateInstance]'; } } sdk/src/Twilio/Rest/Voice/V1/DialingPermissions/BulkCountryUpdatePage.php 0000644 00000001710 15002236443 0022366 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Voice\V1\DialingPermissions; use Twilio\Page; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class BulkCountryUpdatePage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new BulkCountryUpdateInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Voice.V1.BulkCountryUpdatePage]'; } } sdk/src/Twilio/Rest/Voice/V1/DialingPermissions/SettingsContext.php 0000644 00000004642 15002236443 0021321 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Voice\V1\DialingPermissions; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class SettingsContext extends InstanceContext { /** * Initialize the SettingsContext * * @param \Twilio\Version $version Version that contains the resource * @return \Twilio\Rest\Voice\V1\DialingPermissions\SettingsContext */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = array(); $this->uri = '/Settings'; } /** * Fetch a SettingsInstance * * @return SettingsInstance Fetched SettingsInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new SettingsInstance($this->version, $payload); } /** * Update the SettingsInstance * * @param array|Options $options Optional Arguments * @return SettingsInstance Updated SettingsInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { $options = new Values($options); $data = Values::of(array( 'DialingPermissionsInheritance' => Serialize::booleanToString($options['dialingPermissionsInheritance']), )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new SettingsInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Voice.V1.SettingsContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Voice/V1/DialingPermissions/CountryOptions.php 0000644 00000016707 15002236443 0021200 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Voice\V1\DialingPermissions; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ abstract class CountryOptions { /** * @param string $isoCode Filter to retrieve the country permissions by * specifying the ISO country code * @param string $continent Filter to retrieve the country permissions by * specifying the continent * @param string $countryCode Country code filter * @param bool $lowRiskNumbersEnabled Filter to retrieve the country * permissions with dialing to low-risk * numbers enabled * @param bool $highRiskSpecialNumbersEnabled Filter to retrieve the country * permissions with dialing to * high-risk special service numbers * enabled * @param bool $highRiskTollfraudNumbersEnabled Filter to retrieve the country * permissions with dialing to * high-risk toll fraud numbers * enabled * @return ReadCountryOptions Options builder */ public static function read($isoCode = Values::NONE, $continent = Values::NONE, $countryCode = Values::NONE, $lowRiskNumbersEnabled = Values::NONE, $highRiskSpecialNumbersEnabled = Values::NONE, $highRiskTollfraudNumbersEnabled = Values::NONE) { return new ReadCountryOptions($isoCode, $continent, $countryCode, $lowRiskNumbersEnabled, $highRiskSpecialNumbersEnabled, $highRiskTollfraudNumbersEnabled); } } class ReadCountryOptions extends Options { /** * @param string $isoCode Filter to retrieve the country permissions by * specifying the ISO country code * @param string $continent Filter to retrieve the country permissions by * specifying the continent * @param string $countryCode Country code filter * @param bool $lowRiskNumbersEnabled Filter to retrieve the country * permissions with dialing to low-risk * numbers enabled * @param bool $highRiskSpecialNumbersEnabled Filter to retrieve the country * permissions with dialing to * high-risk special service numbers * enabled * @param bool $highRiskTollfraudNumbersEnabled Filter to retrieve the country * permissions with dialing to * high-risk toll fraud numbers * enabled */ public function __construct($isoCode = Values::NONE, $continent = Values::NONE, $countryCode = Values::NONE, $lowRiskNumbersEnabled = Values::NONE, $highRiskSpecialNumbersEnabled = Values::NONE, $highRiskTollfraudNumbersEnabled = Values::NONE) { $this->options['isoCode'] = $isoCode; $this->options['continent'] = $continent; $this->options['countryCode'] = $countryCode; $this->options['lowRiskNumbersEnabled'] = $lowRiskNumbersEnabled; $this->options['highRiskSpecialNumbersEnabled'] = $highRiskSpecialNumbersEnabled; $this->options['highRiskTollfraudNumbersEnabled'] = $highRiskTollfraudNumbersEnabled; } /** * Filter to retrieve the country permissions by specifying the [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) * * @param string $isoCode Filter to retrieve the country permissions by * specifying the ISO country code * @return $this Fluent Builder */ public function setIsoCode($isoCode) { $this->options['isoCode'] = $isoCode; return $this; } /** * Filter to retrieve the country permissions by specifying the continent * * @param string $continent Filter to retrieve the country permissions by * specifying the continent * @return $this Fluent Builder */ public function setContinent($continent) { $this->options['continent'] = $continent; return $this; } /** * Filter the results by specified [country codes](https://www.itu.int/itudoc/itu-t/ob-lists/icc/e164_763.html) * * @param string $countryCode Country code filter * @return $this Fluent Builder */ public function setCountryCode($countryCode) { $this->options['countryCode'] = $countryCode; return $this; } /** * Filter to retrieve the country permissions with dialing to low-risk numbers enabled. Can be: `true` or `false`. * * @param bool $lowRiskNumbersEnabled Filter to retrieve the country * permissions with dialing to low-risk * numbers enabled * @return $this Fluent Builder */ public function setLowRiskNumbersEnabled($lowRiskNumbersEnabled) { $this->options['lowRiskNumbersEnabled'] = $lowRiskNumbersEnabled; return $this; } /** * Filter to retrieve the country permissions with dialing to high-risk special service numbers enabled. Can be: `true` or `false` * * @param bool $highRiskSpecialNumbersEnabled Filter to retrieve the country * permissions with dialing to * high-risk special service numbers * enabled * @return $this Fluent Builder */ public function setHighRiskSpecialNumbersEnabled($highRiskSpecialNumbersEnabled) { $this->options['highRiskSpecialNumbersEnabled'] = $highRiskSpecialNumbersEnabled; return $this; } /** * Filter to retrieve the country permissions with dialing to high-risk [toll fraud](https://www.twilio.com/learn/voice-and-video/toll-fraud) numbers enabled. Can be: `true` or `false`. * * @param bool $highRiskTollfraudNumbersEnabled Filter to retrieve the country * permissions with dialing to * high-risk toll fraud numbers * enabled * @return $this Fluent Builder */ public function setHighRiskTollfraudNumbersEnabled($highRiskTollfraudNumbersEnabled) { $this->options['highRiskTollfraudNumbersEnabled'] = $highRiskTollfraudNumbersEnabled; 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.Voice.V1.ReadCountryOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Voice/V1/DialingPermissions/CountryContext.php 0000644 00000007177 15002236443 0021172 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Voice\V1\DialingPermissions; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Rest\Voice\V1\DialingPermissions\Country\HighriskSpecialPrefixList; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property \Twilio\Rest\Voice\V1\DialingPermissions\Country\HighriskSpecialPrefixList $highriskSpecialPrefixes */ class CountryContext extends InstanceContext { protected $_highriskSpecialPrefixes = null; /** * Initialize the CountryContext * * @param \Twilio\Version $version Version that contains the resource * @param string $isoCode The ISO country code * @return \Twilio\Rest\Voice\V1\DialingPermissions\CountryContext */ public function __construct(Version $version, $isoCode) { parent::__construct($version); // Path Solution $this->solution = array('isoCode' => $isoCode, ); $this->uri = '/DialingPermissions/Countries/' . \rawurlencode($isoCode) . ''; } /** * Fetch a CountryInstance * * @return CountryInstance Fetched CountryInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new CountryInstance($this->version, $payload, $this->solution['isoCode']); } /** * Access the highriskSpecialPrefixes * * @return \Twilio\Rest\Voice\V1\DialingPermissions\Country\HighriskSpecialPrefixList */ protected function getHighriskSpecialPrefixes() { if (!$this->_highriskSpecialPrefixes) { $this->_highriskSpecialPrefixes = new HighriskSpecialPrefixList( $this->version, $this->solution['isoCode'] ); } return $this->_highriskSpecialPrefixes; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get($name) { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Voice.V1.CountryContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Voice/V1/DialingPermissions/CountryInstance.php 0000644 00000010346 15002236443 0021302 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Voice\V1\DialingPermissions; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $isoCode * @property string $name * @property string $continent * @property string $countryCodes * @property bool $lowRiskNumbersEnabled * @property bool $highRiskSpecialNumbersEnabled * @property bool $highRiskTollfraudNumbersEnabled * @property string $url * @property array $links */ class CountryInstance extends InstanceResource { protected $_highriskSpecialPrefixes = null; /** * Initialize the CountryInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $isoCode The ISO country code * @return \Twilio\Rest\Voice\V1\DialingPermissions\CountryInstance */ public function __construct(Version $version, array $payload, $isoCode = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'isoCode' => Values::array_get($payload, 'iso_code'), 'name' => Values::array_get($payload, 'name'), 'continent' => Values::array_get($payload, 'continent'), 'countryCodes' => Values::array_get($payload, 'country_codes'), 'lowRiskNumbersEnabled' => Values::array_get($payload, 'low_risk_numbers_enabled'), 'highRiskSpecialNumbersEnabled' => Values::array_get($payload, 'high_risk_special_numbers_enabled'), 'highRiskTollfraudNumbersEnabled' => Values::array_get($payload, 'high_risk_tollfraud_numbers_enabled'), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ); $this->solution = array('isoCode' => $isoCode ?: $this->properties['isoCode'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Voice\V1\DialingPermissions\CountryContext Context for * this * CountryInstance */ protected function proxy() { if (!$this->context) { $this->context = new CountryContext($this->version, $this->solution['isoCode']); } return $this->context; } /** * Fetch a CountryInstance * * @return CountryInstance Fetched CountryInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Access the highriskSpecialPrefixes * * @return \Twilio\Rest\Voice\V1\DialingPermissions\Country\HighriskSpecialPrefixList */ protected function getHighriskSpecialPrefixes() { return $this->proxy()->highriskSpecialPrefixes; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Voice.V1.CountryInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Voice/V1/DialingPermissionsInstance.php 0000644 00000003305 15002236443 0017634 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Voice\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class DialingPermissionsInstance extends InstanceResource { /** * Initialize the DialingPermissionsInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @return \Twilio\Rest\Voice\V1\DialingPermissionsInstance */ public function __construct(Version $version, array $payload) { parent::__construct($version); $this->solution = array(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Voice.V1.DialingPermissionsInstance]'; } } sdk/src/Twilio/Rest/Voice/V1/DialingPermissionsList.php 0000644 00000007052 15002236443 0017006 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Voice\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Rest\Voice\V1\DialingPermissions\BulkCountryUpdateList; use Twilio\Rest\Voice\V1\DialingPermissions\CountryList; use Twilio\Rest\Voice\V1\DialingPermissions\SettingsList; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property \Twilio\Rest\Voice\V1\DialingPermissions\CountryList $countries * @property \Twilio\Rest\Voice\V1\DialingPermissions\SettingsList $settings * @property \Twilio\Rest\Voice\V1\DialingPermissions\BulkCountryUpdateList $bulkCountryUpdates * @method \Twilio\Rest\Voice\V1\DialingPermissions\CountryContext countries(string $isoCode) * @method \Twilio\Rest\Voice\V1\DialingPermissions\SettingsContext settings() */ class DialingPermissionsList extends ListResource { protected $_countries = null; protected $_settings = null; protected $_bulkCountryUpdates = null; /** * Construct the DialingPermissionsList * * @param Version $version Version that contains the resource * @return \Twilio\Rest\Voice\V1\DialingPermissionsList */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = array(); } /** * Access the countries */ protected function getCountries() { if (!$this->_countries) { $this->_countries = new CountryList($this->version); } return $this->_countries; } /** * Access the settings */ protected function getSettings() { if (!$this->_settings) { $this->_settings = new SettingsList($this->version); } return $this->_settings; } /** * Access the bulkCountryUpdates */ protected function getBulkCountryUpdates() { if (!$this->_bulkCountryUpdates) { $this->_bulkCountryUpdates = new BulkCountryUpdateList($this->version); } return $this->_bulkCountryUpdates; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get($name) { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Voice.V1.DialingPermissionsList]'; } } sdk/src/Twilio/Rest/Trunking/V1.php 0000644 00000004357 15002236443 0013110 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Trunking; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\Rest\Trunking\V1\TrunkList; use Twilio\Version; /** * @property \Twilio\Rest\Trunking\V1\TrunkList $trunks * @method \Twilio\Rest\Trunking\V1\TrunkContext trunks(string $sid) */ class V1 extends Version { protected $_trunks = null; /** * Construct the V1 version of Trunking * * @param \Twilio\Domain $domain Domain that contains the version * @return \Twilio\Rest\Trunking\V1 V1 version of Trunking */ public function __construct(Domain $domain) { parent::__construct($domain); $this->version = 'v1'; } /** * @return \Twilio\Rest\Trunking\V1\TrunkList */ protected function getTrunks() { if (!$this->_trunks) { $this->_trunks = new TrunkList($this); } return $this->_trunks; } /** * Magic getter to lazy load root resources * * @param string $name Resource to return * @return \Twilio\ListResource The requested resource * @throws TwilioException For unknown resource */ public function __get($name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown resource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Trunking.V1]'; } } sdk/src/Twilio/Rest/Trunking/V1/TrunkPage.php 0000644 00000001314 15002236443 0014776 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Trunking\V1; use Twilio\Page; class TrunkPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new TrunkInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Trunking.V1.TrunkPage]'; } } sdk/src/Twilio/Rest/Trunking/V1/TrunkContext.php 0000644 00000016403 15002236443 0015553 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Trunking\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Rest\Trunking\V1\Trunk\CredentialListList; use Twilio\Rest\Trunking\V1\Trunk\IpAccessControlListList; use Twilio\Rest\Trunking\V1\Trunk\OriginationUrlList; use Twilio\Rest\Trunking\V1\Trunk\PhoneNumberList; use Twilio\Rest\Trunking\V1\Trunk\TerminatingSipDomainList; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * @property \Twilio\Rest\Trunking\V1\Trunk\OriginationUrlList $originationUrls * @property \Twilio\Rest\Trunking\V1\Trunk\CredentialListList $credentialsLists * @property \Twilio\Rest\Trunking\V1\Trunk\IpAccessControlListList $ipAccessControlLists * @property \Twilio\Rest\Trunking\V1\Trunk\PhoneNumberList $phoneNumbers * @property \Twilio\Rest\Trunking\V1\Trunk\TerminatingSipDomainList $terminatingSipDomains * @method \Twilio\Rest\Trunking\V1\Trunk\OriginationUrlContext originationUrls(string $sid) * @method \Twilio\Rest\Trunking\V1\Trunk\CredentialListContext credentialsLists(string $sid) * @method \Twilio\Rest\Trunking\V1\Trunk\IpAccessControlListContext ipAccessControlLists(string $sid) * @method \Twilio\Rest\Trunking\V1\Trunk\PhoneNumberContext phoneNumbers(string $sid) * @method \Twilio\Rest\Trunking\V1\Trunk\TerminatingSipDomainContext terminatingSipDomains(string $sid) */ class TrunkContext extends InstanceContext { protected $_originationUrls = null; protected $_credentialsLists = null; protected $_ipAccessControlLists = null; protected $_phoneNumbers = null; protected $_terminatingSipDomains = null; /** * Initialize the TrunkContext * * @param \Twilio\Version $version Version that contains the resource * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Trunking\V1\TrunkContext */ public function __construct(Version $version, $sid) { parent::__construct($version); // Path Solution $this->solution = array('sid' => $sid, ); $this->uri = '/Trunks/' . \rawurlencode($sid) . ''; } /** * Fetch a TrunkInstance * * @return TrunkInstance Fetched TrunkInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new TrunkInstance($this->version, $payload, $this->solution['sid']); } /** * Deletes the TrunkInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Update the TrunkInstance * * @param array|Options $options Optional Arguments * @return TrunkInstance Updated TrunkInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { $options = new Values($options); $data = Values::of(array( 'FriendlyName' => $options['friendlyName'], 'DomainName' => $options['domainName'], 'DisasterRecoveryUrl' => $options['disasterRecoveryUrl'], 'DisasterRecoveryMethod' => $options['disasterRecoveryMethod'], 'Recording' => $options['recording'], 'Secure' => Serialize::booleanToString($options['secure']), 'CnamLookupEnabled' => Serialize::booleanToString($options['cnamLookupEnabled']), )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new TrunkInstance($this->version, $payload, $this->solution['sid']); } /** * Access the originationUrls * * @return \Twilio\Rest\Trunking\V1\Trunk\OriginationUrlList */ protected function getOriginationUrls() { if (!$this->_originationUrls) { $this->_originationUrls = new OriginationUrlList($this->version, $this->solution['sid']); } return $this->_originationUrls; } /** * Access the credentialsLists * * @return \Twilio\Rest\Trunking\V1\Trunk\CredentialListList */ protected function getCredentialsLists() { if (!$this->_credentialsLists) { $this->_credentialsLists = new CredentialListList($this->version, $this->solution['sid']); } return $this->_credentialsLists; } /** * Access the ipAccessControlLists * * @return \Twilio\Rest\Trunking\V1\Trunk\IpAccessControlListList */ protected function getIpAccessControlLists() { if (!$this->_ipAccessControlLists) { $this->_ipAccessControlLists = new IpAccessControlListList($this->version, $this->solution['sid']); } return $this->_ipAccessControlLists; } /** * Access the phoneNumbers * * @return \Twilio\Rest\Trunking\V1\Trunk\PhoneNumberList */ protected function getPhoneNumbers() { if (!$this->_phoneNumbers) { $this->_phoneNumbers = new PhoneNumberList($this->version, $this->solution['sid']); } return $this->_phoneNumbers; } /** * Access the terminatingSipDomains * * @return \Twilio\Rest\Trunking\V1\Trunk\TerminatingSipDomainList */ protected function getTerminatingSipDomains() { if (!$this->_terminatingSipDomains) { $this->_terminatingSipDomains = new TerminatingSipDomainList( $this->version, $this->solution['sid'] ); } return $this->_terminatingSipDomains; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get($name) { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Trunking.V1.TrunkContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Trunking/V1/TrunkList.php 0000644 00000013251 15002236443 0015040 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Trunking\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class TrunkList extends ListResource { /** * Construct the TrunkList * * @param Version $version Version that contains the resource * @return \Twilio\Rest\Trunking\V1\TrunkList */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = array(); $this->uri = '/Trunks'; } /** * Create a new TrunkInstance * * @param array|Options $options Optional Arguments * @return TrunkInstance Newly created TrunkInstance * @throws TwilioException When an HTTP error occurs. */ public function create($options = array()) { $options = new Values($options); $data = Values::of(array( 'FriendlyName' => $options['friendlyName'], 'DomainName' => $options['domainName'], 'DisasterRecoveryUrl' => $options['disasterRecoveryUrl'], 'DisasterRecoveryMethod' => $options['disasterRecoveryMethod'], 'Recording' => $options['recording'], 'Secure' => Serialize::booleanToString($options['secure']), 'CnamLookupEnabled' => Serialize::booleanToString($options['cnamLookupEnabled']), )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new TrunkInstance($this->version, $payload); } /** * Streams TrunkInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads TrunkInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return TrunkInstance[] Array of results */ public function read($limit = null, $pageSize = null) { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of TrunkInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of TrunkInstance */ public function page($pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $params = Values::of(array( 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new TrunkPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of TrunkInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of TrunkInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new TrunkPage($this->version, $response, $this->solution); } /** * Constructs a TrunkContext * * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Trunking\V1\TrunkContext */ public function getContext($sid) { return new TrunkContext($this->version, $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Trunking.V1.TrunkList]'; } } sdk/src/Twilio/Rest/Trunking/V1/TrunkOptions.php 0000644 00000036250 15002236443 0015564 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Trunking\V1; use Twilio\Options; use Twilio\Values; abstract class TrunkOptions { /** * @param string $friendlyName A string to describe the resource * @param string $domainName The unique address you reserve on Twilio to which * you route your SIP traffic * @param string $disasterRecoveryUrl The HTTP URL that we should call if an * error occurs while sending SIP traffic * towards your configured Origination URL * @param string $disasterRecoveryMethod The HTTP method we should use to call * the disaster_recovery_url * @param string $recording The recording settings for the trunk * @param bool $secure Whether Secure Trunking is enabled for the trunk * @param bool $cnamLookupEnabled Whether Caller ID Name (CNAM) lookup should * be enabled for the trunk * @return CreateTrunkOptions Options builder */ public static function create($friendlyName = Values::NONE, $domainName = Values::NONE, $disasterRecoveryUrl = Values::NONE, $disasterRecoveryMethod = Values::NONE, $recording = Values::NONE, $secure = Values::NONE, $cnamLookupEnabled = Values::NONE) { return new CreateTrunkOptions($friendlyName, $domainName, $disasterRecoveryUrl, $disasterRecoveryMethod, $recording, $secure, $cnamLookupEnabled); } /** * @param string $friendlyName A string to describe the resource * @param string $domainName The unique address you reserve on Twilio to which * you route your SIP traffic * @param string $disasterRecoveryUrl The HTTP URL that we should call if an * error occurs while sending SIP traffic * towards your configured Origination URL * @param string $disasterRecoveryMethod The HTTP method we should use to call * the disaster_recovery_url * @param string $recording The recording settings for the trunk * @param bool $secure Whether Secure Trunking is enabled for the trunk * @param bool $cnamLookupEnabled Whether Caller ID Name (CNAM) lookup should * be enabled for the trunk * @return UpdateTrunkOptions Options builder */ public static function update($friendlyName = Values::NONE, $domainName = Values::NONE, $disasterRecoveryUrl = Values::NONE, $disasterRecoveryMethod = Values::NONE, $recording = Values::NONE, $secure = Values::NONE, $cnamLookupEnabled = Values::NONE) { return new UpdateTrunkOptions($friendlyName, $domainName, $disasterRecoveryUrl, $disasterRecoveryMethod, $recording, $secure, $cnamLookupEnabled); } } class CreateTrunkOptions extends Options { /** * @param string $friendlyName A string to describe the resource * @param string $domainName The unique address you reserve on Twilio to which * you route your SIP traffic * @param string $disasterRecoveryUrl The HTTP URL that we should call if an * error occurs while sending SIP traffic * towards your configured Origination URL * @param string $disasterRecoveryMethod The HTTP method we should use to call * the disaster_recovery_url * @param string $recording The recording settings for the trunk * @param bool $secure Whether Secure Trunking is enabled for the trunk * @param bool $cnamLookupEnabled Whether Caller ID Name (CNAM) lookup should * be enabled for the trunk */ public function __construct($friendlyName = Values::NONE, $domainName = Values::NONE, $disasterRecoveryUrl = Values::NONE, $disasterRecoveryMethod = Values::NONE, $recording = Values::NONE, $secure = Values::NONE, $cnamLookupEnabled = Values::NONE) { $this->options['friendlyName'] = $friendlyName; $this->options['domainName'] = $domainName; $this->options['disasterRecoveryUrl'] = $disasterRecoveryUrl; $this->options['disasterRecoveryMethod'] = $disasterRecoveryMethod; $this->options['recording'] = $recording; $this->options['secure'] = $secure; $this->options['cnamLookupEnabled'] = $cnamLookupEnabled; } /** * A descriptive string that you create to describe the resource. It can be up to 64 characters long. * * @param string $friendlyName A string to describe the resource * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The unique address you reserve on Twilio to which you route your SIP traffic. Domain names can contain letters, digits, and `-` and must end with `pstn.twilio.com`. See [Termination Settings](https://www.twilio.com/docs/sip-trunking#termination) for more information. * * @param string $domainName The unique address you reserve on Twilio to which * you route your SIP traffic * @return $this Fluent Builder */ public function setDomainName($domainName) { $this->options['domainName'] = $domainName; return $this; } /** * The URL we should call using the `disaster_recovery_method` if an error occurs while sending SIP traffic towards the configured Origination URL. We retrieve TwiML from the URL and execute the instructions like any other normal TwiML call. See [Disaster Recovery](https://www.twilio.com/docs/sip-trunking#disaster-recovery) for more information. * * @param string $disasterRecoveryUrl The HTTP URL that we should call if an * error occurs while sending SIP traffic * towards your configured Origination URL * @return $this Fluent Builder */ public function setDisasterRecoveryUrl($disasterRecoveryUrl) { $this->options['disasterRecoveryUrl'] = $disasterRecoveryUrl; return $this; } /** * The HTTP method we should use to call the `disaster_recovery_url`. Can be: `GET` or `POST`. * * @param string $disasterRecoveryMethod The HTTP method we should use to call * the disaster_recovery_url * @return $this Fluent Builder */ public function setDisasterRecoveryMethod($disasterRecoveryMethod) { $this->options['disasterRecoveryMethod'] = $disasterRecoveryMethod; return $this; } /** * The recording settings for the trunk. Can be: `do-not-record`, `record-from-ringing`, `record-from-answer`. If set to `record-from-ringing` or `record-from-answer`, all calls going through the trunk will be recorded. The only way to change recording parameters is on a sub-resource of a Trunk after it has been created. e.g.`/Trunks/[Trunk_SID]/Recording -XPOST -d'Mode=record-from-answer'`. See [Recording](https://www.twilio.com/docs/sip-trunking#recording) for more information. * * @param string $recording The recording settings for the trunk * @return $this Fluent Builder */ public function setRecording($recording) { $this->options['recording'] = $recording; return $this; } /** * Whether Secure Trunking is enabled for the trunk. If enabled, all calls going through the trunk will be secure using SRTP for media and TLS for signaling. If disabled, then RTP will be used for media. See [Secure Trunking](https://www.twilio.com/docs/sip-trunking#securetrunking) for more information. * * @param bool $secure Whether Secure Trunking is enabled for the trunk * @return $this Fluent Builder */ public function setSecure($secure) { $this->options['secure'] = $secure; return $this; } /** * Whether Caller ID Name (CNAM) lookup should be enabled for the trunk. If enabled, all inbound calls to the SIP Trunk from the United States and Canada automatically perform a CNAM Lookup and display Caller ID data on your phone. See [CNAM Lookups](https://www.twilio.com/docs/sip-trunking#CNAM) for more information. * * @param bool $cnamLookupEnabled Whether Caller ID Name (CNAM) lookup should * be enabled for the trunk * @return $this Fluent Builder */ public function setCnamLookupEnabled($cnamLookupEnabled) { $this->options['cnamLookupEnabled'] = $cnamLookupEnabled; 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.Trunking.V1.CreateTrunkOptions ' . \implode(' ', $options) . ']'; } } class UpdateTrunkOptions extends Options { /** * @param string $friendlyName A string to describe the resource * @param string $domainName The unique address you reserve on Twilio to which * you route your SIP traffic * @param string $disasterRecoveryUrl The HTTP URL that we should call if an * error occurs while sending SIP traffic * towards your configured Origination URL * @param string $disasterRecoveryMethod The HTTP method we should use to call * the disaster_recovery_url * @param string $recording The recording settings for the trunk * @param bool $secure Whether Secure Trunking is enabled for the trunk * @param bool $cnamLookupEnabled Whether Caller ID Name (CNAM) lookup should * be enabled for the trunk */ public function __construct($friendlyName = Values::NONE, $domainName = Values::NONE, $disasterRecoveryUrl = Values::NONE, $disasterRecoveryMethod = Values::NONE, $recording = Values::NONE, $secure = Values::NONE, $cnamLookupEnabled = Values::NONE) { $this->options['friendlyName'] = $friendlyName; $this->options['domainName'] = $domainName; $this->options['disasterRecoveryUrl'] = $disasterRecoveryUrl; $this->options['disasterRecoveryMethod'] = $disasterRecoveryMethod; $this->options['recording'] = $recording; $this->options['secure'] = $secure; $this->options['cnamLookupEnabled'] = $cnamLookupEnabled; } /** * A descriptive string that you create to describe the resource. It can be up to 64 characters long. * * @param string $friendlyName A string to describe the resource * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The unique address you reserve on Twilio to which you route your SIP traffic. Domain names can contain letters, digits, and `-` and must end with `pstn.twilio.com`. See [Termination Settings](https://www.twilio.com/docs/sip-trunking#termination) for more information. * * @param string $domainName The unique address you reserve on Twilio to which * you route your SIP traffic * @return $this Fluent Builder */ public function setDomainName($domainName) { $this->options['domainName'] = $domainName; return $this; } /** * The URL we should call using the `disaster_recovery_method` if an error occurs while sending SIP traffic towards the configured Origination URL. We retrieve TwiML from the URL and execute the instructions like any other normal TwiML call. See [Disaster Recovery](https://www.twilio.com/docs/sip-trunking#disaster-recovery) for more information. * * @param string $disasterRecoveryUrl The HTTP URL that we should call if an * error occurs while sending SIP traffic * towards your configured Origination URL * @return $this Fluent Builder */ public function setDisasterRecoveryUrl($disasterRecoveryUrl) { $this->options['disasterRecoveryUrl'] = $disasterRecoveryUrl; return $this; } /** * The HTTP method we should use to call the `disaster_recovery_url`. Can be: `GET` or `POST`. * * @param string $disasterRecoveryMethod The HTTP method we should use to call * the disaster_recovery_url * @return $this Fluent Builder */ public function setDisasterRecoveryMethod($disasterRecoveryMethod) { $this->options['disasterRecoveryMethod'] = $disasterRecoveryMethod; return $this; } /** * The recording settings for the trunk. Can be: `do-not-record`, `record-from-ringing`, `record-from-answer`. If set to `record-from-ringing` or `record-from-answer`, all calls going through the trunk will be recorded. See [Recording](https://www.twilio.com/docs/sip-trunking#recording) for more information. * * @param string $recording The recording settings for the trunk * @return $this Fluent Builder */ public function setRecording($recording) { $this->options['recording'] = $recording; return $this; } /** * Whether Secure Trunking is enabled for the trunk. If enabled, all calls going through the trunk will be secure using SRTP for media and TLS for signaling. If disabled, then RTP will be used for media. See [Secure Trunking](https://www.twilio.com/docs/sip-trunking#securetrunking) for more information. * * @param bool $secure Whether Secure Trunking is enabled for the trunk * @return $this Fluent Builder */ public function setSecure($secure) { $this->options['secure'] = $secure; return $this; } /** * Whether Caller ID Name (CNAM) lookup should be enabled for the trunk. If enabled, all inbound calls to the SIP Trunk from the United States and Canada automatically perform a CNAM Lookup and display Caller ID data on your phone. See [CNAM Lookups](https://www.twilio.com/docs/sip-trunking#CNAM) for more information. * * @param bool $cnamLookupEnabled Whether Caller ID Name (CNAM) lookup should * be enabled for the trunk * @return $this Fluent Builder */ public function setCnamLookupEnabled($cnamLookupEnabled) { $this->options['cnamLookupEnabled'] = $cnamLookupEnabled; 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.Trunking.V1.UpdateTrunkOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Trunking/V1/Trunk/CredentialListContext.php 0000644 00000004354 15002236443 0020463 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Trunking\V1\Trunk; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; class CredentialListContext extends InstanceContext { /** * Initialize the CredentialListContext * * @param \Twilio\Version $version Version that contains the resource * @param string $trunkSid The SID of the Trunk from which to fetch the * credential list * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Trunking\V1\Trunk\CredentialListContext */ public function __construct(Version $version, $trunkSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array('trunkSid' => $trunkSid, 'sid' => $sid, ); $this->uri = '/Trunks/' . \rawurlencode($trunkSid) . '/CredentialLists/' . \rawurlencode($sid) . ''; } /** * Fetch a CredentialListInstance * * @return CredentialListInstance Fetched CredentialListInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new CredentialListInstance( $this->version, $payload, $this->solution['trunkSid'], $this->solution['sid'] ); } /** * Deletes the CredentialListInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Trunking.V1.CredentialListContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Trunking/V1/Trunk/IpAccessControlListContext.php 0000644 00000004445 15002236443 0021445 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Trunking\V1\Trunk; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; class IpAccessControlListContext extends InstanceContext { /** * Initialize the IpAccessControlListContext * * @param \Twilio\Version $version Version that contains the resource * @param string $trunkSid The SID of the Trunk from which to fetch the IP * Access Control List * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Trunking\V1\Trunk\IpAccessControlListContext */ public function __construct(Version $version, $trunkSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array('trunkSid' => $trunkSid, 'sid' => $sid, ); $this->uri = '/Trunks/' . \rawurlencode($trunkSid) . '/IpAccessControlLists/' . \rawurlencode($sid) . ''; } /** * Fetch a IpAccessControlListInstance * * @return IpAccessControlListInstance Fetched IpAccessControlListInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new IpAccessControlListInstance( $this->version, $payload, $this->solution['trunkSid'], $this->solution['sid'] ); } /** * Deletes the IpAccessControlListInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Trunking.V1.IpAccessControlListContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Trunking/V1/Trunk/CredentialListInstance.php 0000644 00000010005 15002236443 0020571 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Trunking\V1\Trunk; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property string $sid * @property string $trunkSid * @property string $friendlyName * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $url */ class CredentialListInstance extends InstanceResource { /** * Initialize the CredentialListInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $trunkSid The SID of the Trunk the credential list in * associated with * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Trunking\V1\Trunk\CredentialListInstance */ public function __construct(Version $version, array $payload, $trunkSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'accountSid' => Values::array_get($payload, 'account_sid'), 'sid' => Values::array_get($payload, 'sid'), 'trunkSid' => Values::array_get($payload, 'trunk_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), ); $this->solution = array('trunkSid' => $trunkSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Trunking\V1\Trunk\CredentialListContext Context for * this * CredentialListInstance */ protected function proxy() { if (!$this->context) { $this->context = new CredentialListContext( $this->version, $this->solution['trunkSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch a CredentialListInstance * * @return CredentialListInstance Fetched CredentialListInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the CredentialListInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Trunking.V1.CredentialListInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Trunking/V1/Trunk/PhoneNumberPage.php 0000644 00000001401 15002236443 0017215 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Trunking\V1\Trunk; use Twilio\Page; class PhoneNumberPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new PhoneNumberInstance($this->version, $payload, $this->solution['trunkSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Trunking.V1.PhoneNumberPage]'; } } sdk/src/Twilio/Rest/Trunking/V1/Trunk/OriginationUrlList.php 0000644 00000014322 15002236443 0020005 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Trunking\V1\Trunk; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class OriginationUrlList extends ListResource { /** * Construct the OriginationUrlList * * @param Version $version Version that contains the resource * @param string $trunkSid The SID of the Trunk that owns the Origination URL * @return \Twilio\Rest\Trunking\V1\Trunk\OriginationUrlList */ public function __construct(Version $version, $trunkSid) { parent::__construct($version); // Path Solution $this->solution = array('trunkSid' => $trunkSid, ); $this->uri = '/Trunks/' . \rawurlencode($trunkSid) . '/OriginationUrls'; } /** * Create a new OriginationUrlInstance * * @param int $weight The value that determines the relative load the URI * should receive compared to others with the same priority * @param int $priority The relative importance of the URI * @param bool $enabled Whether the URL is enabled * @param string $friendlyName A string to describe the resource * @param string $sipUrl The SIP address you want Twilio to route your * Origination calls to * @return OriginationUrlInstance Newly created OriginationUrlInstance * @throws TwilioException When an HTTP error occurs. */ public function create($weight, $priority, $enabled, $friendlyName, $sipUrl) { $data = Values::of(array( 'Weight' => $weight, 'Priority' => $priority, 'Enabled' => Serialize::booleanToString($enabled), 'FriendlyName' => $friendlyName, 'SipUrl' => $sipUrl, )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new OriginationUrlInstance($this->version, $payload, $this->solution['trunkSid']); } /** * Streams OriginationUrlInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads OriginationUrlInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return OriginationUrlInstance[] Array of results */ public function read($limit = null, $pageSize = null) { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of OriginationUrlInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of OriginationUrlInstance */ public function page($pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $params = Values::of(array( 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new OriginationUrlPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of OriginationUrlInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of OriginationUrlInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new OriginationUrlPage($this->version, $response, $this->solution); } /** * Constructs a OriginationUrlContext * * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Trunking\V1\Trunk\OriginationUrlContext */ public function getContext($sid) { return new OriginationUrlContext($this->version, $this->solution['trunkSid'], $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Trunking.V1.OriginationUrlList]'; } } sdk/src/Twilio/Rest/Trunking/V1/Trunk/OriginationUrlPage.php 0000644 00000001412 15002236443 0017742 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Trunking\V1\Trunk; use Twilio\Page; class OriginationUrlPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new OriginationUrlInstance($this->version, $payload, $this->solution['trunkSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Trunking.V1.OriginationUrlPage]'; } } sdk/src/Twilio/Rest/Trunking/V1/Trunk/IpAccessControlListPage.php 0000644 00000001431 15002236443 0020665 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Trunking\V1\Trunk; use Twilio\Page; class IpAccessControlListPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new IpAccessControlListInstance($this->version, $payload, $this->solution['trunkSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Trunking.V1.IpAccessControlListPage]'; } } sdk/src/Twilio/Rest/Trunking/V1/Trunk/OriginationUrlContext.php 0000644 00000006345 15002236443 0020524 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Trunking\V1\Trunk; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class OriginationUrlContext extends InstanceContext { /** * Initialize the OriginationUrlContext * * @param \Twilio\Version $version Version that contains the resource * @param string $trunkSid The SID of the Trunk from which to fetch the * OriginationUrl * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Trunking\V1\Trunk\OriginationUrlContext */ public function __construct(Version $version, $trunkSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array('trunkSid' => $trunkSid, 'sid' => $sid, ); $this->uri = '/Trunks/' . \rawurlencode($trunkSid) . '/OriginationUrls/' . \rawurlencode($sid) . ''; } /** * Fetch a OriginationUrlInstance * * @return OriginationUrlInstance Fetched OriginationUrlInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new OriginationUrlInstance( $this->version, $payload, $this->solution['trunkSid'], $this->solution['sid'] ); } /** * Deletes the OriginationUrlInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Update the OriginationUrlInstance * * @param array|Options $options Optional Arguments * @return OriginationUrlInstance Updated OriginationUrlInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { $options = new Values($options); $data = Values::of(array( 'Weight' => $options['weight'], 'Priority' => $options['priority'], 'Enabled' => Serialize::booleanToString($options['enabled']), 'FriendlyName' => $options['friendlyName'], 'SipUrl' => $options['sipUrl'], )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new OriginationUrlInstance( $this->version, $payload, $this->solution['trunkSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Trunking.V1.OriginationUrlContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Trunking/V1/Trunk/CredentialListList.php 0000644 00000013321 15002236443 0017744 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Trunking\V1\Trunk; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Values; use Twilio\Version; class CredentialListList extends ListResource { /** * Construct the CredentialListList * * @param Version $version Version that contains the resource * @param string $trunkSid The SID of the Trunk the credential list in * associated with * @return \Twilio\Rest\Trunking\V1\Trunk\CredentialListList */ public function __construct(Version $version, $trunkSid) { parent::__construct($version); // Path Solution $this->solution = array('trunkSid' => $trunkSid, ); $this->uri = '/Trunks/' . \rawurlencode($trunkSid) . '/CredentialLists'; } /** * Create a new CredentialListInstance * * @param string $credentialListSid The SID of the Credential List that you * want to associate with the trunk * @return CredentialListInstance Newly created CredentialListInstance * @throws TwilioException When an HTTP error occurs. */ public function create($credentialListSid) { $data = Values::of(array('CredentialListSid' => $credentialListSid, )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new CredentialListInstance($this->version, $payload, $this->solution['trunkSid']); } /** * Streams CredentialListInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads CredentialListInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return CredentialListInstance[] Array of results */ public function read($limit = null, $pageSize = null) { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of CredentialListInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of CredentialListInstance */ public function page($pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $params = Values::of(array( 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new CredentialListPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of CredentialListInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of CredentialListInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new CredentialListPage($this->version, $response, $this->solution); } /** * Constructs a CredentialListContext * * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Trunking\V1\Trunk\CredentialListContext */ public function getContext($sid) { return new CredentialListContext($this->version, $this->solution['trunkSid'], $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Trunking.V1.CredentialListList]'; } } sdk/src/Twilio/Rest/Trunking/V1/Trunk/PhoneNumberContext.php 0000644 00000004323 15002236443 0017773 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Trunking\V1\Trunk; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; class PhoneNumberContext extends InstanceContext { /** * Initialize the PhoneNumberContext * * @param \Twilio\Version $version Version that contains the resource * @param string $trunkSid The SID of the Trunk from which to fetch the * PhoneNumber resource * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Trunking\V1\Trunk\PhoneNumberContext */ public function __construct(Version $version, $trunkSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array('trunkSid' => $trunkSid, 'sid' => $sid, ); $this->uri = '/Trunks/' . \rawurlencode($trunkSid) . '/PhoneNumbers/' . \rawurlencode($sid) . ''; } /** * Fetch a PhoneNumberInstance * * @return PhoneNumberInstance Fetched PhoneNumberInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new PhoneNumberInstance( $this->version, $payload, $this->solution['trunkSid'], $this->solution['sid'] ); } /** * Deletes the PhoneNumberInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Trunking.V1.PhoneNumberContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Trunking/V1/Trunk/OriginationUrlInstance.php 0000644 00000011277 15002236443 0020644 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Trunking\V1\Trunk; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property string $sid * @property string $trunkSid * @property int $weight * @property bool $enabled * @property string $sipUrl * @property string $friendlyName * @property int $priority * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $url */ class OriginationUrlInstance extends InstanceResource { /** * Initialize the OriginationUrlInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $trunkSid The SID of the Trunk that owns the Origination URL * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Trunking\V1\Trunk\OriginationUrlInstance */ public function __construct(Version $version, array $payload, $trunkSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'accountSid' => Values::array_get($payload, 'account_sid'), 'sid' => Values::array_get($payload, 'sid'), 'trunkSid' => Values::array_get($payload, 'trunk_sid'), 'weight' => Values::array_get($payload, 'weight'), 'enabled' => Values::array_get($payload, 'enabled'), 'sipUrl' => Values::array_get($payload, 'sip_url'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'priority' => Values::array_get($payload, 'priority'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), ); $this->solution = array('trunkSid' => $trunkSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Trunking\V1\Trunk\OriginationUrlContext Context for * this * OriginationUrlInstance */ protected function proxy() { if (!$this->context) { $this->context = new OriginationUrlContext( $this->version, $this->solution['trunkSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch a OriginationUrlInstance * * @return OriginationUrlInstance Fetched OriginationUrlInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the OriginationUrlInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Update the OriginationUrlInstance * * @param array|Options $options Optional Arguments * @return OriginationUrlInstance Updated OriginationUrlInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Trunking.V1.OriginationUrlInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Trunking/V1/Trunk/OriginationUrlOptions.php 0000644 00000010756 15002236443 0020534 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Trunking\V1\Trunk; use Twilio\Options; use Twilio\Values; abstract class OriginationUrlOptions { /** * @param int $weight The value that determines the relative load the URI * should receive compared to others with the same priority * @param int $priority The relative importance of the URI * @param bool $enabled Whether the URL is enabled * @param string $friendlyName A string to describe the resource * @param string $sipUrl The SIP address you want Twilio to route your * Origination calls to * @return UpdateOriginationUrlOptions Options builder */ public static function update($weight = Values::NONE, $priority = Values::NONE, $enabled = Values::NONE, $friendlyName = Values::NONE, $sipUrl = Values::NONE) { return new UpdateOriginationUrlOptions($weight, $priority, $enabled, $friendlyName, $sipUrl); } } class UpdateOriginationUrlOptions extends Options { /** * @param int $weight The value that determines the relative load the URI * should receive compared to others with the same priority * @param int $priority The relative importance of the URI * @param bool $enabled Whether the URL is enabled * @param string $friendlyName A string to describe the resource * @param string $sipUrl The SIP address you want Twilio to route your * Origination calls to */ public function __construct($weight = Values::NONE, $priority = Values::NONE, $enabled = Values::NONE, $friendlyName = Values::NONE, $sipUrl = Values::NONE) { $this->options['weight'] = $weight; $this->options['priority'] = $priority; $this->options['enabled'] = $enabled; $this->options['friendlyName'] = $friendlyName; $this->options['sipUrl'] = $sipUrl; } /** * The value that determines the relative share of the load the URI should receive compared to other URIs with the same priority. Can be an integer from 1 to 65535, inclusive, and the default is 10. URLs with higher values receive more load than those with lower ones with the same priority. * * @param int $weight The value that determines the relative load the URI * should receive compared to others with the same priority * @return $this Fluent Builder */ public function setWeight($weight) { $this->options['weight'] = $weight; return $this; } /** * The relative importance of the URI. Can be an integer from 0 to 65535, inclusive, and the default is 10. The lowest number represents the most important URI. * * @param int $priority The relative importance of the URI * @return $this Fluent Builder */ public function setPriority($priority) { $this->options['priority'] = $priority; return $this; } /** * Whether the URL is enabled. The default is `true`. * * @param bool $enabled Whether the URL is enabled * @return $this Fluent Builder */ public function setEnabled($enabled) { $this->options['enabled'] = $enabled; return $this; } /** * A descriptive string that you create to describe the resource. It can be up to 64 characters long. * * @param string $friendlyName A string to describe the resource * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The SIP address you want Twilio to route your Origination calls to. This must be a `sip:` schema. `sips` is NOT supported. * * @param string $sipUrl The SIP address you want Twilio to route your * Origination calls to * @return $this Fluent Builder */ public function setSipUrl($sipUrl) { $this->options['sipUrl'] = $sipUrl; 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.Trunking.V1.UpdateOriginationUrlOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Trunking/V1/Trunk/TerminatingSipDomainList.php 0000644 00000013466 15002236443 0021135 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Trunking\V1\Trunk; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Values; use Twilio\Version; class TerminatingSipDomainList extends ListResource { /** * Construct the TerminatingSipDomainList * * @param Version $version Version that contains the resource * @param string $trunkSid The SID of the Trunk to which we should route calls * @return \Twilio\Rest\Trunking\V1\Trunk\TerminatingSipDomainList */ public function __construct(Version $version, $trunkSid) { parent::__construct($version); // Path Solution $this->solution = array('trunkSid' => $trunkSid, ); $this->uri = '/Trunks/' . \rawurlencode($trunkSid) . '/TerminatingSipDomains'; } /** * Create a new TerminatingSipDomainInstance * * @param string $sipDomainSid The SID of the SIP Domain to associate with the * trunk * @return TerminatingSipDomainInstance Newly created * TerminatingSipDomainInstance * @throws TwilioException When an HTTP error occurs. */ public function create($sipDomainSid) { $data = Values::of(array('SipDomainSid' => $sipDomainSid, )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new TerminatingSipDomainInstance($this->version, $payload, $this->solution['trunkSid']); } /** * Streams TerminatingSipDomainInstance records from the API as a generator * stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads TerminatingSipDomainInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return TerminatingSipDomainInstance[] Array of results */ public function read($limit = null, $pageSize = null) { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of TerminatingSipDomainInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of TerminatingSipDomainInstance */ public function page($pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $params = Values::of(array( 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new TerminatingSipDomainPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of TerminatingSipDomainInstance records from the * API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of TerminatingSipDomainInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new TerminatingSipDomainPage($this->version, $response, $this->solution); } /** * Constructs a TerminatingSipDomainContext * * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Trunking\V1\Trunk\TerminatingSipDomainContext */ public function getContext($sid) { return new TerminatingSipDomainContext($this->version, $this->solution['trunkSid'], $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Trunking.V1.TerminatingSipDomainList]'; } } sdk/src/Twilio/Rest/Trunking/V1/Trunk/CredentialListPage.php 0000644 00000001412 15002236443 0017703 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Trunking\V1\Trunk; use Twilio\Page; class CredentialListPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new CredentialListInstance($this->version, $payload, $this->solution['trunkSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Trunking.V1.CredentialListPage]'; } } sdk/src/Twilio/Rest/Trunking/V1/Trunk/TerminatingSipDomainInstance.php 0000644 00000012433 15002236443 0021757 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Trunking\V1\Trunk; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property string $apiVersion * @property string $authType * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $domainName * @property string $friendlyName * @property string $sid * @property string $url * @property string $voiceFallbackMethod * @property string $voiceFallbackUrl * @property string $voiceMethod * @property string $voiceStatusCallbackMethod * @property string $voiceStatusCallbackUrl * @property string $voiceUrl * @property bool $sipRegistration * @property string $trunkSid * @property array $links */ class TerminatingSipDomainInstance extends InstanceResource { /** * Initialize the TerminatingSipDomainInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $trunkSid The SID of the Trunk to which we should route calls * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Trunking\V1\Trunk\TerminatingSipDomainInstance */ public function __construct(Version $version, array $payload, $trunkSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'accountSid' => Values::array_get($payload, 'account_sid'), 'apiVersion' => Values::array_get($payload, 'api_version'), 'authType' => Values::array_get($payload, 'auth_type'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'domainName' => Values::array_get($payload, 'domain_name'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'sid' => Values::array_get($payload, 'sid'), 'url' => Values::array_get($payload, 'url'), 'voiceFallbackMethod' => Values::array_get($payload, 'voice_fallback_method'), 'voiceFallbackUrl' => Values::array_get($payload, 'voice_fallback_url'), 'voiceMethod' => Values::array_get($payload, 'voice_method'), 'voiceStatusCallbackMethod' => Values::array_get($payload, 'voice_status_callback_method'), 'voiceStatusCallbackUrl' => Values::array_get($payload, 'voice_status_callback_url'), 'voiceUrl' => Values::array_get($payload, 'voice_url'), 'sipRegistration' => Values::array_get($payload, 'sip_registration'), 'trunkSid' => Values::array_get($payload, 'trunk_sid'), 'links' => Values::array_get($payload, 'links'), ); $this->solution = array('trunkSid' => $trunkSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Trunking\V1\Trunk\TerminatingSipDomainContext Context * for this * TerminatingSipDomainInstance */ protected function proxy() { if (!$this->context) { $this->context = new TerminatingSipDomainContext( $this->version, $this->solution['trunkSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch a TerminatingSipDomainInstance * * @return TerminatingSipDomainInstance Fetched TerminatingSipDomainInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the TerminatingSipDomainInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Trunking.V1.TerminatingSipDomainInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Trunking/V1/Trunk/PhoneNumberInstance.php 0000644 00000014011 15002236443 0020106 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Trunking\V1\Trunk; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property string $addressRequirements * @property string $apiVersion * @property bool $beta * @property array $capabilities * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $friendlyName * @property array $links * @property string $phoneNumber * @property string $sid * @property string $smsApplicationSid * @property string $smsFallbackMethod * @property string $smsFallbackUrl * @property string $smsMethod * @property string $smsUrl * @property string $statusCallback * @property string $statusCallbackMethod * @property string $trunkSid * @property string $url * @property string $voiceApplicationSid * @property bool $voiceCallerIdLookup * @property string $voiceFallbackMethod * @property string $voiceFallbackUrl * @property string $voiceMethod * @property string $voiceUrl */ class PhoneNumberInstance extends InstanceResource { /** * Initialize the PhoneNumberInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $trunkSid The SID of the Trunk that handles calls to the phone * number * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Trunking\V1\Trunk\PhoneNumberInstance */ public function __construct(Version $version, array $payload, $trunkSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'accountSid' => Values::array_get($payload, 'account_sid'), 'addressRequirements' => Values::array_get($payload, 'address_requirements'), 'apiVersion' => Values::array_get($payload, 'api_version'), 'beta' => Values::array_get($payload, 'beta'), 'capabilities' => Values::array_get($payload, 'capabilities'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'links' => Values::array_get($payload, 'links'), 'phoneNumber' => Values::array_get($payload, 'phone_number'), 'sid' => Values::array_get($payload, 'sid'), 'smsApplicationSid' => Values::array_get($payload, 'sms_application_sid'), 'smsFallbackMethod' => Values::array_get($payload, 'sms_fallback_method'), 'smsFallbackUrl' => Values::array_get($payload, 'sms_fallback_url'), 'smsMethod' => Values::array_get($payload, 'sms_method'), 'smsUrl' => Values::array_get($payload, 'sms_url'), 'statusCallback' => Values::array_get($payload, 'status_callback'), 'statusCallbackMethod' => Values::array_get($payload, 'status_callback_method'), 'trunkSid' => Values::array_get($payload, 'trunk_sid'), 'url' => Values::array_get($payload, 'url'), 'voiceApplicationSid' => Values::array_get($payload, 'voice_application_sid'), 'voiceCallerIdLookup' => Values::array_get($payload, 'voice_caller_id_lookup'), 'voiceFallbackMethod' => Values::array_get($payload, 'voice_fallback_method'), 'voiceFallbackUrl' => Values::array_get($payload, 'voice_fallback_url'), 'voiceMethod' => Values::array_get($payload, 'voice_method'), 'voiceUrl' => Values::array_get($payload, 'voice_url'), ); $this->solution = array('trunkSid' => $trunkSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Trunking\V1\Trunk\PhoneNumberContext Context for this * PhoneNumberInstance */ protected function proxy() { if (!$this->context) { $this->context = new PhoneNumberContext( $this->version, $this->solution['trunkSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch a PhoneNumberInstance * * @return PhoneNumberInstance Fetched PhoneNumberInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the PhoneNumberInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Trunking.V1.PhoneNumberInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Trunking/V1/Trunk/IpAccessControlListInstance.php 0000644 00000010040 15002236443 0021551 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Trunking\V1\Trunk; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property string $sid * @property string $trunkSid * @property string $friendlyName * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $url */ class IpAccessControlListInstance extends InstanceResource { /** * Initialize the IpAccessControlListInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $trunkSid The SID of the Trunk the resource is associated with * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Trunking\V1\Trunk\IpAccessControlListInstance */ public function __construct(Version $version, array $payload, $trunkSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'accountSid' => Values::array_get($payload, 'account_sid'), 'sid' => Values::array_get($payload, 'sid'), 'trunkSid' => Values::array_get($payload, 'trunk_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), ); $this->solution = array('trunkSid' => $trunkSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Trunking\V1\Trunk\IpAccessControlListContext Context * for this * IpAccessControlListInstance */ protected function proxy() { if (!$this->context) { $this->context = new IpAccessControlListContext( $this->version, $this->solution['trunkSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch a IpAccessControlListInstance * * @return IpAccessControlListInstance Fetched IpAccessControlListInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the IpAccessControlListInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Trunking.V1.IpAccessControlListInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Trunking/V1/Trunk/IpAccessControlListList.php 0000644 00000013550 15002236443 0020731 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Trunking\V1\Trunk; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Values; use Twilio\Version; class IpAccessControlListList extends ListResource { /** * Construct the IpAccessControlListList * * @param Version $version Version that contains the resource * @param string $trunkSid The SID of the Trunk the resource is associated with * @return \Twilio\Rest\Trunking\V1\Trunk\IpAccessControlListList */ public function __construct(Version $version, $trunkSid) { parent::__construct($version); // Path Solution $this->solution = array('trunkSid' => $trunkSid, ); $this->uri = '/Trunks/' . \rawurlencode($trunkSid) . '/IpAccessControlLists'; } /** * Create a new IpAccessControlListInstance * * @param string $ipAccessControlListSid The SID of the IP Access Control List * that you want to associate with the * trunk * @return IpAccessControlListInstance Newly created IpAccessControlListInstance * @throws TwilioException When an HTTP error occurs. */ public function create($ipAccessControlListSid) { $data = Values::of(array('IpAccessControlListSid' => $ipAccessControlListSid, )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new IpAccessControlListInstance($this->version, $payload, $this->solution['trunkSid']); } /** * Streams IpAccessControlListInstance records from the API as a generator * stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads IpAccessControlListInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return IpAccessControlListInstance[] Array of results */ public function read($limit = null, $pageSize = null) { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of IpAccessControlListInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of IpAccessControlListInstance */ public function page($pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $params = Values::of(array( 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new IpAccessControlListPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of IpAccessControlListInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of IpAccessControlListInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new IpAccessControlListPage($this->version, $response, $this->solution); } /** * Constructs a IpAccessControlListContext * * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Trunking\V1\Trunk\IpAccessControlListContext */ public function getContext($sid) { return new IpAccessControlListContext($this->version, $this->solution['trunkSid'], $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Trunking.V1.IpAccessControlListList]'; } } sdk/src/Twilio/Rest/Trunking/V1/Trunk/TerminatingSipDomainPage.php 0000644 00000001434 15002236443 0021066 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Trunking\V1\Trunk; use Twilio\Page; class TerminatingSipDomainPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new TerminatingSipDomainInstance($this->version, $payload, $this->solution['trunkSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Trunking.V1.TerminatingSipDomainPage]'; } } sdk/src/Twilio/Rest/Trunking/V1/Trunk/PhoneNumberList.php 0000644 00000013211 15002236443 0017256 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Trunking\V1\Trunk; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Values; use Twilio\Version; class PhoneNumberList extends ListResource { /** * Construct the PhoneNumberList * * @param Version $version Version that contains the resource * @param string $trunkSid The SID of the Trunk that handles calls to the phone * number * @return \Twilio\Rest\Trunking\V1\Trunk\PhoneNumberList */ public function __construct(Version $version, $trunkSid) { parent::__construct($version); // Path Solution $this->solution = array('trunkSid' => $trunkSid, ); $this->uri = '/Trunks/' . \rawurlencode($trunkSid) . '/PhoneNumbers'; } /** * Create a new PhoneNumberInstance * * @param string $phoneNumberSid The SID of the Incoming Phone Number that you * want to associate with the trunk * @return PhoneNumberInstance Newly created PhoneNumberInstance * @throws TwilioException When an HTTP error occurs. */ public function create($phoneNumberSid) { $data = Values::of(array('PhoneNumberSid' => $phoneNumberSid, )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new PhoneNumberInstance($this->version, $payload, $this->solution['trunkSid']); } /** * Streams PhoneNumberInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads PhoneNumberInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return PhoneNumberInstance[] Array of results */ public function read($limit = null, $pageSize = null) { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of PhoneNumberInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of PhoneNumberInstance */ public function page($pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $params = Values::of(array( 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new PhoneNumberPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of PhoneNumberInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of PhoneNumberInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new PhoneNumberPage($this->version, $response, $this->solution); } /** * Constructs a PhoneNumberContext * * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Trunking\V1\Trunk\PhoneNumberContext */ public function getContext($sid) { return new PhoneNumberContext($this->version, $this->solution['trunkSid'], $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Trunking.V1.PhoneNumberList]'; } } sdk/src/Twilio/Rest/Trunking/V1/Trunk/TerminatingSipDomainContext.php 0000644 00000004374 15002236443 0021644 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Trunking\V1\Trunk; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; class TerminatingSipDomainContext extends InstanceContext { /** * Initialize the TerminatingSipDomainContext * * @param \Twilio\Version $version Version that contains the resource * @param string $trunkSid The SID of the Trunk with the resource to fetch * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Trunking\V1\Trunk\TerminatingSipDomainContext */ public function __construct(Version $version, $trunkSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array('trunkSid' => $trunkSid, 'sid' => $sid, ); $this->uri = '/Trunks/' . \rawurlencode($trunkSid) . '/TerminatingSipDomains/' . \rawurlencode($sid) . ''; } /** * Fetch a TerminatingSipDomainInstance * * @return TerminatingSipDomainInstance Fetched TerminatingSipDomainInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new TerminatingSipDomainInstance( $this->version, $payload, $this->solution['trunkSid'], $this->solution['sid'] ); } /** * Deletes the TerminatingSipDomainInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Trunking.V1.TerminatingSipDomainContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Trunking/V1/TrunkInstance.php 0000644 00000014054 15002236443 0015673 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Trunking\V1; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property string $domainName * @property string $disasterRecoveryMethod * @property string $disasterRecoveryUrl * @property string $friendlyName * @property bool $secure * @property array $recording * @property bool $cnamLookupEnabled * @property string $authType * @property string $authTypeSet * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $sid * @property string $url * @property array $links */ class TrunkInstance extends InstanceResource { protected $_originationUrls = null; protected $_credentialsLists = null; protected $_ipAccessControlLists = null; protected $_phoneNumbers = null; protected $_terminatingSipDomains = null; /** * Initialize the TrunkInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Trunking\V1\TrunkInstance */ public function __construct(Version $version, array $payload, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'accountSid' => Values::array_get($payload, 'account_sid'), 'domainName' => Values::array_get($payload, 'domain_name'), 'disasterRecoveryMethod' => Values::array_get($payload, 'disaster_recovery_method'), 'disasterRecoveryUrl' => Values::array_get($payload, 'disaster_recovery_url'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'secure' => Values::array_get($payload, 'secure'), 'recording' => Values::array_get($payload, 'recording'), 'cnamLookupEnabled' => Values::array_get($payload, 'cnam_lookup_enabled'), 'authType' => Values::array_get($payload, 'auth_type'), 'authTypeSet' => Values::array_get($payload, 'auth_type_set'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'sid' => Values::array_get($payload, 'sid'), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ); $this->solution = array('sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Trunking\V1\TrunkContext Context for this TrunkInstance */ protected function proxy() { if (!$this->context) { $this->context = new TrunkContext($this->version, $this->solution['sid']); } return $this->context; } /** * Fetch a TrunkInstance * * @return TrunkInstance Fetched TrunkInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the TrunkInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Update the TrunkInstance * * @param array|Options $options Optional Arguments * @return TrunkInstance Updated TrunkInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Access the originationUrls * * @return \Twilio\Rest\Trunking\V1\Trunk\OriginationUrlList */ protected function getOriginationUrls() { return $this->proxy()->originationUrls; } /** * Access the credentialsLists * * @return \Twilio\Rest\Trunking\V1\Trunk\CredentialListList */ protected function getCredentialsLists() { return $this->proxy()->credentialsLists; } /** * Access the ipAccessControlLists * * @return \Twilio\Rest\Trunking\V1\Trunk\IpAccessControlListList */ protected function getIpAccessControlLists() { return $this->proxy()->ipAccessControlLists; } /** * Access the phoneNumbers * * @return \Twilio\Rest\Trunking\V1\Trunk\PhoneNumberList */ protected function getPhoneNumbers() { return $this->proxy()->phoneNumbers; } /** * Access the terminatingSipDomains * * @return \Twilio\Rest\Trunking\V1\Trunk\TerminatingSipDomainList */ protected function getTerminatingSipDomains() { return $this->proxy()->terminatingSipDomains; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Trunking.V1.TrunkInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview.php 0000644 00000035723 15002236443 0012443 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\Rest\Preview\AccSecurity as PreviewAccSecurity; use Twilio\Rest\Preview\BulkExports as PreviewBulkExports; use Twilio\Rest\Preview\DeployedDevices as PreviewDeployedDevices; use Twilio\Rest\Preview\HostedNumbers as PreviewHostedNumbers; use Twilio\Rest\Preview\Marketplace as PreviewMarketplace; use Twilio\Rest\Preview\Sync as PreviewSync; use Twilio\Rest\Preview\TrustedComms as PreviewTrustedComms; use Twilio\Rest\Preview\Understand as PreviewUnderstand; use Twilio\Rest\Preview\Wireless as PreviewWireless; /** * @property \Twilio\Rest\Preview\BulkExports $bulkExports * @property \Twilio\Rest\Preview\DeployedDevices $deployedDevices * @property \Twilio\Rest\Preview\HostedNumbers $hostedNumbers * @property \Twilio\Rest\Preview\Marketplace $marketplace * @property \Twilio\Rest\Preview\AccSecurity $accSecurity * @property \Twilio\Rest\Preview\Sync $sync * @property \Twilio\Rest\Preview\Understand $understand * @property \Twilio\Rest\Preview\Wireless $wireless * @property \Twilio\Rest\Preview\TrustedComms $trustedComms * @property \Twilio\Rest\Preview\BulkExports\ExportList $exports * @property \Twilio\Rest\Preview\BulkExports\ExportConfigurationList $exportConfiguration * @property \Twilio\Rest\Preview\DeployedDevices\FleetList $fleets * @property \Twilio\Rest\Preview\HostedNumbers\AuthorizationDocumentList $authorizationDocuments * @property \Twilio\Rest\Preview\HostedNumbers\HostedNumberOrderList $hostedNumberOrders * @property \Twilio\Rest\Preview\Marketplace\AvailableAddOnList $availableAddOns * @property \Twilio\Rest\Preview\Marketplace\InstalledAddOnList $installedAddOns * @property \Twilio\Rest\Preview\Sync\ServiceList $services * @property \Twilio\Rest\Preview\Understand\AssistantList $assistants * @property \Twilio\Rest\Preview\Wireless\CommandList $commands * @property \Twilio\Rest\Preview\Wireless\RatePlanList $ratePlans * @property \Twilio\Rest\Preview\Wireless\SimList $sims * @property \Twilio\Rest\Preview\TrustedComms\BrandedCallList $brandedCalls * @property \Twilio\Rest\Preview\TrustedComms\BusinessList $businesses * @property \Twilio\Rest\Preview\TrustedComms\CpsList $cps * @property \Twilio\Rest\Preview\TrustedComms\CurrentCallList $currentCalls * @property \Twilio\Rest\Preview\TrustedComms\DeviceList $devices * @property \Twilio\Rest\Preview\TrustedComms\PhoneCallList $phoneCalls * @method \Twilio\Rest\Preview\BulkExports\ExportContext exports(string $resourceType) * @method \Twilio\Rest\Preview\BulkExports\ExportConfigurationContext exportConfiguration(string $resourceType) * @method \Twilio\Rest\Preview\DeployedDevices\FleetContext fleets(string $sid) * @method \Twilio\Rest\Preview\HostedNumbers\AuthorizationDocumentContext authorizationDocuments(string $sid) * @method \Twilio\Rest\Preview\HostedNumbers\HostedNumberOrderContext hostedNumberOrders(string $sid) * @method \Twilio\Rest\Preview\Marketplace\AvailableAddOnContext availableAddOns(string $sid) * @method \Twilio\Rest\Preview\Marketplace\InstalledAddOnContext installedAddOns(string $sid) * @method \Twilio\Rest\Preview\Sync\ServiceContext services(string $sid) * @method \Twilio\Rest\Preview\Understand\AssistantContext assistants(string $sid) * @method \Twilio\Rest\Preview\Wireless\CommandContext commands(string $sid) * @method \Twilio\Rest\Preview\Wireless\RatePlanContext ratePlans(string $sid) * @method \Twilio\Rest\Preview\Wireless\SimContext sims(string $sid) * @method \Twilio\Rest\Preview\TrustedComms\BusinessContext businesses(string $sid) * @method \Twilio\Rest\Preview\TrustedComms\CpsContext cps() * @method \Twilio\Rest\Preview\TrustedComms\CurrentCallContext currentCalls() */ class Preview extends Domain { protected $_bulkExports = null; protected $_deployedDevices = null; protected $_hostedNumbers = null; protected $_marketplace = null; protected $_accSecurity = null; protected $_sync = null; protected $_understand = null; protected $_wireless = null; protected $_trustedComms = null; /** * Construct the Preview Domain * * @param \Twilio\Rest\Client $client Twilio\Rest\Client to communicate with * Twilio * @return \Twilio\Rest\Preview Domain for Preview */ public function __construct(Client $client) { parent::__construct($client); $this->baseUrl = 'https://preview.twilio.com'; } /** * @return \Twilio\Rest\Preview\BulkExports Version bulkExports of preview */ protected function getBulkExports() { if (!$this->_bulkExports) { $this->_bulkExports = new PreviewBulkExports($this); } return $this->_bulkExports; } /** * @return \Twilio\Rest\Preview\DeployedDevices Version deployedDevices of * preview */ protected function getDeployedDevices() { if (!$this->_deployedDevices) { $this->_deployedDevices = new PreviewDeployedDevices($this); } return $this->_deployedDevices; } /** * @return \Twilio\Rest\Preview\HostedNumbers Version hostedNumbers of preview */ protected function getHostedNumbers() { if (!$this->_hostedNumbers) { $this->_hostedNumbers = new PreviewHostedNumbers($this); } return $this->_hostedNumbers; } /** * @return \Twilio\Rest\Preview\Marketplace Version marketplace of preview */ protected function getMarketplace() { if (!$this->_marketplace) { $this->_marketplace = new PreviewMarketplace($this); } return $this->_marketplace; } /** * @return \Twilio\Rest\Preview\AccSecurity Version accSecurity of preview */ protected function getAccSecurity() { if (!$this->_accSecurity) { $this->_accSecurity = new PreviewAccSecurity($this); } return $this->_accSecurity; } /** * @return \Twilio\Rest\Preview\Sync Version sync of preview */ protected function getSync() { if (!$this->_sync) { $this->_sync = new PreviewSync($this); } return $this->_sync; } /** * @return \Twilio\Rest\Preview\Understand Version understand of preview */ protected function getUnderstand() { if (!$this->_understand) { $this->_understand = new PreviewUnderstand($this); } return $this->_understand; } /** * @return \Twilio\Rest\Preview\Wireless Version wireless of preview */ protected function getWireless() { if (!$this->_wireless) { $this->_wireless = new PreviewWireless($this); } return $this->_wireless; } /** * @return \Twilio\Rest\Preview\TrustedComms Version trustedComms of preview */ protected function getTrustedComms() { if (!$this->_trustedComms) { $this->_trustedComms = new PreviewTrustedComms($this); } return $this->_trustedComms; } /** * Magic getter to lazy load version * * @param string $name Version to return * @return \Twilio\Version The requested version * @throws TwilioException For unknown versions */ public function __get($name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown version ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $method = 'context' . \ucfirst($name); if (\method_exists($this, $method)) { return \call_user_func_array(array($this, $method), $arguments); } throw new TwilioException('Unknown context ' . $name); } /** * @return \Twilio\Rest\Preview\BulkExports\ExportList */ protected function getExports() { return $this->bulkExports->exports; } /** * @param string $resourceType The resource_type * @return \Twilio\Rest\Preview\BulkExports\ExportContext */ protected function contextExports($resourceType) { return $this->bulkExports->exports($resourceType); } /** * @return \Twilio\Rest\Preview\BulkExports\ExportConfigurationList */ protected function getExportConfiguration() { return $this->bulkExports->exportConfiguration; } /** * @param string $resourceType The resource_type * @return \Twilio\Rest\Preview\BulkExports\ExportConfigurationContext */ protected function contextExportConfiguration($resourceType) { return $this->bulkExports->exportConfiguration($resourceType); } /** * @return \Twilio\Rest\Preview\DeployedDevices\FleetList */ protected function getFleets() { return $this->deployedDevices->fleets; } /** * @param string $sid A string that uniquely identifies the Fleet. * @return \Twilio\Rest\Preview\DeployedDevices\FleetContext */ protected function contextFleets($sid) { return $this->deployedDevices->fleets($sid); } /** * @return \Twilio\Rest\Preview\HostedNumbers\AuthorizationDocumentList */ protected function getAuthorizationDocuments() { return $this->hostedNumbers->authorizationDocuments; } /** * @param string $sid AuthorizationDocument sid. * @return \Twilio\Rest\Preview\HostedNumbers\AuthorizationDocumentContext */ protected function contextAuthorizationDocuments($sid) { return $this->hostedNumbers->authorizationDocuments($sid); } /** * @return \Twilio\Rest\Preview\HostedNumbers\HostedNumberOrderList */ protected function getHostedNumberOrders() { return $this->hostedNumbers->hostedNumberOrders; } /** * @param string $sid HostedNumberOrder sid. * @return \Twilio\Rest\Preview\HostedNumbers\HostedNumberOrderContext */ protected function contextHostedNumberOrders($sid) { return $this->hostedNumbers->hostedNumberOrders($sid); } /** * @return \Twilio\Rest\Preview\Marketplace\AvailableAddOnList */ protected function getAvailableAddOns() { return $this->marketplace->availableAddOns; } /** * @param string $sid The SID of the AvailableAddOn resource to fetch * @return \Twilio\Rest\Preview\Marketplace\AvailableAddOnContext */ protected function contextAvailableAddOns($sid) { return $this->marketplace->availableAddOns($sid); } /** * @return \Twilio\Rest\Preview\Marketplace\InstalledAddOnList */ protected function getInstalledAddOns() { return $this->marketplace->installedAddOns; } /** * @param string $sid The SID of the InstalledAddOn resource to fetch * @return \Twilio\Rest\Preview\Marketplace\InstalledAddOnContext */ protected function contextInstalledAddOns($sid) { return $this->marketplace->installedAddOns($sid); } /** * @return \Twilio\Rest\Preview\Sync\ServiceList */ protected function getServices() { return $this->sync->services; } /** * @param string $sid The sid * @return \Twilio\Rest\Preview\Sync\ServiceContext */ protected function contextServices($sid) { return $this->sync->services($sid); } /** * @return \Twilio\Rest\Preview\Understand\AssistantList */ protected function getAssistants() { return $this->understand->assistants; } /** * @param string $sid A 34 character string that uniquely identifies this * resource. * @return \Twilio\Rest\Preview\Understand\AssistantContext */ protected function contextAssistants($sid) { return $this->understand->assistants($sid); } /** * @return \Twilio\Rest\Preview\Wireless\CommandList */ protected function getCommands() { return $this->wireless->commands; } /** * @param string $sid The sid * @return \Twilio\Rest\Preview\Wireless\CommandContext */ protected function contextCommands($sid) { return $this->wireless->commands($sid); } /** * @return \Twilio\Rest\Preview\Wireless\RatePlanList */ protected function getRatePlans() { return $this->wireless->ratePlans; } /** * @param string $sid The sid * @return \Twilio\Rest\Preview\Wireless\RatePlanContext */ protected function contextRatePlans($sid) { return $this->wireless->ratePlans($sid); } /** * @return \Twilio\Rest\Preview\Wireless\SimList */ protected function getSims() { return $this->wireless->sims; } /** * @param string $sid The sid * @return \Twilio\Rest\Preview\Wireless\SimContext */ protected function contextSims($sid) { return $this->wireless->sims($sid); } /** * @return \Twilio\Rest\Preview\TrustedComms\BrandedCallList */ protected function getBrandedCalls() { return $this->trustedComms->brandedCalls; } /** * @return \Twilio\Rest\Preview\TrustedComms\BusinessList */ protected function getBusinesses() { return $this->trustedComms->businesses; } /** * @param string $sid A string that uniquely identifies this Business. * @return \Twilio\Rest\Preview\TrustedComms\BusinessContext */ protected function contextBusinesses($sid) { return $this->trustedComms->businesses($sid); } /** * @return \Twilio\Rest\Preview\TrustedComms\CpsList */ protected function getCps() { return $this->trustedComms->cps; } /** * @return \Twilio\Rest\Preview\TrustedComms\CpsContext */ protected function contextCps() { return $this->trustedComms->cps(); } /** * @return \Twilio\Rest\Preview\TrustedComms\CurrentCallList */ protected function getCurrentCalls() { return $this->trustedComms->currentCalls; } /** * @return \Twilio\Rest\Preview\TrustedComms\CurrentCallContext */ protected function contextCurrentCalls() { return $this->trustedComms->currentCalls(); } /** * @return \Twilio\Rest\Preview\TrustedComms\DeviceList */ protected function getDevices() { return $this->trustedComms->devices; } /** * @return \Twilio\Rest\Preview\TrustedComms\PhoneCallList */ protected function getPhoneCalls() { return $this->trustedComms->phoneCalls; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Preview]'; } } sdk/src/Twilio/Rest/FlexApi/V1.php 0000644 00000007107 15002236443 0012633 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\FlexApi; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\Rest\FlexApi\V1\ChannelList; use Twilio\Rest\FlexApi\V1\ConfigurationList; use Twilio\Rest\FlexApi\V1\FlexFlowList; use Twilio\Rest\FlexApi\V1\WebChannelList; use Twilio\Version; /** * @property \Twilio\Rest\FlexApi\V1\ChannelList $channel * @property \Twilio\Rest\FlexApi\V1\ConfigurationList $configuration * @property \Twilio\Rest\FlexApi\V1\FlexFlowList $flexFlow * @property \Twilio\Rest\FlexApi\V1\WebChannelList $webChannel * @method \Twilio\Rest\FlexApi\V1\ChannelContext channel(string $sid) * @method \Twilio\Rest\FlexApi\V1\FlexFlowContext flexFlow(string $sid) * @method \Twilio\Rest\FlexApi\V1\WebChannelContext webChannel(string $sid) */ class V1 extends Version { protected $_channel = null; protected $_configuration = null; protected $_flexFlow = null; protected $_webChannel = null; /** * Construct the V1 version of FlexApi * * @param \Twilio\Domain $domain Domain that contains the version * @return \Twilio\Rest\FlexApi\V1 V1 version of FlexApi */ public function __construct(Domain $domain) { parent::__construct($domain); $this->version = 'v1'; } /** * @return \Twilio\Rest\FlexApi\V1\ChannelList */ protected function getChannel() { if (!$this->_channel) { $this->_channel = new ChannelList($this); } return $this->_channel; } /** * @return \Twilio\Rest\FlexApi\V1\ConfigurationList */ protected function getConfiguration() { if (!$this->_configuration) { $this->_configuration = new ConfigurationList($this); } return $this->_configuration; } /** * @return \Twilio\Rest\FlexApi\V1\FlexFlowList */ protected function getFlexFlow() { if (!$this->_flexFlow) { $this->_flexFlow = new FlexFlowList($this); } return $this->_flexFlow; } /** * @return \Twilio\Rest\FlexApi\V1\WebChannelList */ protected function getWebChannel() { if (!$this->_webChannel) { $this->_webChannel = new WebChannelList($this); } return $this->_webChannel; } /** * Magic getter to lazy load root resources * * @param string $name Resource to return * @return \Twilio\ListResource The requested resource * @throws TwilioException For unknown resource */ public function __get($name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown resource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.FlexApi.V1]'; } } sdk/src/Twilio/Rest/FlexApi/V1/WebChannelList.php 0000644 00000013645 15002236443 0015501 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\FlexApi\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; class WebChannelList extends ListResource { /** * Construct the WebChannelList * * @param Version $version Version that contains the resource * @return \Twilio\Rest\FlexApi\V1\WebChannelList */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = array(); $this->uri = '/WebChannels'; } /** * Streams WebChannelInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads WebChannelInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return WebChannelInstance[] Array of results */ public function read($limit = null, $pageSize = null) { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of WebChannelInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of WebChannelInstance */ public function page($pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $params = Values::of(array( 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new WebChannelPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of WebChannelInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of WebChannelInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new WebChannelPage($this->version, $response, $this->solution); } /** * Create a new WebChannelInstance * * @param string $flexFlowSid The SID of the FlexFlow * @param string $identity The chat identity * @param string $customerFriendlyName The chat participant's friendly name * @param string $chatFriendlyName The chat channel's friendly name * @param array|Options $options Optional Arguments * @return WebChannelInstance Newly created WebChannelInstance * @throws TwilioException When an HTTP error occurs. */ public function create($flexFlowSid, $identity, $customerFriendlyName, $chatFriendlyName, $options = array()) { $options = new Values($options); $data = Values::of(array( 'FlexFlowSid' => $flexFlowSid, 'Identity' => $identity, 'CustomerFriendlyName' => $customerFriendlyName, 'ChatFriendlyName' => $chatFriendlyName, 'ChatUniqueName' => $options['chatUniqueName'], 'PreEngagementData' => $options['preEngagementData'], )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new WebChannelInstance($this->version, $payload); } /** * Constructs a WebChannelContext * * @param string $sid The SID of the WebChannel resource to fetch * @return \Twilio\Rest\FlexApi\V1\WebChannelContext */ public function getContext($sid) { return new WebChannelContext($this->version, $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.FlexApi.V1.WebChannelList]'; } } sdk/src/Twilio/Rest/FlexApi/V1/WebChannelOptions.php 0000644 00000007557 15002236443 0016226 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\FlexApi\V1; use Twilio\Options; use Twilio\Values; abstract class WebChannelOptions { /** * @param string $chatUniqueName The chat channel's unique name * @param string $preEngagementData The pre-engagement data * @return CreateWebChannelOptions Options builder */ public static function create($chatUniqueName = Values::NONE, $preEngagementData = Values::NONE) { return new CreateWebChannelOptions($chatUniqueName, $preEngagementData); } /** * @param string $chatStatus The chat status * @param string $postEngagementData The post-engagement data * @return UpdateWebChannelOptions Options builder */ public static function update($chatStatus = Values::NONE, $postEngagementData = Values::NONE) { return new UpdateWebChannelOptions($chatStatus, $postEngagementData); } } class CreateWebChannelOptions extends Options { /** * @param string $chatUniqueName The chat channel's unique name * @param string $preEngagementData The pre-engagement data */ public function __construct($chatUniqueName = Values::NONE, $preEngagementData = Values::NONE) { $this->options['chatUniqueName'] = $chatUniqueName; $this->options['preEngagementData'] = $preEngagementData; } /** * The chat channel's unique name. * * @param string $chatUniqueName The chat channel's unique name * @return $this Fluent Builder */ public function setChatUniqueName($chatUniqueName) { $this->options['chatUniqueName'] = $chatUniqueName; return $this; } /** * The pre-engagement data. * * @param string $preEngagementData The pre-engagement data * @return $this Fluent Builder */ public function setPreEngagementData($preEngagementData) { $this->options['preEngagementData'] = $preEngagementData; 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.FlexApi.V1.CreateWebChannelOptions ' . \implode(' ', $options) . ']'; } } class UpdateWebChannelOptions extends Options { /** * @param string $chatStatus The chat status * @param string $postEngagementData The post-engagement data */ public function __construct($chatStatus = Values::NONE, $postEngagementData = Values::NONE) { $this->options['chatStatus'] = $chatStatus; $this->options['postEngagementData'] = $postEngagementData; } /** * The chat status. Can only be `inactive`. * * @param string $chatStatus The chat status * @return $this Fluent Builder */ public function setChatStatus($chatStatus) { $this->options['chatStatus'] = $chatStatus; return $this; } /** * The post-engagement data. * * @param string $postEngagementData The post-engagement data * @return $this Fluent Builder */ public function setPostEngagementData($postEngagementData) { $this->options['postEngagementData'] = $postEngagementData; 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.FlexApi.V1.UpdateWebChannelOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/FlexApi/V1/ConfigurationList.php 0000644 00000002004 15002236443 0016265 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\FlexApi\V1; use Twilio\ListResource; use Twilio\Version; class ConfigurationList extends ListResource { /** * Construct the ConfigurationList * * @param Version $version Version that contains the resource * @return \Twilio\Rest\FlexApi\V1\ConfigurationList */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = array(); } /** * Constructs a ConfigurationContext * * @return \Twilio\Rest\FlexApi\V1\ConfigurationContext */ public function getContext() { return new ConfigurationContext($this->version); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.FlexApi.V1.ConfigurationList]'; } } sdk/src/Twilio/Rest/FlexApi/V1/FlexFlowPage.php 0000644 00000001323 15002236443 0015150 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\FlexApi\V1; use Twilio\Page; class FlexFlowPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new FlexFlowInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.FlexApi.V1.FlexFlowPage]'; } } sdk/src/Twilio/Rest/FlexApi/V1/WebChannelContext.php 0000644 00000005177 15002236443 0016213 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\FlexApi\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Values; use Twilio\Version; class WebChannelContext extends InstanceContext { /** * Initialize the WebChannelContext * * @param \Twilio\Version $version Version that contains the resource * @param string $sid The SID of the WebChannel resource to fetch * @return \Twilio\Rest\FlexApi\V1\WebChannelContext */ public function __construct(Version $version, $sid) { parent::__construct($version); // Path Solution $this->solution = array('sid' => $sid, ); $this->uri = '/WebChannels/' . \rawurlencode($sid) . ''; } /** * Fetch a WebChannelInstance * * @return WebChannelInstance Fetched WebChannelInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new WebChannelInstance($this->version, $payload, $this->solution['sid']); } /** * Update the WebChannelInstance * * @param array|Options $options Optional Arguments * @return WebChannelInstance Updated WebChannelInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { $options = new Values($options); $data = Values::of(array( 'ChatStatus' => $options['chatStatus'], 'PostEngagementData' => $options['postEngagementData'], )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new WebChannelInstance($this->version, $payload, $this->solution['sid']); } /** * Deletes the WebChannelInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.FlexApi.V1.WebChannelContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/FlexApi/V1/ChannelInstance.php 0000644 00000007334 15002236443 0015672 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\FlexApi\V1; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property string $flexFlowSid * @property string $sid * @property string $userSid * @property string $taskSid * @property string $url * @property \DateTime $dateCreated * @property \DateTime $dateUpdated */ class ChannelInstance extends InstanceResource { /** * Initialize the ChannelInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The SID that identifies the Flex chat channel resource to * fetch * @return \Twilio\Rest\FlexApi\V1\ChannelInstance */ public function __construct(Version $version, array $payload, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'accountSid' => Values::array_get($payload, 'account_sid'), 'flexFlowSid' => Values::array_get($payload, 'flex_flow_sid'), 'sid' => Values::array_get($payload, 'sid'), 'userSid' => Values::array_get($payload, 'user_sid'), 'taskSid' => Values::array_get($payload, 'task_sid'), 'url' => Values::array_get($payload, 'url'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), ); $this->solution = array('sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\FlexApi\V1\ChannelContext Context for this * ChannelInstance */ protected function proxy() { if (!$this->context) { $this->context = new ChannelContext($this->version, $this->solution['sid']); } return $this->context; } /** * Fetch a ChannelInstance * * @return ChannelInstance Fetched ChannelInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the ChannelInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.FlexApi.V1.ChannelInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/FlexApi/V1/WebChannelInstance.php 0000644 00000007574 15002236443 0016336 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\FlexApi\V1; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property string $flexFlowSid * @property string $sid * @property string $url * @property \DateTime $dateCreated * @property \DateTime $dateUpdated */ class WebChannelInstance extends InstanceResource { /** * Initialize the WebChannelInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The SID of the WebChannel resource to fetch * @return \Twilio\Rest\FlexApi\V1\WebChannelInstance */ public function __construct(Version $version, array $payload, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'accountSid' => Values::array_get($payload, 'account_sid'), 'flexFlowSid' => Values::array_get($payload, 'flex_flow_sid'), 'sid' => Values::array_get($payload, 'sid'), 'url' => Values::array_get($payload, 'url'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), ); $this->solution = array('sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\FlexApi\V1\WebChannelContext Context for this * WebChannelInstance */ protected function proxy() { if (!$this->context) { $this->context = new WebChannelContext($this->version, $this->solution['sid']); } return $this->context; } /** * Fetch a WebChannelInstance * * @return WebChannelInstance Fetched WebChannelInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Update the WebChannelInstance * * @param array|Options $options Optional Arguments * @return WebChannelInstance Updated WebChannelInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Deletes the WebChannelInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.FlexApi.V1.WebChannelInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/FlexApi/V1/ConfigurationInstance.php 0000644 00000016461 15002236443 0017132 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\FlexApi\V1; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property array $attributes * @property string $status * @property string $taskrouterWorkspaceSid * @property string $taskrouterTargetWorkflowSid * @property string $taskrouterTargetTaskqueueSid * @property array $taskrouterTaskqueues * @property array $taskrouterSkills * @property array $taskrouterWorkerChannels * @property array $taskrouterWorkerAttributes * @property string $taskrouterOfflineActivitySid * @property string $runtimeDomain * @property string $messagingServiceInstanceSid * @property string $chatServiceInstanceSid * @property string $uiLanguage * @property array $uiAttributes * @property string $uiVersion * @property string $serviceVersion * @property bool $callRecordingEnabled * @property string $callRecordingWebhookUrl * @property bool $crmEnabled * @property string $crmType * @property string $crmCallbackUrl * @property string $crmFallbackUrl * @property array $crmAttributes * @property array $publicAttributes * @property bool $pluginServiceEnabled * @property array $pluginServiceAttributes * @property array $integrations * @property array $outboundCallFlows * @property string $serverlessServiceSids * @property string $url */ class ConfigurationInstance extends InstanceResource { /** * Initialize the ConfigurationInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @return \Twilio\Rest\FlexApi\V1\ConfigurationInstance */ public function __construct(Version $version, array $payload) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'accountSid' => Values::array_get($payload, 'account_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'attributes' => Values::array_get($payload, 'attributes'), 'status' => Values::array_get($payload, 'status'), 'taskrouterWorkspaceSid' => Values::array_get($payload, 'taskrouter_workspace_sid'), 'taskrouterTargetWorkflowSid' => Values::array_get($payload, 'taskrouter_target_workflow_sid'), 'taskrouterTargetTaskqueueSid' => Values::array_get($payload, 'taskrouter_target_taskqueue_sid'), 'taskrouterTaskqueues' => Values::array_get($payload, 'taskrouter_taskqueues'), 'taskrouterSkills' => Values::array_get($payload, 'taskrouter_skills'), 'taskrouterWorkerChannels' => Values::array_get($payload, 'taskrouter_worker_channels'), 'taskrouterWorkerAttributes' => Values::array_get($payload, 'taskrouter_worker_attributes'), 'taskrouterOfflineActivitySid' => Values::array_get($payload, 'taskrouter_offline_activity_sid'), 'runtimeDomain' => Values::array_get($payload, 'runtime_domain'), 'messagingServiceInstanceSid' => Values::array_get($payload, 'messaging_service_instance_sid'), 'chatServiceInstanceSid' => Values::array_get($payload, 'chat_service_instance_sid'), 'uiLanguage' => Values::array_get($payload, 'ui_language'), 'uiAttributes' => Values::array_get($payload, 'ui_attributes'), 'uiVersion' => Values::array_get($payload, 'ui_version'), 'serviceVersion' => Values::array_get($payload, 'service_version'), 'callRecordingEnabled' => Values::array_get($payload, 'call_recording_enabled'), 'callRecordingWebhookUrl' => Values::array_get($payload, 'call_recording_webhook_url'), 'crmEnabled' => Values::array_get($payload, 'crm_enabled'), 'crmType' => Values::array_get($payload, 'crm_type'), 'crmCallbackUrl' => Values::array_get($payload, 'crm_callback_url'), 'crmFallbackUrl' => Values::array_get($payload, 'crm_fallback_url'), 'crmAttributes' => Values::array_get($payload, 'crm_attributes'), 'publicAttributes' => Values::array_get($payload, 'public_attributes'), 'pluginServiceEnabled' => Values::array_get($payload, 'plugin_service_enabled'), 'pluginServiceAttributes' => Values::array_get($payload, 'plugin_service_attributes'), 'integrations' => Values::array_get($payload, 'integrations'), 'outboundCallFlows' => Values::array_get($payload, 'outbound_call_flows'), 'serverlessServiceSids' => Values::array_get($payload, 'serverless_service_sids'), 'url' => Values::array_get($payload, 'url'), ); $this->solution = array(); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\FlexApi\V1\ConfigurationContext Context for this * ConfigurationInstance */ protected function proxy() { if (!$this->context) { $this->context = new ConfigurationContext($this->version); } return $this->context; } /** * Fetch a ConfigurationInstance * * @param array|Options $options Optional Arguments * @return ConfigurationInstance Fetched ConfigurationInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch($options = array()) { return $this->proxy()->fetch($options); } /** * Create a new ConfigurationInstance * * @return ConfigurationInstance Newly created ConfigurationInstance * @throws TwilioException When an HTTP error occurs. */ public function create() { return $this->proxy()->create(); } /** * Update the ConfigurationInstance * * @return ConfigurationInstance Updated ConfigurationInstance * @throws TwilioException When an HTTP error occurs. */ public function update() { return $this->proxy()->update(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.FlexApi.V1.ConfigurationInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/FlexApi/V1/ConfigurationPage.php 0000644 00000001342 15002236443 0016232 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\FlexApi\V1; use Twilio\Page; class ConfigurationPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new ConfigurationInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.FlexApi.V1.ConfigurationPage]'; } } sdk/src/Twilio/Rest/FlexApi/V1/WebChannelPage.php 0000644 00000001331 15002236443 0015427 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\FlexApi\V1; use Twilio\Page; class WebChannelPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new WebChannelInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.FlexApi.V1.WebChannelPage]'; } } sdk/src/Twilio/Rest/FlexApi/V1/FlexFlowInstance.php 0000644 00000011312 15002236443 0016037 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\FlexApi\V1; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $sid * @property string $friendlyName * @property string $chatServiceSid * @property string $channelType * @property string $contactIdentity * @property bool $enabled * @property string $integrationType * @property array $integration * @property bool $longLived * @property bool $janitorEnabled * @property string $url */ class FlexFlowInstance extends InstanceResource { /** * Initialize the FlexFlowInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The SID that identifies the resource to fetch * @return \Twilio\Rest\FlexApi\V1\FlexFlowInstance */ public function __construct(Version $version, array $payload, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'accountSid' => Values::array_get($payload, 'account_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'sid' => Values::array_get($payload, 'sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'chatServiceSid' => Values::array_get($payload, 'chat_service_sid'), 'channelType' => Values::array_get($payload, 'channel_type'), 'contactIdentity' => Values::array_get($payload, 'contact_identity'), 'enabled' => Values::array_get($payload, 'enabled'), 'integrationType' => Values::array_get($payload, 'integration_type'), 'integration' => Values::array_get($payload, 'integration'), 'longLived' => Values::array_get($payload, 'long_lived'), 'janitorEnabled' => Values::array_get($payload, 'janitor_enabled'), 'url' => Values::array_get($payload, 'url'), ); $this->solution = array('sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\FlexApi\V1\FlexFlowContext Context for this * FlexFlowInstance */ protected function proxy() { if (!$this->context) { $this->context = new FlexFlowContext($this->version, $this->solution['sid']); } return $this->context; } /** * Fetch a FlexFlowInstance * * @return FlexFlowInstance Fetched FlexFlowInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Update the FlexFlowInstance * * @param array|Options $options Optional Arguments * @return FlexFlowInstance Updated FlexFlowInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Deletes the FlexFlowInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.FlexApi.V1.FlexFlowInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/FlexApi/V1/ChannelList.php 0000644 00000014333 15002236443 0015036 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\FlexApi\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class ChannelList extends ListResource { /** * Construct the ChannelList * * @param Version $version Version that contains the resource * @return \Twilio\Rest\FlexApi\V1\ChannelList */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = array(); $this->uri = '/Channels'; } /** * Streams ChannelInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads ChannelInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return ChannelInstance[] Array of results */ public function read($limit = null, $pageSize = null) { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of ChannelInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of ChannelInstance */ public function page($pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $params = Values::of(array( 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new ChannelPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of ChannelInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of ChannelInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new ChannelPage($this->version, $response, $this->solution); } /** * Create a new ChannelInstance * * @param string $flexFlowSid The SID of the FlexFlow * @param string $identity The identity value that identifies the new * resource's chat User * @param string $chatUserFriendlyName The chat participant's friendly name * @param string $chatFriendlyName The chat channel's friendly name * @param array|Options $options Optional Arguments * @return ChannelInstance Newly created ChannelInstance * @throws TwilioException When an HTTP error occurs. */ public function create($flexFlowSid, $identity, $chatUserFriendlyName, $chatFriendlyName, $options = array()) { $options = new Values($options); $data = Values::of(array( 'FlexFlowSid' => $flexFlowSid, 'Identity' => $identity, 'ChatUserFriendlyName' => $chatUserFriendlyName, 'ChatFriendlyName' => $chatFriendlyName, 'Target' => $options['target'], 'ChatUniqueName' => $options['chatUniqueName'], 'PreEngagementData' => $options['preEngagementData'], 'TaskSid' => $options['taskSid'], 'TaskAttributes' => $options['taskAttributes'], 'LongLived' => Serialize::booleanToString($options['longLived']), )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new ChannelInstance($this->version, $payload); } /** * Constructs a ChannelContext * * @param string $sid The SID that identifies the Flex chat channel resource to * fetch * @return \Twilio\Rest\FlexApi\V1\ChannelContext */ public function getContext($sid) { return new ChannelContext($this->version, $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.FlexApi.V1.ChannelList]'; } } sdk/src/Twilio/Rest/FlexApi/V1/ChannelContext.php 0000644 00000003644 15002236443 0015552 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\FlexApi\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; class ChannelContext extends InstanceContext { /** * Initialize the ChannelContext * * @param \Twilio\Version $version Version that contains the resource * @param string $sid The SID that identifies the Flex chat channel resource to * fetch * @return \Twilio\Rest\FlexApi\V1\ChannelContext */ public function __construct(Version $version, $sid) { parent::__construct($version); // Path Solution $this->solution = array('sid' => $sid, ); $this->uri = '/Channels/' . \rawurlencode($sid) . ''; } /** * Fetch a ChannelInstance * * @return ChannelInstance Fetched ChannelInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new ChannelInstance($this->version, $payload, $this->solution['sid']); } /** * Deletes the ChannelInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.FlexApi.V1.ChannelContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/FlexApi/V1/ChannelPage.php 0000644 00000001320 15002236443 0014767 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\FlexApi\V1; use Twilio\Page; class ChannelPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new ChannelInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.FlexApi.V1.ChannelPage]'; } } sdk/src/Twilio/Rest/FlexApi/V1/ChannelOptions.php 0000644 00000010635 15002236443 0015557 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\FlexApi\V1; use Twilio\Options; use Twilio\Values; abstract class ChannelOptions { /** * @param string $target The Target Contact Identity * @param string $chatUniqueName The chat channel's unique name * @param string $preEngagementData The pre-engagement data * @param string $taskSid The SID of the TaskRouter task * @param string $taskAttributes The task attributes to be added for the * TaskRouter Task * @param bool $longLived Whether to create the channel as long-lived * @return CreateChannelOptions Options builder */ public static function create($target = Values::NONE, $chatUniqueName = Values::NONE, $preEngagementData = Values::NONE, $taskSid = Values::NONE, $taskAttributes = Values::NONE, $longLived = Values::NONE) { return new CreateChannelOptions($target, $chatUniqueName, $preEngagementData, $taskSid, $taskAttributes, $longLived); } } class CreateChannelOptions extends Options { /** * @param string $target The Target Contact Identity * @param string $chatUniqueName The chat channel's unique name * @param string $preEngagementData The pre-engagement data * @param string $taskSid The SID of the TaskRouter task * @param string $taskAttributes The task attributes to be added for the * TaskRouter Task * @param bool $longLived Whether to create the channel as long-lived */ public function __construct($target = Values::NONE, $chatUniqueName = Values::NONE, $preEngagementData = Values::NONE, $taskSid = Values::NONE, $taskAttributes = Values::NONE, $longLived = Values::NONE) { $this->options['target'] = $target; $this->options['chatUniqueName'] = $chatUniqueName; $this->options['preEngagementData'] = $preEngagementData; $this->options['taskSid'] = $taskSid; $this->options['taskAttributes'] = $taskAttributes; $this->options['longLived'] = $longLived; } /** * The Target Contact Identity, for example the phone number of an SMS. * * @param string $target The Target Contact Identity * @return $this Fluent Builder */ public function setTarget($target) { $this->options['target'] = $target; return $this; } /** * The chat channel's unique name. * * @param string $chatUniqueName The chat channel's unique name * @return $this Fluent Builder */ public function setChatUniqueName($chatUniqueName) { $this->options['chatUniqueName'] = $chatUniqueName; return $this; } /** * The pre-engagement data. * * @param string $preEngagementData The pre-engagement data * @return $this Fluent Builder */ public function setPreEngagementData($preEngagementData) { $this->options['preEngagementData'] = $preEngagementData; return $this; } /** * The SID of the TaskRouter task. * * @param string $taskSid The SID of the TaskRouter task * @return $this Fluent Builder */ public function setTaskSid($taskSid) { $this->options['taskSid'] = $taskSid; return $this; } /** * The task attributes to be added for the TaskRouter Task. * * @param string $taskAttributes The task attributes to be added for the * TaskRouter Task * @return $this Fluent Builder */ public function setTaskAttributes($taskAttributes) { $this->options['taskAttributes'] = $taskAttributes; return $this; } /** * Whether to create the channel as long-lived. * * @param bool $longLived Whether to create the channel as long-lived * @return $this Fluent Builder */ public function setLongLived($longLived) { $this->options['longLived'] = $longLived; 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.FlexApi.V1.CreateChannelOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/FlexApi/V1/FlexFlowList.php 0000644 00000015761 15002236443 0015222 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\FlexApi\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class FlexFlowList extends ListResource { /** * Construct the FlexFlowList * * @param Version $version Version that contains the resource * @return \Twilio\Rest\FlexApi\V1\FlexFlowList */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = array(); $this->uri = '/FlexFlows'; } /** * Streams FlexFlowInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($options = array(), $limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads FlexFlowInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return FlexFlowInstance[] Array of results */ public function read($options = array(), $limit = null, $pageSize = null) { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Retrieve a single page of FlexFlowInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of FlexFlowInstance */ public function page($options = array(), $pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $options = new Values($options); $params = Values::of(array( 'FriendlyName' => $options['friendlyName'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new FlexFlowPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of FlexFlowInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of FlexFlowInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new FlexFlowPage($this->version, $response, $this->solution); } /** * Create a new FlexFlowInstance * * @param string $friendlyName A string to describe the resource * @param string $chatServiceSid The SID of the chat service * @param string $channelType The channel type * @param array|Options $options Optional Arguments * @return FlexFlowInstance Newly created FlexFlowInstance * @throws TwilioException When an HTTP error occurs. */ public function create($friendlyName, $chatServiceSid, $channelType, $options = array()) { $options = new Values($options); $data = Values::of(array( 'FriendlyName' => $friendlyName, 'ChatServiceSid' => $chatServiceSid, 'ChannelType' => $channelType, 'ContactIdentity' => $options['contactIdentity'], 'Enabled' => Serialize::booleanToString($options['enabled']), 'IntegrationType' => $options['integrationType'], 'Integration.FlowSid' => $options['integrationFlowSid'], 'Integration.Url' => $options['integrationUrl'], 'Integration.WorkspaceSid' => $options['integrationWorkspaceSid'], 'Integration.WorkflowSid' => $options['integrationWorkflowSid'], 'Integration.Channel' => $options['integrationChannel'], 'Integration.Timeout' => $options['integrationTimeout'], 'Integration.Priority' => $options['integrationPriority'], 'Integration.CreationOnMessage' => Serialize::booleanToString($options['integrationCreationOnMessage']), 'LongLived' => Serialize::booleanToString($options['longLived']), 'JanitorEnabled' => Serialize::booleanToString($options['janitorEnabled']), 'Integration.RetryCount' => $options['integrationRetryCount'], )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new FlexFlowInstance($this->version, $payload); } /** * Constructs a FlexFlowContext * * @param string $sid The SID that identifies the resource to fetch * @return \Twilio\Rest\FlexApi\V1\FlexFlowContext */ public function getContext($sid) { return new FlexFlowContext($this->version, $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.FlexApi.V1.FlexFlowList]'; } } sdk/src/Twilio/Rest/FlexApi/V1/ConfigurationContext.php 0000644 00000005147 15002236443 0017011 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\FlexApi\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Values; use Twilio\Version; class ConfigurationContext extends InstanceContext { /** * Initialize the ConfigurationContext * * @param \Twilio\Version $version Version that contains the resource * @return \Twilio\Rest\FlexApi\V1\ConfigurationContext */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = array(); $this->uri = '/Configuration'; } /** * Fetch a ConfigurationInstance * * @param array|Options $options Optional Arguments * @return ConfigurationInstance Fetched ConfigurationInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch($options = array()) { $options = new Values($options); $params = Values::of(array('UiVersion' => $options['uiVersion'], )); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new ConfigurationInstance($this->version, $payload); } /** * Create a new ConfigurationInstance * * @return ConfigurationInstance Newly created ConfigurationInstance * @throws TwilioException When an HTTP error occurs. */ public function create() { $data = Values::of(array()); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new ConfigurationInstance($this->version, $payload); } /** * Update the ConfigurationInstance * * @return ConfigurationInstance Updated ConfigurationInstance * @throws TwilioException When an HTTP error occurs. */ public function update() { $data = Values::of(array()); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new ConfigurationInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.FlexApi.V1.ConfigurationContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/FlexApi/V1/FlexFlowContext.php 0000644 00000007310 15002236443 0015722 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\FlexApi\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class FlexFlowContext extends InstanceContext { /** * Initialize the FlexFlowContext * * @param \Twilio\Version $version Version that contains the resource * @param string $sid The SID that identifies the resource to fetch * @return \Twilio\Rest\FlexApi\V1\FlexFlowContext */ public function __construct(Version $version, $sid) { parent::__construct($version); // Path Solution $this->solution = array('sid' => $sid, ); $this->uri = '/FlexFlows/' . \rawurlencode($sid) . ''; } /** * Fetch a FlexFlowInstance * * @return FlexFlowInstance Fetched FlexFlowInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new FlexFlowInstance($this->version, $payload, $this->solution['sid']); } /** * Update the FlexFlowInstance * * @param array|Options $options Optional Arguments * @return FlexFlowInstance Updated FlexFlowInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { $options = new Values($options); $data = Values::of(array( 'FriendlyName' => $options['friendlyName'], 'ChatServiceSid' => $options['chatServiceSid'], 'ChannelType' => $options['channelType'], 'ContactIdentity' => $options['contactIdentity'], 'Enabled' => Serialize::booleanToString($options['enabled']), 'IntegrationType' => $options['integrationType'], 'Integration.FlowSid' => $options['integrationFlowSid'], 'Integration.Url' => $options['integrationUrl'], 'Integration.WorkspaceSid' => $options['integrationWorkspaceSid'], 'Integration.WorkflowSid' => $options['integrationWorkflowSid'], 'Integration.Channel' => $options['integrationChannel'], 'Integration.Timeout' => $options['integrationTimeout'], 'Integration.Priority' => $options['integrationPriority'], 'Integration.CreationOnMessage' => Serialize::booleanToString($options['integrationCreationOnMessage']), 'LongLived' => Serialize::booleanToString($options['longLived']), 'JanitorEnabled' => Serialize::booleanToString($options['janitorEnabled']), 'Integration.RetryCount' => $options['integrationRetryCount'], )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new FlexFlowInstance($this->version, $payload, $this->solution['sid']); } /** * Deletes the FlexFlowInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.FlexApi.V1.FlexFlowContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/FlexApi/V1/ConfigurationOptions.php 0000644 00000003234 15002236443 0017013 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\FlexApi\V1; use Twilio\Options; use Twilio\Values; abstract class ConfigurationOptions { /** * @param string $uiVersion The Pinned UI version of the Configuration resource * to fetch * @return FetchConfigurationOptions Options builder */ public static function fetch($uiVersion = Values::NONE) { return new FetchConfigurationOptions($uiVersion); } } class FetchConfigurationOptions extends Options { /** * @param string $uiVersion The Pinned UI version of the Configuration resource * to fetch */ public function __construct($uiVersion = Values::NONE) { $this->options['uiVersion'] = $uiVersion; } /** * The Pinned UI version of the Configuration resource to fetch. * * @param string $uiVersion The Pinned UI version of the Configuration resource * to fetch * @return $this Fluent Builder */ public function setUiVersion($uiVersion) { $this->options['uiVersion'] = $uiVersion; 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.FlexApi.V1.FetchConfigurationOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/FlexApi/V1/FlexFlowOptions.php 0000644 00000060315 15002236443 0015735 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\FlexApi\V1; use Twilio\Options; use Twilio\Values; abstract class FlexFlowOptions { /** * @param string $friendlyName The `friendly_name` of the FlexFlow resources to * read * @return ReadFlexFlowOptions Options builder */ public static function read($friendlyName = Values::NONE) { return new ReadFlexFlowOptions($friendlyName); } /** * @param string $contactIdentity The channel contact's Identity * @param bool $enabled Whether the new FlexFlow is enabled * @param string $integrationType The integration type * @param string $integrationFlowSid The SID of the Flow * @param string $integrationUrl The External Webhook URL * @param string $integrationWorkspaceSid The Workspace SID for a new task * @param string $integrationWorkflowSid The Workflow SID for a new task * @param string $integrationChannel The task channel for a new task * @param int $integrationTimeout The task timeout in seconds for a new task * @param int $integrationPriority The task priority of a new task * @param bool $integrationCreationOnMessage Whether to create a task when the * first message arrives * @param bool $longLived Whether new channels are long-lived * @param bool $janitorEnabled Boolean flag for enabling or disabling the * Janitor * @param int $integrationRetryCount The number of times to retry the webhook * if the first attempt fails * @return CreateFlexFlowOptions Options builder */ public static function create($contactIdentity = Values::NONE, $enabled = Values::NONE, $integrationType = Values::NONE, $integrationFlowSid = Values::NONE, $integrationUrl = Values::NONE, $integrationWorkspaceSid = Values::NONE, $integrationWorkflowSid = Values::NONE, $integrationChannel = Values::NONE, $integrationTimeout = Values::NONE, $integrationPriority = Values::NONE, $integrationCreationOnMessage = Values::NONE, $longLived = Values::NONE, $janitorEnabled = Values::NONE, $integrationRetryCount = Values::NONE) { return new CreateFlexFlowOptions($contactIdentity, $enabled, $integrationType, $integrationFlowSid, $integrationUrl, $integrationWorkspaceSid, $integrationWorkflowSid, $integrationChannel, $integrationTimeout, $integrationPriority, $integrationCreationOnMessage, $longLived, $janitorEnabled, $integrationRetryCount); } /** * @param string $friendlyName A string to describe the resource * @param string $chatServiceSid The SID of the chat service * @param string $channelType The channel type * @param string $contactIdentity The channel contact's Identity * @param bool $enabled Whether the FlexFlow is enabled * @param string $integrationType The integration type * @param string $integrationFlowSid The SID of the Flow * @param string $integrationUrl The External Webhook URL * @param string $integrationWorkspaceSid The Workspace SID for a new task * @param string $integrationWorkflowSid The Workflow SID for a new task * @param string $integrationChannel task channel for a new task * @param int $integrationTimeout The task timeout in seconds for a new task * @param int $integrationPriority The task priority of a new task * @param bool $integrationCreationOnMessage Whether to create a task when the * first message arrives * @param bool $longLived Whether new channels created are long-lived * @param bool $janitorEnabled Boolean flag for enabling or disabling the * Janitor * @param int $integrationRetryCount The number of times to retry the webhook * if the first attempt fails * @return UpdateFlexFlowOptions Options builder */ public static function update($friendlyName = Values::NONE, $chatServiceSid = Values::NONE, $channelType = Values::NONE, $contactIdentity = Values::NONE, $enabled = Values::NONE, $integrationType = Values::NONE, $integrationFlowSid = Values::NONE, $integrationUrl = Values::NONE, $integrationWorkspaceSid = Values::NONE, $integrationWorkflowSid = Values::NONE, $integrationChannel = Values::NONE, $integrationTimeout = Values::NONE, $integrationPriority = Values::NONE, $integrationCreationOnMessage = Values::NONE, $longLived = Values::NONE, $janitorEnabled = Values::NONE, $integrationRetryCount = Values::NONE) { return new UpdateFlexFlowOptions($friendlyName, $chatServiceSid, $channelType, $contactIdentity, $enabled, $integrationType, $integrationFlowSid, $integrationUrl, $integrationWorkspaceSid, $integrationWorkflowSid, $integrationChannel, $integrationTimeout, $integrationPriority, $integrationCreationOnMessage, $longLived, $janitorEnabled, $integrationRetryCount); } } class ReadFlexFlowOptions extends Options { /** * @param string $friendlyName The `friendly_name` of the FlexFlow resources to * read */ public function __construct($friendlyName = Values::NONE) { $this->options['friendlyName'] = $friendlyName; } /** * The `friendly_name` of the FlexFlow resources to read. * * @param string $friendlyName The `friendly_name` of the FlexFlow resources to * read * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; 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.FlexApi.V1.ReadFlexFlowOptions ' . \implode(' ', $options) . ']'; } } class CreateFlexFlowOptions extends Options { /** * @param string $contactIdentity The channel contact's Identity * @param bool $enabled Whether the new FlexFlow is enabled * @param string $integrationType The integration type * @param string $integrationFlowSid The SID of the Flow * @param string $integrationUrl The External Webhook URL * @param string $integrationWorkspaceSid The Workspace SID for a new task * @param string $integrationWorkflowSid The Workflow SID for a new task * @param string $integrationChannel The task channel for a new task * @param int $integrationTimeout The task timeout in seconds for a new task * @param int $integrationPriority The task priority of a new task * @param bool $integrationCreationOnMessage Whether to create a task when the * first message arrives * @param bool $longLived Whether new channels are long-lived * @param bool $janitorEnabled Boolean flag for enabling or disabling the * Janitor * @param int $integrationRetryCount The number of times to retry the webhook * if the first attempt fails */ public function __construct($contactIdentity = Values::NONE, $enabled = Values::NONE, $integrationType = Values::NONE, $integrationFlowSid = Values::NONE, $integrationUrl = Values::NONE, $integrationWorkspaceSid = Values::NONE, $integrationWorkflowSid = Values::NONE, $integrationChannel = Values::NONE, $integrationTimeout = Values::NONE, $integrationPriority = Values::NONE, $integrationCreationOnMessage = Values::NONE, $longLived = Values::NONE, $janitorEnabled = Values::NONE, $integrationRetryCount = Values::NONE) { $this->options['contactIdentity'] = $contactIdentity; $this->options['enabled'] = $enabled; $this->options['integrationType'] = $integrationType; $this->options['integrationFlowSid'] = $integrationFlowSid; $this->options['integrationUrl'] = $integrationUrl; $this->options['integrationWorkspaceSid'] = $integrationWorkspaceSid; $this->options['integrationWorkflowSid'] = $integrationWorkflowSid; $this->options['integrationChannel'] = $integrationChannel; $this->options['integrationTimeout'] = $integrationTimeout; $this->options['integrationPriority'] = $integrationPriority; $this->options['integrationCreationOnMessage'] = $integrationCreationOnMessage; $this->options['longLived'] = $longLived; $this->options['janitorEnabled'] = $janitorEnabled; $this->options['integrationRetryCount'] = $integrationRetryCount; } /** * The channel contact's Identity. * * @param string $contactIdentity The channel contact's Identity * @return $this Fluent Builder */ public function setContactIdentity($contactIdentity) { $this->options['contactIdentity'] = $contactIdentity; return $this; } /** * Whether the new FlexFlow is enabled. * * @param bool $enabled Whether the new FlexFlow is enabled * @return $this Fluent Builder */ public function setEnabled($enabled) { $this->options['enabled'] = $enabled; return $this; } /** * The integration type. Can be: `studio`, `external`, or `task`. * * @param string $integrationType The integration type * @return $this Fluent Builder */ public function setIntegrationType($integrationType) { $this->options['integrationType'] = $integrationType; return $this; } /** * The SID of the Flow when `integration_type` is `studio`. * * @param string $integrationFlowSid The SID of the Flow * @return $this Fluent Builder */ public function setIntegrationFlowSid($integrationFlowSid) { $this->options['integrationFlowSid'] = $integrationFlowSid; return $this; } /** * The External Webhook URL when `integration_type` is `external`. * * @param string $integrationUrl The External Webhook URL * @return $this Fluent Builder */ public function setIntegrationUrl($integrationUrl) { $this->options['integrationUrl'] = $integrationUrl; return $this; } /** * The Workspace SID for a new task for Task `integration_type`. * * @param string $integrationWorkspaceSid The Workspace SID for a new task * @return $this Fluent Builder */ public function setIntegrationWorkspaceSid($integrationWorkspaceSid) { $this->options['integrationWorkspaceSid'] = $integrationWorkspaceSid; return $this; } /** * The Workflow SID for a new task when `integration_type` is `task`. * * @param string $integrationWorkflowSid The Workflow SID for a new task * @return $this Fluent Builder */ public function setIntegrationWorkflowSid($integrationWorkflowSid) { $this->options['integrationWorkflowSid'] = $integrationWorkflowSid; return $this; } /** * The task channel for a new task when `integration_type` is `task`. The default is `default`. * * @param string $integrationChannel The task channel for a new task * @return $this Fluent Builder */ public function setIntegrationChannel($integrationChannel) { $this->options['integrationChannel'] = $integrationChannel; return $this; } /** * The task timeout in seconds for a new task when `integration_type` is `task`. The default is `86,400` seconds (24 hours). * * @param int $integrationTimeout The task timeout in seconds for a new task * @return $this Fluent Builder */ public function setIntegrationTimeout($integrationTimeout) { $this->options['integrationTimeout'] = $integrationTimeout; return $this; } /** * The task priority of a new task when `integration_type` is `task`. The default priority is `0`. * * @param int $integrationPriority The task priority of a new task * @return $this Fluent Builder */ public function setIntegrationPriority($integrationPriority) { $this->options['integrationPriority'] = $integrationPriority; return $this; } /** * Whether to create a task when the first message arrives when `integration_type` is `task`. If `false`, the task is created with the channel. * * @param bool $integrationCreationOnMessage Whether to create a task when the * first message arrives * @return $this Fluent Builder */ public function setIntegrationCreationOnMessage($integrationCreationOnMessage) { $this->options['integrationCreationOnMessage'] = $integrationCreationOnMessage; return $this; } /** * Whether new channels are long-lived. * * @param bool $longLived Whether new channels are long-lived * @return $this Fluent Builder */ public function setLongLived($longLived) { $this->options['longLived'] = $longLived; return $this; } /** * Boolean flag for enabling or disabling the Janitor * * @param bool $janitorEnabled Boolean flag for enabling or disabling the * Janitor * @return $this Fluent Builder */ public function setJanitorEnabled($janitorEnabled) { $this->options['janitorEnabled'] = $janitorEnabled; return $this; } /** * The number of times to retry the webhook if the first attempt fails. Can be an integer between 0 and 3, inclusive, and the default is 0. * * @param int $integrationRetryCount The number of times to retry the webhook * if the first attempt fails * @return $this Fluent Builder */ public function setIntegrationRetryCount($integrationRetryCount) { $this->options['integrationRetryCount'] = $integrationRetryCount; 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.FlexApi.V1.CreateFlexFlowOptions ' . \implode(' ', $options) . ']'; } } class UpdateFlexFlowOptions extends Options { /** * @param string $friendlyName A string to describe the resource * @param string $chatServiceSid The SID of the chat service * @param string $channelType The channel type * @param string $contactIdentity The channel contact's Identity * @param bool $enabled Whether the FlexFlow is enabled * @param string $integrationType The integration type * @param string $integrationFlowSid The SID of the Flow * @param string $integrationUrl The External Webhook URL * @param string $integrationWorkspaceSid The Workspace SID for a new task * @param string $integrationWorkflowSid The Workflow SID for a new task * @param string $integrationChannel task channel for a new task * @param int $integrationTimeout The task timeout in seconds for a new task * @param int $integrationPriority The task priority of a new task * @param bool $integrationCreationOnMessage Whether to create a task when the * first message arrives * @param bool $longLived Whether new channels created are long-lived * @param bool $janitorEnabled Boolean flag for enabling or disabling the * Janitor * @param int $integrationRetryCount The number of times to retry the webhook * if the first attempt fails */ public function __construct($friendlyName = Values::NONE, $chatServiceSid = Values::NONE, $channelType = Values::NONE, $contactIdentity = Values::NONE, $enabled = Values::NONE, $integrationType = Values::NONE, $integrationFlowSid = Values::NONE, $integrationUrl = Values::NONE, $integrationWorkspaceSid = Values::NONE, $integrationWorkflowSid = Values::NONE, $integrationChannel = Values::NONE, $integrationTimeout = Values::NONE, $integrationPriority = Values::NONE, $integrationCreationOnMessage = Values::NONE, $longLived = Values::NONE, $janitorEnabled = Values::NONE, $integrationRetryCount = Values::NONE) { $this->options['friendlyName'] = $friendlyName; $this->options['chatServiceSid'] = $chatServiceSid; $this->options['channelType'] = $channelType; $this->options['contactIdentity'] = $contactIdentity; $this->options['enabled'] = $enabled; $this->options['integrationType'] = $integrationType; $this->options['integrationFlowSid'] = $integrationFlowSid; $this->options['integrationUrl'] = $integrationUrl; $this->options['integrationWorkspaceSid'] = $integrationWorkspaceSid; $this->options['integrationWorkflowSid'] = $integrationWorkflowSid; $this->options['integrationChannel'] = $integrationChannel; $this->options['integrationTimeout'] = $integrationTimeout; $this->options['integrationPriority'] = $integrationPriority; $this->options['integrationCreationOnMessage'] = $integrationCreationOnMessage; $this->options['longLived'] = $longLived; $this->options['janitorEnabled'] = $janitorEnabled; $this->options['integrationRetryCount'] = $integrationRetryCount; } /** * A descriptive string that you create to describe the FlexFlow resource. * * @param string $friendlyName A string to describe the resource * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The SID of the chat service. * * @param string $chatServiceSid The SID of the chat service * @return $this Fluent Builder */ public function setChatServiceSid($chatServiceSid) { $this->options['chatServiceSid'] = $chatServiceSid; return $this; } /** * The channel type. Can be: `web`, `facebook`, `sms`, `whatsapp`, `line` or `custom`. * * @param string $channelType The channel type * @return $this Fluent Builder */ public function setChannelType($channelType) { $this->options['channelType'] = $channelType; return $this; } /** * The channel contact's Identity. * * @param string $contactIdentity The channel contact's Identity * @return $this Fluent Builder */ public function setContactIdentity($contactIdentity) { $this->options['contactIdentity'] = $contactIdentity; return $this; } /** * Whether the FlexFlow is enabled. * * @param bool $enabled Whether the FlexFlow is enabled * @return $this Fluent Builder */ public function setEnabled($enabled) { $this->options['enabled'] = $enabled; return $this; } /** * The integration type. Can be: `studio`, `external`, or `task`. * * @param string $integrationType The integration type * @return $this Fluent Builder */ public function setIntegrationType($integrationType) { $this->options['integrationType'] = $integrationType; return $this; } /** * The SID of the Flow when `integration_type` is `studio`. * * @param string $integrationFlowSid The SID of the Flow * @return $this Fluent Builder */ public function setIntegrationFlowSid($integrationFlowSid) { $this->options['integrationFlowSid'] = $integrationFlowSid; return $this; } /** * The External Webhook URL when `integration_type` is `external`. * * @param string $integrationUrl The External Webhook URL * @return $this Fluent Builder */ public function setIntegrationUrl($integrationUrl) { $this->options['integrationUrl'] = $integrationUrl; return $this; } /** * The Workspace SID for a new task when `integration_type` is `task`. * * @param string $integrationWorkspaceSid The Workspace SID for a new task * @return $this Fluent Builder */ public function setIntegrationWorkspaceSid($integrationWorkspaceSid) { $this->options['integrationWorkspaceSid'] = $integrationWorkspaceSid; return $this; } /** * The Workflow SID for a new task when `integration_type` is `task`. * * @param string $integrationWorkflowSid The Workflow SID for a new task * @return $this Fluent Builder */ public function setIntegrationWorkflowSid($integrationWorkflowSid) { $this->options['integrationWorkflowSid'] = $integrationWorkflowSid; return $this; } /** * The task channel for a new task when `integration_type` is `task`. The default is `default`. * * @param string $integrationChannel task channel for a new task * @return $this Fluent Builder */ public function setIntegrationChannel($integrationChannel) { $this->options['integrationChannel'] = $integrationChannel; return $this; } /** * The task timeout in seconds for a new task when `integration_type` is `task`. The default is `86,400` seconds (24 hours). * * @param int $integrationTimeout The task timeout in seconds for a new task * @return $this Fluent Builder */ public function setIntegrationTimeout($integrationTimeout) { $this->options['integrationTimeout'] = $integrationTimeout; return $this; } /** * The task priority of a new task when `integration_type` is `task`. The default priority is `0`. * * @param int $integrationPriority The task priority of a new task * @return $this Fluent Builder */ public function setIntegrationPriority($integrationPriority) { $this->options['integrationPriority'] = $integrationPriority; return $this; } /** * Whether to create a task when the first message arrives when `integration_type` is `task`. If `false`, the task is created with the channel. * * @param bool $integrationCreationOnMessage Whether to create a task when the * first message arrives * @return $this Fluent Builder */ public function setIntegrationCreationOnMessage($integrationCreationOnMessage) { $this->options['integrationCreationOnMessage'] = $integrationCreationOnMessage; return $this; } /** * Whether new channels created are long-lived. * * @param bool $longLived Whether new channels created are long-lived * @return $this Fluent Builder */ public function setLongLived($longLived) { $this->options['longLived'] = $longLived; return $this; } /** * Boolean flag for enabling or disabling the Janitor * * @param bool $janitorEnabled Boolean flag for enabling or disabling the * Janitor * @return $this Fluent Builder */ public function setJanitorEnabled($janitorEnabled) { $this->options['janitorEnabled'] = $janitorEnabled; return $this; } /** * The number of times to retry the webhook if the first attempt fails. Can be an integer between 0 and 3, inclusive, and the default is 0. * * @param int $integrationRetryCount The number of times to retry the webhook * if the first attempt fails * @return $this Fluent Builder */ public function setIntegrationRetryCount($integrationRetryCount) { $this->options['integrationRetryCount'] = $integrationRetryCount; 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.FlexApi.V1.UpdateFlexFlowOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Authy.php 0000644 00000006124 15002236443 0012105 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\Rest\Authy\V1; /** * @property \Twilio\Rest\Authy\V1 $v1 * @property \Twilio\Rest\Authy\V1\FormList $forms * @property \Twilio\Rest\Authy\V1\ServiceList $services * @method \Twilio\Rest\Authy\V1\FormContext forms(string $formType) * @method \Twilio\Rest\Authy\V1\ServiceContext services(string $sid) */ class Authy extends Domain { protected $_v1 = null; /** * Construct the Authy Domain * * @param \Twilio\Rest\Client $client Twilio\Rest\Client to communicate with * Twilio * @return \Twilio\Rest\Authy Domain for Authy */ public function __construct(Client $client) { parent::__construct($client); $this->baseUrl = 'https://authy.twilio.com'; } /** * @return \Twilio\Rest\Authy\V1 Version v1 of authy */ protected function getV1() { if (!$this->_v1) { $this->_v1 = new V1($this); } return $this->_v1; } /** * Magic getter to lazy load version * * @param string $name Version to return * @return \Twilio\Version The requested version * @throws TwilioException For unknown versions */ public function __get($name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown version ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $method = 'context' . \ucfirst($name); if (\method_exists($this, $method)) { return \call_user_func_array(array($this, $method), $arguments); } throw new TwilioException('Unknown context ' . $name); } /** * @return \Twilio\Rest\Authy\V1\FormList */ protected function getForms() { return $this->v1->forms; } /** * @param string $formType The Type of this Form * @return \Twilio\Rest\Authy\V1\FormContext */ protected function contextForms($formType) { return $this->v1->forms($formType); } /** * @return \Twilio\Rest\Authy\V1\ServiceList */ protected function getServices() { return $this->v1->services; } /** * @param string $sid A string that uniquely identifies this Service. * @return \Twilio\Rest\Authy\V1\ServiceContext */ protected function contextServices($sid) { return $this->v1->services($sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Authy]'; } } sdk/src/Twilio/Rest/Messaging.php 0000644 00000007157 15002236443 0012737 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\Rest\Messaging\V1; /** * @property \Twilio\Rest\Messaging\V1 $v1 * @property \Twilio\Rest\Messaging\V1\ServiceList $services * @property \Twilio\Rest\Messaging\V1\SessionList $sessions * @property \Twilio\Rest\Messaging\V1\WebhookList $webhooks * @method \Twilio\Rest\Messaging\V1\ServiceContext services(string $sid) * @method \Twilio\Rest\Messaging\V1\SessionContext sessions(string $sid) * @method \Twilio\Rest\Messaging\V1\WebhookContext webhooks() */ class Messaging extends Domain { protected $_v1 = null; /** * Construct the Messaging Domain * * @param \Twilio\Rest\Client $client Twilio\Rest\Client to communicate with * Twilio * @return \Twilio\Rest\Messaging Domain for Messaging */ public function __construct(Client $client) { parent::__construct($client); $this->baseUrl = 'https://messaging.twilio.com'; } /** * @return \Twilio\Rest\Messaging\V1 Version v1 of messaging */ protected function getV1() { if (!$this->_v1) { $this->_v1 = new V1($this); } return $this->_v1; } /** * Magic getter to lazy load version * * @param string $name Version to return * @return \Twilio\Version The requested version * @throws TwilioException For unknown versions */ public function __get($name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown version ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $method = 'context' . \ucfirst($name); if (\method_exists($this, $method)) { return \call_user_func_array(array($this, $method), $arguments); } throw new TwilioException('Unknown context ' . $name); } /** * @return \Twilio\Rest\Messaging\V1\ServiceList */ protected function getServices() { return $this->v1->services; } /** * @param string $sid The SID that identifies the resource to fetch * @return \Twilio\Rest\Messaging\V1\ServiceContext */ protected function contextServices($sid) { return $this->v1->services($sid); } /** * @return \Twilio\Rest\Messaging\V1\SessionList */ protected function getSessions() { return $this->v1->sessions; } /** * @param string $sid The SID that identifies the resource to fetch * @return \Twilio\Rest\Messaging\V1\SessionContext */ protected function contextSessions($sid) { return $this->v1->sessions($sid); } /** * @return \Twilio\Rest\Messaging\V1\WebhookList */ protected function getWebhooks() { return $this->v1->webhooks; } /** * @return \Twilio\Rest\Messaging\V1\WebhookContext */ protected function contextWebhooks() { return $this->v1->webhooks(); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Messaging]'; } } sdk/src/Twilio/Rest/Conversations.php 0000644 00000006405 15002236443 0013652 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\Rest\Conversations\V1; /** * @property \Twilio\Rest\Conversations\V1 $v1 * @property \Twilio\Rest\Conversations\V1\ConversationList $conversations * @property \Twilio\Rest\Conversations\V1\WebhookList $webhooks * @method \Twilio\Rest\Conversations\V1\ConversationContext conversations(string $sid) * @method \Twilio\Rest\Conversations\V1\WebhookContext webhooks() */ class Conversations extends Domain { protected $_v1 = null; /** * Construct the Conversations Domain * * @param \Twilio\Rest\Client $client Twilio\Rest\Client to communicate with * Twilio * @return \Twilio\Rest\Conversations Domain for Conversations */ public function __construct(Client $client) { parent::__construct($client); $this->baseUrl = 'https://conversations.twilio.com'; } /** * @return \Twilio\Rest\Conversations\V1 Version v1 of conversations */ protected function getV1() { if (!$this->_v1) { $this->_v1 = new V1($this); } return $this->_v1; } /** * Magic getter to lazy load version * * @param string $name Version to return * @return \Twilio\Version The requested version * @throws TwilioException For unknown versions */ public function __get($name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown version ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $method = 'context' . \ucfirst($name); if (\method_exists($this, $method)) { return \call_user_func_array(array($this, $method), $arguments); } throw new TwilioException('Unknown context ' . $name); } /** * @return \Twilio\Rest\Conversations\V1\ConversationList */ protected function getConversations() { return $this->v1->conversations; } /** * @param string $sid A 34 character string that uniquely identifies this * resource. * @return \Twilio\Rest\Conversations\V1\ConversationContext */ protected function contextConversations($sid) { return $this->v1->conversations($sid); } /** * @return \Twilio\Rest\Conversations\V1\WebhookList */ protected function getWebhooks() { return $this->v1->webhooks; } /** * @return \Twilio\Rest\Conversations\V1\WebhookContext */ protected function contextWebhooks() { return $this->v1->webhooks(); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Conversations]'; } } sdk/src/Twilio/Rest/Serverless.php 0000644 00000005267 15002236443 0013157 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\Rest\Serverless\V1; /** * @property \Twilio\Rest\Serverless\V1 $v1 * @property \Twilio\Rest\Serverless\V1\ServiceList $services * @method \Twilio\Rest\Serverless\V1\ServiceContext services(string $sid) */ class Serverless extends Domain { protected $_v1 = null; /** * Construct the Serverless Domain * * @param \Twilio\Rest\Client $client Twilio\Rest\Client to communicate with * Twilio * @return \Twilio\Rest\Serverless Domain for Serverless */ public function __construct(Client $client) { parent::__construct($client); $this->baseUrl = 'https://serverless.twilio.com'; } /** * @return \Twilio\Rest\Serverless\V1 Version v1 of serverless */ protected function getV1() { if (!$this->_v1) { $this->_v1 = new V1($this); } return $this->_v1; } /** * Magic getter to lazy load version * * @param string $name Version to return * @return \Twilio\Version The requested version * @throws TwilioException For unknown versions */ public function __get($name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown version ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $method = 'context' . \ucfirst($name); if (\method_exists($this, $method)) { return \call_user_func_array(array($this, $method), $arguments); } throw new TwilioException('Unknown context ' . $name); } /** * @return \Twilio\Rest\Serverless\V1\ServiceList */ protected function getServices() { return $this->v1->services; } /** * @param string $sid The SID of the Service resource to fetch * @return \Twilio\Rest\Serverless\V1\ServiceContext */ protected function contextServices($sid) { return $this->v1->services($sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Serverless]'; } } sdk/src/Twilio/Rest/Voice.php 0000644 00000004570 15002236443 0012063 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\Rest\Voice\V1; /** * @property \Twilio\Rest\Voice\V1 $v1 * @property \Twilio\Rest\Voice\V1\DialingPermissionsList $dialingPermissions */ class Voice extends Domain { protected $_v1 = null; /** * Construct the Voice Domain * * @param \Twilio\Rest\Client $client Twilio\Rest\Client to communicate with * Twilio * @return \Twilio\Rest\Voice Domain for Voice */ public function __construct(Client $client) { parent::__construct($client); $this->baseUrl = 'https://voice.twilio.com'; } /** * @return \Twilio\Rest\Voice\V1 Version v1 of voice */ protected function getV1() { if (!$this->_v1) { $this->_v1 = new V1($this); } return $this->_v1; } /** * Magic getter to lazy load version * * @param string $name Version to return * @return \Twilio\Version The requested version * @throws TwilioException For unknown versions */ public function __get($name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown version ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $method = 'context' . \ucfirst($name); if (\method_exists($this, $method)) { return \call_user_func_array(array($this, $method), $arguments); } throw new TwilioException('Unknown context ' . $name); } /** * @return \Twilio\Rest\Voice\V1\DialingPermissionsList */ protected function getDialingPermissions() { return $this->v1->dialingPermissions; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Voice]'; } } sdk/src/Twilio/Rest/Video.php 0000644 00000012364 15002236443 0012064 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\Rest\Video\V1; /** * @property \Twilio\Rest\Video\V1 $v1 * @property \Twilio\Rest\Video\V1\CompositionList $compositions * @property \Twilio\Rest\Video\V1\CompositionHookList $compositionHooks * @property \Twilio\Rest\Video\V1\CompositionSettingsList $compositionSettings * @property \Twilio\Rest\Video\V1\RecordingList $recordings * @property \Twilio\Rest\Video\V1\RecordingSettingsList $recordingSettings * @property \Twilio\Rest\Video\V1\RoomList $rooms * @method \Twilio\Rest\Video\V1\CompositionContext compositions(string $sid) * @method \Twilio\Rest\Video\V1\CompositionHookContext compositionHooks(string $sid) * @method \Twilio\Rest\Video\V1\CompositionSettingsContext compositionSettings() * @method \Twilio\Rest\Video\V1\RecordingContext recordings(string $sid) * @method \Twilio\Rest\Video\V1\RecordingSettingsContext recordingSettings() * @method \Twilio\Rest\Video\V1\RoomContext rooms(string $sid) */ class Video extends Domain { protected $_v1 = null; /** * Construct the Video Domain * * @param \Twilio\Rest\Client $client Twilio\Rest\Client to communicate with * Twilio * @return \Twilio\Rest\Video Domain for Video */ public function __construct(Client $client) { parent::__construct($client); $this->baseUrl = 'https://video.twilio.com'; } /** * @return \Twilio\Rest\Video\V1 Version v1 of video */ protected function getV1() { if (!$this->_v1) { $this->_v1 = new V1($this); } return $this->_v1; } /** * Magic getter to lazy load version * * @param string $name Version to return * @return \Twilio\Version The requested version * @throws TwilioException For unknown versions */ public function __get($name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown version ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $method = 'context' . \ucfirst($name); if (\method_exists($this, $method)) { return \call_user_func_array(array($this, $method), $arguments); } throw new TwilioException('Unknown context ' . $name); } /** * @return \Twilio\Rest\Video\V1\CompositionList */ protected function getCompositions() { return $this->v1->compositions; } /** * @param string $sid The SID that identifies the resource to fetch * @return \Twilio\Rest\Video\V1\CompositionContext */ protected function contextCompositions($sid) { return $this->v1->compositions($sid); } /** * @return \Twilio\Rest\Video\V1\CompositionHookList */ protected function getCompositionHooks() { return $this->v1->compositionHooks; } /** * @param string $sid The SID that identifies the resource to fetch * @return \Twilio\Rest\Video\V1\CompositionHookContext */ protected function contextCompositionHooks($sid) { return $this->v1->compositionHooks($sid); } /** * @return \Twilio\Rest\Video\V1\CompositionSettingsList */ protected function getCompositionSettings() { return $this->v1->compositionSettings; } /** * @return \Twilio\Rest\Video\V1\CompositionSettingsContext */ protected function contextCompositionSettings() { return $this->v1->compositionSettings(); } /** * @return \Twilio\Rest\Video\V1\RecordingList */ protected function getRecordings() { return $this->v1->recordings; } /** * @param string $sid The SID that identifies the resource to fetch * @return \Twilio\Rest\Video\V1\RecordingContext */ protected function contextRecordings($sid) { return $this->v1->recordings($sid); } /** * @return \Twilio\Rest\Video\V1\RecordingSettingsList */ protected function getRecordingSettings() { return $this->v1->recordingSettings; } /** * @return \Twilio\Rest\Video\V1\RecordingSettingsContext */ protected function contextRecordingSettings() { return $this->v1->recordingSettings(); } /** * @return \Twilio\Rest\Video\V1\RoomList */ protected function getRooms() { return $this->v1->rooms; } /** * @param string $sid The SID that identifies the resource to fetch * @return \Twilio\Rest\Video\V1\RoomContext */ protected function contextRooms($sid) { return $this->v1->rooms($sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Video]'; } } sdk/src/Twilio/Rest/Chat/V1.php 0000644 00000005273 15002236443 0012164 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\Rest\Chat\V1\CredentialList; use Twilio\Rest\Chat\V1\ServiceList; use Twilio\Version; /** * @property \Twilio\Rest\Chat\V1\CredentialList $credentials * @property \Twilio\Rest\Chat\V1\ServiceList $services * @method \Twilio\Rest\Chat\V1\CredentialContext credentials(string $sid) * @method \Twilio\Rest\Chat\V1\ServiceContext services(string $sid) */ class V1 extends Version { protected $_credentials = null; protected $_services = null; /** * Construct the V1 version of Chat * * @param \Twilio\Domain $domain Domain that contains the version * @return \Twilio\Rest\Chat\V1 V1 version of Chat */ public function __construct(Domain $domain) { parent::__construct($domain); $this->version = 'v1'; } /** * @return \Twilio\Rest\Chat\V1\CredentialList */ protected function getCredentials() { if (!$this->_credentials) { $this->_credentials = new CredentialList($this); } return $this->_credentials; } /** * @return \Twilio\Rest\Chat\V1\ServiceList */ protected function getServices() { if (!$this->_services) { $this->_services = new ServiceList($this); } return $this->_services; } /** * Magic getter to lazy load root resources * * @param string $name Resource to return * @return \Twilio\ListResource The requested resource * @throws TwilioException For unknown resource */ public function __get($name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown resource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Chat.V1]'; } } sdk/src/Twilio/Rest/Chat/V1/CredentialInstance.php 0000644 00000010045 15002236443 0015714 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V1; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $accountSid * @property string $friendlyName * @property string $type * @property string $sandbox * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $url */ class CredentialInstance extends InstanceResource { /** * Initialize the CredentialInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Chat\V1\CredentialInstance */ public function __construct(Version $version, array $payload, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'type' => Values::array_get($payload, 'type'), 'sandbox' => Values::array_get($payload, 'sandbox'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), ); $this->solution = array('sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Chat\V1\CredentialContext Context for this * CredentialInstance */ protected function proxy() { if (!$this->context) { $this->context = new CredentialContext($this->version, $this->solution['sid']); } return $this->context; } /** * Fetch a CredentialInstance * * @return CredentialInstance Fetched CredentialInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Update the CredentialInstance * * @param array|Options $options Optional Arguments * @return CredentialInstance Updated CredentialInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Deletes the CredentialInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Chat.V1.CredentialInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Chat/V1/ServiceOptions.php 0000644 00000201007 15002236443 0015131 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V1; use Twilio\Options; use Twilio\Values; abstract class ServiceOptions { /** * @param string $friendlyName A string to describe the resource * @param string $defaultServiceRoleSid The service role assigned to users when * they are added to the service * @param string $defaultChannelRoleSid The channel role assigned to users when * they are added to a channel * @param string $defaultChannelCreatorRoleSid The channel role assigned to a * channel creator when they join a * new channel * @param bool $readStatusEnabled Whether to enable the Message Consumption * Horizon feature * @param bool $reachabilityEnabled Whether to enable the Reachability * Indicator feature for this Service instance * @param int $typingIndicatorTimeout How long in seconds to wait before * assuming the user is no longer typing * @param int $consumptionReportInterval DEPRECATED * @param bool $notificationsNewMessageEnabled Whether to send a notification * when a new message is added to a * channel * @param string $notificationsNewMessageTemplate The template to use to create * the notification text * displayed when a new message * is added to a channel * @param bool $notificationsAddedToChannelEnabled Whether to send a * notification when a member * is added to a channel * @param string $notificationsAddedToChannelTemplate The template to use to * create the notification * text displayed when a * member is added to a * channel * @param bool $notificationsRemovedFromChannelEnabled Whether to send a * notification to a user * when they are removed * from a channel * @param string $notificationsRemovedFromChannelTemplate The template to use * to create the * notification text * displayed to a user * when they are removed * @param bool $notificationsInvitedToChannelEnabled Whether to send a * notification when a user * is invited to a channel * @param string $notificationsInvitedToChannelTemplate The template to use to * create the notification * text displayed when a * user is invited to a * channel * @param string $preWebhookUrl The webhook URL for pre-event webhooks * @param string $postWebhookUrl The URL for post-event webhooks * @param string $webhookMethod The HTTP method to use for both PRE and POST * webhooks * @param string $webhookFilters The list of WebHook events that are enabled * for this Service instance * @param string $webhooksOnMessageSendUrl The URL of the webhook to call in * response to the on_message_send event * @param string $webhooksOnMessageSendMethod The HTTP method to use when * calling the * webhooks.on_message_send.url * @param string $webhooksOnMessageUpdateUrl The URL of the webhook to call in * response to the on_message_update * event * @param string $webhooksOnMessageUpdateMethod The HTTP method to use when * calling the * webhooks.on_message_update.url * @param string $webhooksOnMessageRemoveUrl The URL of the webhook to call in * response to the on_message_remove * event * @param string $webhooksOnMessageRemoveMethod The HTTP method to use when * calling the * webhooks.on_message_remove.url * @param string $webhooksOnChannelAddUrl The URL of the webhook to call in * response to the on_channel_add event * @param string $webhooksOnChannelAddMethod The HTTP method to use when * calling the * webhooks.on_channel_add.url * @param string $webhooksOnChannelDestroyUrl The URL of the webhook to call in * response to the * on_channel_destroy event * @param string $webhooksOnChannelDestroyMethod The HTTP method to use when * calling the * webhooks.on_channel_destroy.url * @param string $webhooksOnChannelUpdateUrl The URL of the webhook to call in * response to the on_channel_update * event * @param string $webhooksOnChannelUpdateMethod The HTTP method to use when * calling the * webhooks.on_channel_update.url * @param string $webhooksOnMemberAddUrl The URL of the webhook to call in * response to the on_member_add event * @param string $webhooksOnMemberAddMethod The HTTP method to use when calling * the webhooks.on_member_add.url * @param string $webhooksOnMemberRemoveUrl The URL of the webhook to call in * response to the on_member_remove * event * @param string $webhooksOnMemberRemoveMethod The HTTP method to use when * calling the * webhooks.on_member_remove.url * @param string $webhooksOnMessageSentUrl The URL of the webhook to call in * response to the on_message_sent event * @param string $webhooksOnMessageSentMethod The URL of the webhook to call in * response to the on_message_sent * event * @param string $webhooksOnMessageUpdatedUrl The URL of the webhook to call in * response to the * on_message_updated event * @param string $webhooksOnMessageUpdatedMethod The HTTP method to use when * calling the * webhooks.on_message_updated.url * @param string $webhooksOnMessageRemovedUrl The URL of the webhook to call in * response to the * on_message_removed event * @param string $webhooksOnMessageRemovedMethod The HTTP method to use when * calling the * webhooks.on_message_removed.url * @param string $webhooksOnChannelAddedUrl The URL of the webhook to call in * response to the on_channel_added * event * @param string $webhooksOnChannelAddedMethod The URL of the webhook to call * in response to the * on_channel_added event * @param string $webhooksOnChannelDestroyedUrl The URL of the webhook to call * in response to the * on_channel_added event * @param string $webhooksOnChannelDestroyedMethod The HTTP method to use when * calling the * webhooks.on_channel_destroyed.url * @param string $webhooksOnChannelUpdatedUrl he URL of the webhook to call in * response to the * on_channel_updated event * @param string $webhooksOnChannelUpdatedMethod The HTTP method to use when * calling the * webhooks.on_channel_updated.url * @param string $webhooksOnMemberAddedUrl The URL of the webhook to call in * response to the on_channel_updated * event * @param string $webhooksOnMemberAddedMethod he HTTP method to use when * calling the * webhooks.on_channel_updated.url * @param string $webhooksOnMemberRemovedUrl The URL of the webhook to call in * response to the on_member_removed * event * @param string $webhooksOnMemberRemovedMethod The HTTP method to use when * calling the * webhooks.on_member_removed.url * @param int $limitsChannelMembers The maximum number of Members that can be * added to Channels within this Service * @param int $limitsUserChannels The maximum number of Channels Users can be a * Member of within this Service * @return UpdateServiceOptions Options builder */ public static function update($friendlyName = Values::NONE, $defaultServiceRoleSid = Values::NONE, $defaultChannelRoleSid = Values::NONE, $defaultChannelCreatorRoleSid = Values::NONE, $readStatusEnabled = Values::NONE, $reachabilityEnabled = Values::NONE, $typingIndicatorTimeout = Values::NONE, $consumptionReportInterval = Values::NONE, $notificationsNewMessageEnabled = Values::NONE, $notificationsNewMessageTemplate = Values::NONE, $notificationsAddedToChannelEnabled = Values::NONE, $notificationsAddedToChannelTemplate = Values::NONE, $notificationsRemovedFromChannelEnabled = Values::NONE, $notificationsRemovedFromChannelTemplate = Values::NONE, $notificationsInvitedToChannelEnabled = Values::NONE, $notificationsInvitedToChannelTemplate = Values::NONE, $preWebhookUrl = Values::NONE, $postWebhookUrl = Values::NONE, $webhookMethod = Values::NONE, $webhookFilters = Values::NONE, $webhooksOnMessageSendUrl = Values::NONE, $webhooksOnMessageSendMethod = Values::NONE, $webhooksOnMessageUpdateUrl = Values::NONE, $webhooksOnMessageUpdateMethod = Values::NONE, $webhooksOnMessageRemoveUrl = Values::NONE, $webhooksOnMessageRemoveMethod = Values::NONE, $webhooksOnChannelAddUrl = Values::NONE, $webhooksOnChannelAddMethod = Values::NONE, $webhooksOnChannelDestroyUrl = Values::NONE, $webhooksOnChannelDestroyMethod = Values::NONE, $webhooksOnChannelUpdateUrl = Values::NONE, $webhooksOnChannelUpdateMethod = Values::NONE, $webhooksOnMemberAddUrl = Values::NONE, $webhooksOnMemberAddMethod = Values::NONE, $webhooksOnMemberRemoveUrl = Values::NONE, $webhooksOnMemberRemoveMethod = Values::NONE, $webhooksOnMessageSentUrl = Values::NONE, $webhooksOnMessageSentMethod = Values::NONE, $webhooksOnMessageUpdatedUrl = Values::NONE, $webhooksOnMessageUpdatedMethod = Values::NONE, $webhooksOnMessageRemovedUrl = Values::NONE, $webhooksOnMessageRemovedMethod = Values::NONE, $webhooksOnChannelAddedUrl = Values::NONE, $webhooksOnChannelAddedMethod = Values::NONE, $webhooksOnChannelDestroyedUrl = Values::NONE, $webhooksOnChannelDestroyedMethod = Values::NONE, $webhooksOnChannelUpdatedUrl = Values::NONE, $webhooksOnChannelUpdatedMethod = Values::NONE, $webhooksOnMemberAddedUrl = Values::NONE, $webhooksOnMemberAddedMethod = Values::NONE, $webhooksOnMemberRemovedUrl = Values::NONE, $webhooksOnMemberRemovedMethod = Values::NONE, $limitsChannelMembers = Values::NONE, $limitsUserChannels = Values::NONE) { return new UpdateServiceOptions($friendlyName, $defaultServiceRoleSid, $defaultChannelRoleSid, $defaultChannelCreatorRoleSid, $readStatusEnabled, $reachabilityEnabled, $typingIndicatorTimeout, $consumptionReportInterval, $notificationsNewMessageEnabled, $notificationsNewMessageTemplate, $notificationsAddedToChannelEnabled, $notificationsAddedToChannelTemplate, $notificationsRemovedFromChannelEnabled, $notificationsRemovedFromChannelTemplate, $notificationsInvitedToChannelEnabled, $notificationsInvitedToChannelTemplate, $preWebhookUrl, $postWebhookUrl, $webhookMethod, $webhookFilters, $webhooksOnMessageSendUrl, $webhooksOnMessageSendMethod, $webhooksOnMessageUpdateUrl, $webhooksOnMessageUpdateMethod, $webhooksOnMessageRemoveUrl, $webhooksOnMessageRemoveMethod, $webhooksOnChannelAddUrl, $webhooksOnChannelAddMethod, $webhooksOnChannelDestroyUrl, $webhooksOnChannelDestroyMethod, $webhooksOnChannelUpdateUrl, $webhooksOnChannelUpdateMethod, $webhooksOnMemberAddUrl, $webhooksOnMemberAddMethod, $webhooksOnMemberRemoveUrl, $webhooksOnMemberRemoveMethod, $webhooksOnMessageSentUrl, $webhooksOnMessageSentMethod, $webhooksOnMessageUpdatedUrl, $webhooksOnMessageUpdatedMethod, $webhooksOnMessageRemovedUrl, $webhooksOnMessageRemovedMethod, $webhooksOnChannelAddedUrl, $webhooksOnChannelAddedMethod, $webhooksOnChannelDestroyedUrl, $webhooksOnChannelDestroyedMethod, $webhooksOnChannelUpdatedUrl, $webhooksOnChannelUpdatedMethod, $webhooksOnMemberAddedUrl, $webhooksOnMemberAddedMethod, $webhooksOnMemberRemovedUrl, $webhooksOnMemberRemovedMethod, $limitsChannelMembers, $limitsUserChannels); } } class UpdateServiceOptions extends Options { /** * @param string $friendlyName A string to describe the resource * @param string $defaultServiceRoleSid The service role assigned to users when * they are added to the service * @param string $defaultChannelRoleSid The channel role assigned to users when * they are added to a channel * @param string $defaultChannelCreatorRoleSid The channel role assigned to a * channel creator when they join a * new channel * @param bool $readStatusEnabled Whether to enable the Message Consumption * Horizon feature * @param bool $reachabilityEnabled Whether to enable the Reachability * Indicator feature for this Service instance * @param int $typingIndicatorTimeout How long in seconds to wait before * assuming the user is no longer typing * @param int $consumptionReportInterval DEPRECATED * @param bool $notificationsNewMessageEnabled Whether to send a notification * when a new message is added to a * channel * @param string $notificationsNewMessageTemplate The template to use to create * the notification text * displayed when a new message * is added to a channel * @param bool $notificationsAddedToChannelEnabled Whether to send a * notification when a member * is added to a channel * @param string $notificationsAddedToChannelTemplate The template to use to * create the notification * text displayed when a * member is added to a * channel * @param bool $notificationsRemovedFromChannelEnabled Whether to send a * notification to a user * when they are removed * from a channel * @param string $notificationsRemovedFromChannelTemplate The template to use * to create the * notification text * displayed to a user * when they are removed * @param bool $notificationsInvitedToChannelEnabled Whether to send a * notification when a user * is invited to a channel * @param string $notificationsInvitedToChannelTemplate The template to use to * create the notification * text displayed when a * user is invited to a * channel * @param string $preWebhookUrl The webhook URL for pre-event webhooks * @param string $postWebhookUrl The URL for post-event webhooks * @param string $webhookMethod The HTTP method to use for both PRE and POST * webhooks * @param string $webhookFilters The list of WebHook events that are enabled * for this Service instance * @param string $webhooksOnMessageSendUrl The URL of the webhook to call in * response to the on_message_send event * @param string $webhooksOnMessageSendMethod The HTTP method to use when * calling the * webhooks.on_message_send.url * @param string $webhooksOnMessageUpdateUrl The URL of the webhook to call in * response to the on_message_update * event * @param string $webhooksOnMessageUpdateMethod The HTTP method to use when * calling the * webhooks.on_message_update.url * @param string $webhooksOnMessageRemoveUrl The URL of the webhook to call in * response to the on_message_remove * event * @param string $webhooksOnMessageRemoveMethod The HTTP method to use when * calling the * webhooks.on_message_remove.url * @param string $webhooksOnChannelAddUrl The URL of the webhook to call in * response to the on_channel_add event * @param string $webhooksOnChannelAddMethod The HTTP method to use when * calling the * webhooks.on_channel_add.url * @param string $webhooksOnChannelDestroyUrl The URL of the webhook to call in * response to the * on_channel_destroy event * @param string $webhooksOnChannelDestroyMethod The HTTP method to use when * calling the * webhooks.on_channel_destroy.url * @param string $webhooksOnChannelUpdateUrl The URL of the webhook to call in * response to the on_channel_update * event * @param string $webhooksOnChannelUpdateMethod The HTTP method to use when * calling the * webhooks.on_channel_update.url * @param string $webhooksOnMemberAddUrl The URL of the webhook to call in * response to the on_member_add event * @param string $webhooksOnMemberAddMethod The HTTP method to use when calling * the webhooks.on_member_add.url * @param string $webhooksOnMemberRemoveUrl The URL of the webhook to call in * response to the on_member_remove * event * @param string $webhooksOnMemberRemoveMethod The HTTP method to use when * calling the * webhooks.on_member_remove.url * @param string $webhooksOnMessageSentUrl The URL of the webhook to call in * response to the on_message_sent event * @param string $webhooksOnMessageSentMethod The URL of the webhook to call in * response to the on_message_sent * event * @param string $webhooksOnMessageUpdatedUrl The URL of the webhook to call in * response to the * on_message_updated event * @param string $webhooksOnMessageUpdatedMethod The HTTP method to use when * calling the * webhooks.on_message_updated.url * @param string $webhooksOnMessageRemovedUrl The URL of the webhook to call in * response to the * on_message_removed event * @param string $webhooksOnMessageRemovedMethod The HTTP method to use when * calling the * webhooks.on_message_removed.url * @param string $webhooksOnChannelAddedUrl The URL of the webhook to call in * response to the on_channel_added * event * @param string $webhooksOnChannelAddedMethod The URL of the webhook to call * in response to the * on_channel_added event * @param string $webhooksOnChannelDestroyedUrl The URL of the webhook to call * in response to the * on_channel_added event * @param string $webhooksOnChannelDestroyedMethod The HTTP method to use when * calling the * webhooks.on_channel_destroyed.url * @param string $webhooksOnChannelUpdatedUrl he URL of the webhook to call in * response to the * on_channel_updated event * @param string $webhooksOnChannelUpdatedMethod The HTTP method to use when * calling the * webhooks.on_channel_updated.url * @param string $webhooksOnMemberAddedUrl The URL of the webhook to call in * response to the on_channel_updated * event * @param string $webhooksOnMemberAddedMethod he HTTP method to use when * calling the * webhooks.on_channel_updated.url * @param string $webhooksOnMemberRemovedUrl The URL of the webhook to call in * response to the on_member_removed * event * @param string $webhooksOnMemberRemovedMethod The HTTP method to use when * calling the * webhooks.on_member_removed.url * @param int $limitsChannelMembers The maximum number of Members that can be * added to Channels within this Service * @param int $limitsUserChannels The maximum number of Channels Users can be a * Member of within this Service */ public function __construct($friendlyName = Values::NONE, $defaultServiceRoleSid = Values::NONE, $defaultChannelRoleSid = Values::NONE, $defaultChannelCreatorRoleSid = Values::NONE, $readStatusEnabled = Values::NONE, $reachabilityEnabled = Values::NONE, $typingIndicatorTimeout = Values::NONE, $consumptionReportInterval = Values::NONE, $notificationsNewMessageEnabled = Values::NONE, $notificationsNewMessageTemplate = Values::NONE, $notificationsAddedToChannelEnabled = Values::NONE, $notificationsAddedToChannelTemplate = Values::NONE, $notificationsRemovedFromChannelEnabled = Values::NONE, $notificationsRemovedFromChannelTemplate = Values::NONE, $notificationsInvitedToChannelEnabled = Values::NONE, $notificationsInvitedToChannelTemplate = Values::NONE, $preWebhookUrl = Values::NONE, $postWebhookUrl = Values::NONE, $webhookMethod = Values::NONE, $webhookFilters = Values::NONE, $webhooksOnMessageSendUrl = Values::NONE, $webhooksOnMessageSendMethod = Values::NONE, $webhooksOnMessageUpdateUrl = Values::NONE, $webhooksOnMessageUpdateMethod = Values::NONE, $webhooksOnMessageRemoveUrl = Values::NONE, $webhooksOnMessageRemoveMethod = Values::NONE, $webhooksOnChannelAddUrl = Values::NONE, $webhooksOnChannelAddMethod = Values::NONE, $webhooksOnChannelDestroyUrl = Values::NONE, $webhooksOnChannelDestroyMethod = Values::NONE, $webhooksOnChannelUpdateUrl = Values::NONE, $webhooksOnChannelUpdateMethod = Values::NONE, $webhooksOnMemberAddUrl = Values::NONE, $webhooksOnMemberAddMethod = Values::NONE, $webhooksOnMemberRemoveUrl = Values::NONE, $webhooksOnMemberRemoveMethod = Values::NONE, $webhooksOnMessageSentUrl = Values::NONE, $webhooksOnMessageSentMethod = Values::NONE, $webhooksOnMessageUpdatedUrl = Values::NONE, $webhooksOnMessageUpdatedMethod = Values::NONE, $webhooksOnMessageRemovedUrl = Values::NONE, $webhooksOnMessageRemovedMethod = Values::NONE, $webhooksOnChannelAddedUrl = Values::NONE, $webhooksOnChannelAddedMethod = Values::NONE, $webhooksOnChannelDestroyedUrl = Values::NONE, $webhooksOnChannelDestroyedMethod = Values::NONE, $webhooksOnChannelUpdatedUrl = Values::NONE, $webhooksOnChannelUpdatedMethod = Values::NONE, $webhooksOnMemberAddedUrl = Values::NONE, $webhooksOnMemberAddedMethod = Values::NONE, $webhooksOnMemberRemovedUrl = Values::NONE, $webhooksOnMemberRemovedMethod = Values::NONE, $limitsChannelMembers = Values::NONE, $limitsUserChannels = Values::NONE) { $this->options['friendlyName'] = $friendlyName; $this->options['defaultServiceRoleSid'] = $defaultServiceRoleSid; $this->options['defaultChannelRoleSid'] = $defaultChannelRoleSid; $this->options['defaultChannelCreatorRoleSid'] = $defaultChannelCreatorRoleSid; $this->options['readStatusEnabled'] = $readStatusEnabled; $this->options['reachabilityEnabled'] = $reachabilityEnabled; $this->options['typingIndicatorTimeout'] = $typingIndicatorTimeout; $this->options['consumptionReportInterval'] = $consumptionReportInterval; $this->options['notificationsNewMessageEnabled'] = $notificationsNewMessageEnabled; $this->options['notificationsNewMessageTemplate'] = $notificationsNewMessageTemplate; $this->options['notificationsAddedToChannelEnabled'] = $notificationsAddedToChannelEnabled; $this->options['notificationsAddedToChannelTemplate'] = $notificationsAddedToChannelTemplate; $this->options['notificationsRemovedFromChannelEnabled'] = $notificationsRemovedFromChannelEnabled; $this->options['notificationsRemovedFromChannelTemplate'] = $notificationsRemovedFromChannelTemplate; $this->options['notificationsInvitedToChannelEnabled'] = $notificationsInvitedToChannelEnabled; $this->options['notificationsInvitedToChannelTemplate'] = $notificationsInvitedToChannelTemplate; $this->options['preWebhookUrl'] = $preWebhookUrl; $this->options['postWebhookUrl'] = $postWebhookUrl; $this->options['webhookMethod'] = $webhookMethod; $this->options['webhookFilters'] = $webhookFilters; $this->options['webhooksOnMessageSendUrl'] = $webhooksOnMessageSendUrl; $this->options['webhooksOnMessageSendMethod'] = $webhooksOnMessageSendMethod; $this->options['webhooksOnMessageUpdateUrl'] = $webhooksOnMessageUpdateUrl; $this->options['webhooksOnMessageUpdateMethod'] = $webhooksOnMessageUpdateMethod; $this->options['webhooksOnMessageRemoveUrl'] = $webhooksOnMessageRemoveUrl; $this->options['webhooksOnMessageRemoveMethod'] = $webhooksOnMessageRemoveMethod; $this->options['webhooksOnChannelAddUrl'] = $webhooksOnChannelAddUrl; $this->options['webhooksOnChannelAddMethod'] = $webhooksOnChannelAddMethod; $this->options['webhooksOnChannelDestroyUrl'] = $webhooksOnChannelDestroyUrl; $this->options['webhooksOnChannelDestroyMethod'] = $webhooksOnChannelDestroyMethod; $this->options['webhooksOnChannelUpdateUrl'] = $webhooksOnChannelUpdateUrl; $this->options['webhooksOnChannelUpdateMethod'] = $webhooksOnChannelUpdateMethod; $this->options['webhooksOnMemberAddUrl'] = $webhooksOnMemberAddUrl; $this->options['webhooksOnMemberAddMethod'] = $webhooksOnMemberAddMethod; $this->options['webhooksOnMemberRemoveUrl'] = $webhooksOnMemberRemoveUrl; $this->options['webhooksOnMemberRemoveMethod'] = $webhooksOnMemberRemoveMethod; $this->options['webhooksOnMessageSentUrl'] = $webhooksOnMessageSentUrl; $this->options['webhooksOnMessageSentMethod'] = $webhooksOnMessageSentMethod; $this->options['webhooksOnMessageUpdatedUrl'] = $webhooksOnMessageUpdatedUrl; $this->options['webhooksOnMessageUpdatedMethod'] = $webhooksOnMessageUpdatedMethod; $this->options['webhooksOnMessageRemovedUrl'] = $webhooksOnMessageRemovedUrl; $this->options['webhooksOnMessageRemovedMethod'] = $webhooksOnMessageRemovedMethod; $this->options['webhooksOnChannelAddedUrl'] = $webhooksOnChannelAddedUrl; $this->options['webhooksOnChannelAddedMethod'] = $webhooksOnChannelAddedMethod; $this->options['webhooksOnChannelDestroyedUrl'] = $webhooksOnChannelDestroyedUrl; $this->options['webhooksOnChannelDestroyedMethod'] = $webhooksOnChannelDestroyedMethod; $this->options['webhooksOnChannelUpdatedUrl'] = $webhooksOnChannelUpdatedUrl; $this->options['webhooksOnChannelUpdatedMethod'] = $webhooksOnChannelUpdatedMethod; $this->options['webhooksOnMemberAddedUrl'] = $webhooksOnMemberAddedUrl; $this->options['webhooksOnMemberAddedMethod'] = $webhooksOnMemberAddedMethod; $this->options['webhooksOnMemberRemovedUrl'] = $webhooksOnMemberRemovedUrl; $this->options['webhooksOnMemberRemovedMethod'] = $webhooksOnMemberRemovedMethod; $this->options['limitsChannelMembers'] = $limitsChannelMembers; $this->options['limitsUserChannels'] = $limitsUserChannels; } /** * A descriptive string that you create to describe the resource. It can be up to 64 characters long. * * @param string $friendlyName A string to describe the resource * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The service role assigned to users when they are added to the service. See the [Roles endpoint](https://www.twilio.com/docs/chat/api/roles) for more details. * * @param string $defaultServiceRoleSid The service role assigned to users when * they are added to the service * @return $this Fluent Builder */ public function setDefaultServiceRoleSid($defaultServiceRoleSid) { $this->options['defaultServiceRoleSid'] = $defaultServiceRoleSid; return $this; } /** * The channel role assigned to users when they are added to a channel. See the [Roles endpoint](https://www.twilio.com/docs/chat/api/roles) for more details. * * @param string $defaultChannelRoleSid The channel role assigned to users when * they are added to a channel * @return $this Fluent Builder */ public function setDefaultChannelRoleSid($defaultChannelRoleSid) { $this->options['defaultChannelRoleSid'] = $defaultChannelRoleSid; return $this; } /** * The channel role assigned to a channel creator when they join a new channel. See the [Roles endpoint](https://www.twilio.com/docs/chat/api/roles) for more details. * * @param string $defaultChannelCreatorRoleSid The channel role assigned to a * channel creator when they join a * new channel * @return $this Fluent Builder */ public function setDefaultChannelCreatorRoleSid($defaultChannelCreatorRoleSid) { $this->options['defaultChannelCreatorRoleSid'] = $defaultChannelCreatorRoleSid; return $this; } /** * Whether to enable the [Message Consumption Horizon](https://www.twilio.com/docs/chat/consumption-horizon) feature. The default is `true`. * * @param bool $readStatusEnabled Whether to enable the Message Consumption * Horizon feature * @return $this Fluent Builder */ public function setReadStatusEnabled($readStatusEnabled) { $this->options['readStatusEnabled'] = $readStatusEnabled; return $this; } /** * Whether to enable the [Reachability Indicator](https://www.twilio.com/docs/chat/reachability-indicator) for this Service instance. The default is `false`. * * @param bool $reachabilityEnabled Whether to enable the Reachability * Indicator feature for this Service instance * @return $this Fluent Builder */ public function setReachabilityEnabled($reachabilityEnabled) { $this->options['reachabilityEnabled'] = $reachabilityEnabled; return $this; } /** * How long in seconds after a `started typing` event until clients should assume that user is no longer typing, even if no `ended typing` message was received. The default is 5 seconds. * * @param int $typingIndicatorTimeout How long in seconds to wait before * assuming the user is no longer typing * @return $this Fluent Builder */ public function setTypingIndicatorTimeout($typingIndicatorTimeout) { $this->options['typingIndicatorTimeout'] = $typingIndicatorTimeout; return $this; } /** * DEPRECATED. The interval in seconds between consumption reports submission batches from client endpoints. * * @param int $consumptionReportInterval DEPRECATED * @return $this Fluent Builder */ public function setConsumptionReportInterval($consumptionReportInterval) { $this->options['consumptionReportInterval'] = $consumptionReportInterval; return $this; } /** * Whether to send a notification when a new message is added to a channel. Can be: `true` or `false` and the default is `false`. * * @param bool $notificationsNewMessageEnabled Whether to send a notification * when a new message is added to a * channel * @return $this Fluent Builder */ public function setNotificationsNewMessageEnabled($notificationsNewMessageEnabled) { $this->options['notificationsNewMessageEnabled'] = $notificationsNewMessageEnabled; return $this; } /** * The template to use to create the notification text displayed when a new message is added to a channel and `notifications.new_message.enabled` is `true`. * * @param string $notificationsNewMessageTemplate The template to use to create * the notification text * displayed when a new message * is added to a channel * @return $this Fluent Builder */ public function setNotificationsNewMessageTemplate($notificationsNewMessageTemplate) { $this->options['notificationsNewMessageTemplate'] = $notificationsNewMessageTemplate; return $this; } /** * Whether to send a notification when a member is added to a channel. Can be: `true` or `false` and the default is `false`. * * @param bool $notificationsAddedToChannelEnabled Whether to send a * notification when a member * is added to a channel * @return $this Fluent Builder */ public function setNotificationsAddedToChannelEnabled($notificationsAddedToChannelEnabled) { $this->options['notificationsAddedToChannelEnabled'] = $notificationsAddedToChannelEnabled; return $this; } /** * The template to use to create the notification text displayed when a member is added to a channel and `notifications.added_to_channel.enabled` is `true`. * * @param string $notificationsAddedToChannelTemplate The template to use to * create the notification * text displayed when a * member is added to a * channel * @return $this Fluent Builder */ public function setNotificationsAddedToChannelTemplate($notificationsAddedToChannelTemplate) { $this->options['notificationsAddedToChannelTemplate'] = $notificationsAddedToChannelTemplate; return $this; } /** * Whether to send a notification to a user when they are removed from a channel. Can be: `true` or `false` and the default is `false`. * * @param bool $notificationsRemovedFromChannelEnabled Whether to send a * notification to a user * when they are removed * from a channel * @return $this Fluent Builder */ public function setNotificationsRemovedFromChannelEnabled($notificationsRemovedFromChannelEnabled) { $this->options['notificationsRemovedFromChannelEnabled'] = $notificationsRemovedFromChannelEnabled; return $this; } /** * The template to use to create the notification text displayed to a user when they are removed from a channel and `notifications.removed_from_channel.enabled` is `true`. * * @param string $notificationsRemovedFromChannelTemplate The template to use * to create the * notification text * displayed to a user * when they are removed * @return $this Fluent Builder */ public function setNotificationsRemovedFromChannelTemplate($notificationsRemovedFromChannelTemplate) { $this->options['notificationsRemovedFromChannelTemplate'] = $notificationsRemovedFromChannelTemplate; return $this; } /** * Whether to send a notification when a user is invited to a channel. Can be: `true` or `false` and the default is `false`. * * @param bool $notificationsInvitedToChannelEnabled Whether to send a * notification when a user * is invited to a channel * @return $this Fluent Builder */ public function setNotificationsInvitedToChannelEnabled($notificationsInvitedToChannelEnabled) { $this->options['notificationsInvitedToChannelEnabled'] = $notificationsInvitedToChannelEnabled; return $this; } /** * The template to use to create the notification text displayed when a user is invited to a channel and `notifications.invited_to_channel.enabled` is `true`. * * @param string $notificationsInvitedToChannelTemplate The template to use to * create the notification * text displayed when a * user is invited to a * channel * @return $this Fluent Builder */ public function setNotificationsInvitedToChannelTemplate($notificationsInvitedToChannelTemplate) { $this->options['notificationsInvitedToChannelTemplate'] = $notificationsInvitedToChannelTemplate; return $this; } /** * The URL for pre-event webhooks, which are called by using the `webhook_method`. See [Webhook Events](https://www.twilio.com/docs/api/chat/webhooks) for more details. * * @param string $preWebhookUrl The webhook URL for pre-event webhooks * @return $this Fluent Builder */ public function setPreWebhookUrl($preWebhookUrl) { $this->options['preWebhookUrl'] = $preWebhookUrl; return $this; } /** * The URL for post-event webhooks, which are called by using the `webhook_method`. See [Webhook Events](https://www.twilio.com/docs/api/chat/webhooks) for more details. * * @param string $postWebhookUrl The URL for post-event webhooks * @return $this Fluent Builder */ public function setPostWebhookUrl($postWebhookUrl) { $this->options['postWebhookUrl'] = $postWebhookUrl; return $this; } /** * The HTTP method to use for calls to the `pre_webhook_url` and `post_webhook_url` webhooks. Can be: `POST` or `GET` and the default is `POST`. See [Webhook Events](https://www.twilio.com/docs/chat/webhook-events) for more details. * * @param string $webhookMethod The HTTP method to use for both PRE and POST * webhooks * @return $this Fluent Builder */ public function setWebhookMethod($webhookMethod) { $this->options['webhookMethod'] = $webhookMethod; return $this; } /** * The list of WebHook events that are enabled for this Service instance. See [Webhook Events](https://www.twilio.com/docs/chat/webhook-events) for more details. * * @param string $webhookFilters The list of WebHook events that are enabled * for this Service instance * @return $this Fluent Builder */ public function setWebhookFilters($webhookFilters) { $this->options['webhookFilters'] = $webhookFilters; return $this; } /** * The URL of the webhook to call in response to the `on_message_send` event using the `webhooks.on_message_send.method` HTTP method. * * @param string $webhooksOnMessageSendUrl The URL of the webhook to call in * response to the on_message_send event * @return $this Fluent Builder */ public function setWebhooksOnMessageSendUrl($webhooksOnMessageSendUrl) { $this->options['webhooksOnMessageSendUrl'] = $webhooksOnMessageSendUrl; return $this; } /** * The HTTP method to use when calling the `webhooks.on_message_send.url`. * * @param string $webhooksOnMessageSendMethod The HTTP method to use when * calling the * webhooks.on_message_send.url * @return $this Fluent Builder */ public function setWebhooksOnMessageSendMethod($webhooksOnMessageSendMethod) { $this->options['webhooksOnMessageSendMethod'] = $webhooksOnMessageSendMethod; return $this; } /** * The URL of the webhook to call in response to the `on_message_update` event using the `webhooks.on_message_update.method` HTTP method. * * @param string $webhooksOnMessageUpdateUrl The URL of the webhook to call in * response to the on_message_update * event * @return $this Fluent Builder */ public function setWebhooksOnMessageUpdateUrl($webhooksOnMessageUpdateUrl) { $this->options['webhooksOnMessageUpdateUrl'] = $webhooksOnMessageUpdateUrl; return $this; } /** * The HTTP method to use when calling the `webhooks.on_message_update.url`. * * @param string $webhooksOnMessageUpdateMethod The HTTP method to use when * calling the * webhooks.on_message_update.url * @return $this Fluent Builder */ public function setWebhooksOnMessageUpdateMethod($webhooksOnMessageUpdateMethod) { $this->options['webhooksOnMessageUpdateMethod'] = $webhooksOnMessageUpdateMethod; return $this; } /** * The URL of the webhook to call in response to the `on_message_remove` event using the `webhooks.on_message_remove.method` HTTP method. * * @param string $webhooksOnMessageRemoveUrl The URL of the webhook to call in * response to the on_message_remove * event * @return $this Fluent Builder */ public function setWebhooksOnMessageRemoveUrl($webhooksOnMessageRemoveUrl) { $this->options['webhooksOnMessageRemoveUrl'] = $webhooksOnMessageRemoveUrl; return $this; } /** * The HTTP method to use when calling the `webhooks.on_message_remove.url`. * * @param string $webhooksOnMessageRemoveMethod The HTTP method to use when * calling the * webhooks.on_message_remove.url * @return $this Fluent Builder */ public function setWebhooksOnMessageRemoveMethod($webhooksOnMessageRemoveMethod) { $this->options['webhooksOnMessageRemoveMethod'] = $webhooksOnMessageRemoveMethod; return $this; } /** * The URL of the webhook to call in response to the `on_channel_add` event using the `webhooks.on_channel_add.method` HTTP method. * * @param string $webhooksOnChannelAddUrl The URL of the webhook to call in * response to the on_channel_add event * @return $this Fluent Builder */ public function setWebhooksOnChannelAddUrl($webhooksOnChannelAddUrl) { $this->options['webhooksOnChannelAddUrl'] = $webhooksOnChannelAddUrl; return $this; } /** * The HTTP method to use when calling the `webhooks.on_channel_add.url`. * * @param string $webhooksOnChannelAddMethod The HTTP method to use when * calling the * webhooks.on_channel_add.url * @return $this Fluent Builder */ public function setWebhooksOnChannelAddMethod($webhooksOnChannelAddMethod) { $this->options['webhooksOnChannelAddMethod'] = $webhooksOnChannelAddMethod; return $this; } /** * The URL of the webhook to call in response to the `on_channel_destroy` event using the `webhooks.on_channel_destroy.method` HTTP method. * * @param string $webhooksOnChannelDestroyUrl The URL of the webhook to call in * response to the * on_channel_destroy event * @return $this Fluent Builder */ public function setWebhooksOnChannelDestroyUrl($webhooksOnChannelDestroyUrl) { $this->options['webhooksOnChannelDestroyUrl'] = $webhooksOnChannelDestroyUrl; return $this; } /** * The HTTP method to use when calling the `webhooks.on_channel_destroy.url`. * * @param string $webhooksOnChannelDestroyMethod The HTTP method to use when * calling the * webhooks.on_channel_destroy.url * @return $this Fluent Builder */ public function setWebhooksOnChannelDestroyMethod($webhooksOnChannelDestroyMethod) { $this->options['webhooksOnChannelDestroyMethod'] = $webhooksOnChannelDestroyMethod; return $this; } /** * The URL of the webhook to call in response to the `on_channel_update` event using the `webhooks.on_channel_update.method` HTTP method. * * @param string $webhooksOnChannelUpdateUrl The URL of the webhook to call in * response to the on_channel_update * event * @return $this Fluent Builder */ public function setWebhooksOnChannelUpdateUrl($webhooksOnChannelUpdateUrl) { $this->options['webhooksOnChannelUpdateUrl'] = $webhooksOnChannelUpdateUrl; return $this; } /** * The HTTP method to use when calling the `webhooks.on_channel_update.url`. * * @param string $webhooksOnChannelUpdateMethod The HTTP method to use when * calling the * webhooks.on_channel_update.url * @return $this Fluent Builder */ public function setWebhooksOnChannelUpdateMethod($webhooksOnChannelUpdateMethod) { $this->options['webhooksOnChannelUpdateMethod'] = $webhooksOnChannelUpdateMethod; return $this; } /** * The URL of the webhook to call in response to the `on_member_add` event using the `webhooks.on_member_add.method` HTTP method. * * @param string $webhooksOnMemberAddUrl The URL of the webhook to call in * response to the on_member_add event * @return $this Fluent Builder */ public function setWebhooksOnMemberAddUrl($webhooksOnMemberAddUrl) { $this->options['webhooksOnMemberAddUrl'] = $webhooksOnMemberAddUrl; return $this; } /** * The HTTP method to use when calling the `webhooks.on_member_add.url`. * * @param string $webhooksOnMemberAddMethod The HTTP method to use when calling * the webhooks.on_member_add.url * @return $this Fluent Builder */ public function setWebhooksOnMemberAddMethod($webhooksOnMemberAddMethod) { $this->options['webhooksOnMemberAddMethod'] = $webhooksOnMemberAddMethod; return $this; } /** * The URL of the webhook to call in response to the `on_member_remove` event using the `webhooks.on_member_remove.method` HTTP method. * * @param string $webhooksOnMemberRemoveUrl The URL of the webhook to call in * response to the on_member_remove * event * @return $this Fluent Builder */ public function setWebhooksOnMemberRemoveUrl($webhooksOnMemberRemoveUrl) { $this->options['webhooksOnMemberRemoveUrl'] = $webhooksOnMemberRemoveUrl; return $this; } /** * The HTTP method to use when calling the `webhooks.on_member_remove.url`. * * @param string $webhooksOnMemberRemoveMethod The HTTP method to use when * calling the * webhooks.on_member_remove.url * @return $this Fluent Builder */ public function setWebhooksOnMemberRemoveMethod($webhooksOnMemberRemoveMethod) { $this->options['webhooksOnMemberRemoveMethod'] = $webhooksOnMemberRemoveMethod; return $this; } /** * The URL of the webhook to call in response to the `on_message_sent` event using the `webhooks.on_message_sent.method` HTTP method. * * @param string $webhooksOnMessageSentUrl The URL of the webhook to call in * response to the on_message_sent event * @return $this Fluent Builder */ public function setWebhooksOnMessageSentUrl($webhooksOnMessageSentUrl) { $this->options['webhooksOnMessageSentUrl'] = $webhooksOnMessageSentUrl; return $this; } /** * The URL of the webhook to call in response to the `on_message_sent` event`. * * @param string $webhooksOnMessageSentMethod The URL of the webhook to call in * response to the on_message_sent * event * @return $this Fluent Builder */ public function setWebhooksOnMessageSentMethod($webhooksOnMessageSentMethod) { $this->options['webhooksOnMessageSentMethod'] = $webhooksOnMessageSentMethod; return $this; } /** * The URL of the webhook to call in response to the `on_message_updated` event using the `webhooks.on_message_updated.method` HTTP method. * * @param string $webhooksOnMessageUpdatedUrl The URL of the webhook to call in * response to the * on_message_updated event * @return $this Fluent Builder */ public function setWebhooksOnMessageUpdatedUrl($webhooksOnMessageUpdatedUrl) { $this->options['webhooksOnMessageUpdatedUrl'] = $webhooksOnMessageUpdatedUrl; return $this; } /** * The HTTP method to use when calling the `webhooks.on_message_updated.url`. * * @param string $webhooksOnMessageUpdatedMethod The HTTP method to use when * calling the * webhooks.on_message_updated.url * @return $this Fluent Builder */ public function setWebhooksOnMessageUpdatedMethod($webhooksOnMessageUpdatedMethod) { $this->options['webhooksOnMessageUpdatedMethod'] = $webhooksOnMessageUpdatedMethod; return $this; } /** * The URL of the webhook to call in response to the `on_message_removed` event using the `webhooks.on_message_removed.method` HTTP method. * * @param string $webhooksOnMessageRemovedUrl The URL of the webhook to call in * response to the * on_message_removed event * @return $this Fluent Builder */ public function setWebhooksOnMessageRemovedUrl($webhooksOnMessageRemovedUrl) { $this->options['webhooksOnMessageRemovedUrl'] = $webhooksOnMessageRemovedUrl; return $this; } /** * The HTTP method to use when calling the `webhooks.on_message_removed.url`. * * @param string $webhooksOnMessageRemovedMethod The HTTP method to use when * calling the * webhooks.on_message_removed.url * @return $this Fluent Builder */ public function setWebhooksOnMessageRemovedMethod($webhooksOnMessageRemovedMethod) { $this->options['webhooksOnMessageRemovedMethod'] = $webhooksOnMessageRemovedMethod; return $this; } /** * The URL of the webhook to call in response to the `on_channel_added` event using the `webhooks.on_channel_added.method` HTTP method. * * @param string $webhooksOnChannelAddedUrl The URL of the webhook to call in * response to the on_channel_added * event * @return $this Fluent Builder */ public function setWebhooksOnChannelAddedUrl($webhooksOnChannelAddedUrl) { $this->options['webhooksOnChannelAddedUrl'] = $webhooksOnChannelAddedUrl; return $this; } /** * The URL of the webhook to call in response to the `on_channel_added` event`. * * @param string $webhooksOnChannelAddedMethod The URL of the webhook to call * in response to the * on_channel_added event * @return $this Fluent Builder */ public function setWebhooksOnChannelAddedMethod($webhooksOnChannelAddedMethod) { $this->options['webhooksOnChannelAddedMethod'] = $webhooksOnChannelAddedMethod; return $this; } /** * The URL of the webhook to call in response to the `on_channel_added` event using the `webhooks.on_channel_destroyed.method` HTTP method. * * @param string $webhooksOnChannelDestroyedUrl The URL of the webhook to call * in response to the * on_channel_added event * @return $this Fluent Builder */ public function setWebhooksOnChannelDestroyedUrl($webhooksOnChannelDestroyedUrl) { $this->options['webhooksOnChannelDestroyedUrl'] = $webhooksOnChannelDestroyedUrl; return $this; } /** * The HTTP method to use when calling the `webhooks.on_channel_destroyed.url`. * * @param string $webhooksOnChannelDestroyedMethod The HTTP method to use when * calling the * webhooks.on_channel_destroyed.url * @return $this Fluent Builder */ public function setWebhooksOnChannelDestroyedMethod($webhooksOnChannelDestroyedMethod) { $this->options['webhooksOnChannelDestroyedMethod'] = $webhooksOnChannelDestroyedMethod; return $this; } /** * The URL of the webhook to call in response to the `on_channel_updated` event using the `webhooks.on_channel_updated.method` HTTP method. * * @param string $webhooksOnChannelUpdatedUrl he URL of the webhook to call in * response to the * on_channel_updated event * @return $this Fluent Builder */ public function setWebhooksOnChannelUpdatedUrl($webhooksOnChannelUpdatedUrl) { $this->options['webhooksOnChannelUpdatedUrl'] = $webhooksOnChannelUpdatedUrl; return $this; } /** * The HTTP method to use when calling the `webhooks.on_channel_updated.url`. * * @param string $webhooksOnChannelUpdatedMethod The HTTP method to use when * calling the * webhooks.on_channel_updated.url * @return $this Fluent Builder */ public function setWebhooksOnChannelUpdatedMethod($webhooksOnChannelUpdatedMethod) { $this->options['webhooksOnChannelUpdatedMethod'] = $webhooksOnChannelUpdatedMethod; return $this; } /** * The URL of the webhook to call in response to the `on_channel_updated` event using the `webhooks.on_channel_updated.method` HTTP method. * * @param string $webhooksOnMemberAddedUrl The URL of the webhook to call in * response to the on_channel_updated * event * @return $this Fluent Builder */ public function setWebhooksOnMemberAddedUrl($webhooksOnMemberAddedUrl) { $this->options['webhooksOnMemberAddedUrl'] = $webhooksOnMemberAddedUrl; return $this; } /** * The HTTP method to use when calling the `webhooks.on_channel_updated.url`. * * @param string $webhooksOnMemberAddedMethod he HTTP method to use when * calling the * webhooks.on_channel_updated.url * @return $this Fluent Builder */ public function setWebhooksOnMemberAddedMethod($webhooksOnMemberAddedMethod) { $this->options['webhooksOnMemberAddedMethod'] = $webhooksOnMemberAddedMethod; return $this; } /** * The URL of the webhook to call in response to the `on_member_removed` event using the `webhooks.on_member_removed.method` HTTP method. * * @param string $webhooksOnMemberRemovedUrl The URL of the webhook to call in * response to the on_member_removed * event * @return $this Fluent Builder */ public function setWebhooksOnMemberRemovedUrl($webhooksOnMemberRemovedUrl) { $this->options['webhooksOnMemberRemovedUrl'] = $webhooksOnMemberRemovedUrl; return $this; } /** * The HTTP method to use when calling the `webhooks.on_member_removed.url`. * * @param string $webhooksOnMemberRemovedMethod The HTTP method to use when * calling the * webhooks.on_member_removed.url * @return $this Fluent Builder */ public function setWebhooksOnMemberRemovedMethod($webhooksOnMemberRemovedMethod) { $this->options['webhooksOnMemberRemovedMethod'] = $webhooksOnMemberRemovedMethod; return $this; } /** * The maximum number of Members that can be added to Channels within this Service. Can be up to 1,000. * * @param int $limitsChannelMembers The maximum number of Members that can be * added to Channels within this Service * @return $this Fluent Builder */ public function setLimitsChannelMembers($limitsChannelMembers) { $this->options['limitsChannelMembers'] = $limitsChannelMembers; return $this; } /** * The maximum number of Channels Users can be a Member of within this Service. Can be up to 1,000. * * @param int $limitsUserChannels The maximum number of Channels Users can be a * Member of within this Service * @return $this Fluent Builder */ public function setLimitsUserChannels($limitsUserChannels) { $this->options['limitsUserChannels'] = $limitsUserChannels; 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.Chat.V1.UpdateServiceOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Chat/V1/CredentialContext.php 0000644 00000005533 15002236443 0015602 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class CredentialContext extends InstanceContext { /** * Initialize the CredentialContext * * @param \Twilio\Version $version Version that contains the resource * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Chat\V1\CredentialContext */ public function __construct(Version $version, $sid) { parent::__construct($version); // Path Solution $this->solution = array('sid' => $sid, ); $this->uri = '/Credentials/' . \rawurlencode($sid) . ''; } /** * Fetch a CredentialInstance * * @return CredentialInstance Fetched CredentialInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new CredentialInstance($this->version, $payload, $this->solution['sid']); } /** * Update the CredentialInstance * * @param array|Options $options Optional Arguments * @return CredentialInstance Updated CredentialInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { $options = new Values($options); $data = Values::of(array( 'FriendlyName' => $options['friendlyName'], 'Certificate' => $options['certificate'], 'PrivateKey' => $options['privateKey'], 'Sandbox' => Serialize::booleanToString($options['sandbox']), 'ApiKey' => $options['apiKey'], 'Secret' => $options['secret'], )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new CredentialInstance($this->version, $payload, $this->solution['sid']); } /** * Deletes the CredentialInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Chat.V1.CredentialContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Chat/V1/CredentialOptions.php 0000644 00000027060 15002236443 0015610 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V1; use Twilio\Options; use Twilio\Values; abstract class CredentialOptions { /** * @param string $friendlyName A string to describe the resource * @param string $certificate [APN only] The URL encoded representation of the * certificate * @param string $privateKey [APN only] The URL encoded representation of the * private key * @param bool $sandbox [APN only] Whether to send the credential to sandbox * APNs * @param string $apiKey [GCM only] The API key for the project that was * obtained from the Google Developer console for your * GCM Service application credential * @param string $secret [FCM only] The Server key of your project from * Firebase console * @return CreateCredentialOptions Options builder */ public static function create($friendlyName = Values::NONE, $certificate = Values::NONE, $privateKey = Values::NONE, $sandbox = Values::NONE, $apiKey = Values::NONE, $secret = Values::NONE) { return new CreateCredentialOptions($friendlyName, $certificate, $privateKey, $sandbox, $apiKey, $secret); } /** * @param string $friendlyName A string to describe the resource * @param string $certificate [APN only] The URL encoded representation of the * certificate * @param string $privateKey [APN only] The URL encoded representation of the * private key * @param bool $sandbox [APN only] Whether to send the credential to sandbox * APNs * @param string $apiKey [GCM only] The API key for the project that was * obtained from the Google Developer console for your * GCM Service application credential * @param string $secret [FCM only] The Server key of your project from * Firebase console * @return UpdateCredentialOptions Options builder */ public static function update($friendlyName = Values::NONE, $certificate = Values::NONE, $privateKey = Values::NONE, $sandbox = Values::NONE, $apiKey = Values::NONE, $secret = Values::NONE) { return new UpdateCredentialOptions($friendlyName, $certificate, $privateKey, $sandbox, $apiKey, $secret); } } class CreateCredentialOptions extends Options { /** * @param string $friendlyName A string to describe the resource * @param string $certificate [APN only] The URL encoded representation of the * certificate * @param string $privateKey [APN only] The URL encoded representation of the * private key * @param bool $sandbox [APN only] Whether to send the credential to sandbox * APNs * @param string $apiKey [GCM only] The API key for the project that was * obtained from the Google Developer console for your * GCM Service application credential * @param string $secret [FCM only] The Server key of your project from * Firebase console */ public function __construct($friendlyName = Values::NONE, $certificate = Values::NONE, $privateKey = Values::NONE, $sandbox = Values::NONE, $apiKey = Values::NONE, $secret = Values::NONE) { $this->options['friendlyName'] = $friendlyName; $this->options['certificate'] = $certificate; $this->options['privateKey'] = $privateKey; $this->options['sandbox'] = $sandbox; $this->options['apiKey'] = $apiKey; $this->options['secret'] = $secret; } /** * A descriptive string that you create to describe the new resource. It can be up to 64 characters long. * * @param string $friendlyName A string to describe the resource * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * [APN only] The URL encoded representation of the certificate. For example, `-----BEGIN CERTIFICATE----- MIIFnTCCBIWgAwIBAgIIAjy9H849+E8wDQYJKoZIhvcNAQEFBQAwgZYxCzAJBgNV.....A== -----END CERTIFICATE-----` * * @param string $certificate [APN only] The URL encoded representation of the * certificate * @return $this Fluent Builder */ public function setCertificate($certificate) { $this->options['certificate'] = $certificate; return $this; } /** * [APN only] The URL encoded representation of the private key. For example, `-----BEGIN RSA PRIVATE KEY----- MIIEpQIBAAKCAQEAuyf/lNrH9ck8DmNyo3fGgvCI1l9s+cmBY3WIz+cUDqmxiieR. -----END RSA PRIVATE KEY-----` * * @param string $privateKey [APN only] The URL encoded representation of the * private key * @return $this Fluent Builder */ public function setPrivateKey($privateKey) { $this->options['privateKey'] = $privateKey; return $this; } /** * [APN only] Whether to send the credential to sandbox APNs. Can be `true` to send to sandbox APNs or `false` to send to production. * * @param bool $sandbox [APN only] Whether to send the credential to sandbox * APNs * @return $this Fluent Builder */ public function setSandbox($sandbox) { $this->options['sandbox'] = $sandbox; return $this; } /** * [GCM only] The API key for the project that was obtained from the Google Developer console for your GCM Service application credential. * * @param string $apiKey [GCM only] The API key for the project that was * obtained from the Google Developer console for your * GCM Service application credential * @return $this Fluent Builder */ public function setApiKey($apiKey) { $this->options['apiKey'] = $apiKey; return $this; } /** * [FCM only] The **Server key** of your project from the Firebase console, found under Settings / Cloud messaging. * * @param string $secret [FCM only] The Server key of your project from * Firebase console * @return $this Fluent Builder */ public function setSecret($secret) { $this->options['secret'] = $secret; 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.Chat.V1.CreateCredentialOptions ' . \implode(' ', $options) . ']'; } } class UpdateCredentialOptions extends Options { /** * @param string $friendlyName A string to describe the resource * @param string $certificate [APN only] The URL encoded representation of the * certificate * @param string $privateKey [APN only] The URL encoded representation of the * private key * @param bool $sandbox [APN only] Whether to send the credential to sandbox * APNs * @param string $apiKey [GCM only] The API key for the project that was * obtained from the Google Developer console for your * GCM Service application credential * @param string $secret [FCM only] The Server key of your project from * Firebase console */ public function __construct($friendlyName = Values::NONE, $certificate = Values::NONE, $privateKey = Values::NONE, $sandbox = Values::NONE, $apiKey = Values::NONE, $secret = Values::NONE) { $this->options['friendlyName'] = $friendlyName; $this->options['certificate'] = $certificate; $this->options['privateKey'] = $privateKey; $this->options['sandbox'] = $sandbox; $this->options['apiKey'] = $apiKey; $this->options['secret'] = $secret; } /** * A descriptive string that you create to describe the resource. It can be up to 64 characters long. * * @param string $friendlyName A string to describe the resource * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * [APN only] The URL encoded representation of the certificate. For example, `-----BEGIN CERTIFICATE----- MIIFnTCCBIWgAwIBAgIIAjy9H849+E8wDQYJKoZIhvcNAQEFBQAwgZYxCzAJBgNV.....A== -----END CERTIFICATE-----` * * @param string $certificate [APN only] The URL encoded representation of the * certificate * @return $this Fluent Builder */ public function setCertificate($certificate) { $this->options['certificate'] = $certificate; return $this; } /** * [APN only] The URL encoded representation of the private key. For example, `-----BEGIN RSA PRIVATE KEY----- MIIEpQIBAAKCAQEAuyf/lNrH9ck8DmNyo3fGgvCI1l9s+cmBY3WIz+cUDqmxiieR. -----END RSA PRIVATE KEY-----` * * @param string $privateKey [APN only] The URL encoded representation of the * private key * @return $this Fluent Builder */ public function setPrivateKey($privateKey) { $this->options['privateKey'] = $privateKey; return $this; } /** * [APN only] Whether to send the credential to sandbox APNs. Can be `true` to send to sandbox APNs or `false` to send to production. * * @param bool $sandbox [APN only] Whether to send the credential to sandbox * APNs * @return $this Fluent Builder */ public function setSandbox($sandbox) { $this->options['sandbox'] = $sandbox; return $this; } /** * [GCM only] The API key for the project that was obtained from the Google Developer console for your GCM Service application credential. * * @param string $apiKey [GCM only] The API key for the project that was * obtained from the Google Developer console for your * GCM Service application credential * @return $this Fluent Builder */ public function setApiKey($apiKey) { $this->options['apiKey'] = $apiKey; return $this; } /** * [FCM only] The **Server key** of your project from the Firebase console, found under Settings / Cloud messaging. * * @param string $secret [FCM only] The Server key of your project from * Firebase console * @return $this Fluent Builder */ public function setSecret($secret) { $this->options['secret'] = $secret; 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.Chat.V1.UpdateCredentialOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Chat/V1/ServiceList.php 0000644 00000012271 15002236443 0014414 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Values; use Twilio\Version; class ServiceList extends ListResource { /** * Construct the ServiceList * * @param Version $version Version that contains the resource * @return \Twilio\Rest\Chat\V1\ServiceList */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = array(); $this->uri = '/Services'; } /** * Create a new ServiceInstance * * @param string $friendlyName A string to describe the resource * @return ServiceInstance Newly created ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function create($friendlyName) { $data = Values::of(array('FriendlyName' => $friendlyName, )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new ServiceInstance($this->version, $payload); } /** * Streams ServiceInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads ServiceInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return ServiceInstance[] Array of results */ public function read($limit = null, $pageSize = null) { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of ServiceInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of ServiceInstance */ public function page($pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $params = Values::of(array( 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new ServicePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of ServiceInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of ServiceInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new ServicePage($this->version, $response, $this->solution); } /** * Constructs a ServiceContext * * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Chat\V1\ServiceContext */ public function getContext($sid) { return new ServiceContext($this->version, $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Chat.V1.ServiceList]'; } } sdk/src/Twilio/Rest/Chat/V1/CredentialList.php 0000644 00000013406 15002236443 0015067 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class CredentialList extends ListResource { /** * Construct the CredentialList * * @param Version $version Version that contains the resource * @return \Twilio\Rest\Chat\V1\CredentialList */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = array(); $this->uri = '/Credentials'; } /** * Streams CredentialInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads CredentialInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return CredentialInstance[] Array of results */ public function read($limit = null, $pageSize = null) { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of CredentialInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of CredentialInstance */ public function page($pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $params = Values::of(array( 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new CredentialPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of CredentialInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of CredentialInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new CredentialPage($this->version, $response, $this->solution); } /** * Create a new CredentialInstance * * @param string $type The type of push-notification service the credential is * for * @param array|Options $options Optional Arguments * @return CredentialInstance Newly created CredentialInstance * @throws TwilioException When an HTTP error occurs. */ public function create($type, $options = array()) { $options = new Values($options); $data = Values::of(array( 'Type' => $type, 'FriendlyName' => $options['friendlyName'], 'Certificate' => $options['certificate'], 'PrivateKey' => $options['privateKey'], 'Sandbox' => Serialize::booleanToString($options['sandbox']), 'ApiKey' => $options['apiKey'], 'Secret' => $options['secret'], )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new CredentialInstance($this->version, $payload); } /** * Constructs a CredentialContext * * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Chat\V1\CredentialContext */ public function getContext($sid) { return new CredentialContext($this->version, $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Chat.V1.CredentialList]'; } } sdk/src/Twilio/Rest/Chat/V1/ServicePage.php 0000644 00000001312 15002236443 0014347 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V1; use Twilio\Page; class ServicePage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new ServiceInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Chat.V1.ServicePage]'; } } sdk/src/Twilio/Rest/Chat/V1/CredentialPage.php 0000644 00000001323 15002236443 0015023 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V1; use Twilio\Page; class CredentialPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new CredentialInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Chat.V1.CredentialPage]'; } } sdk/src/Twilio/Rest/Chat/V1/ServiceInstance.php 0000644 00000014270 15002236443 0015246 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V1; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $accountSid * @property string $friendlyName * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $defaultServiceRoleSid * @property string $defaultChannelRoleSid * @property string $defaultChannelCreatorRoleSid * @property bool $readStatusEnabled * @property bool $reachabilityEnabled * @property int $typingIndicatorTimeout * @property int $consumptionReportInterval * @property array $limits * @property array $webhooks * @property string $preWebhookUrl * @property string $postWebhookUrl * @property string $webhookMethod * @property string $webhookFilters * @property array $notifications * @property string $url * @property array $links */ class ServiceInstance extends InstanceResource { protected $_channels = null; protected $_roles = null; protected $_users = null; /** * Initialize the ServiceInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Chat\V1\ServiceInstance */ public function __construct(Version $version, array $payload, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'defaultServiceRoleSid' => Values::array_get($payload, 'default_service_role_sid'), 'defaultChannelRoleSid' => Values::array_get($payload, 'default_channel_role_sid'), 'defaultChannelCreatorRoleSid' => Values::array_get($payload, 'default_channel_creator_role_sid'), 'readStatusEnabled' => Values::array_get($payload, 'read_status_enabled'), 'reachabilityEnabled' => Values::array_get($payload, 'reachability_enabled'), 'typingIndicatorTimeout' => Values::array_get($payload, 'typing_indicator_timeout'), 'consumptionReportInterval' => Values::array_get($payload, 'consumption_report_interval'), 'limits' => Values::array_get($payload, 'limits'), 'webhooks' => Values::array_get($payload, 'webhooks'), 'preWebhookUrl' => Values::array_get($payload, 'pre_webhook_url'), 'postWebhookUrl' => Values::array_get($payload, 'post_webhook_url'), 'webhookMethod' => Values::array_get($payload, 'webhook_method'), 'webhookFilters' => Values::array_get($payload, 'webhook_filters'), 'notifications' => Values::array_get($payload, 'notifications'), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ); $this->solution = array('sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Chat\V1\ServiceContext Context for this ServiceInstance */ protected function proxy() { if (!$this->context) { $this->context = new ServiceContext($this->version, $this->solution['sid']); } return $this->context; } /** * Fetch a ServiceInstance * * @return ServiceInstance Fetched ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the ServiceInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Update the ServiceInstance * * @param array|Options $options Optional Arguments * @return ServiceInstance Updated ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Access the channels * * @return \Twilio\Rest\Chat\V1\Service\ChannelList */ protected function getChannels() { return $this->proxy()->channels; } /** * Access the roles * * @return \Twilio\Rest\Chat\V1\Service\RoleList */ protected function getRoles() { return $this->proxy()->roles; } /** * Access the users * * @return \Twilio\Rest\Chat\V1\Service\UserList */ protected function getUsers() { return $this->proxy()->users; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Chat.V1.ServiceInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Chat/V1/Service/UserContext.php 0000644 00000011140 15002236443 0016035 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Rest\Chat\V1\Service\User\UserChannelList; use Twilio\Values; use Twilio\Version; /** * @property \Twilio\Rest\Chat\V1\Service\User\UserChannelList $userChannels */ class UserContext extends InstanceContext { protected $_userChannels = null; /** * Initialize the UserContext * * @param \Twilio\Version $version Version that contains the resource * @param string $serviceSid The SID of the Service to fetch the resource from * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Chat\V1\Service\UserContext */ public function __construct(Version $version, $serviceSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, 'sid' => $sid, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Users/' . \rawurlencode($sid) . ''; } /** * Fetch a UserInstance * * @return UserInstance Fetched UserInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new UserInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Deletes the UserInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Update the UserInstance * * @param array|Options $options Optional Arguments * @return UserInstance Updated UserInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { $options = new Values($options); $data = Values::of(array( 'RoleSid' => $options['roleSid'], 'Attributes' => $options['attributes'], 'FriendlyName' => $options['friendlyName'], )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new UserInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Access the userChannels * * @return \Twilio\Rest\Chat\V1\Service\User\UserChannelList */ protected function getUserChannels() { if (!$this->_userChannels) { $this->_userChannels = new UserChannelList( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->_userChannels; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get($name) { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Chat.V1.UserContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Chat/V1/Service/User/UserChannelPage.php 0000644 00000001530 15002236443 0017476 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V1\Service\User; use Twilio\Page; class UserChannelPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new UserChannelInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['userSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Chat.V1.UserChannelPage]'; } } sdk/src/Twilio/Rest/Chat/V1/Service/User/UserChannelList.php 0000644 00000011362 15002236443 0017541 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V1\Service\User; use Twilio\ListResource; use Twilio\Values; use Twilio\Version; class UserChannelList extends ListResource { /** * Construct the UserChannelList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Service that the resource is * associated with * @param string $userSid The unique string that identifies the resource * @return \Twilio\Rest\Chat\V1\Service\User\UserChannelList */ public function __construct(Version $version, $serviceSid, $userSid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, 'userSid' => $userSid, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Users/' . \rawurlencode($userSid) . '/Channels'; } /** * Streams UserChannelInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads UserChannelInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return UserChannelInstance[] Array of results */ public function read($limit = null, $pageSize = null) { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of UserChannelInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of UserChannelInstance */ public function page($pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $params = Values::of(array( 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new UserChannelPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of UserChannelInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of UserChannelInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new UserChannelPage($this->version, $response, $this->solution); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Chat.V1.UserChannelList]'; } } sdk/src/Twilio/Rest/Chat/V1/Service/User/UserChannelInstance.php 0000644 00000005303 15002236443 0020370 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V1\Service\User; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property string $serviceSid * @property string $channelSid * @property string $memberSid * @property string $status * @property int $lastConsumedMessageIndex * @property int $unreadMessagesCount * @property array $links */ class UserChannelInstance extends InstanceResource { /** * Initialize the UserChannelInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the Service that the resource is * associated with * @param string $userSid The unique string that identifies the resource * @return \Twilio\Rest\Chat\V1\Service\User\UserChannelInstance */ public function __construct(Version $version, array $payload, $serviceSid, $userSid) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'channelSid' => Values::array_get($payload, 'channel_sid'), 'memberSid' => Values::array_get($payload, 'member_sid'), 'status' => Values::array_get($payload, 'status'), 'lastConsumedMessageIndex' => Values::array_get($payload, 'last_consumed_message_index'), 'unreadMessagesCount' => Values::array_get($payload, 'unread_messages_count'), 'links' => Values::array_get($payload, 'links'), ); $this->solution = array('serviceSid' => $serviceSid, 'userSid' => $userSid, ); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Chat.V1.UserChannelInstance]'; } } sdk/src/Twilio/Rest/Chat/V1/Service/RoleInstance.php 0000644 00000010527 15002236443 0016150 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V1\Service; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $accountSid * @property string $serviceSid * @property string $friendlyName * @property string $type * @property string $permissions * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $url */ class RoleInstance extends InstanceResource { /** * Initialize the RoleInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the Service that the resource is * associated with * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Chat\V1\Service\RoleInstance */ public function __construct(Version $version, array $payload, $serviceSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'type' => Values::array_get($payload, 'type'), 'permissions' => Values::array_get($payload, 'permissions'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), ); $this->solution = array('serviceSid' => $serviceSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Chat\V1\Service\RoleContext Context for this * RoleInstance */ protected function proxy() { if (!$this->context) { $this->context = new RoleContext( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch a RoleInstance * * @return RoleInstance Fetched RoleInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the RoleInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Update the RoleInstance * * @param string $permission A permission the role should have * @return RoleInstance Updated RoleInstance * @throws TwilioException When an HTTP error occurs. */ public function update($permission) { return $this->proxy()->update($permission); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Chat.V1.RoleInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Chat/V1/Service/ChannelInstance.php 0000644 00000013100 15002236443 0016605 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V1\Service; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $accountSid * @property string $serviceSid * @property string $friendlyName * @property string $uniqueName * @property string $attributes * @property string $type * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $createdBy * @property int $membersCount * @property int $messagesCount * @property string $url * @property array $links */ class ChannelInstance extends InstanceResource { protected $_members = null; protected $_messages = null; protected $_invites = null; /** * Initialize the ChannelInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the Service that the resource is * associated with * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Chat\V1\Service\ChannelInstance */ public function __construct(Version $version, array $payload, $serviceSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'uniqueName' => Values::array_get($payload, 'unique_name'), 'attributes' => Values::array_get($payload, 'attributes'), 'type' => Values::array_get($payload, 'type'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'createdBy' => Values::array_get($payload, 'created_by'), 'membersCount' => Values::array_get($payload, 'members_count'), 'messagesCount' => Values::array_get($payload, 'messages_count'), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ); $this->solution = array('serviceSid' => $serviceSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Chat\V1\Service\ChannelContext Context for this * ChannelInstance */ protected function proxy() { if (!$this->context) { $this->context = new ChannelContext( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch a ChannelInstance * * @return ChannelInstance Fetched ChannelInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the ChannelInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Update the ChannelInstance * * @param array|Options $options Optional Arguments * @return ChannelInstance Updated ChannelInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Access the members * * @return \Twilio\Rest\Chat\V1\Service\Channel\MemberList */ protected function getMembers() { return $this->proxy()->members; } /** * Access the messages * * @return \Twilio\Rest\Chat\V1\Service\Channel\MessageList */ protected function getMessages() { return $this->proxy()->messages; } /** * Access the invites * * @return \Twilio\Rest\Chat\V1\Service\Channel\InviteList */ protected function getInvites() { return $this->proxy()->invites; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Chat.V1.ChannelInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Chat/V1/Service/UserList.php 0000644 00000013407 15002236443 0015334 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; class UserList extends ListResource { /** * Construct the UserList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Service that the resource is * associated with * @return \Twilio\Rest\Chat\V1\Service\UserList */ public function __construct(Version $version, $serviceSid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Users'; } /** * Create a new UserInstance * * @param string $identity The `identity` value that identifies the new * resource's User * @param array|Options $options Optional Arguments * @return UserInstance Newly created UserInstance * @throws TwilioException When an HTTP error occurs. */ public function create($identity, $options = array()) { $options = new Values($options); $data = Values::of(array( 'Identity' => $identity, 'RoleSid' => $options['roleSid'], 'Attributes' => $options['attributes'], 'FriendlyName' => $options['friendlyName'], )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new UserInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Streams UserInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads UserInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return UserInstance[] Array of results */ public function read($limit = null, $pageSize = null) { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of UserInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of UserInstance */ public function page($pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $params = Values::of(array( 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new UserPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of UserInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of UserInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new UserPage($this->version, $response, $this->solution); } /** * Constructs a UserContext * * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Chat\V1\Service\UserContext */ public function getContext($sid) { return new UserContext($this->version, $this->solution['serviceSid'], $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Chat.V1.UserList]'; } } sdk/src/Twilio/Rest/Chat/V1/Service/UserPage.php 0000644 00000001350 15002236443 0015267 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V1\Service; use Twilio\Page; class UserPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new UserInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Chat.V1.UserPage]'; } } sdk/src/Twilio/Rest/Chat/V1/Service/UserOptions.php 0000644 00000012774 15002236443 0016062 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V1\Service; use Twilio\Options; use Twilio\Values; abstract class UserOptions { /** * @param string $roleSid The SID of the Role assigned to this user * @param string $attributes A valid JSON string that contains * application-specific data * @param string $friendlyName A string to describe the new resource * @return CreateUserOptions Options builder */ public static function create($roleSid = Values::NONE, $attributes = Values::NONE, $friendlyName = Values::NONE) { return new CreateUserOptions($roleSid, $attributes, $friendlyName); } /** * @param string $roleSid The SID id of the Role assigned to this user * @param string $attributes A valid JSON string that contains * application-specific data * @param string $friendlyName A string to describe the resource * @return UpdateUserOptions Options builder */ public static function update($roleSid = Values::NONE, $attributes = Values::NONE, $friendlyName = Values::NONE) { return new UpdateUserOptions($roleSid, $attributes, $friendlyName); } } class CreateUserOptions extends Options { /** * @param string $roleSid The SID of the Role assigned to this user * @param string $attributes A valid JSON string that contains * application-specific data * @param string $friendlyName A string to describe the new resource */ public function __construct($roleSid = Values::NONE, $attributes = Values::NONE, $friendlyName = Values::NONE) { $this->options['roleSid'] = $roleSid; $this->options['attributes'] = $attributes; $this->options['friendlyName'] = $friendlyName; } /** * The SID of the [Role](https://www.twilio.com/docs/api/chat/rest/roles) assigned to the new User. * * @param string $roleSid The SID of the Role assigned to this user * @return $this Fluent Builder */ public function setRoleSid($roleSid) { $this->options['roleSid'] = $roleSid; return $this; } /** * A valid JSON string that contains application-specific data. * * @param string $attributes A valid JSON string that contains * application-specific data * @return $this Fluent Builder */ public function setAttributes($attributes) { $this->options['attributes'] = $attributes; return $this; } /** * A descriptive string that you create to describe the new resource. This value is often used for display purposes. * * @param string $friendlyName A string to describe the new resource * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; 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.Chat.V1.CreateUserOptions ' . \implode(' ', $options) . ']'; } } class UpdateUserOptions extends Options { /** * @param string $roleSid The SID id of the Role assigned to this user * @param string $attributes A valid JSON string that contains * application-specific data * @param string $friendlyName A string to describe the resource */ public function __construct($roleSid = Values::NONE, $attributes = Values::NONE, $friendlyName = Values::NONE) { $this->options['roleSid'] = $roleSid; $this->options['attributes'] = $attributes; $this->options['friendlyName'] = $friendlyName; } /** * The SID of the [Role](https://www.twilio.com/docs/api/chat/rest/roles) assigned to this user. * * @param string $roleSid The SID id of the Role assigned to this user * @return $this Fluent Builder */ public function setRoleSid($roleSid) { $this->options['roleSid'] = $roleSid; return $this; } /** * A valid JSON string that contains application-specific data. * * @param string $attributes A valid JSON string that contains * application-specific data * @return $this Fluent Builder */ public function setAttributes($attributes) { $this->options['attributes'] = $attributes; return $this; } /** * A descriptive string that you create to describe the resource. It is often used for display purposes. * * @param string $friendlyName A string to describe the resource * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; 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.Chat.V1.UpdateUserOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Chat/V1/Service/RolePage.php 0000644 00000001350 15002236443 0015252 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V1\Service; use Twilio\Page; class RolePage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new RoleInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Chat.V1.RolePage]'; } } sdk/src/Twilio/Rest/Chat/V1/Service/RoleContext.php 0000644 00000005465 15002236443 0016035 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class RoleContext extends InstanceContext { /** * Initialize the RoleContext * * @param \Twilio\Version $version Version that contains the resource * @param string $serviceSid The SID of the Service to fetch the resource from * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Chat\V1\Service\RoleContext */ public function __construct(Version $version, $serviceSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, 'sid' => $sid, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Roles/' . \rawurlencode($sid) . ''; } /** * Fetch a RoleInstance * * @return RoleInstance Fetched RoleInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new RoleInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Deletes the RoleInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Update the RoleInstance * * @param string $permission A permission the role should have * @return RoleInstance Updated RoleInstance * @throws TwilioException When an HTTP error occurs. */ public function update($permission) { $data = Values::of(array('Permission' => Serialize::map($permission, function($e) { return $e; }), )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new RoleInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Chat.V1.RoleContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Chat/V1/Service/ChannelList.php 0000644 00000014125 15002236443 0015764 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class ChannelList extends ListResource { /** * Construct the ChannelList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Service that the resource is * associated with * @return \Twilio\Rest\Chat\V1\Service\ChannelList */ public function __construct(Version $version, $serviceSid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Channels'; } /** * Create a new ChannelInstance * * @param array|Options $options Optional Arguments * @return ChannelInstance Newly created ChannelInstance * @throws TwilioException When an HTTP error occurs. */ public function create($options = array()) { $options = new Values($options); $data = Values::of(array( 'FriendlyName' => $options['friendlyName'], 'UniqueName' => $options['uniqueName'], 'Attributes' => $options['attributes'], 'Type' => $options['type'], )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new ChannelInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Streams ChannelInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($options = array(), $limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads ChannelInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return ChannelInstance[] Array of results */ public function read($options = array(), $limit = null, $pageSize = null) { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Retrieve a single page of ChannelInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of ChannelInstance */ public function page($options = array(), $pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $options = new Values($options); $params = Values::of(array( 'Type' => Serialize::map($options['type'], function($e) { return $e; }), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new ChannelPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of ChannelInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of ChannelInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new ChannelPage($this->version, $response, $this->solution); } /** * Constructs a ChannelContext * * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Chat\V1\Service\ChannelContext */ public function getContext($sid) { return new ChannelContext($this->version, $this->solution['serviceSid'], $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Chat.V1.ChannelList]'; } } sdk/src/Twilio/Rest/Chat/V1/Service/ChannelContext.php 0000644 00000013722 15002236443 0016477 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Rest\Chat\V1\Service\Channel\InviteList; use Twilio\Rest\Chat\V1\Service\Channel\MemberList; use Twilio\Rest\Chat\V1\Service\Channel\MessageList; use Twilio\Values; use Twilio\Version; /** * @property \Twilio\Rest\Chat\V1\Service\Channel\MemberList $members * @property \Twilio\Rest\Chat\V1\Service\Channel\MessageList $messages * @property \Twilio\Rest\Chat\V1\Service\Channel\InviteList $invites * @method \Twilio\Rest\Chat\V1\Service\Channel\MemberContext members(string $sid) * @method \Twilio\Rest\Chat\V1\Service\Channel\MessageContext messages(string $sid) * @method \Twilio\Rest\Chat\V1\Service\Channel\InviteContext invites(string $sid) */ class ChannelContext extends InstanceContext { protected $_members = null; protected $_messages = null; protected $_invites = null; /** * Initialize the ChannelContext * * @param \Twilio\Version $version Version that contains the resource * @param string $serviceSid The SID of the Service to fetch the resource from * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Chat\V1\Service\ChannelContext */ public function __construct(Version $version, $serviceSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, 'sid' => $sid, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Channels/' . \rawurlencode($sid) . ''; } /** * Fetch a ChannelInstance * * @return ChannelInstance Fetched ChannelInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new ChannelInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Deletes the ChannelInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Update the ChannelInstance * * @param array|Options $options Optional Arguments * @return ChannelInstance Updated ChannelInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { $options = new Values($options); $data = Values::of(array( 'FriendlyName' => $options['friendlyName'], 'UniqueName' => $options['uniqueName'], 'Attributes' => $options['attributes'], )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new ChannelInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Access the members * * @return \Twilio\Rest\Chat\V1\Service\Channel\MemberList */ protected function getMembers() { if (!$this->_members) { $this->_members = new MemberList( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->_members; } /** * Access the messages * * @return \Twilio\Rest\Chat\V1\Service\Channel\MessageList */ protected function getMessages() { if (!$this->_messages) { $this->_messages = new MessageList( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->_messages; } /** * Access the invites * * @return \Twilio\Rest\Chat\V1\Service\Channel\InviteList */ protected function getInvites() { if (!$this->_invites) { $this->_invites = new InviteList( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->_invites; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get($name) { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Chat.V1.ChannelContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Chat/V1/Service/ChannelPage.php 0000644 00000001361 15002236443 0015723 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V1\Service; use Twilio\Page; class ChannelPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new ChannelInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Chat.V1.ChannelPage]'; } } sdk/src/Twilio/Rest/Chat/V1/Service/UserInstance.php 0000644 00000012154 15002236443 0016163 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V1\Service; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $accountSid * @property string $serviceSid * @property string $attributes * @property string $friendlyName * @property string $roleSid * @property string $identity * @property bool $isOnline * @property bool $isNotifiable * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property int $joinedChannelsCount * @property array $links * @property string $url */ class UserInstance extends InstanceResource { protected $_userChannels = null; /** * Initialize the UserInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the Service that the resource is * associated with * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Chat\V1\Service\UserInstance */ public function __construct(Version $version, array $payload, $serviceSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'attributes' => Values::array_get($payload, 'attributes'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'roleSid' => Values::array_get($payload, 'role_sid'), 'identity' => Values::array_get($payload, 'identity'), 'isOnline' => Values::array_get($payload, 'is_online'), 'isNotifiable' => Values::array_get($payload, 'is_notifiable'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'joinedChannelsCount' => Values::array_get($payload, 'joined_channels_count'), 'links' => Values::array_get($payload, 'links'), 'url' => Values::array_get($payload, 'url'), ); $this->solution = array('serviceSid' => $serviceSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Chat\V1\Service\UserContext Context for this * UserInstance */ protected function proxy() { if (!$this->context) { $this->context = new UserContext( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch a UserInstance * * @return UserInstance Fetched UserInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the UserInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Update the UserInstance * * @param array|Options $options Optional Arguments * @return UserInstance Updated UserInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Access the userChannels * * @return \Twilio\Rest\Chat\V1\Service\User\UserChannelList */ protected function getUserChannels() { return $this->proxy()->userChannels; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Chat.V1.UserInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Chat/V1/Service/ChannelOptions.php 0000644 00000017647 15002236443 0016520 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V1\Service; use Twilio\Options; use Twilio\Values; abstract class ChannelOptions { /** * @param string $friendlyName A string to describe the new resource * @param string $uniqueName An application-defined string that uniquely * identifies the resource * @param string $attributes A valid JSON string that contains * application-specific data * @param string $type The visibility of the channel * @return CreateChannelOptions Options builder */ public static function create($friendlyName = Values::NONE, $uniqueName = Values::NONE, $attributes = Values::NONE, $type = Values::NONE) { return new CreateChannelOptions($friendlyName, $uniqueName, $attributes, $type); } /** * @param string $type The visibility of the channel to read * @return ReadChannelOptions Options builder */ public static function read($type = Values::NONE) { return new ReadChannelOptions($type); } /** * @param string $friendlyName A string to describe the resource * @param string $uniqueName An application-defined string that uniquely * identifies the resource * @param string $attributes A valid JSON string that contains * application-specific data * @return UpdateChannelOptions Options builder */ public static function update($friendlyName = Values::NONE, $uniqueName = Values::NONE, $attributes = Values::NONE) { return new UpdateChannelOptions($friendlyName, $uniqueName, $attributes); } } class CreateChannelOptions extends Options { /** * @param string $friendlyName A string to describe the new resource * @param string $uniqueName An application-defined string that uniquely * identifies the resource * @param string $attributes A valid JSON string that contains * application-specific data * @param string $type The visibility of the channel */ public function __construct($friendlyName = Values::NONE, $uniqueName = Values::NONE, $attributes = Values::NONE, $type = Values::NONE) { $this->options['friendlyName'] = $friendlyName; $this->options['uniqueName'] = $uniqueName; $this->options['attributes'] = $attributes; $this->options['type'] = $type; } /** * A descriptive string that you create to describe the new resource. It can be up to 64 characters long. * * @param string $friendlyName A string to describe the new resource * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * An application-defined string that uniquely identifies the resource. It can be used to address the resource in place of the resource's `sid` in the URL. This value must be 64 characters or less in length and be unique within the Service. * * @param string $uniqueName An application-defined string that uniquely * identifies the resource * @return $this Fluent Builder */ public function setUniqueName($uniqueName) { $this->options['uniqueName'] = $uniqueName; return $this; } /** * A valid JSON string that contains application-specific data. * * @param string $attributes A valid JSON string that contains * application-specific data * @return $this Fluent Builder */ public function setAttributes($attributes) { $this->options['attributes'] = $attributes; return $this; } /** * The visibility of the channel. Can be: `public` or `private` and defaults to `public`. * * @param string $type The visibility of the channel * @return $this Fluent Builder */ public function setType($type) { $this->options['type'] = $type; 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.Chat.V1.CreateChannelOptions ' . \implode(' ', $options) . ']'; } } class ReadChannelOptions extends Options { /** * @param string $type The visibility of the channel to read */ public function __construct($type = Values::NONE) { $this->options['type'] = $type; } /** * The visibility of the Channels to read. Can be: `public` or `private` and defaults to `public`. * * @param string $type The visibility of the channel to read * @return $this Fluent Builder */ public function setType($type) { $this->options['type'] = $type; 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.Chat.V1.ReadChannelOptions ' . \implode(' ', $options) . ']'; } } class UpdateChannelOptions extends Options { /** * @param string $friendlyName A string to describe the resource * @param string $uniqueName An application-defined string that uniquely * identifies the resource * @param string $attributes A valid JSON string that contains * application-specific data */ public function __construct($friendlyName = Values::NONE, $uniqueName = Values::NONE, $attributes = Values::NONE) { $this->options['friendlyName'] = $friendlyName; $this->options['uniqueName'] = $uniqueName; $this->options['attributes'] = $attributes; } /** * A descriptive string that you create to describe the resource. It can be up to 64 characters long. * * @param string $friendlyName A string to describe the resource * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * An application-defined string that uniquely identifies the resource. It can be used to address the resource in place of the resource's `sid` in the URL. This value must be 64 characters or less in length and be unique within the Service. * * @param string $uniqueName An application-defined string that uniquely * identifies the resource * @return $this Fluent Builder */ public function setUniqueName($uniqueName) { $this->options['uniqueName'] = $uniqueName; return $this; } /** * A valid JSON string that contains application-specific data. * * @param string $attributes A valid JSON string that contains * application-specific data * @return $this Fluent Builder */ public function setAttributes($attributes) { $this->options['attributes'] = $attributes; 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.Chat.V1.UpdateChannelOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Chat/V1/Service/RoleList.php 0000644 00000013311 15002236443 0015311 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class RoleList extends ListResource { /** * Construct the RoleList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Service that the resource is * associated with * @return \Twilio\Rest\Chat\V1\Service\RoleList */ public function __construct(Version $version, $serviceSid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Roles'; } /** * Create a new RoleInstance * * @param string $friendlyName A string to describe the new resource * @param string $type The type of role * @param string $permission A permission the role should have * @return RoleInstance Newly created RoleInstance * @throws TwilioException When an HTTP error occurs. */ public function create($friendlyName, $type, $permission) { $data = Values::of(array( 'FriendlyName' => $friendlyName, 'Type' => $type, 'Permission' => Serialize::map($permission, function($e) { return $e; }), )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new RoleInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Streams RoleInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads RoleInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return RoleInstance[] Array of results */ public function read($limit = null, $pageSize = null) { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of RoleInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of RoleInstance */ public function page($pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $params = Values::of(array( 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new RolePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of RoleInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of RoleInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new RolePage($this->version, $response, $this->solution); } /** * Constructs a RoleContext * * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Chat\V1\Service\RoleContext */ public function getContext($sid) { return new RoleContext($this->version, $this->solution['serviceSid'], $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Chat.V1.RoleList]'; } } sdk/src/Twilio/Rest/Chat/V1/Service/Channel/MessageContext.php 0000644 00000006270 15002236443 0020063 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V1\Service\Channel; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Values; use Twilio\Version; class MessageContext extends InstanceContext { /** * Initialize the MessageContext * * @param \Twilio\Version $version Version that contains the resource * @param string $serviceSid The SID of the Service to fetch the resource from * @param string $channelSid The unique ID of the Channel the message to fetch * belongs to * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Chat\V1\Service\Channel\MessageContext */ public function __construct(Version $version, $serviceSid, $channelSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, 'channelSid' => $channelSid, 'sid' => $sid, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Channels/' . \rawurlencode($channelSid) . '/Messages/' . \rawurlencode($sid) . ''; } /** * Fetch a MessageInstance * * @return MessageInstance Fetched MessageInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new MessageInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid'], $this->solution['sid'] ); } /** * Deletes the MessageInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Update the MessageInstance * * @param array|Options $options Optional Arguments * @return MessageInstance Updated MessageInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { $options = new Values($options); $data = Values::of(array('Body' => $options['body'], 'Attributes' => $options['attributes'], )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new MessageInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Chat.V1.MessageContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Chat/V1/Service/Channel/MemberOptions.php 0000644 00000012663 15002236443 0017720 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V1\Service\Channel; use Twilio\Options; use Twilio\Values; abstract class MemberOptions { /** * @param string $roleSid The SID of the Role to assign to the member * @return CreateMemberOptions Options builder */ public static function create($roleSid = Values::NONE) { return new CreateMemberOptions($roleSid); } /** * @param string $identity The `identity` value of the resources to read * @return ReadMemberOptions Options builder */ public static function read($identity = Values::NONE) { return new ReadMemberOptions($identity); } /** * @param string $roleSid The SID of the Role to assign to the member * @param int $lastConsumedMessageIndex The index of the last consumed Message * for the Channel for the Member * @return UpdateMemberOptions Options builder */ public static function update($roleSid = Values::NONE, $lastConsumedMessageIndex = Values::NONE) { return new UpdateMemberOptions($roleSid, $lastConsumedMessageIndex); } } class CreateMemberOptions extends Options { /** * @param string $roleSid The SID of the Role to assign to the member */ public function __construct($roleSid = Values::NONE) { $this->options['roleSid'] = $roleSid; } /** * The SID of the [Role](https://www.twilio.com/docs/api/chat/rest/roles) to assign to the member. The default roles are those specified on the [Service](https://www.twilio.com/docs/chat/api/services). * * @param string $roleSid The SID of the Role to assign to the member * @return $this Fluent Builder */ public function setRoleSid($roleSid) { $this->options['roleSid'] = $roleSid; 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.Chat.V1.CreateMemberOptions ' . \implode(' ', $options) . ']'; } } class ReadMemberOptions extends Options { /** * @param string $identity The `identity` value of the resources to read */ public function __construct($identity = Values::NONE) { $this->options['identity'] = $identity; } /** * The [User](https://www.twilio.com/docs/api/chat/rest/v1/user)'s `identity` value of the resources to read. See [access tokens](https://www.twilio.com/docs/api/chat/guides/create-tokens) for more details. * * @param string $identity The `identity` value of the resources to read * @return $this Fluent Builder */ public function setIdentity($identity) { $this->options['identity'] = $identity; 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.Chat.V1.ReadMemberOptions ' . \implode(' ', $options) . ']'; } } class UpdateMemberOptions extends Options { /** * @param string $roleSid The SID of the Role to assign to the member * @param int $lastConsumedMessageIndex The index of the last consumed Message * for the Channel for the Member */ public function __construct($roleSid = Values::NONE, $lastConsumedMessageIndex = Values::NONE) { $this->options['roleSid'] = $roleSid; $this->options['lastConsumedMessageIndex'] = $lastConsumedMessageIndex; } /** * The SID of the [Role](https://www.twilio.com/docs/api/chat/rest/roles) to assign to the member. The default roles are those specified on the [Service](https://www.twilio.com/docs/chat/api/services). * * @param string $roleSid The SID of the Role to assign to the member * @return $this Fluent Builder */ public function setRoleSid($roleSid) { $this->options['roleSid'] = $roleSid; return $this; } /** * The index of the last [Message](https://www.twilio.com/docs/api/chat/rest/messages) that the Member has read within the [Channel](https://www.twilio.com/docs/api/chat/rest/channels). * * @param int $lastConsumedMessageIndex The index of the last consumed Message * for the Channel for the Member * @return $this Fluent Builder */ public function setLastConsumedMessageIndex($lastConsumedMessageIndex) { $this->options['lastConsumedMessageIndex'] = $lastConsumedMessageIndex; 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.Chat.V1.UpdateMemberOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Chat/V1/Service/Channel/MemberContext.php 0000644 00000006302 15002236443 0017702 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V1\Service\Channel; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Values; use Twilio\Version; class MemberContext extends InstanceContext { /** * Initialize the MemberContext * * @param \Twilio\Version $version Version that contains the resource * @param string $serviceSid The SID of the Service to fetch the resource from * @param string $channelSid The unique ID of the channel the member belongs to * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Chat\V1\Service\Channel\MemberContext */ public function __construct(Version $version, $serviceSid, $channelSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, 'channelSid' => $channelSid, 'sid' => $sid, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Channels/' . \rawurlencode($channelSid) . '/Members/' . \rawurlencode($sid) . ''; } /** * Fetch a MemberInstance * * @return MemberInstance Fetched MemberInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new MemberInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid'], $this->solution['sid'] ); } /** * Deletes the MemberInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Update the MemberInstance * * @param array|Options $options Optional Arguments * @return MemberInstance Updated MemberInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { $options = new Values($options); $data = Values::of(array( 'RoleSid' => $options['roleSid'], 'LastConsumedMessageIndex' => $options['lastConsumedMessageIndex'], )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new MemberInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Chat.V1.MemberContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Chat/V1/Service/Channel/MessageList.php 0000644 00000014651 15002236443 0017354 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V1\Service\Channel; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; class MessageList extends ListResource { /** * Construct the MessageList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Service that the resource is * associated with * @param string $channelSid The unique ID of the Channel the Message resource * belongs to * @return \Twilio\Rest\Chat\V1\Service\Channel\MessageList */ public function __construct(Version $version, $serviceSid, $channelSid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, 'channelSid' => $channelSid, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Channels/' . \rawurlencode($channelSid) . '/Messages'; } /** * Create a new MessageInstance * * @param string $body The message to send to the channel * @param array|Options $options Optional Arguments * @return MessageInstance Newly created MessageInstance * @throws TwilioException When an HTTP error occurs. */ public function create($body, $options = array()) { $options = new Values($options); $data = Values::of(array( 'Body' => $body, 'From' => $options['from'], 'Attributes' => $options['attributes'], )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new MessageInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid'] ); } /** * Streams MessageInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($options = array(), $limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads MessageInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return MessageInstance[] Array of results */ public function read($options = array(), $limit = null, $pageSize = null) { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Retrieve a single page of MessageInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of MessageInstance */ public function page($options = array(), $pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $options = new Values($options); $params = Values::of(array( 'Order' => $options['order'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new MessagePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of MessageInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of MessageInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new MessagePage($this->version, $response, $this->solution); } /** * Constructs a MessageContext * * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Chat\V1\Service\Channel\MessageContext */ public function getContext($sid) { return new MessageContext( $this->version, $this->solution['serviceSid'], $this->solution['channelSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Chat.V1.MessageList]'; } } sdk/src/Twilio/Rest/Chat/V1/Service/Channel/MessageInstance.php 0000644 00000012011 15002236443 0020171 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V1\Service\Channel; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $accountSid * @property string $attributes * @property string $serviceSid * @property string $to * @property string $channelSid * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property bool $wasEdited * @property string $from * @property string $body * @property int $index * @property string $url */ class MessageInstance extends InstanceResource { /** * Initialize the MessageInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the Service that the resource is * associated with * @param string $channelSid The unique ID of the Channel the Message resource * belongs to * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Chat\V1\Service\Channel\MessageInstance */ public function __construct(Version $version, array $payload, $serviceSid, $channelSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'attributes' => Values::array_get($payload, 'attributes'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'to' => Values::array_get($payload, 'to'), 'channelSid' => Values::array_get($payload, 'channel_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'wasEdited' => Values::array_get($payload, 'was_edited'), 'from' => Values::array_get($payload, 'from'), 'body' => Values::array_get($payload, 'body'), 'index' => Values::array_get($payload, 'index'), 'url' => Values::array_get($payload, 'url'), ); $this->solution = array( 'serviceSid' => $serviceSid, 'channelSid' => $channelSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Chat\V1\Service\Channel\MessageContext Context for this * MessageInstance */ protected function proxy() { if (!$this->context) { $this->context = new MessageContext( $this->version, $this->solution['serviceSid'], $this->solution['channelSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch a MessageInstance * * @return MessageInstance Fetched MessageInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the MessageInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Update the MessageInstance * * @param array|Options $options Optional Arguments * @return MessageInstance Updated MessageInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Chat.V1.MessageInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Chat/V1/Service/Channel/MemberList.php 0000644 00000014645 15002236443 0017202 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V1\Service\Channel; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class MemberList extends ListResource { /** * Construct the MemberList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Service that the resource is * associated with * @param string $channelSid The unique ID of the Channel for the member * @return \Twilio\Rest\Chat\V1\Service\Channel\MemberList */ public function __construct(Version $version, $serviceSid, $channelSid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, 'channelSid' => $channelSid, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Channels/' . \rawurlencode($channelSid) . '/Members'; } /** * Create a new MemberInstance * * @param string $identity The `identity` value that identifies the new * resource's User * @param array|Options $options Optional Arguments * @return MemberInstance Newly created MemberInstance * @throws TwilioException When an HTTP error occurs. */ public function create($identity, $options = array()) { $options = new Values($options); $data = Values::of(array('Identity' => $identity, 'RoleSid' => $options['roleSid'], )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new MemberInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid'] ); } /** * Streams MemberInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($options = array(), $limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads MemberInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return MemberInstance[] Array of results */ public function read($options = array(), $limit = null, $pageSize = null) { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Retrieve a single page of MemberInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of MemberInstance */ public function page($options = array(), $pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $options = new Values($options); $params = Values::of(array( 'Identity' => Serialize::map($options['identity'], function($e) { return $e; }), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new MemberPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of MemberInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of MemberInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new MemberPage($this->version, $response, $this->solution); } /** * Constructs a MemberContext * * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Chat\V1\Service\Channel\MemberContext */ public function getContext($sid) { return new MemberContext( $this->version, $this->solution['serviceSid'], $this->solution['channelSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Chat.V1.MemberList]'; } } sdk/src/Twilio/Rest/Chat/V1/Service/Channel/InviteContext.php 0000644 00000004603 15002236443 0017733 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V1\Service\Channel; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; class InviteContext extends InstanceContext { /** * Initialize the InviteContext * * @param \Twilio\Version $version Version that contains the resource * @param string $serviceSid The SID of the Service to fetch the resource from * @param string $channelSid The SID of the Channel the resource to fetch * belongs to * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Chat\V1\Service\Channel\InviteContext */ public function __construct(Version $version, $serviceSid, $channelSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, 'channelSid' => $channelSid, 'sid' => $sid, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Channels/' . \rawurlencode($channelSid) . '/Invites/' . \rawurlencode($sid) . ''; } /** * Fetch a InviteInstance * * @return InviteInstance Fetched InviteInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new InviteInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid'], $this->solution['sid'] ); } /** * Deletes the InviteInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Chat.V1.InviteContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Chat/V1/Service/Channel/MemberPage.php 0000644 00000001517 15002236443 0017135 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V1\Service\Channel; use Twilio\Page; class MemberPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new MemberInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Chat.V1.MemberPage]'; } } sdk/src/Twilio/Rest/Chat/V1/Service/Channel/InviteList.php 0000644 00000014654 15002236443 0017231 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V1\Service\Channel; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class InviteList extends ListResource { /** * Construct the InviteList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Service that the resource is * associated with * @param string $channelSid The SID of the Channel the new resource belongs to * @return \Twilio\Rest\Chat\V1\Service\Channel\InviteList */ public function __construct(Version $version, $serviceSid, $channelSid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, 'channelSid' => $channelSid, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Channels/' . \rawurlencode($channelSid) . '/Invites'; } /** * Create a new InviteInstance * * @param string $identity The `identity` value that identifies the new * resource's User * @param array|Options $options Optional Arguments * @return InviteInstance Newly created InviteInstance * @throws TwilioException When an HTTP error occurs. */ public function create($identity, $options = array()) { $options = new Values($options); $data = Values::of(array('Identity' => $identity, 'RoleSid' => $options['roleSid'], )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new InviteInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid'] ); } /** * Streams InviteInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($options = array(), $limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads InviteInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return InviteInstance[] Array of results */ public function read($options = array(), $limit = null, $pageSize = null) { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Retrieve a single page of InviteInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of InviteInstance */ public function page($options = array(), $pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $options = new Values($options); $params = Values::of(array( 'Identity' => Serialize::map($options['identity'], function($e) { return $e; }), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new InvitePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of InviteInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of InviteInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new InvitePage($this->version, $response, $this->solution); } /** * Constructs a InviteContext * * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Chat\V1\Service\Channel\InviteContext */ public function getContext($sid) { return new InviteContext( $this->version, $this->solution['serviceSid'], $this->solution['channelSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Chat.V1.InviteList]'; } } sdk/src/Twilio/Rest/Chat/V1/Service/Channel/MessagePage.php 0000644 00000001522 15002236443 0017306 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V1\Service\Channel; use Twilio\Page; class MessagePage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new MessageInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Chat.V1.MessagePage]'; } } sdk/src/Twilio/Rest/Chat/V1/Service/Channel/InvitePage.php 0000644 00000001517 15002236443 0017164 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V1\Service\Channel; use Twilio\Page; class InvitePage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new InviteInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Chat.V1.InvitePage]'; } } sdk/src/Twilio/Rest/Chat/V1/Service/Channel/InviteOptions.php 0000644 00000005561 15002236443 0017746 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V1\Service\Channel; use Twilio\Options; use Twilio\Values; abstract class InviteOptions { /** * @param string $roleSid The Role assigned to the new member * @return CreateInviteOptions Options builder */ public static function create($roleSid = Values::NONE) { return new CreateInviteOptions($roleSid); } /** * @param string $identity The `identity` value of the resources to read * @return ReadInviteOptions Options builder */ public static function read($identity = Values::NONE) { return new ReadInviteOptions($identity); } } class CreateInviteOptions extends Options { /** * @param string $roleSid The Role assigned to the new member */ public function __construct($roleSid = Values::NONE) { $this->options['roleSid'] = $roleSid; } /** * The SID of the [Role](https://www.twilio.com/docs/api/chat/rest/roles) assigned to the new member. * * @param string $roleSid The Role assigned to the new member * @return $this Fluent Builder */ public function setRoleSid($roleSid) { $this->options['roleSid'] = $roleSid; 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.Chat.V1.CreateInviteOptions ' . \implode(' ', $options) . ']'; } } class ReadInviteOptions extends Options { /** * @param string $identity The `identity` value of the resources to read */ public function __construct($identity = Values::NONE) { $this->options['identity'] = $identity; } /** * The [User](https://www.twilio.com/docs/api/chat/rest/v1/user)'s `identity` value of the resources to read. See [access tokens](https://www.twilio.com/docs/api/chat/guides/create-tokens) for more details. * * @param string $identity The `identity` value of the resources to read * @return $this Fluent Builder */ public function setIdentity($identity) { $this->options['identity'] = $identity; 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.Chat.V1.ReadInviteOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Chat/V1/Service/Channel/InviteInstance.php 0000644 00000010600 15002236443 0020045 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V1\Service\Channel; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $accountSid * @property string $channelSid * @property string $serviceSid * @property string $identity * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $roleSid * @property string $createdBy * @property string $url */ class InviteInstance extends InstanceResource { /** * Initialize the InviteInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the Service that the resource is * associated with * @param string $channelSid The SID of the Channel the new resource belongs to * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Chat\V1\Service\Channel\InviteInstance */ public function __construct(Version $version, array $payload, $serviceSid, $channelSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'channelSid' => Values::array_get($payload, 'channel_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'identity' => Values::array_get($payload, 'identity'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'roleSid' => Values::array_get($payload, 'role_sid'), 'createdBy' => Values::array_get($payload, 'created_by'), 'url' => Values::array_get($payload, 'url'), ); $this->solution = array( 'serviceSid' => $serviceSid, 'channelSid' => $channelSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Chat\V1\Service\Channel\InviteContext Context for this * InviteInstance */ protected function proxy() { if (!$this->context) { $this->context = new InviteContext( $this->version, $this->solution['serviceSid'], $this->solution['channelSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch a InviteInstance * * @return InviteInstance Fetched InviteInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the InviteInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Chat.V1.InviteInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Chat/V1/Service/Channel/MessageOptions.php 0000644 00000013022 15002236443 0020063 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V1\Service\Channel; use Twilio\Options; use Twilio\Values; abstract class MessageOptions { /** * @param string $from The identity of the new message's author * @param string $attributes A valid JSON string that contains * application-specific data * @return CreateMessageOptions Options builder */ public static function create($from = Values::NONE, $attributes = Values::NONE) { return new CreateMessageOptions($from, $attributes); } /** * @param string $order The sort order of the returned messages * @return ReadMessageOptions Options builder */ public static function read($order = Values::NONE) { return new ReadMessageOptions($order); } /** * @param string $body The message to send to the channel * @param string $attributes A valid JSON string that contains * application-specific data * @return UpdateMessageOptions Options builder */ public static function update($body = Values::NONE, $attributes = Values::NONE) { return new UpdateMessageOptions($body, $attributes); } } class CreateMessageOptions extends Options { /** * @param string $from The identity of the new message's author * @param string $attributes A valid JSON string that contains * application-specific data */ public function __construct($from = Values::NONE, $attributes = Values::NONE) { $this->options['from'] = $from; $this->options['attributes'] = $attributes; } /** * The [identity](https://www.twilio.com/docs/api/chat/guides/identity) of the new message's author. The default value is `system`. * * @param string $from The identity of the new message's author * @return $this Fluent Builder */ public function setFrom($from) { $this->options['from'] = $from; return $this; } /** * A valid JSON string that contains application-specific data. * * @param string $attributes A valid JSON string that contains * application-specific data * @return $this Fluent Builder */ public function setAttributes($attributes) { $this->options['attributes'] = $attributes; 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.Chat.V1.CreateMessageOptions ' . \implode(' ', $options) . ']'; } } class ReadMessageOptions extends Options { /** * @param string $order The sort order of the returned messages */ public function __construct($order = Values::NONE) { $this->options['order'] = $order; } /** * The sort order of the returned messages. Can be: `asc` (ascending) or `desc` (descending) with `asc` as the default. * * @param string $order The sort order of the returned messages * @return $this Fluent Builder */ public function setOrder($order) { $this->options['order'] = $order; 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.Chat.V1.ReadMessageOptions ' . \implode(' ', $options) . ']'; } } class UpdateMessageOptions extends Options { /** * @param string $body The message to send to the channel * @param string $attributes A valid JSON string that contains * application-specific data */ public function __construct($body = Values::NONE, $attributes = Values::NONE) { $this->options['body'] = $body; $this->options['attributes'] = $attributes; } /** * The message to send to the channel. Can also be an empty string or `null`, which sets the value as an empty string. You can send structured data in the body by serializing it as a string. * * @param string $body The message to send to the channel * @return $this Fluent Builder */ public function setBody($body) { $this->options['body'] = $body; return $this; } /** * A valid JSON string that contains application-specific data. * * @param string $attributes A valid JSON string that contains * application-specific data * @return $this Fluent Builder */ public function setAttributes($attributes) { $this->options['attributes'] = $attributes; 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.Chat.V1.UpdateMessageOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Chat/V1/Service/Channel/MemberInstance.php 0000644 00000011656 15002236443 0020032 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V1\Service\Channel; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $accountSid * @property string $channelSid * @property string $serviceSid * @property string $identity * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $roleSid * @property int $lastConsumedMessageIndex * @property \DateTime $lastConsumptionTimestamp * @property string $url */ class MemberInstance extends InstanceResource { /** * Initialize the MemberInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the Service that the resource is * associated with * @param string $channelSid The unique ID of the Channel for the member * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Chat\V1\Service\Channel\MemberInstance */ public function __construct(Version $version, array $payload, $serviceSid, $channelSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'channelSid' => Values::array_get($payload, 'channel_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'identity' => Values::array_get($payload, 'identity'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'roleSid' => Values::array_get($payload, 'role_sid'), 'lastConsumedMessageIndex' => Values::array_get($payload, 'last_consumed_message_index'), 'lastConsumptionTimestamp' => Deserialize::dateTime(Values::array_get($payload, 'last_consumption_timestamp')), 'url' => Values::array_get($payload, 'url'), ); $this->solution = array( 'serviceSid' => $serviceSid, 'channelSid' => $channelSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Chat\V1\Service\Channel\MemberContext Context for this * MemberInstance */ protected function proxy() { if (!$this->context) { $this->context = new MemberContext( $this->version, $this->solution['serviceSid'], $this->solution['channelSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch a MemberInstance * * @return MemberInstance Fetched MemberInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the MemberInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Update the MemberInstance * * @param array|Options $options Optional Arguments * @return MemberInstance Updated MemberInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Chat.V1.MemberInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Chat/V1/ServiceContext.php 0000644 00000023413 15002236443 0015125 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Rest\Chat\V1\Service\ChannelList; use Twilio\Rest\Chat\V1\Service\RoleList; use Twilio\Rest\Chat\V1\Service\UserList; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * @property \Twilio\Rest\Chat\V1\Service\ChannelList $channels * @property \Twilio\Rest\Chat\V1\Service\RoleList $roles * @property \Twilio\Rest\Chat\V1\Service\UserList $users * @method \Twilio\Rest\Chat\V1\Service\ChannelContext channels(string $sid) * @method \Twilio\Rest\Chat\V1\Service\RoleContext roles(string $sid) * @method \Twilio\Rest\Chat\V1\Service\UserContext users(string $sid) */ class ServiceContext extends InstanceContext { protected $_channels = null; protected $_roles = null; protected $_users = null; /** * Initialize the ServiceContext * * @param \Twilio\Version $version Version that contains the resource * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Chat\V1\ServiceContext */ public function __construct(Version $version, $sid) { parent::__construct($version); // Path Solution $this->solution = array('sid' => $sid, ); $this->uri = '/Services/' . \rawurlencode($sid) . ''; } /** * Fetch a ServiceInstance * * @return ServiceInstance Fetched ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new ServiceInstance($this->version, $payload, $this->solution['sid']); } /** * Deletes the ServiceInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Update the ServiceInstance * * @param array|Options $options Optional Arguments * @return ServiceInstance Updated ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { $options = new Values($options); $data = Values::of(array( 'FriendlyName' => $options['friendlyName'], 'DefaultServiceRoleSid' => $options['defaultServiceRoleSid'], 'DefaultChannelRoleSid' => $options['defaultChannelRoleSid'], 'DefaultChannelCreatorRoleSid' => $options['defaultChannelCreatorRoleSid'], 'ReadStatusEnabled' => Serialize::booleanToString($options['readStatusEnabled']), 'ReachabilityEnabled' => Serialize::booleanToString($options['reachabilityEnabled']), 'TypingIndicatorTimeout' => $options['typingIndicatorTimeout'], 'ConsumptionReportInterval' => $options['consumptionReportInterval'], 'Notifications.NewMessage.Enabled' => Serialize::booleanToString($options['notificationsNewMessageEnabled']), 'Notifications.NewMessage.Template' => $options['notificationsNewMessageTemplate'], 'Notifications.AddedToChannel.Enabled' => Serialize::booleanToString($options['notificationsAddedToChannelEnabled']), 'Notifications.AddedToChannel.Template' => $options['notificationsAddedToChannelTemplate'], 'Notifications.RemovedFromChannel.Enabled' => Serialize::booleanToString($options['notificationsRemovedFromChannelEnabled']), 'Notifications.RemovedFromChannel.Template' => $options['notificationsRemovedFromChannelTemplate'], 'Notifications.InvitedToChannel.Enabled' => Serialize::booleanToString($options['notificationsInvitedToChannelEnabled']), 'Notifications.InvitedToChannel.Template' => $options['notificationsInvitedToChannelTemplate'], 'PreWebhookUrl' => $options['preWebhookUrl'], 'PostWebhookUrl' => $options['postWebhookUrl'], 'WebhookMethod' => $options['webhookMethod'], 'WebhookFilters' => Serialize::map($options['webhookFilters'], function($e) { return $e; }), 'Webhooks.OnMessageSend.Url' => $options['webhooksOnMessageSendUrl'], 'Webhooks.OnMessageSend.Method' => $options['webhooksOnMessageSendMethod'], 'Webhooks.OnMessageUpdate.Url' => $options['webhooksOnMessageUpdateUrl'], 'Webhooks.OnMessageUpdate.Method' => $options['webhooksOnMessageUpdateMethod'], 'Webhooks.OnMessageRemove.Url' => $options['webhooksOnMessageRemoveUrl'], 'Webhooks.OnMessageRemove.Method' => $options['webhooksOnMessageRemoveMethod'], 'Webhooks.OnChannelAdd.Url' => $options['webhooksOnChannelAddUrl'], 'Webhooks.OnChannelAdd.Method' => $options['webhooksOnChannelAddMethod'], 'Webhooks.OnChannelDestroy.Url' => $options['webhooksOnChannelDestroyUrl'], 'Webhooks.OnChannelDestroy.Method' => $options['webhooksOnChannelDestroyMethod'], 'Webhooks.OnChannelUpdate.Url' => $options['webhooksOnChannelUpdateUrl'], 'Webhooks.OnChannelUpdate.Method' => $options['webhooksOnChannelUpdateMethod'], 'Webhooks.OnMemberAdd.Url' => $options['webhooksOnMemberAddUrl'], 'Webhooks.OnMemberAdd.Method' => $options['webhooksOnMemberAddMethod'], 'Webhooks.OnMemberRemove.Url' => $options['webhooksOnMemberRemoveUrl'], 'Webhooks.OnMemberRemove.Method' => $options['webhooksOnMemberRemoveMethod'], 'Webhooks.OnMessageSent.Url' => $options['webhooksOnMessageSentUrl'], 'Webhooks.OnMessageSent.Method' => $options['webhooksOnMessageSentMethod'], 'Webhooks.OnMessageUpdated.Url' => $options['webhooksOnMessageUpdatedUrl'], 'Webhooks.OnMessageUpdated.Method' => $options['webhooksOnMessageUpdatedMethod'], 'Webhooks.OnMessageRemoved.Url' => $options['webhooksOnMessageRemovedUrl'], 'Webhooks.OnMessageRemoved.Method' => $options['webhooksOnMessageRemovedMethod'], 'Webhooks.OnChannelAdded.Url' => $options['webhooksOnChannelAddedUrl'], 'Webhooks.OnChannelAdded.Method' => $options['webhooksOnChannelAddedMethod'], 'Webhooks.OnChannelDestroyed.Url' => $options['webhooksOnChannelDestroyedUrl'], 'Webhooks.OnChannelDestroyed.Method' => $options['webhooksOnChannelDestroyedMethod'], 'Webhooks.OnChannelUpdated.Url' => $options['webhooksOnChannelUpdatedUrl'], 'Webhooks.OnChannelUpdated.Method' => $options['webhooksOnChannelUpdatedMethod'], 'Webhooks.OnMemberAdded.Url' => $options['webhooksOnMemberAddedUrl'], 'Webhooks.OnMemberAdded.Method' => $options['webhooksOnMemberAddedMethod'], 'Webhooks.OnMemberRemoved.Url' => $options['webhooksOnMemberRemovedUrl'], 'Webhooks.OnMemberRemoved.Method' => $options['webhooksOnMemberRemovedMethod'], 'Limits.ChannelMembers' => $options['limitsChannelMembers'], 'Limits.UserChannels' => $options['limitsUserChannels'], )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new ServiceInstance($this->version, $payload, $this->solution['sid']); } /** * Access the channels * * @return \Twilio\Rest\Chat\V1\Service\ChannelList */ protected function getChannels() { if (!$this->_channels) { $this->_channels = new ChannelList($this->version, $this->solution['sid']); } return $this->_channels; } /** * Access the roles * * @return \Twilio\Rest\Chat\V1\Service\RoleList */ protected function getRoles() { if (!$this->_roles) { $this->_roles = new RoleList($this->version, $this->solution['sid']); } return $this->_roles; } /** * Access the users * * @return \Twilio\Rest\Chat\V1\Service\UserList */ protected function getUsers() { if (!$this->_users) { $this->_users = new UserList($this->version, $this->solution['sid']); } return $this->_users; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get($name) { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Chat.V1.ServiceContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Chat/V2.php 0000644 00000005273 15002236443 0012165 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\Rest\Chat\V2\CredentialList; use Twilio\Rest\Chat\V2\ServiceList; use Twilio\Version; /** * @property \Twilio\Rest\Chat\V2\CredentialList $credentials * @property \Twilio\Rest\Chat\V2\ServiceList $services * @method \Twilio\Rest\Chat\V2\CredentialContext credentials(string $sid) * @method \Twilio\Rest\Chat\V2\ServiceContext services(string $sid) */ class V2 extends Version { protected $_credentials = null; protected $_services = null; /** * Construct the V2 version of Chat * * @param \Twilio\Domain $domain Domain that contains the version * @return \Twilio\Rest\Chat\V2 V2 version of Chat */ public function __construct(Domain $domain) { parent::__construct($domain); $this->version = 'v2'; } /** * @return \Twilio\Rest\Chat\V2\CredentialList */ protected function getCredentials() { if (!$this->_credentials) { $this->_credentials = new CredentialList($this); } return $this->_credentials; } /** * @return \Twilio\Rest\Chat\V2\ServiceList */ protected function getServices() { if (!$this->_services) { $this->_services = new ServiceList($this); } return $this->_services; } /** * Magic getter to lazy load root resources * * @param string $name Resource to return * @return \Twilio\ListResource The requested resource * @throws TwilioException For unknown resource */ public function __get($name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown resource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Chat.V2]'; } } sdk/src/Twilio/Rest/Chat/V2/CredentialInstance.php 0000644 00000010042 15002236443 0015712 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V2; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $accountSid * @property string $friendlyName * @property string $type * @property string $sandbox * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $url */ class CredentialInstance extends InstanceResource { /** * Initialize the CredentialInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The SID of the Credential resource to fetch * @return \Twilio\Rest\Chat\V2\CredentialInstance */ public function __construct(Version $version, array $payload, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'type' => Values::array_get($payload, 'type'), 'sandbox' => Values::array_get($payload, 'sandbox'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), ); $this->solution = array('sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Chat\V2\CredentialContext Context for this * CredentialInstance */ protected function proxy() { if (!$this->context) { $this->context = new CredentialContext($this->version, $this->solution['sid']); } return $this->context; } /** * Fetch a CredentialInstance * * @return CredentialInstance Fetched CredentialInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Update the CredentialInstance * * @param array|Options $options Optional Arguments * @return CredentialInstance Updated CredentialInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Deletes the CredentialInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Chat.V2.CredentialInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Chat/V2/ServiceOptions.php 0000644 00000112015 15002236443 0015132 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V2; use Twilio\Options; use Twilio\Values; abstract class ServiceOptions { /** * @param string $friendlyName A string to describe the resource * @param string $defaultServiceRoleSid The service role assigned to users when * they are added to the service * @param string $defaultChannelRoleSid The channel role assigned to users when * they are added to a channel * @param string $defaultChannelCreatorRoleSid The channel role assigned to a * channel creator when they join a * new channel * @param bool $readStatusEnabled Whether to enable the Message Consumption * Horizon feature * @param bool $reachabilityEnabled Whether to enable the Reachability * Indicator feature for this Service instance * @param int $typingIndicatorTimeout How long in seconds to wait before * assuming the user is no longer typing * @param int $consumptionReportInterval DEPRECATED * @param bool $notificationsNewMessageEnabled Whether to send a notification * when a new message is added to a * channel * @param string $notificationsNewMessageTemplate The template to use to create * the notification text * displayed when a new message * is added to a channel * @param string $notificationsNewMessageSound The name of the sound to play * when a new message is added to a * channel * @param bool $notificationsNewMessageBadgeCountEnabled Whether the new * message badge is * enabled * @param bool $notificationsAddedToChannelEnabled Whether to send a * notification when a member * is added to a channel * @param string $notificationsAddedToChannelTemplate The template to use to * create the notification * text displayed when a * member is added to a * channel * @param string $notificationsAddedToChannelSound The name of the sound to * play when a member is added * to a channel * @param bool $notificationsRemovedFromChannelEnabled Whether to send a * notification to a user * when they are removed * from a channel * @param string $notificationsRemovedFromChannelTemplate The template to use * to create the * notification text * displayed to a user * when they are removed * @param string $notificationsRemovedFromChannelSound The name of the sound to * play to a user when they * are removed from a * channel * @param bool $notificationsInvitedToChannelEnabled Whether to send a * notification when a user * is invited to a channel * @param string $notificationsInvitedToChannelTemplate The template to use to * create the notification * text displayed when a * user is invited to a * channel * @param string $notificationsInvitedToChannelSound The name of the sound to * play when a user is * invited to a channel * @param string $preWebhookUrl The webhook URL for pre-event webhooks * @param string $postWebhookUrl The URL for post-event webhooks * @param string $webhookMethod The HTTP method to use for both PRE and POST * webhooks * @param string $webhookFilters The list of webhook events that are enabled * for this Service instance * @param int $limitsChannelMembers The maximum number of Members that can be * added to Channels within this Service * @param int $limitsUserChannels The maximum number of Channels Users can be a * Member of within this Service * @param string $mediaCompatibilityMessage The message to send when a media * message has no text * @param int $preWebhookRetryCount Count of times webhook will be retried in * case of timeout or 429/503/504 HTTP * responses * @param int $postWebhookRetryCount The number of times calls to the * `post_webhook_url` will be retried * @param bool $notificationsLogEnabled Whether to log notifications * @return UpdateServiceOptions Options builder */ public static function update($friendlyName = Values::NONE, $defaultServiceRoleSid = Values::NONE, $defaultChannelRoleSid = Values::NONE, $defaultChannelCreatorRoleSid = Values::NONE, $readStatusEnabled = Values::NONE, $reachabilityEnabled = Values::NONE, $typingIndicatorTimeout = Values::NONE, $consumptionReportInterval = Values::NONE, $notificationsNewMessageEnabled = Values::NONE, $notificationsNewMessageTemplate = Values::NONE, $notificationsNewMessageSound = Values::NONE, $notificationsNewMessageBadgeCountEnabled = Values::NONE, $notificationsAddedToChannelEnabled = Values::NONE, $notificationsAddedToChannelTemplate = Values::NONE, $notificationsAddedToChannelSound = Values::NONE, $notificationsRemovedFromChannelEnabled = Values::NONE, $notificationsRemovedFromChannelTemplate = Values::NONE, $notificationsRemovedFromChannelSound = Values::NONE, $notificationsInvitedToChannelEnabled = Values::NONE, $notificationsInvitedToChannelTemplate = Values::NONE, $notificationsInvitedToChannelSound = Values::NONE, $preWebhookUrl = Values::NONE, $postWebhookUrl = Values::NONE, $webhookMethod = Values::NONE, $webhookFilters = Values::NONE, $limitsChannelMembers = Values::NONE, $limitsUserChannels = Values::NONE, $mediaCompatibilityMessage = Values::NONE, $preWebhookRetryCount = Values::NONE, $postWebhookRetryCount = Values::NONE, $notificationsLogEnabled = Values::NONE) { return new UpdateServiceOptions($friendlyName, $defaultServiceRoleSid, $defaultChannelRoleSid, $defaultChannelCreatorRoleSid, $readStatusEnabled, $reachabilityEnabled, $typingIndicatorTimeout, $consumptionReportInterval, $notificationsNewMessageEnabled, $notificationsNewMessageTemplate, $notificationsNewMessageSound, $notificationsNewMessageBadgeCountEnabled, $notificationsAddedToChannelEnabled, $notificationsAddedToChannelTemplate, $notificationsAddedToChannelSound, $notificationsRemovedFromChannelEnabled, $notificationsRemovedFromChannelTemplate, $notificationsRemovedFromChannelSound, $notificationsInvitedToChannelEnabled, $notificationsInvitedToChannelTemplate, $notificationsInvitedToChannelSound, $preWebhookUrl, $postWebhookUrl, $webhookMethod, $webhookFilters, $limitsChannelMembers, $limitsUserChannels, $mediaCompatibilityMessage, $preWebhookRetryCount, $postWebhookRetryCount, $notificationsLogEnabled); } } class UpdateServiceOptions extends Options { /** * @param string $friendlyName A string to describe the resource * @param string $defaultServiceRoleSid The service role assigned to users when * they are added to the service * @param string $defaultChannelRoleSid The channel role assigned to users when * they are added to a channel * @param string $defaultChannelCreatorRoleSid The channel role assigned to a * channel creator when they join a * new channel * @param bool $readStatusEnabled Whether to enable the Message Consumption * Horizon feature * @param bool $reachabilityEnabled Whether to enable the Reachability * Indicator feature for this Service instance * @param int $typingIndicatorTimeout How long in seconds to wait before * assuming the user is no longer typing * @param int $consumptionReportInterval DEPRECATED * @param bool $notificationsNewMessageEnabled Whether to send a notification * when a new message is added to a * channel * @param string $notificationsNewMessageTemplate The template to use to create * the notification text * displayed when a new message * is added to a channel * @param string $notificationsNewMessageSound The name of the sound to play * when a new message is added to a * channel * @param bool $notificationsNewMessageBadgeCountEnabled Whether the new * message badge is * enabled * @param bool $notificationsAddedToChannelEnabled Whether to send a * notification when a member * is added to a channel * @param string $notificationsAddedToChannelTemplate The template to use to * create the notification * text displayed when a * member is added to a * channel * @param string $notificationsAddedToChannelSound The name of the sound to * play when a member is added * to a channel * @param bool $notificationsRemovedFromChannelEnabled Whether to send a * notification to a user * when they are removed * from a channel * @param string $notificationsRemovedFromChannelTemplate The template to use * to create the * notification text * displayed to a user * when they are removed * @param string $notificationsRemovedFromChannelSound The name of the sound to * play to a user when they * are removed from a * channel * @param bool $notificationsInvitedToChannelEnabled Whether to send a * notification when a user * is invited to a channel * @param string $notificationsInvitedToChannelTemplate The template to use to * create the notification * text displayed when a * user is invited to a * channel * @param string $notificationsInvitedToChannelSound The name of the sound to * play when a user is * invited to a channel * @param string $preWebhookUrl The webhook URL for pre-event webhooks * @param string $postWebhookUrl The URL for post-event webhooks * @param string $webhookMethod The HTTP method to use for both PRE and POST * webhooks * @param string $webhookFilters The list of webhook events that are enabled * for this Service instance * @param int $limitsChannelMembers The maximum number of Members that can be * added to Channels within this Service * @param int $limitsUserChannels The maximum number of Channels Users can be a * Member of within this Service * @param string $mediaCompatibilityMessage The message to send when a media * message has no text * @param int $preWebhookRetryCount Count of times webhook will be retried in * case of timeout or 429/503/504 HTTP * responses * @param int $postWebhookRetryCount The number of times calls to the * `post_webhook_url` will be retried * @param bool $notificationsLogEnabled Whether to log notifications */ public function __construct($friendlyName = Values::NONE, $defaultServiceRoleSid = Values::NONE, $defaultChannelRoleSid = Values::NONE, $defaultChannelCreatorRoleSid = Values::NONE, $readStatusEnabled = Values::NONE, $reachabilityEnabled = Values::NONE, $typingIndicatorTimeout = Values::NONE, $consumptionReportInterval = Values::NONE, $notificationsNewMessageEnabled = Values::NONE, $notificationsNewMessageTemplate = Values::NONE, $notificationsNewMessageSound = Values::NONE, $notificationsNewMessageBadgeCountEnabled = Values::NONE, $notificationsAddedToChannelEnabled = Values::NONE, $notificationsAddedToChannelTemplate = Values::NONE, $notificationsAddedToChannelSound = Values::NONE, $notificationsRemovedFromChannelEnabled = Values::NONE, $notificationsRemovedFromChannelTemplate = Values::NONE, $notificationsRemovedFromChannelSound = Values::NONE, $notificationsInvitedToChannelEnabled = Values::NONE, $notificationsInvitedToChannelTemplate = Values::NONE, $notificationsInvitedToChannelSound = Values::NONE, $preWebhookUrl = Values::NONE, $postWebhookUrl = Values::NONE, $webhookMethod = Values::NONE, $webhookFilters = Values::NONE, $limitsChannelMembers = Values::NONE, $limitsUserChannels = Values::NONE, $mediaCompatibilityMessage = Values::NONE, $preWebhookRetryCount = Values::NONE, $postWebhookRetryCount = Values::NONE, $notificationsLogEnabled = Values::NONE) { $this->options['friendlyName'] = $friendlyName; $this->options['defaultServiceRoleSid'] = $defaultServiceRoleSid; $this->options['defaultChannelRoleSid'] = $defaultChannelRoleSid; $this->options['defaultChannelCreatorRoleSid'] = $defaultChannelCreatorRoleSid; $this->options['readStatusEnabled'] = $readStatusEnabled; $this->options['reachabilityEnabled'] = $reachabilityEnabled; $this->options['typingIndicatorTimeout'] = $typingIndicatorTimeout; $this->options['consumptionReportInterval'] = $consumptionReportInterval; $this->options['notificationsNewMessageEnabled'] = $notificationsNewMessageEnabled; $this->options['notificationsNewMessageTemplate'] = $notificationsNewMessageTemplate; $this->options['notificationsNewMessageSound'] = $notificationsNewMessageSound; $this->options['notificationsNewMessageBadgeCountEnabled'] = $notificationsNewMessageBadgeCountEnabled; $this->options['notificationsAddedToChannelEnabled'] = $notificationsAddedToChannelEnabled; $this->options['notificationsAddedToChannelTemplate'] = $notificationsAddedToChannelTemplate; $this->options['notificationsAddedToChannelSound'] = $notificationsAddedToChannelSound; $this->options['notificationsRemovedFromChannelEnabled'] = $notificationsRemovedFromChannelEnabled; $this->options['notificationsRemovedFromChannelTemplate'] = $notificationsRemovedFromChannelTemplate; $this->options['notificationsRemovedFromChannelSound'] = $notificationsRemovedFromChannelSound; $this->options['notificationsInvitedToChannelEnabled'] = $notificationsInvitedToChannelEnabled; $this->options['notificationsInvitedToChannelTemplate'] = $notificationsInvitedToChannelTemplate; $this->options['notificationsInvitedToChannelSound'] = $notificationsInvitedToChannelSound; $this->options['preWebhookUrl'] = $preWebhookUrl; $this->options['postWebhookUrl'] = $postWebhookUrl; $this->options['webhookMethod'] = $webhookMethod; $this->options['webhookFilters'] = $webhookFilters; $this->options['limitsChannelMembers'] = $limitsChannelMembers; $this->options['limitsUserChannels'] = $limitsUserChannels; $this->options['mediaCompatibilityMessage'] = $mediaCompatibilityMessage; $this->options['preWebhookRetryCount'] = $preWebhookRetryCount; $this->options['postWebhookRetryCount'] = $postWebhookRetryCount; $this->options['notificationsLogEnabled'] = $notificationsLogEnabled; } /** * A descriptive string that you create to describe the resource. * * @param string $friendlyName A string to describe the resource * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The service role assigned to users when they are added to the service. See the [Role resource](https://www.twilio.com/docs/chat/rest/role-resource) for more info about roles. * * @param string $defaultServiceRoleSid The service role assigned to users when * they are added to the service * @return $this Fluent Builder */ public function setDefaultServiceRoleSid($defaultServiceRoleSid) { $this->options['defaultServiceRoleSid'] = $defaultServiceRoleSid; return $this; } /** * The channel role assigned to users when they are added to a channel. See the [Role resource](https://www.twilio.com/docs/chat/rest/role-resource) for more info about roles. * * @param string $defaultChannelRoleSid The channel role assigned to users when * they are added to a channel * @return $this Fluent Builder */ public function setDefaultChannelRoleSid($defaultChannelRoleSid) { $this->options['defaultChannelRoleSid'] = $defaultChannelRoleSid; return $this; } /** * The channel role assigned to a channel creator when they join a new channel. See the [Role resource](https://www.twilio.com/docs/chat/rest/role-resource) for more info about roles. * * @param string $defaultChannelCreatorRoleSid The channel role assigned to a * channel creator when they join a * new channel * @return $this Fluent Builder */ public function setDefaultChannelCreatorRoleSid($defaultChannelCreatorRoleSid) { $this->options['defaultChannelCreatorRoleSid'] = $defaultChannelCreatorRoleSid; return $this; } /** * Whether to enable the [Message Consumption Horizon](https://www.twilio.com/docs/chat/consumption-horizon) feature. The default is `true`. * * @param bool $readStatusEnabled Whether to enable the Message Consumption * Horizon feature * @return $this Fluent Builder */ public function setReadStatusEnabled($readStatusEnabled) { $this->options['readStatusEnabled'] = $readStatusEnabled; return $this; } /** * Whether to enable the [Reachability Indicator](https://www.twilio.com/docs/chat/reachability-indicator) for this Service instance. The default is `false`. * * @param bool $reachabilityEnabled Whether to enable the Reachability * Indicator feature for this Service instance * @return $this Fluent Builder */ public function setReachabilityEnabled($reachabilityEnabled) { $this->options['reachabilityEnabled'] = $reachabilityEnabled; return $this; } /** * How long in seconds after a `started typing` event until clients should assume that user is no longer typing, even if no `ended typing` message was received. The default is 5 seconds. * * @param int $typingIndicatorTimeout How long in seconds to wait before * assuming the user is no longer typing * @return $this Fluent Builder */ public function setTypingIndicatorTimeout($typingIndicatorTimeout) { $this->options['typingIndicatorTimeout'] = $typingIndicatorTimeout; return $this; } /** * DEPRECATED. The interval in seconds between consumption reports submission batches from client endpoints. * * @param int $consumptionReportInterval DEPRECATED * @return $this Fluent Builder */ public function setConsumptionReportInterval($consumptionReportInterval) { $this->options['consumptionReportInterval'] = $consumptionReportInterval; return $this; } /** * Whether to send a notification when a new message is added to a channel. The default is `false`. * * @param bool $notificationsNewMessageEnabled Whether to send a notification * when a new message is added to a * channel * @return $this Fluent Builder */ public function setNotificationsNewMessageEnabled($notificationsNewMessageEnabled) { $this->options['notificationsNewMessageEnabled'] = $notificationsNewMessageEnabled; return $this; } /** * The template to use to create the notification text displayed when a new message is added to a channel and `notifications.new_message.enabled` is `true`. * * @param string $notificationsNewMessageTemplate The template to use to create * the notification text * displayed when a new message * is added to a channel * @return $this Fluent Builder */ public function setNotificationsNewMessageTemplate($notificationsNewMessageTemplate) { $this->options['notificationsNewMessageTemplate'] = $notificationsNewMessageTemplate; return $this; } /** * The name of the sound to play when a new message is added to a channel and `notifications.new_message.enabled` is `true`. * * @param string $notificationsNewMessageSound The name of the sound to play * when a new message is added to a * channel * @return $this Fluent Builder */ public function setNotificationsNewMessageSound($notificationsNewMessageSound) { $this->options['notificationsNewMessageSound'] = $notificationsNewMessageSound; return $this; } /** * Whether the new message badge is enabled. The default is `false`. * * @param bool $notificationsNewMessageBadgeCountEnabled Whether the new * message badge is * enabled * @return $this Fluent Builder */ public function setNotificationsNewMessageBadgeCountEnabled($notificationsNewMessageBadgeCountEnabled) { $this->options['notificationsNewMessageBadgeCountEnabled'] = $notificationsNewMessageBadgeCountEnabled; return $this; } /** * Whether to send a notification when a member is added to a channel. The default is `false`. * * @param bool $notificationsAddedToChannelEnabled Whether to send a * notification when a member * is added to a channel * @return $this Fluent Builder */ public function setNotificationsAddedToChannelEnabled($notificationsAddedToChannelEnabled) { $this->options['notificationsAddedToChannelEnabled'] = $notificationsAddedToChannelEnabled; return $this; } /** * The template to use to create the notification text displayed when a member is added to a channel and `notifications.added_to_channel.enabled` is `true`. * * @param string $notificationsAddedToChannelTemplate The template to use to * create the notification * text displayed when a * member is added to a * channel * @return $this Fluent Builder */ public function setNotificationsAddedToChannelTemplate($notificationsAddedToChannelTemplate) { $this->options['notificationsAddedToChannelTemplate'] = $notificationsAddedToChannelTemplate; return $this; } /** * The name of the sound to play when a member is added to a channel and `notifications.added_to_channel.enabled` is `true`. * * @param string $notificationsAddedToChannelSound The name of the sound to * play when a member is added * to a channel * @return $this Fluent Builder */ public function setNotificationsAddedToChannelSound($notificationsAddedToChannelSound) { $this->options['notificationsAddedToChannelSound'] = $notificationsAddedToChannelSound; return $this; } /** * Whether to send a notification to a user when they are removed from a channel. The default is `false`. * * @param bool $notificationsRemovedFromChannelEnabled Whether to send a * notification to a user * when they are removed * from a channel * @return $this Fluent Builder */ public function setNotificationsRemovedFromChannelEnabled($notificationsRemovedFromChannelEnabled) { $this->options['notificationsRemovedFromChannelEnabled'] = $notificationsRemovedFromChannelEnabled; return $this; } /** * The template to use to create the notification text displayed to a user when they are removed from a channel and `notifications.removed_from_channel.enabled` is `true`. * * @param string $notificationsRemovedFromChannelTemplate The template to use * to create the * notification text * displayed to a user * when they are removed * @return $this Fluent Builder */ public function setNotificationsRemovedFromChannelTemplate($notificationsRemovedFromChannelTemplate) { $this->options['notificationsRemovedFromChannelTemplate'] = $notificationsRemovedFromChannelTemplate; return $this; } /** * The name of the sound to play to a user when they are removed from a channel and `notifications.removed_from_channel.enabled` is `true`. * * @param string $notificationsRemovedFromChannelSound The name of the sound to * play to a user when they * are removed from a * channel * @return $this Fluent Builder */ public function setNotificationsRemovedFromChannelSound($notificationsRemovedFromChannelSound) { $this->options['notificationsRemovedFromChannelSound'] = $notificationsRemovedFromChannelSound; return $this; } /** * Whether to send a notification when a user is invited to a channel. The default is `false`. * * @param bool $notificationsInvitedToChannelEnabled Whether to send a * notification when a user * is invited to a channel * @return $this Fluent Builder */ public function setNotificationsInvitedToChannelEnabled($notificationsInvitedToChannelEnabled) { $this->options['notificationsInvitedToChannelEnabled'] = $notificationsInvitedToChannelEnabled; return $this; } /** * The template to use to create the notification text displayed when a user is invited to a channel and `notifications.invited_to_channel.enabled` is `true`. * * @param string $notificationsInvitedToChannelTemplate The template to use to * create the notification * text displayed when a * user is invited to a * channel * @return $this Fluent Builder */ public function setNotificationsInvitedToChannelTemplate($notificationsInvitedToChannelTemplate) { $this->options['notificationsInvitedToChannelTemplate'] = $notificationsInvitedToChannelTemplate; return $this; } /** * The name of the sound to play when a user is invited to a channel and `notifications.invited_to_channel.enabled` is `true`. * * @param string $notificationsInvitedToChannelSound The name of the sound to * play when a user is * invited to a channel * @return $this Fluent Builder */ public function setNotificationsInvitedToChannelSound($notificationsInvitedToChannelSound) { $this->options['notificationsInvitedToChannelSound'] = $notificationsInvitedToChannelSound; return $this; } /** * The URL for pre-event webhooks, which are called by using the `webhook_method`. See [Webhook Events](https://www.twilio.com/docs/chat/webhook-events) for more details. * * @param string $preWebhookUrl The webhook URL for pre-event webhooks * @return $this Fluent Builder */ public function setPreWebhookUrl($preWebhookUrl) { $this->options['preWebhookUrl'] = $preWebhookUrl; return $this; } /** * The URL for post-event webhooks, which are called by using the `webhook_method`. See [Webhook Events](https://www.twilio.com/docs/chat/webhook-events) for more details. * * @param string $postWebhookUrl The URL for post-event webhooks * @return $this Fluent Builder */ public function setPostWebhookUrl($postWebhookUrl) { $this->options['postWebhookUrl'] = $postWebhookUrl; return $this; } /** * The HTTP method to use for calls to the `pre_webhook_url` and `post_webhook_url` webhooks. Can be: `POST` or `GET` and the default is `POST`. See [Webhook Events](https://www.twilio.com/docs/chat/webhook-events) for more details. * * @param string $webhookMethod The HTTP method to use for both PRE and POST * webhooks * @return $this Fluent Builder */ public function setWebhookMethod($webhookMethod) { $this->options['webhookMethod'] = $webhookMethod; return $this; } /** * The list of webhook events that are enabled for this Service instance. See [Webhook Events](https://www.twilio.com/docs/chat/webhook-events) for more details. * * @param string $webhookFilters The list of webhook events that are enabled * for this Service instance * @return $this Fluent Builder */ public function setWebhookFilters($webhookFilters) { $this->options['webhookFilters'] = $webhookFilters; return $this; } /** * The maximum number of Members that can be added to Channels within this Service. Can be up to 1,000. * * @param int $limitsChannelMembers The maximum number of Members that can be * added to Channels within this Service * @return $this Fluent Builder */ public function setLimitsChannelMembers($limitsChannelMembers) { $this->options['limitsChannelMembers'] = $limitsChannelMembers; return $this; } /** * The maximum number of Channels Users can be a Member of within this Service. Can be up to 1,000. * * @param int $limitsUserChannels The maximum number of Channels Users can be a * Member of within this Service * @return $this Fluent Builder */ public function setLimitsUserChannels($limitsUserChannels) { $this->options['limitsUserChannels'] = $limitsUserChannels; return $this; } /** * The message to send when a media message has no text. Can be used as placeholder message. * * @param string $mediaCompatibilityMessage The message to send when a media * message has no text * @return $this Fluent Builder */ public function setMediaCompatibilityMessage($mediaCompatibilityMessage) { $this->options['mediaCompatibilityMessage'] = $mediaCompatibilityMessage; return $this; } /** * The number of times to retry a call to the `pre_webhook_url` if the request times out (after 5 seconds) or it receives a 429, 503, or 504 HTTP response. Default retry count is 0 times, which means the call won't be retried. * * @param int $preWebhookRetryCount Count of times webhook will be retried in * case of timeout or 429/503/504 HTTP * responses * @return $this Fluent Builder */ public function setPreWebhookRetryCount($preWebhookRetryCount) { $this->options['preWebhookRetryCount'] = $preWebhookRetryCount; return $this; } /** * The number of times to retry a call to the `post_webhook_url` if the request times out (after 5 seconds) or it receives a 429, 503, or 504 HTTP response. The default is 0, which means the call won't be retried. * * @param int $postWebhookRetryCount The number of times calls to the * `post_webhook_url` will be retried * @return $this Fluent Builder */ public function setPostWebhookRetryCount($postWebhookRetryCount) { $this->options['postWebhookRetryCount'] = $postWebhookRetryCount; return $this; } /** * Whether to log notifications. The default is `false`. * * @param bool $notificationsLogEnabled Whether to log notifications * @return $this Fluent Builder */ public function setNotificationsLogEnabled($notificationsLogEnabled) { $this->options['notificationsLogEnabled'] = $notificationsLogEnabled; 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.Chat.V2.UpdateServiceOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Chat/V2/CredentialContext.php 0000644 00000005530 15002236443 0015600 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V2; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class CredentialContext extends InstanceContext { /** * Initialize the CredentialContext * * @param \Twilio\Version $version Version that contains the resource * @param string $sid The SID of the Credential resource to fetch * @return \Twilio\Rest\Chat\V2\CredentialContext */ public function __construct(Version $version, $sid) { parent::__construct($version); // Path Solution $this->solution = array('sid' => $sid, ); $this->uri = '/Credentials/' . \rawurlencode($sid) . ''; } /** * Fetch a CredentialInstance * * @return CredentialInstance Fetched CredentialInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new CredentialInstance($this->version, $payload, $this->solution['sid']); } /** * Update the CredentialInstance * * @param array|Options $options Optional Arguments * @return CredentialInstance Updated CredentialInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { $options = new Values($options); $data = Values::of(array( 'FriendlyName' => $options['friendlyName'], 'Certificate' => $options['certificate'], 'PrivateKey' => $options['privateKey'], 'Sandbox' => Serialize::booleanToString($options['sandbox']), 'ApiKey' => $options['apiKey'], 'Secret' => $options['secret'], )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new CredentialInstance($this->version, $payload, $this->solution['sid']); } /** * Deletes the CredentialInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Chat.V2.CredentialContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Chat/V2/CredentialOptions.php 0000644 00000026734 15002236443 0015620 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V2; use Twilio\Options; use Twilio\Values; abstract class CredentialOptions { /** * @param string $friendlyName A string to describe the resource * @param string $certificate [APN only] The URL encoded representation of the * certificate * @param string $privateKey [APN only] The URL encoded representation of the * private key * @param bool $sandbox [APN only] Whether to send the credential to sandbox * APNs * @param string $apiKey [GCM only] The API key for the project that was * obtained from the Google Developer console for your * GCM Service application credential * @param string $secret [FCM only] The Server key of your project from * Firebase console * @return CreateCredentialOptions Options builder */ public static function create($friendlyName = Values::NONE, $certificate = Values::NONE, $privateKey = Values::NONE, $sandbox = Values::NONE, $apiKey = Values::NONE, $secret = Values::NONE) { return new CreateCredentialOptions($friendlyName, $certificate, $privateKey, $sandbox, $apiKey, $secret); } /** * @param string $friendlyName A string to describe the resource * @param string $certificate [APN only] The URL encoded representation of the * certificate * @param string $privateKey [APN only] The URL encoded representation of the * private key * @param bool $sandbox [APN only] Whether to send the credential to sandbox * APNs * @param string $apiKey [GCM only] The API key for the project that was * obtained from the Google Developer console for your * GCM Service application credential * @param string $secret [FCM only] The Server key of your project from * Firebase console * @return UpdateCredentialOptions Options builder */ public static function update($friendlyName = Values::NONE, $certificate = Values::NONE, $privateKey = Values::NONE, $sandbox = Values::NONE, $apiKey = Values::NONE, $secret = Values::NONE) { return new UpdateCredentialOptions($friendlyName, $certificate, $privateKey, $sandbox, $apiKey, $secret); } } class CreateCredentialOptions extends Options { /** * @param string $friendlyName A string to describe the resource * @param string $certificate [APN only] The URL encoded representation of the * certificate * @param string $privateKey [APN only] The URL encoded representation of the * private key * @param bool $sandbox [APN only] Whether to send the credential to sandbox * APNs * @param string $apiKey [GCM only] The API key for the project that was * obtained from the Google Developer console for your * GCM Service application credential * @param string $secret [FCM only] The Server key of your project from * Firebase console */ public function __construct($friendlyName = Values::NONE, $certificate = Values::NONE, $privateKey = Values::NONE, $sandbox = Values::NONE, $apiKey = Values::NONE, $secret = Values::NONE) { $this->options['friendlyName'] = $friendlyName; $this->options['certificate'] = $certificate; $this->options['privateKey'] = $privateKey; $this->options['sandbox'] = $sandbox; $this->options['apiKey'] = $apiKey; $this->options['secret'] = $secret; } /** * A descriptive string that you create to describe the new resource. It can be up to 64 characters long. * * @param string $friendlyName A string to describe the resource * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * [APN only] The URL encoded representation of the certificate. For example, `-----BEGIN CERTIFICATE----- MIIFnTCCBIWgAwIBAgIIAjy9H849+E8wDQYJKoZIhvcNAQEF.....A== -----END CERTIFICATE-----` * * @param string $certificate [APN only] The URL encoded representation of the * certificate * @return $this Fluent Builder */ public function setCertificate($certificate) { $this->options['certificate'] = $certificate; return $this; } /** * [APN only] The URL encoded representation of the private key. For example, `-----BEGIN RSA PRIVATE KEY----- MIIEpQIBAAKCAQEAuyf/lNrH9ck8DmNyo3fG... -----END RSA PRIVATE KEY-----` * * @param string $privateKey [APN only] The URL encoded representation of the * private key * @return $this Fluent Builder */ public function setPrivateKey($privateKey) { $this->options['privateKey'] = $privateKey; return $this; } /** * [APN only] Whether to send the credential to sandbox APNs. Can be `true` to send to sandbox APNs or `false` to send to production. * * @param bool $sandbox [APN only] Whether to send the credential to sandbox * APNs * @return $this Fluent Builder */ public function setSandbox($sandbox) { $this->options['sandbox'] = $sandbox; return $this; } /** * [GCM only] The API key for the project that was obtained from the Google Developer console for your GCM Service application credential. * * @param string $apiKey [GCM only] The API key for the project that was * obtained from the Google Developer console for your * GCM Service application credential * @return $this Fluent Builder */ public function setApiKey($apiKey) { $this->options['apiKey'] = $apiKey; return $this; } /** * [FCM only] The **Server key** of your project from the Firebase console, found under Settings / Cloud messaging. * * @param string $secret [FCM only] The Server key of your project from * Firebase console * @return $this Fluent Builder */ public function setSecret($secret) { $this->options['secret'] = $secret; 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.Chat.V2.CreateCredentialOptions ' . \implode(' ', $options) . ']'; } } class UpdateCredentialOptions extends Options { /** * @param string $friendlyName A string to describe the resource * @param string $certificate [APN only] The URL encoded representation of the * certificate * @param string $privateKey [APN only] The URL encoded representation of the * private key * @param bool $sandbox [APN only] Whether to send the credential to sandbox * APNs * @param string $apiKey [GCM only] The API key for the project that was * obtained from the Google Developer console for your * GCM Service application credential * @param string $secret [FCM only] The Server key of your project from * Firebase console */ public function __construct($friendlyName = Values::NONE, $certificate = Values::NONE, $privateKey = Values::NONE, $sandbox = Values::NONE, $apiKey = Values::NONE, $secret = Values::NONE) { $this->options['friendlyName'] = $friendlyName; $this->options['certificate'] = $certificate; $this->options['privateKey'] = $privateKey; $this->options['sandbox'] = $sandbox; $this->options['apiKey'] = $apiKey; $this->options['secret'] = $secret; } /** * A descriptive string that you create to describe the resource. It can be up to 64 characters long. * * @param string $friendlyName A string to describe the resource * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * [APN only] The URL encoded representation of the certificate. For example, `-----BEGIN CERTIFICATE----- MIIFnTCCBIWgAwIBAgIIAjy9H849+E8wDQYJKoZIhvcNAQEF.....A== -----END CERTIFICATE-----` * * @param string $certificate [APN only] The URL encoded representation of the * certificate * @return $this Fluent Builder */ public function setCertificate($certificate) { $this->options['certificate'] = $certificate; return $this; } /** * [APN only] The URL encoded representation of the private key. For example, `-----BEGIN RSA PRIVATE KEY----- MIIEpQIBAAKCAQEAuyf/lNrH9ck8DmNyo3fG... -----END RSA PRIVATE KEY-----` * * @param string $privateKey [APN only] The URL encoded representation of the * private key * @return $this Fluent Builder */ public function setPrivateKey($privateKey) { $this->options['privateKey'] = $privateKey; return $this; } /** * [APN only] Whether to send the credential to sandbox APNs. Can be `true` to send to sandbox APNs or `false` to send to production. * * @param bool $sandbox [APN only] Whether to send the credential to sandbox * APNs * @return $this Fluent Builder */ public function setSandbox($sandbox) { $this->options['sandbox'] = $sandbox; return $this; } /** * [GCM only] The API key for the project that was obtained from the Google Developer console for your GCM Service application credential. * * @param string $apiKey [GCM only] The API key for the project that was * obtained from the Google Developer console for your * GCM Service application credential * @return $this Fluent Builder */ public function setApiKey($apiKey) { $this->options['apiKey'] = $apiKey; return $this; } /** * [FCM only] The **Server key** of your project from the Firebase console, found under Settings / Cloud messaging. * * @param string $secret [FCM only] The Server key of your project from * Firebase console * @return $this Fluent Builder */ public function setSecret($secret) { $this->options['secret'] = $secret; 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.Chat.V2.UpdateCredentialOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Chat/V2/ServiceList.php 0000644 00000012263 15002236443 0014416 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V2; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Values; use Twilio\Version; class ServiceList extends ListResource { /** * Construct the ServiceList * * @param Version $version Version that contains the resource * @return \Twilio\Rest\Chat\V2\ServiceList */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = array(); $this->uri = '/Services'; } /** * Create a new ServiceInstance * * @param string $friendlyName A string to describe the resource * @return ServiceInstance Newly created ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function create($friendlyName) { $data = Values::of(array('FriendlyName' => $friendlyName, )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new ServiceInstance($this->version, $payload); } /** * Streams ServiceInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads ServiceInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return ServiceInstance[] Array of results */ public function read($limit = null, $pageSize = null) { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of ServiceInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of ServiceInstance */ public function page($pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $params = Values::of(array( 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new ServicePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of ServiceInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of ServiceInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new ServicePage($this->version, $response, $this->solution); } /** * Constructs a ServiceContext * * @param string $sid The SID of the Service resource to fetch * @return \Twilio\Rest\Chat\V2\ServiceContext */ public function getContext($sid) { return new ServiceContext($this->version, $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Chat.V2.ServiceList]'; } } sdk/src/Twilio/Rest/Chat/V2/CredentialList.php 0000644 00000013403 15002236443 0015065 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V2; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class CredentialList extends ListResource { /** * Construct the CredentialList * * @param Version $version Version that contains the resource * @return \Twilio\Rest\Chat\V2\CredentialList */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = array(); $this->uri = '/Credentials'; } /** * Streams CredentialInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads CredentialInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return CredentialInstance[] Array of results */ public function read($limit = null, $pageSize = null) { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of CredentialInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of CredentialInstance */ public function page($pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $params = Values::of(array( 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new CredentialPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of CredentialInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of CredentialInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new CredentialPage($this->version, $response, $this->solution); } /** * Create a new CredentialInstance * * @param string $type The type of push-notification service the credential is * for * @param array|Options $options Optional Arguments * @return CredentialInstance Newly created CredentialInstance * @throws TwilioException When an HTTP error occurs. */ public function create($type, $options = array()) { $options = new Values($options); $data = Values::of(array( 'Type' => $type, 'FriendlyName' => $options['friendlyName'], 'Certificate' => $options['certificate'], 'PrivateKey' => $options['privateKey'], 'Sandbox' => Serialize::booleanToString($options['sandbox']), 'ApiKey' => $options['apiKey'], 'Secret' => $options['secret'], )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new CredentialInstance($this->version, $payload); } /** * Constructs a CredentialContext * * @param string $sid The SID of the Credential resource to fetch * @return \Twilio\Rest\Chat\V2\CredentialContext */ public function getContext($sid) { return new CredentialContext($this->version, $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Chat.V2.CredentialList]'; } } sdk/src/Twilio/Rest/Chat/V2/ServicePage.php 0000644 00000001312 15002236443 0014350 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V2; use Twilio\Page; class ServicePage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new ServiceInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Chat.V2.ServicePage]'; } } sdk/src/Twilio/Rest/Chat/V2/CredentialPage.php 0000644 00000001323 15002236443 0015024 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V2; use Twilio\Page; class CredentialPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new CredentialInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Chat.V2.CredentialPage]'; } } sdk/src/Twilio/Rest/Chat/V2/ServiceInstance.php 0000644 00000015230 15002236443 0015244 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V2; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $accountSid * @property string $friendlyName * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $defaultServiceRoleSid * @property string $defaultChannelRoleSid * @property string $defaultChannelCreatorRoleSid * @property bool $readStatusEnabled * @property bool $reachabilityEnabled * @property int $typingIndicatorTimeout * @property int $consumptionReportInterval * @property array $limits * @property string $preWebhookUrl * @property string $postWebhookUrl * @property string $webhookMethod * @property string $webhookFilters * @property int $preWebhookRetryCount * @property int $postWebhookRetryCount * @property array $notifications * @property array $media * @property string $url * @property array $links */ class ServiceInstance extends InstanceResource { protected $_channels = null; protected $_roles = null; protected $_users = null; protected $_bindings = null; /** * Initialize the ServiceInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The SID of the Service resource to fetch * @return \Twilio\Rest\Chat\V2\ServiceInstance */ public function __construct(Version $version, array $payload, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'defaultServiceRoleSid' => Values::array_get($payload, 'default_service_role_sid'), 'defaultChannelRoleSid' => Values::array_get($payload, 'default_channel_role_sid'), 'defaultChannelCreatorRoleSid' => Values::array_get($payload, 'default_channel_creator_role_sid'), 'readStatusEnabled' => Values::array_get($payload, 'read_status_enabled'), 'reachabilityEnabled' => Values::array_get($payload, 'reachability_enabled'), 'typingIndicatorTimeout' => Values::array_get($payload, 'typing_indicator_timeout'), 'consumptionReportInterval' => Values::array_get($payload, 'consumption_report_interval'), 'limits' => Values::array_get($payload, 'limits'), 'preWebhookUrl' => Values::array_get($payload, 'pre_webhook_url'), 'postWebhookUrl' => Values::array_get($payload, 'post_webhook_url'), 'webhookMethod' => Values::array_get($payload, 'webhook_method'), 'webhookFilters' => Values::array_get($payload, 'webhook_filters'), 'preWebhookRetryCount' => Values::array_get($payload, 'pre_webhook_retry_count'), 'postWebhookRetryCount' => Values::array_get($payload, 'post_webhook_retry_count'), 'notifications' => Values::array_get($payload, 'notifications'), 'media' => Values::array_get($payload, 'media'), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ); $this->solution = array('sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Chat\V2\ServiceContext Context for this ServiceInstance */ protected function proxy() { if (!$this->context) { $this->context = new ServiceContext($this->version, $this->solution['sid']); } return $this->context; } /** * Fetch a ServiceInstance * * @return ServiceInstance Fetched ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the ServiceInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Update the ServiceInstance * * @param array|Options $options Optional Arguments * @return ServiceInstance Updated ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Access the channels * * @return \Twilio\Rest\Chat\V2\Service\ChannelList */ protected function getChannels() { return $this->proxy()->channels; } /** * Access the roles * * @return \Twilio\Rest\Chat\V2\Service\RoleList */ protected function getRoles() { return $this->proxy()->roles; } /** * Access the users * * @return \Twilio\Rest\Chat\V2\Service\UserList */ protected function getUsers() { return $this->proxy()->users; } /** * Access the bindings * * @return \Twilio\Rest\Chat\V2\Service\BindingList */ protected function getBindings() { return $this->proxy()->bindings; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Chat.V2.ServiceInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Chat/V2/Service/BindingContext.php 0000644 00000004164 15002236443 0016502 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V2\Service; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; class BindingContext extends InstanceContext { /** * Initialize the BindingContext * * @param \Twilio\Version $version Version that contains the resource * @param string $serviceSid The SID of the Service to fetch the resource from * @param string $sid The SID of the resource to fetch * @return \Twilio\Rest\Chat\V2\Service\BindingContext */ public function __construct(Version $version, $serviceSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, 'sid' => $sid, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Bindings/' . \rawurlencode($sid) . ''; } /** * Fetch a BindingInstance * * @return BindingInstance Fetched BindingInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new BindingInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Deletes the BindingInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Chat.V2.BindingContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Chat/V2/Service/UserContext.php 0000644 00000012565 15002236443 0016052 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V2\Service; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Rest\Chat\V2\Service\User\UserBindingList; use Twilio\Rest\Chat\V2\Service\User\UserChannelList; use Twilio\Values; use Twilio\Version; /** * @property \Twilio\Rest\Chat\V2\Service\User\UserChannelList $userChannels * @property \Twilio\Rest\Chat\V2\Service\User\UserBindingList $userBindings * @method \Twilio\Rest\Chat\V2\Service\User\UserChannelContext userChannels(string $channelSid) * @method \Twilio\Rest\Chat\V2\Service\User\UserBindingContext userBindings(string $sid) */ class UserContext extends InstanceContext { protected $_userChannels = null; protected $_userBindings = null; /** * Initialize the UserContext * * @param \Twilio\Version $version Version that contains the resource * @param string $serviceSid The SID of the Service to fetch the resource from * @param string $sid The SID of the User resource to fetch * @return \Twilio\Rest\Chat\V2\Service\UserContext */ public function __construct(Version $version, $serviceSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, 'sid' => $sid, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Users/' . \rawurlencode($sid) . ''; } /** * Fetch a UserInstance * * @return UserInstance Fetched UserInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new UserInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Deletes the UserInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Update the UserInstance * * @param array|Options $options Optional Arguments * @return UserInstance Updated UserInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { $options = new Values($options); $data = Values::of(array( 'RoleSid' => $options['roleSid'], 'Attributes' => $options['attributes'], 'FriendlyName' => $options['friendlyName'], )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new UserInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Access the userChannels * * @return \Twilio\Rest\Chat\V2\Service\User\UserChannelList */ protected function getUserChannels() { if (!$this->_userChannels) { $this->_userChannels = new UserChannelList( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->_userChannels; } /** * Access the userBindings * * @return \Twilio\Rest\Chat\V2\Service\User\UserBindingList */ protected function getUserBindings() { if (!$this->_userBindings) { $this->_userBindings = new UserBindingList( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->_userBindings; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get($name) { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Chat.V2.UserContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Chat/V2/Service/BindingPage.php 0000644 00000001361 15002236443 0015726 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V2\Service; use Twilio\Page; class BindingPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new BindingInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Chat.V2.BindingPage]'; } } sdk/src/Twilio/Rest/Chat/V2/Service/BindingInstance.php 0000644 00000010542 15002236443 0016617 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V2\Service; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $accountSid * @property string $serviceSid * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $endpoint * @property string $identity * @property string $credentialSid * @property string $bindingType * @property string $messageTypes * @property string $url * @property array $links */ class BindingInstance extends InstanceResource { /** * Initialize the BindingInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the Service that the Binding resource * is associated with * @param string $sid The SID of the resource to fetch * @return \Twilio\Rest\Chat\V2\Service\BindingInstance */ public function __construct(Version $version, array $payload, $serviceSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'endpoint' => Values::array_get($payload, 'endpoint'), 'identity' => Values::array_get($payload, 'identity'), 'credentialSid' => Values::array_get($payload, 'credential_sid'), 'bindingType' => Values::array_get($payload, 'binding_type'), 'messageTypes' => Values::array_get($payload, 'message_types'), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ); $this->solution = array('serviceSid' => $serviceSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Chat\V2\Service\BindingContext Context for this * BindingInstance */ protected function proxy() { if (!$this->context) { $this->context = new BindingContext( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch a BindingInstance * * @return BindingInstance Fetched BindingInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the BindingInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Chat.V2.BindingInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Chat/V2/Service/User/UserBindingInstance.php 0000644 00000011264 15002236443 0020376 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V2\Service\User; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $accountSid * @property string $serviceSid * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $endpoint * @property string $identity * @property string $userSid * @property string $credentialSid * @property string $bindingType * @property string $messageTypes * @property string $url */ class UserBindingInstance extends InstanceResource { /** * Initialize the UserBindingInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the Service that the resource is * associated with * @param string $userSid The SID of the User with the binding * @param string $sid The SID of the User Binding resource to fetch * @return \Twilio\Rest\Chat\V2\Service\User\UserBindingInstance */ public function __construct(Version $version, array $payload, $serviceSid, $userSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'endpoint' => Values::array_get($payload, 'endpoint'), 'identity' => Values::array_get($payload, 'identity'), 'userSid' => Values::array_get($payload, 'user_sid'), 'credentialSid' => Values::array_get($payload, 'credential_sid'), 'bindingType' => Values::array_get($payload, 'binding_type'), 'messageTypes' => Values::array_get($payload, 'message_types'), 'url' => Values::array_get($payload, 'url'), ); $this->solution = array( 'serviceSid' => $serviceSid, 'userSid' => $userSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Chat\V2\Service\User\UserBindingContext Context for * this * UserBindingInstance */ protected function proxy() { if (!$this->context) { $this->context = new UserBindingContext( $this->version, $this->solution['serviceSid'], $this->solution['userSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch a UserBindingInstance * * @return UserBindingInstance Fetched UserBindingInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the UserBindingInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Chat.V2.UserBindingInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Chat/V2/Service/User/UserBindingPage.php 0000644 00000001530 15002236443 0017501 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V2\Service\User; use Twilio\Page; class UserBindingPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new UserBindingInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['userSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Chat.V2.UserBindingPage]'; } } sdk/src/Twilio/Rest/Chat/V2/Service/User/UserChannelOptions.php 0000644 00000011220 15002236443 0020253 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V2\Service\User; use Twilio\Options; use Twilio\Values; abstract class UserChannelOptions { /** * @param string $notificationLevel The push notification level to assign to * the User Channel * @param int $lastConsumedMessageIndex The index of the last Message that the * Member has read within the Channel * @param \DateTime $lastConsumptionTimestamp The ISO 8601 based timestamp * string that represents the * datetime of the last Message read * event for the Member within the * Channel * @return UpdateUserChannelOptions Options builder */ public static function update($notificationLevel = Values::NONE, $lastConsumedMessageIndex = Values::NONE, $lastConsumptionTimestamp = Values::NONE) { return new UpdateUserChannelOptions($notificationLevel, $lastConsumedMessageIndex, $lastConsumptionTimestamp); } } class UpdateUserChannelOptions extends Options { /** * @param string $notificationLevel The push notification level to assign to * the User Channel * @param int $lastConsumedMessageIndex The index of the last Message that the * Member has read within the Channel * @param \DateTime $lastConsumptionTimestamp The ISO 8601 based timestamp * string that represents the * datetime of the last Message read * event for the Member within the * Channel */ public function __construct($notificationLevel = Values::NONE, $lastConsumedMessageIndex = Values::NONE, $lastConsumptionTimestamp = Values::NONE) { $this->options['notificationLevel'] = $notificationLevel; $this->options['lastConsumedMessageIndex'] = $lastConsumedMessageIndex; $this->options['lastConsumptionTimestamp'] = $lastConsumptionTimestamp; } /** * The push notification level to assign to the User Channel. Can be: `default` or `muted`. * * @param string $notificationLevel The push notification level to assign to * the User Channel * @return $this Fluent Builder */ public function setNotificationLevel($notificationLevel) { $this->options['notificationLevel'] = $notificationLevel; return $this; } /** * The index of the last [Message](https://www.twilio.com/docs/chat/rest/message-resource) in the [Channel](https://www.twilio.com/docs/chat/channels) that the Member has read. * * @param int $lastConsumedMessageIndex The index of the last Message that the * Member has read within the Channel * @return $this Fluent Builder */ public function setLastConsumedMessageIndex($lastConsumedMessageIndex) { $this->options['lastConsumedMessageIndex'] = $lastConsumedMessageIndex; return $this; } /** * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) timestamp of the last [Message](https://www.twilio.com/docs/chat/rest/message-resource) read event for the Member within the [Channel](https://www.twilio.com/docs/chat/channels). * * @param \DateTime $lastConsumptionTimestamp The ISO 8601 based timestamp * string that represents the * datetime of the last Message read * event for the Member within the * Channel * @return $this Fluent Builder */ public function setLastConsumptionTimestamp($lastConsumptionTimestamp) { $this->options['lastConsumptionTimestamp'] = $lastConsumptionTimestamp; 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.Chat.V2.UpdateUserChannelOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Chat/V2/Service/User/UserChannelPage.php 0000644 00000001530 15002236443 0017477 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V2\Service\User; use Twilio\Page; class UserChannelPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new UserChannelInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['userSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Chat.V2.UserChannelPage]'; } } sdk/src/Twilio/Rest/Chat/V2/Service/User/UserChannelList.php 0000644 00000012337 15002236443 0017545 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V2\Service\User; use Twilio\ListResource; use Twilio\Values; use Twilio\Version; class UserChannelList extends ListResource { /** * Construct the UserChannelList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Service that the resource is * associated with * @param string $userSid The SID of the User the User Channel belongs to * @return \Twilio\Rest\Chat\V2\Service\User\UserChannelList */ public function __construct(Version $version, $serviceSid, $userSid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, 'userSid' => $userSid, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Users/' . \rawurlencode($userSid) . '/Channels'; } /** * Streams UserChannelInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads UserChannelInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return UserChannelInstance[] Array of results */ public function read($limit = null, $pageSize = null) { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of UserChannelInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of UserChannelInstance */ public function page($pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $params = Values::of(array( 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new UserChannelPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of UserChannelInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of UserChannelInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new UserChannelPage($this->version, $response, $this->solution); } /** * Constructs a UserChannelContext * * @param string $channelSid The SID of the Channel that has the User Channel * to fetch * @return \Twilio\Rest\Chat\V2\Service\User\UserChannelContext */ public function getContext($channelSid) { return new UserChannelContext( $this->version, $this->solution['serviceSid'], $this->solution['userSid'], $channelSid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Chat.V2.UserChannelList]'; } } sdk/src/Twilio/Rest/Chat/V2/Service/User/UserBindingContext.php 0000644 00000004541 15002236443 0020256 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V2\Service\User; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; class UserBindingContext extends InstanceContext { /** * Initialize the UserBindingContext * * @param \Twilio\Version $version Version that contains the resource * @param string $serviceSid The SID of the Service to fetch the resource from * @param string $userSid The SID of the User with the binding * @param string $sid The SID of the User Binding resource to fetch * @return \Twilio\Rest\Chat\V2\Service\User\UserBindingContext */ public function __construct(Version $version, $serviceSid, $userSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, 'userSid' => $userSid, 'sid' => $sid, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Users/' . \rawurlencode($userSid) . '/Bindings/' . \rawurlencode($sid) . ''; } /** * Fetch a UserBindingInstance * * @return UserBindingInstance Fetched UserBindingInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new UserBindingInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['userSid'], $this->solution['sid'] ); } /** * Deletes the UserBindingInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Chat.V2.UserBindingContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Chat/V2/Service/User/UserChannelContext.php 0000644 00000007133 15002236443 0020254 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V2\Service\User; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class UserChannelContext extends InstanceContext { /** * Initialize the UserChannelContext * * @param \Twilio\Version $version Version that contains the resource * @param string $serviceSid The SID of the Service to fetch the User Channel * resource from * @param string $userSid The SID of the User to fetch the User Channel * resource from * @param string $channelSid The SID of the Channel that has the User Channel * to fetch * @return \Twilio\Rest\Chat\V2\Service\User\UserChannelContext */ public function __construct(Version $version, $serviceSid, $userSid, $channelSid) { parent::__construct($version); // Path Solution $this->solution = array( 'serviceSid' => $serviceSid, 'userSid' => $userSid, 'channelSid' => $channelSid, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Users/' . \rawurlencode($userSid) . '/Channels/' . \rawurlencode($channelSid) . ''; } /** * Fetch a UserChannelInstance * * @return UserChannelInstance Fetched UserChannelInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new UserChannelInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['userSid'], $this->solution['channelSid'] ); } /** * Deletes the UserChannelInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Update the UserChannelInstance * * @param array|Options $options Optional Arguments * @return UserChannelInstance Updated UserChannelInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { $options = new Values($options); $data = Values::of(array( 'NotificationLevel' => $options['notificationLevel'], 'LastConsumedMessageIndex' => $options['lastConsumedMessageIndex'], 'LastConsumptionTimestamp' => Serialize::iso8601DateTime($options['lastConsumptionTimestamp']), )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new UserChannelInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['userSid'], $this->solution['channelSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Chat.V2.UserChannelContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Chat/V2/Service/User/UserChannelInstance.php 0000644 00000012017 15002236443 0020371 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V2\Service\User; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property string $serviceSid * @property string $channelSid * @property string $userSid * @property string $memberSid * @property string $status * @property int $lastConsumedMessageIndex * @property int $unreadMessagesCount * @property array $links * @property string $url * @property string $notificationLevel */ class UserChannelInstance extends InstanceResource { /** * Initialize the UserChannelInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the Service that the resource is * associated with * @param string $userSid The SID of the User the User Channel belongs to * @param string $channelSid The SID of the Channel that has the User Channel * to fetch * @return \Twilio\Rest\Chat\V2\Service\User\UserChannelInstance */ public function __construct(Version $version, array $payload, $serviceSid, $userSid, $channelSid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'channelSid' => Values::array_get($payload, 'channel_sid'), 'userSid' => Values::array_get($payload, 'user_sid'), 'memberSid' => Values::array_get($payload, 'member_sid'), 'status' => Values::array_get($payload, 'status'), 'lastConsumedMessageIndex' => Values::array_get($payload, 'last_consumed_message_index'), 'unreadMessagesCount' => Values::array_get($payload, 'unread_messages_count'), 'links' => Values::array_get($payload, 'links'), 'url' => Values::array_get($payload, 'url'), 'notificationLevel' => Values::array_get($payload, 'notification_level'), ); $this->solution = array( 'serviceSid' => $serviceSid, 'userSid' => $userSid, 'channelSid' => $channelSid ?: $this->properties['channelSid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Chat\V2\Service\User\UserChannelContext Context for * this * UserChannelInstance */ protected function proxy() { if (!$this->context) { $this->context = new UserChannelContext( $this->version, $this->solution['serviceSid'], $this->solution['userSid'], $this->solution['channelSid'] ); } return $this->context; } /** * Fetch a UserChannelInstance * * @return UserChannelInstance Fetched UserChannelInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the UserChannelInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Update the UserChannelInstance * * @param array|Options $options Optional Arguments * @return UserChannelInstance Updated UserChannelInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Chat.V2.UserChannelInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Chat/V2/Service/User/UserBindingList.php 0000644 00000013100 15002236443 0017534 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V2\Service\User; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class UserBindingList extends ListResource { /** * Construct the UserBindingList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Service that the resource is * associated with * @param string $userSid The SID of the User with the binding * @return \Twilio\Rest\Chat\V2\Service\User\UserBindingList */ public function __construct(Version $version, $serviceSid, $userSid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, 'userSid' => $userSid, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Users/' . \rawurlencode($userSid) . '/Bindings'; } /** * Streams UserBindingInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($options = array(), $limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads UserBindingInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return UserBindingInstance[] Array of results */ public function read($options = array(), $limit = null, $pageSize = null) { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Retrieve a single page of UserBindingInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of UserBindingInstance */ public function page($options = array(), $pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $options = new Values($options); $params = Values::of(array( 'BindingType' => Serialize::map($options['bindingType'], function($e) { return $e; }), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new UserBindingPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of UserBindingInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of UserBindingInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new UserBindingPage($this->version, $response, $this->solution); } /** * Constructs a UserBindingContext * * @param string $sid The SID of the User Binding resource to fetch * @return \Twilio\Rest\Chat\V2\Service\User\UserBindingContext */ public function getContext($sid) { return new UserBindingContext( $this->version, $this->solution['serviceSid'], $this->solution['userSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Chat.V2.UserBindingList]'; } } sdk/src/Twilio/Rest/Chat/V2/Service/User/UserBindingOptions.php 0000644 00000003522 15002236443 0020263 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V2\Service\User; use Twilio\Options; use Twilio\Values; abstract class UserBindingOptions { /** * @param string $bindingType The push technology used by the User Binding * resources to read * @return ReadUserBindingOptions Options builder */ public static function read($bindingType = Values::NONE) { return new ReadUserBindingOptions($bindingType); } } class ReadUserBindingOptions extends Options { /** * @param string $bindingType The push technology used by the User Binding * resources to read */ public function __construct($bindingType = Values::NONE) { $this->options['bindingType'] = $bindingType; } /** * The push technology used by the User Binding resources to read. Can be: `apn`, `gcm`, or `fcm`. See [push notification configuration](https://www.twilio.com/docs/chat/push-notification-configuration) for more info. * * @param string $bindingType The push technology used by the User Binding * resources to read * @return $this Fluent Builder */ public function setBindingType($bindingType) { $this->options['bindingType'] = $bindingType; 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.Chat.V2.ReadUserBindingOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Chat/V2/Service/RoleInstance.php 0000644 00000010516 15002236443 0016147 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V2\Service; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $accountSid * @property string $serviceSid * @property string $friendlyName * @property string $type * @property string $permissions * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $url */ class RoleInstance extends InstanceResource { /** * Initialize the RoleInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the Service that the resource is * associated with * @param string $sid The SID of the Role resource to fetch * @return \Twilio\Rest\Chat\V2\Service\RoleInstance */ public function __construct(Version $version, array $payload, $serviceSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'type' => Values::array_get($payload, 'type'), 'permissions' => Values::array_get($payload, 'permissions'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), ); $this->solution = array('serviceSid' => $serviceSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Chat\V2\Service\RoleContext Context for this * RoleInstance */ protected function proxy() { if (!$this->context) { $this->context = new RoleContext( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch a RoleInstance * * @return RoleInstance Fetched RoleInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the RoleInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Update the RoleInstance * * @param string $permission A permission the role should have * @return RoleInstance Updated RoleInstance * @throws TwilioException When an HTTP error occurs. */ public function update($permission) { return $this->proxy()->update($permission); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Chat.V2.RoleInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Chat/V2/Service/ChannelInstance.php 0000644 00000013423 15002236443 0016616 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V2\Service; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $accountSid * @property string $serviceSid * @property string $friendlyName * @property string $uniqueName * @property string $attributes * @property string $type * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $createdBy * @property int $membersCount * @property int $messagesCount * @property string $url * @property array $links */ class ChannelInstance extends InstanceResource { protected $_members = null; protected $_messages = null; protected $_invites = null; protected $_webhooks = null; /** * Initialize the ChannelInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the Service that the resource is * associated with * @param string $sid The SID of the resource * @return \Twilio\Rest\Chat\V2\Service\ChannelInstance */ public function __construct(Version $version, array $payload, $serviceSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'uniqueName' => Values::array_get($payload, 'unique_name'), 'attributes' => Values::array_get($payload, 'attributes'), 'type' => Values::array_get($payload, 'type'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'createdBy' => Values::array_get($payload, 'created_by'), 'membersCount' => Values::array_get($payload, 'members_count'), 'messagesCount' => Values::array_get($payload, 'messages_count'), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ); $this->solution = array('serviceSid' => $serviceSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Chat\V2\Service\ChannelContext Context for this * ChannelInstance */ protected function proxy() { if (!$this->context) { $this->context = new ChannelContext( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch a ChannelInstance * * @return ChannelInstance Fetched ChannelInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the ChannelInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Update the ChannelInstance * * @param array|Options $options Optional Arguments * @return ChannelInstance Updated ChannelInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Access the members * * @return \Twilio\Rest\Chat\V2\Service\Channel\MemberList */ protected function getMembers() { return $this->proxy()->members; } /** * Access the messages * * @return \Twilio\Rest\Chat\V2\Service\Channel\MessageList */ protected function getMessages() { return $this->proxy()->messages; } /** * Access the invites * * @return \Twilio\Rest\Chat\V2\Service\Channel\InviteList */ protected function getInvites() { return $this->proxy()->invites; } /** * Access the webhooks * * @return \Twilio\Rest\Chat\V2\Service\Channel\WebhookList */ protected function getWebhooks() { return $this->proxy()->webhooks; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Chat.V2.ChannelInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Chat/V2/Service/UserList.php 0000644 00000013376 15002236443 0015342 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V2\Service; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; class UserList extends ListResource { /** * Construct the UserList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Service that the resource is * associated with * @return \Twilio\Rest\Chat\V2\Service\UserList */ public function __construct(Version $version, $serviceSid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Users'; } /** * Create a new UserInstance * * @param string $identity The `identity` value that identifies the new * resource's User * @param array|Options $options Optional Arguments * @return UserInstance Newly created UserInstance * @throws TwilioException When an HTTP error occurs. */ public function create($identity, $options = array()) { $options = new Values($options); $data = Values::of(array( 'Identity' => $identity, 'RoleSid' => $options['roleSid'], 'Attributes' => $options['attributes'], 'FriendlyName' => $options['friendlyName'], )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new UserInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Streams UserInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads UserInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return UserInstance[] Array of results */ public function read($limit = null, $pageSize = null) { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of UserInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of UserInstance */ public function page($pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $params = Values::of(array( 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new UserPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of UserInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of UserInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new UserPage($this->version, $response, $this->solution); } /** * Constructs a UserContext * * @param string $sid The SID of the User resource to fetch * @return \Twilio\Rest\Chat\V2\Service\UserContext */ public function getContext($sid) { return new UserContext($this->version, $this->solution['serviceSid'], $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Chat.V2.UserList]'; } } sdk/src/Twilio/Rest/Chat/V2/Service/UserPage.php 0000644 00000001350 15002236443 0015270 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V2\Service; use Twilio\Page; class UserPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new UserInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Chat.V2.UserPage]'; } } sdk/src/Twilio/Rest/Chat/V2/Service/UserOptions.php 0000644 00000013005 15002236443 0016047 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V2\Service; use Twilio\Options; use Twilio\Values; abstract class UserOptions { /** * @param string $roleSid The SID of the Role assigned to this user * @param string $attributes A valid JSON string that contains * application-specific data * @param string $friendlyName A string to describe the new resource * @return CreateUserOptions Options builder */ public static function create($roleSid = Values::NONE, $attributes = Values::NONE, $friendlyName = Values::NONE) { return new CreateUserOptions($roleSid, $attributes, $friendlyName); } /** * @param string $roleSid The SID id of the Role assigned to this user * @param string $attributes A valid JSON string that contains * application-specific data * @param string $friendlyName A string to describe the resource * @return UpdateUserOptions Options builder */ public static function update($roleSid = Values::NONE, $attributes = Values::NONE, $friendlyName = Values::NONE) { return new UpdateUserOptions($roleSid, $attributes, $friendlyName); } } class CreateUserOptions extends Options { /** * @param string $roleSid The SID of the Role assigned to this user * @param string $attributes A valid JSON string that contains * application-specific data * @param string $friendlyName A string to describe the new resource */ public function __construct($roleSid = Values::NONE, $attributes = Values::NONE, $friendlyName = Values::NONE) { $this->options['roleSid'] = $roleSid; $this->options['attributes'] = $attributes; $this->options['friendlyName'] = $friendlyName; } /** * The SID of the [Role](https://www.twilio.com/docs/chat/rest/role-resource) to assign to the new User. * * @param string $roleSid The SID of the Role assigned to this user * @return $this Fluent Builder */ public function setRoleSid($roleSid) { $this->options['roleSid'] = $roleSid; return $this; } /** * A valid JSON string that contains application-specific data. * * @param string $attributes A valid JSON string that contains * application-specific data * @return $this Fluent Builder */ public function setAttributes($attributes) { $this->options['attributes'] = $attributes; return $this; } /** * A descriptive string that you create to describe the new resource. This value is often used for display purposes. * * @param string $friendlyName A string to describe the new resource * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; 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.Chat.V2.CreateUserOptions ' . \implode(' ', $options) . ']'; } } class UpdateUserOptions extends Options { /** * @param string $roleSid The SID id of the Role assigned to this user * @param string $attributes A valid JSON string that contains * application-specific data * @param string $friendlyName A string to describe the resource */ public function __construct($roleSid = Values::NONE, $attributes = Values::NONE, $friendlyName = Values::NONE) { $this->options['roleSid'] = $roleSid; $this->options['attributes'] = $attributes; $this->options['friendlyName'] = $friendlyName; } /** * The SID of the [Role](https://www.twilio.com/docs/chat/rest/role-resource) to assign to the User. * * @param string $roleSid The SID id of the Role assigned to this user * @return $this Fluent Builder */ public function setRoleSid($roleSid) { $this->options['roleSid'] = $roleSid; return $this; } /** * A valid JSON string that contains application-specific data. * * @param string $attributes A valid JSON string that contains * application-specific data * @return $this Fluent Builder */ public function setAttributes($attributes) { $this->options['attributes'] = $attributes; return $this; } /** * A descriptive string that you create to describe the resource. It is often used for display purposes. * * @param string $friendlyName A string to describe the resource * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; 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.Chat.V2.UpdateUserOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Chat/V2/Service/BindingOptions.php 0000644 00000004773 15002236443 0016517 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V2\Service; use Twilio\Options; use Twilio\Values; abstract class BindingOptions { /** * @param string $bindingType The push technology used by the Binding resources * to read * @param string $identity The `identity` value of the resources to read * @return ReadBindingOptions Options builder */ public static function read($bindingType = Values::NONE, $identity = Values::NONE) { return new ReadBindingOptions($bindingType, $identity); } } class ReadBindingOptions extends Options { /** * @param string $bindingType The push technology used by the Binding resources * to read * @param string $identity The `identity` value of the resources to read */ public function __construct($bindingType = Values::NONE, $identity = Values::NONE) { $this->options['bindingType'] = $bindingType; $this->options['identity'] = $identity; } /** * The push technology used by the Binding resources to read. Can be: `apn`, `gcm`, or `fcm`. See [push notification configuration](https://www.twilio.com/docs/chat/push-notification-configuration) for more info. * * @param string $bindingType The push technology used by the Binding resources * to read * @return $this Fluent Builder */ public function setBindingType($bindingType) { $this->options['bindingType'] = $bindingType; return $this; } /** * The [User](https://www.twilio.com/docs/chat/rest/user-resource)'s `identity` value of the resources to read. See [access tokens](https://www.twilio.com/docs/chat/create-tokens) for more details. * * @param string $identity The `identity` value of the resources to read * @return $this Fluent Builder */ public function setIdentity($identity) { $this->options['identity'] = $identity; 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.Chat.V2.ReadBindingOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Chat/V2/Service/RolePage.php 0000644 00000001350 15002236443 0015253 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V2\Service; use Twilio\Page; class RolePage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new RoleInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Chat.V2.RolePage]'; } } sdk/src/Twilio/Rest/Chat/V2/Service/RoleContext.php 0000644 00000005454 15002236443 0016034 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V2\Service; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class RoleContext extends InstanceContext { /** * Initialize the RoleContext * * @param \Twilio\Version $version Version that contains the resource * @param string $serviceSid The SID of the Service to fetch the resource from * @param string $sid The SID of the Role resource to fetch * @return \Twilio\Rest\Chat\V2\Service\RoleContext */ public function __construct(Version $version, $serviceSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, 'sid' => $sid, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Roles/' . \rawurlencode($sid) . ''; } /** * Fetch a RoleInstance * * @return RoleInstance Fetched RoleInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new RoleInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Deletes the RoleInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Update the RoleInstance * * @param string $permission A permission the role should have * @return RoleInstance Updated RoleInstance * @throws TwilioException When an HTTP error occurs. */ public function update($permission) { $data = Values::of(array('Permission' => Serialize::map($permission, function($e) { return $e; }), )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new RoleInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Chat.V2.RoleContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Chat/V2/Service/ChannelList.php 0000644 00000014424 15002236443 0015767 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V2\Service; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class ChannelList extends ListResource { /** * Construct the ChannelList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Service that the resource is * associated with * @return \Twilio\Rest\Chat\V2\Service\ChannelList */ public function __construct(Version $version, $serviceSid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Channels'; } /** * Create a new ChannelInstance * * @param array|Options $options Optional Arguments * @return ChannelInstance Newly created ChannelInstance * @throws TwilioException When an HTTP error occurs. */ public function create($options = array()) { $options = new Values($options); $data = Values::of(array( 'FriendlyName' => $options['friendlyName'], 'UniqueName' => $options['uniqueName'], 'Attributes' => $options['attributes'], 'Type' => $options['type'], 'DateCreated' => Serialize::iso8601DateTime($options['dateCreated']), 'DateUpdated' => Serialize::iso8601DateTime($options['dateUpdated']), 'CreatedBy' => $options['createdBy'], )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new ChannelInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Streams ChannelInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($options = array(), $limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads ChannelInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return ChannelInstance[] Array of results */ public function read($options = array(), $limit = null, $pageSize = null) { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Retrieve a single page of ChannelInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of ChannelInstance */ public function page($options = array(), $pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $options = new Values($options); $params = Values::of(array( 'Type' => Serialize::map($options['type'], function($e) { return $e; }), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new ChannelPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of ChannelInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of ChannelInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new ChannelPage($this->version, $response, $this->solution); } /** * Constructs a ChannelContext * * @param string $sid The SID of the resource * @return \Twilio\Rest\Chat\V2\Service\ChannelContext */ public function getContext($sid) { return new ChannelContext($this->version, $this->solution['serviceSid'], $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Chat.V2.ChannelList]'; } } sdk/src/Twilio/Rest/Chat/V2/Service/ChannelContext.php 0000644 00000015474 15002236443 0016506 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V2\Service; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Rest\Chat\V2\Service\Channel\InviteList; use Twilio\Rest\Chat\V2\Service\Channel\MemberList; use Twilio\Rest\Chat\V2\Service\Channel\MessageList; use Twilio\Rest\Chat\V2\Service\Channel\WebhookList; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * @property \Twilio\Rest\Chat\V2\Service\Channel\MemberList $members * @property \Twilio\Rest\Chat\V2\Service\Channel\MessageList $messages * @property \Twilio\Rest\Chat\V2\Service\Channel\InviteList $invites * @property \Twilio\Rest\Chat\V2\Service\Channel\WebhookList $webhooks * @method \Twilio\Rest\Chat\V2\Service\Channel\MemberContext members(string $sid) * @method \Twilio\Rest\Chat\V2\Service\Channel\MessageContext messages(string $sid) * @method \Twilio\Rest\Chat\V2\Service\Channel\InviteContext invites(string $sid) * @method \Twilio\Rest\Chat\V2\Service\Channel\WebhookContext webhooks(string $sid) */ class ChannelContext extends InstanceContext { protected $_members = null; protected $_messages = null; protected $_invites = null; protected $_webhooks = null; /** * Initialize the ChannelContext * * @param \Twilio\Version $version Version that contains the resource * @param string $serviceSid The SID of the Service to fetch the resource from * @param string $sid The SID of the resource * @return \Twilio\Rest\Chat\V2\Service\ChannelContext */ public function __construct(Version $version, $serviceSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, 'sid' => $sid, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Channels/' . \rawurlencode($sid) . ''; } /** * Fetch a ChannelInstance * * @return ChannelInstance Fetched ChannelInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new ChannelInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Deletes the ChannelInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Update the ChannelInstance * * @param array|Options $options Optional Arguments * @return ChannelInstance Updated ChannelInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { $options = new Values($options); $data = Values::of(array( 'FriendlyName' => $options['friendlyName'], 'UniqueName' => $options['uniqueName'], 'Attributes' => $options['attributes'], 'DateCreated' => Serialize::iso8601DateTime($options['dateCreated']), 'DateUpdated' => Serialize::iso8601DateTime($options['dateUpdated']), 'CreatedBy' => $options['createdBy'], )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new ChannelInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Access the members * * @return \Twilio\Rest\Chat\V2\Service\Channel\MemberList */ protected function getMembers() { if (!$this->_members) { $this->_members = new MemberList( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->_members; } /** * Access the messages * * @return \Twilio\Rest\Chat\V2\Service\Channel\MessageList */ protected function getMessages() { if (!$this->_messages) { $this->_messages = new MessageList( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->_messages; } /** * Access the invites * * @return \Twilio\Rest\Chat\V2\Service\Channel\InviteList */ protected function getInvites() { if (!$this->_invites) { $this->_invites = new InviteList( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->_invites; } /** * Access the webhooks * * @return \Twilio\Rest\Chat\V2\Service\Channel\WebhookList */ protected function getWebhooks() { if (!$this->_webhooks) { $this->_webhooks = new WebhookList( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->_webhooks; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get($name) { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Chat.V2.ChannelContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Chat/V2/Service/ChannelPage.php 0000644 00000001361 15002236443 0015724 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V2\Service; use Twilio\Page; class ChannelPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new ChannelInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Chat.V2.ChannelPage]'; } } sdk/src/Twilio/Rest/Chat/V2/Service/UserInstance.php 0000644 00000012536 15002236443 0016170 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V2\Service; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $accountSid * @property string $serviceSid * @property string $attributes * @property string $friendlyName * @property string $roleSid * @property string $identity * @property bool $isOnline * @property bool $isNotifiable * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property int $joinedChannelsCount * @property array $links * @property string $url */ class UserInstance extends InstanceResource { protected $_userChannels = null; protected $_userBindings = null; /** * Initialize the UserInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the Service that the resource is * associated with * @param string $sid The SID of the User resource to fetch * @return \Twilio\Rest\Chat\V2\Service\UserInstance */ public function __construct(Version $version, array $payload, $serviceSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'attributes' => Values::array_get($payload, 'attributes'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'roleSid' => Values::array_get($payload, 'role_sid'), 'identity' => Values::array_get($payload, 'identity'), 'isOnline' => Values::array_get($payload, 'is_online'), 'isNotifiable' => Values::array_get($payload, 'is_notifiable'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'joinedChannelsCount' => Values::array_get($payload, 'joined_channels_count'), 'links' => Values::array_get($payload, 'links'), 'url' => Values::array_get($payload, 'url'), ); $this->solution = array('serviceSid' => $serviceSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Chat\V2\Service\UserContext Context for this * UserInstance */ protected function proxy() { if (!$this->context) { $this->context = new UserContext( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch a UserInstance * * @return UserInstance Fetched UserInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the UserInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Update the UserInstance * * @param array|Options $options Optional Arguments * @return UserInstance Updated UserInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Access the userChannels * * @return \Twilio\Rest\Chat\V2\Service\User\UserChannelList */ protected function getUserChannels() { return $this->proxy()->userChannels; } /** * Access the userBindings * * @return \Twilio\Rest\Chat\V2\Service\User\UserBindingList */ protected function getUserBindings() { return $this->proxy()->userBindings; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Chat.V2.UserInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Chat/V2/Service/ChannelOptions.php 0000644 00000032207 15002236443 0016506 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V2\Service; use Twilio\Options; use Twilio\Values; abstract class ChannelOptions { /** * @param string $friendlyName A string to describe the new resource * @param string $uniqueName An application-defined string that uniquely * identifies the Channel resource * @param string $attributes A valid JSON string that contains * application-specific data * @param string $type The visibility of the channel * @param \DateTime $dateCreated The ISO 8601 date and time in GMT when the * resource was created * @param \DateTime $dateUpdated The ISO 8601 date and time in GMT when the * resource was updated * @param string $createdBy The identity of the User that created the Channel * @return CreateChannelOptions Options builder */ public static function create($friendlyName = Values::NONE, $uniqueName = Values::NONE, $attributes = Values::NONE, $type = Values::NONE, $dateCreated = Values::NONE, $dateUpdated = Values::NONE, $createdBy = Values::NONE) { return new CreateChannelOptions($friendlyName, $uniqueName, $attributes, $type, $dateCreated, $dateUpdated, $createdBy); } /** * @param string $type The visibility of the channel to read * @return ReadChannelOptions Options builder */ public static function read($type = Values::NONE) { return new ReadChannelOptions($type); } /** * @param string $friendlyName A string to describe the resource * @param string $uniqueName An application-defined string that uniquely * identifies the resource * @param string $attributes A valid JSON string that contains * application-specific data * @param \DateTime $dateCreated The ISO 8601 date and time in GMT when the * resource was created * @param \DateTime $dateUpdated The ISO 8601 date and time in GMT when the * resource was updated * @param string $createdBy The identity of the User that created the Channel * @return UpdateChannelOptions Options builder */ public static function update($friendlyName = Values::NONE, $uniqueName = Values::NONE, $attributes = Values::NONE, $dateCreated = Values::NONE, $dateUpdated = Values::NONE, $createdBy = Values::NONE) { return new UpdateChannelOptions($friendlyName, $uniqueName, $attributes, $dateCreated, $dateUpdated, $createdBy); } } class CreateChannelOptions extends Options { /** * @param string $friendlyName A string to describe the new resource * @param string $uniqueName An application-defined string that uniquely * identifies the Channel resource * @param string $attributes A valid JSON string that contains * application-specific data * @param string $type The visibility of the channel * @param \DateTime $dateCreated The ISO 8601 date and time in GMT when the * resource was created * @param \DateTime $dateUpdated The ISO 8601 date and time in GMT when the * resource was updated * @param string $createdBy The identity of the User that created the Channel */ public function __construct($friendlyName = Values::NONE, $uniqueName = Values::NONE, $attributes = Values::NONE, $type = Values::NONE, $dateCreated = Values::NONE, $dateUpdated = Values::NONE, $createdBy = Values::NONE) { $this->options['friendlyName'] = $friendlyName; $this->options['uniqueName'] = $uniqueName; $this->options['attributes'] = $attributes; $this->options['type'] = $type; $this->options['dateCreated'] = $dateCreated; $this->options['dateUpdated'] = $dateUpdated; $this->options['createdBy'] = $createdBy; } /** * A descriptive string that you create to describe the new resource. It can be up to 64 characters long. * * @param string $friendlyName A string to describe the new resource * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * An application-defined string that uniquely identifies the resource. It can be used to address the resource in place of the Channel resource's `sid` in the URL. This value must be 64 characters or less in length and be unique within the Service. * * @param string $uniqueName An application-defined string that uniquely * identifies the Channel resource * @return $this Fluent Builder */ public function setUniqueName($uniqueName) { $this->options['uniqueName'] = $uniqueName; return $this; } /** * A valid JSON string that contains application-specific data. * * @param string $attributes A valid JSON string that contains * application-specific data * @return $this Fluent Builder */ public function setAttributes($attributes) { $this->options['attributes'] = $attributes; return $this; } /** * The visibility of the channel. Can be: `public` or `private` and defaults to `public`. * * @param string $type The visibility of the channel * @return $this Fluent Builder */ public function setType($type) { $this->options['type'] = $type; return $this; } /** * The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was created. The default value is the current time set by the Chat service. Note that this should only be used in cases where a Channel is being recreated from a backup/separate source. * * @param \DateTime $dateCreated The ISO 8601 date and time in GMT when the * resource was created * @return $this Fluent Builder */ public function setDateCreated($dateCreated) { $this->options['dateCreated'] = $dateCreated; return $this; } /** * The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was last updated. The default value is `null`. Note that this parameter should only be used in cases where a Channel is being recreated from a backup/separate source and where a Message was previously updated. * * @param \DateTime $dateUpdated The ISO 8601 date and time in GMT when the * resource was updated * @return $this Fluent Builder */ public function setDateUpdated($dateUpdated) { $this->options['dateUpdated'] = $dateUpdated; return $this; } /** * The `identity` of the User that created the channel. Default is: `system`. * * @param string $createdBy The identity of the User that created the Channel * @return $this Fluent Builder */ public function setCreatedBy($createdBy) { $this->options['createdBy'] = $createdBy; 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.Chat.V2.CreateChannelOptions ' . \implode(' ', $options) . ']'; } } class ReadChannelOptions extends Options { /** * @param string $type The visibility of the channel to read */ public function __construct($type = Values::NONE) { $this->options['type'] = $type; } /** * The visibility of the Channels to read. Can be: `public` or `private` and defaults to `public`. * * @param string $type The visibility of the channel to read * @return $this Fluent Builder */ public function setType($type) { $this->options['type'] = $type; 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.Chat.V2.ReadChannelOptions ' . \implode(' ', $options) . ']'; } } class UpdateChannelOptions extends Options { /** * @param string $friendlyName A string to describe the resource * @param string $uniqueName An application-defined string that uniquely * identifies the resource * @param string $attributes A valid JSON string that contains * application-specific data * @param \DateTime $dateCreated The ISO 8601 date and time in GMT when the * resource was created * @param \DateTime $dateUpdated The ISO 8601 date and time in GMT when the * resource was updated * @param string $createdBy The identity of the User that created the Channel */ public function __construct($friendlyName = Values::NONE, $uniqueName = Values::NONE, $attributes = Values::NONE, $dateCreated = Values::NONE, $dateUpdated = Values::NONE, $createdBy = Values::NONE) { $this->options['friendlyName'] = $friendlyName; $this->options['uniqueName'] = $uniqueName; $this->options['attributes'] = $attributes; $this->options['dateCreated'] = $dateCreated; $this->options['dateUpdated'] = $dateUpdated; $this->options['createdBy'] = $createdBy; } /** * A descriptive string that you create to describe the resource. It can be up to 256 characters long. * * @param string $friendlyName A string to describe the resource * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * An application-defined string that uniquely identifies the resource. It can be used to address the resource in place of the resource's `sid` in the URL. This value must be 256 characters or less in length and unique within the Service. * * @param string $uniqueName An application-defined string that uniquely * identifies the resource * @return $this Fluent Builder */ public function setUniqueName($uniqueName) { $this->options['uniqueName'] = $uniqueName; return $this; } /** * A valid JSON string that contains application-specific data. * * @param string $attributes A valid JSON string that contains * application-specific data * @return $this Fluent Builder */ public function setAttributes($attributes) { $this->options['attributes'] = $attributes; return $this; } /** * The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was created. The default value is the current time set by the Chat service. Note that this should only be used in cases where a Channel is being recreated from a backup/separate source. * * @param \DateTime $dateCreated The ISO 8601 date and time in GMT when the * resource was created * @return $this Fluent Builder */ public function setDateCreated($dateCreated) { $this->options['dateCreated'] = $dateCreated; return $this; } /** * The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was last updated. * * @param \DateTime $dateUpdated The ISO 8601 date and time in GMT when the * resource was updated * @return $this Fluent Builder */ public function setDateUpdated($dateUpdated) { $this->options['dateUpdated'] = $dateUpdated; return $this; } /** * The `identity` of the User that created the channel. Default is: `system`. * * @param string $createdBy The identity of the User that created the Channel * @return $this Fluent Builder */ public function setCreatedBy($createdBy) { $this->options['createdBy'] = $createdBy; 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.Chat.V2.UpdateChannelOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Chat/V2/Service/RoleList.php 0000644 00000013300 15002236443 0015310 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V2\Service; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class RoleList extends ListResource { /** * Construct the RoleList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Service that the resource is * associated with * @return \Twilio\Rest\Chat\V2\Service\RoleList */ public function __construct(Version $version, $serviceSid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Roles'; } /** * Create a new RoleInstance * * @param string $friendlyName A string to describe the new resource * @param string $type The type of role * @param string $permission A permission the role should have * @return RoleInstance Newly created RoleInstance * @throws TwilioException When an HTTP error occurs. */ public function create($friendlyName, $type, $permission) { $data = Values::of(array( 'FriendlyName' => $friendlyName, 'Type' => $type, 'Permission' => Serialize::map($permission, function($e) { return $e; }), )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new RoleInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Streams RoleInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads RoleInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return RoleInstance[] Array of results */ public function read($limit = null, $pageSize = null) { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of RoleInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of RoleInstance */ public function page($pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $params = Values::of(array( 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new RolePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of RoleInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of RoleInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new RolePage($this->version, $response, $this->solution); } /** * Constructs a RoleContext * * @param string $sid The SID of the Role resource to fetch * @return \Twilio\Rest\Chat\V2\Service\RoleContext */ public function getContext($sid) { return new RoleContext($this->version, $this->solution['serviceSid'], $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Chat.V2.RoleList]'; } } sdk/src/Twilio/Rest/Chat/V2/Service/BindingList.php 0000644 00000012551 15002236443 0015770 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V2\Service; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class BindingList extends ListResource { /** * Construct the BindingList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Service that the Binding resource * is associated with * @return \Twilio\Rest\Chat\V2\Service\BindingList */ public function __construct(Version $version, $serviceSid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Bindings'; } /** * Streams BindingInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($options = array(), $limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads BindingInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return BindingInstance[] Array of results */ public function read($options = array(), $limit = null, $pageSize = null) { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Retrieve a single page of BindingInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of BindingInstance */ public function page($options = array(), $pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $options = new Values($options); $params = Values::of(array( 'BindingType' => Serialize::map($options['bindingType'], function($e) { return $e; }), 'Identity' => Serialize::map($options['identity'], function($e) { return $e; }), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new BindingPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of BindingInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of BindingInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new BindingPage($this->version, $response, $this->solution); } /** * Constructs a BindingContext * * @param string $sid The SID of the resource to fetch * @return \Twilio\Rest\Chat\V2\Service\BindingContext */ public function getContext($sid) { return new BindingContext($this->version, $this->solution['serviceSid'], $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Chat.V2.BindingList]'; } } sdk/src/Twilio/Rest/Chat/V2/Service/Channel/WebhookInstance.php 0000644 00000011311 15002236443 0020206 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V2\Service\Channel; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $accountSid * @property string $serviceSid * @property string $channelSid * @property string $type * @property string $url * @property array $configuration * @property \DateTime $dateCreated * @property \DateTime $dateUpdated */ class WebhookInstance extends InstanceResource { /** * Initialize the WebhookInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the Service that the Channel Webhook * resource is associated with * @param string $channelSid The SID of the Channel the Channel Webhook * resource belongs to * @param string $sid The SID of the Channel Webhook resource to fetch * @return \Twilio\Rest\Chat\V2\Service\Channel\WebhookInstance */ public function __construct(Version $version, array $payload, $serviceSid, $channelSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'channelSid' => Values::array_get($payload, 'channel_sid'), 'type' => Values::array_get($payload, 'type'), 'url' => Values::array_get($payload, 'url'), 'configuration' => Values::array_get($payload, 'configuration'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), ); $this->solution = array( 'serviceSid' => $serviceSid, 'channelSid' => $channelSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Chat\V2\Service\Channel\WebhookContext Context for this * WebhookInstance */ protected function proxy() { if (!$this->context) { $this->context = new WebhookContext( $this->version, $this->solution['serviceSid'], $this->solution['channelSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch a WebhookInstance * * @return WebhookInstance Fetched WebhookInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Update the WebhookInstance * * @param array|Options $options Optional Arguments * @return WebhookInstance Updated WebhookInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Deletes the WebhookInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Chat.V2.WebhookInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Chat/V2/Service/Channel/MessageContext.php 0000644 00000006751 15002236443 0020070 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V2\Service\Channel; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class MessageContext extends InstanceContext { /** * Initialize the MessageContext * * @param \Twilio\Version $version Version that contains the resource * @param string $serviceSid The SID of the Service to fetch the resource from * @param string $channelSid The SID of the Channel the message to fetch * belongs to * @param string $sid The SID of the Message resource to fetch * @return \Twilio\Rest\Chat\V2\Service\Channel\MessageContext */ public function __construct(Version $version, $serviceSid, $channelSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, 'channelSid' => $channelSid, 'sid' => $sid, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Channels/' . \rawurlencode($channelSid) . '/Messages/' . \rawurlencode($sid) . ''; } /** * Fetch a MessageInstance * * @return MessageInstance Fetched MessageInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new MessageInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid'], $this->solution['sid'] ); } /** * Deletes the MessageInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Update the MessageInstance * * @param array|Options $options Optional Arguments * @return MessageInstance Updated MessageInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { $options = new Values($options); $data = Values::of(array( 'Body' => $options['body'], 'Attributes' => $options['attributes'], 'DateCreated' => Serialize::iso8601DateTime($options['dateCreated']), 'DateUpdated' => Serialize::iso8601DateTime($options['dateUpdated']), 'LastUpdatedBy' => $options['lastUpdatedBy'], 'From' => $options['from'], )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new MessageInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Chat.V2.MessageContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Chat/V2/Service/Channel/WebhookOptions.php 0000644 00000032700 15002236443 0020102 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V2\Service\Channel; use Twilio\Options; use Twilio\Values; abstract class WebhookOptions { /** * @param string $configurationUrl The URL of the webhook to call * @param string $configurationMethod The HTTP method used to call * `configuration.url` * @param string $configurationFilters The events that cause us to call the * Channel Webhook * @param string $configurationTriggers A string that will cause us to call the * webhook when it is found in a message * body * @param string $configurationFlowSid The SID of the Studio Flow to call when * an event occurs * @param int $configurationRetryCount The number of times to retry the webhook * if the first attempt fails * @return CreateWebhookOptions Options builder */ public static function create($configurationUrl = Values::NONE, $configurationMethod = Values::NONE, $configurationFilters = Values::NONE, $configurationTriggers = Values::NONE, $configurationFlowSid = Values::NONE, $configurationRetryCount = Values::NONE) { return new CreateWebhookOptions($configurationUrl, $configurationMethod, $configurationFilters, $configurationTriggers, $configurationFlowSid, $configurationRetryCount); } /** * @param string $configurationUrl The URL of the webhook to call * @param string $configurationMethod The HTTP method used to call * `configuration.url` * @param string $configurationFilters The events that cause us to call the * Channel Webhook * @param string $configurationTriggers A string that will cause us to call the * webhook when it is found in a message * body * @param string $configurationFlowSid The SID of the Studio Flow to call when * an event occurs * @param int $configurationRetryCount The number of times to retry the webhook * if the first attempt fails * @return UpdateWebhookOptions Options builder */ public static function update($configurationUrl = Values::NONE, $configurationMethod = Values::NONE, $configurationFilters = Values::NONE, $configurationTriggers = Values::NONE, $configurationFlowSid = Values::NONE, $configurationRetryCount = Values::NONE) { return new UpdateWebhookOptions($configurationUrl, $configurationMethod, $configurationFilters, $configurationTriggers, $configurationFlowSid, $configurationRetryCount); } } class CreateWebhookOptions extends Options { /** * @param string $configurationUrl The URL of the webhook to call * @param string $configurationMethod The HTTP method used to call * `configuration.url` * @param string $configurationFilters The events that cause us to call the * Channel Webhook * @param string $configurationTriggers A string that will cause us to call the * webhook when it is found in a message * body * @param string $configurationFlowSid The SID of the Studio Flow to call when * an event occurs * @param int $configurationRetryCount The number of times to retry the webhook * if the first attempt fails */ public function __construct($configurationUrl = Values::NONE, $configurationMethod = Values::NONE, $configurationFilters = Values::NONE, $configurationTriggers = Values::NONE, $configurationFlowSid = Values::NONE, $configurationRetryCount = Values::NONE) { $this->options['configurationUrl'] = $configurationUrl; $this->options['configurationMethod'] = $configurationMethod; $this->options['configurationFilters'] = $configurationFilters; $this->options['configurationTriggers'] = $configurationTriggers; $this->options['configurationFlowSid'] = $configurationFlowSid; $this->options['configurationRetryCount'] = $configurationRetryCount; } /** * The URL of the webhook to call using the `configuration.method`. * * @param string $configurationUrl The URL of the webhook to call * @return $this Fluent Builder */ public function setConfigurationUrl($configurationUrl) { $this->options['configurationUrl'] = $configurationUrl; return $this; } /** * The HTTP method used to call `configuration.url`. Can be: `GET` or `POST` and the default is `POST`. * * @param string $configurationMethod The HTTP method used to call * `configuration.url` * @return $this Fluent Builder */ public function setConfigurationMethod($configurationMethod) { $this->options['configurationMethod'] = $configurationMethod; return $this; } /** * The events that cause us to call the Channel Webhook. Used when `type` is `webhook`. This parameter takes only one event. To specify more than one event, repeat this parameter for each event. For the list of possible events, see [Webhook Event Triggers](https://www.twilio.com/docs/chat/webhook-events#webhook-event-trigger). * * @param string $configurationFilters The events that cause us to call the * Channel Webhook * @return $this Fluent Builder */ public function setConfigurationFilters($configurationFilters) { $this->options['configurationFilters'] = $configurationFilters; return $this; } /** * A string that will cause us to call the webhook when it is present in a message body. This parameter takes only one trigger string. To specify more than one, repeat this parameter for each trigger string up to a total of 5 trigger strings. Used only when `type` = `trigger`. * * @param string $configurationTriggers A string that will cause us to call the * webhook when it is found in a message * body * @return $this Fluent Builder */ public function setConfigurationTriggers($configurationTriggers) { $this->options['configurationTriggers'] = $configurationTriggers; return $this; } /** * The SID of the Studio [Flow](https://www.twilio.com/docs/studio/rest-api/flow) to call when an event in `configuration.filters` occurs. Used only when `type` is `studio`. * * @param string $configurationFlowSid The SID of the Studio Flow to call when * an event occurs * @return $this Fluent Builder */ public function setConfigurationFlowSid($configurationFlowSid) { $this->options['configurationFlowSid'] = $configurationFlowSid; return $this; } /** * The number of times to retry the webhook if the first attempt fails. Can be an integer between 0 and 3, inclusive, and the default is 0. * * @param int $configurationRetryCount The number of times to retry the webhook * if the first attempt fails * @return $this Fluent Builder */ public function setConfigurationRetryCount($configurationRetryCount) { $this->options['configurationRetryCount'] = $configurationRetryCount; 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.Chat.V2.CreateWebhookOptions ' . \implode(' ', $options) . ']'; } } class UpdateWebhookOptions extends Options { /** * @param string $configurationUrl The URL of the webhook to call * @param string $configurationMethod The HTTP method used to call * `configuration.url` * @param string $configurationFilters The events that cause us to call the * Channel Webhook * @param string $configurationTriggers A string that will cause us to call the * webhook when it is found in a message * body * @param string $configurationFlowSid The SID of the Studio Flow to call when * an event occurs * @param int $configurationRetryCount The number of times to retry the webhook * if the first attempt fails */ public function __construct($configurationUrl = Values::NONE, $configurationMethod = Values::NONE, $configurationFilters = Values::NONE, $configurationTriggers = Values::NONE, $configurationFlowSid = Values::NONE, $configurationRetryCount = Values::NONE) { $this->options['configurationUrl'] = $configurationUrl; $this->options['configurationMethod'] = $configurationMethod; $this->options['configurationFilters'] = $configurationFilters; $this->options['configurationTriggers'] = $configurationTriggers; $this->options['configurationFlowSid'] = $configurationFlowSid; $this->options['configurationRetryCount'] = $configurationRetryCount; } /** * The URL of the webhook to call using the `configuration.method`. * * @param string $configurationUrl The URL of the webhook to call * @return $this Fluent Builder */ public function setConfigurationUrl($configurationUrl) { $this->options['configurationUrl'] = $configurationUrl; return $this; } /** * The HTTP method used to call `configuration.url`. Can be: `GET` or `POST` and the default is `POST`. * * @param string $configurationMethod The HTTP method used to call * `configuration.url` * @return $this Fluent Builder */ public function setConfigurationMethod($configurationMethod) { $this->options['configurationMethod'] = $configurationMethod; return $this; } /** * The events that cause us to call the Channel Webhook. Used when `type` is `webhook`. This parameter takes only one event. To specify more than one event, repeat this parameter for each event. For the list of possible events, see [Webhook Event Triggers](https://www.twilio.com/docs/chat/webhook-events#webhook-event-trigger). * * @param string $configurationFilters The events that cause us to call the * Channel Webhook * @return $this Fluent Builder */ public function setConfigurationFilters($configurationFilters) { $this->options['configurationFilters'] = $configurationFilters; return $this; } /** * A string that will cause us to call the webhook when it is present in a message body. This parameter takes only one trigger string. To specify more than one, repeat this parameter for each trigger string up to a total of 5 trigger strings. Used only when `type` = `trigger`. * * @param string $configurationTriggers A string that will cause us to call the * webhook when it is found in a message * body * @return $this Fluent Builder */ public function setConfigurationTriggers($configurationTriggers) { $this->options['configurationTriggers'] = $configurationTriggers; return $this; } /** * The SID of the Studio [Flow](https://www.twilio.com/docs/studio/rest-api/flow) to call when an event in `configuration.filters` occurs. Used only when `type` = `studio`. * * @param string $configurationFlowSid The SID of the Studio Flow to call when * an event occurs * @return $this Fluent Builder */ public function setConfigurationFlowSid($configurationFlowSid) { $this->options['configurationFlowSid'] = $configurationFlowSid; return $this; } /** * The number of times to retry the webhook if the first attempt fails. Can be an integer between 0 and 3, inclusive, and the default is 0. * * @param int $configurationRetryCount The number of times to retry the webhook * if the first attempt fails * @return $this Fluent Builder */ public function setConfigurationRetryCount($configurationRetryCount) { $this->options['configurationRetryCount'] = $configurationRetryCount; 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.Chat.V2.UpdateWebhookOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Chat/V2/Service/Channel/MemberOptions.php 0000644 00000036371 15002236443 0017723 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V2\Service\Channel; use Twilio\Options; use Twilio\Values; abstract class MemberOptions { /** * @param string $roleSid The SID of the Role to assign to the member * @param int $lastConsumedMessageIndex The index of the last Message in the * Channel the Member has read * @param \DateTime $lastConsumptionTimestamp The ISO 8601 based timestamp * string representing the datetime * of the last Message read event * for the member within the Channel * @param \DateTime $dateCreated The ISO 8601 date and time in GMT when the * resource was created * @param \DateTime $dateUpdated The ISO 8601 date and time in GMT when the * resource was updated * @param string $attributes A valid JSON string that contains * application-specific data * @return CreateMemberOptions Options builder */ public static function create($roleSid = Values::NONE, $lastConsumedMessageIndex = Values::NONE, $lastConsumptionTimestamp = Values::NONE, $dateCreated = Values::NONE, $dateUpdated = Values::NONE, $attributes = Values::NONE) { return new CreateMemberOptions($roleSid, $lastConsumedMessageIndex, $lastConsumptionTimestamp, $dateCreated, $dateUpdated, $attributes); } /** * @param string $identity The `identity` value of the resources to read * @return ReadMemberOptions Options builder */ public static function read($identity = Values::NONE) { return new ReadMemberOptions($identity); } /** * @param string $roleSid The SID of the Role to assign to the member * @param int $lastConsumedMessageIndex The index of the last consumed Message * for the Channel for the Member * @param \DateTime $lastConsumptionTimestamp The ISO 8601 based timestamp * string representing the datetime * of the last Message read event * for the Member within the Channel * @param \DateTime $dateCreated The ISO 8601 date and time in GMT when the * resource was created * @param \DateTime $dateUpdated The ISO 8601 date and time in GMT when the * resource was updated * @param string $attributes A valid JSON string that contains * application-specific data * @return UpdateMemberOptions Options builder */ public static function update($roleSid = Values::NONE, $lastConsumedMessageIndex = Values::NONE, $lastConsumptionTimestamp = Values::NONE, $dateCreated = Values::NONE, $dateUpdated = Values::NONE, $attributes = Values::NONE) { return new UpdateMemberOptions($roleSid, $lastConsumedMessageIndex, $lastConsumptionTimestamp, $dateCreated, $dateUpdated, $attributes); } } class CreateMemberOptions extends Options { /** * @param string $roleSid The SID of the Role to assign to the member * @param int $lastConsumedMessageIndex The index of the last Message in the * Channel the Member has read * @param \DateTime $lastConsumptionTimestamp The ISO 8601 based timestamp * string representing the datetime * of the last Message read event * for the member within the Channel * @param \DateTime $dateCreated The ISO 8601 date and time in GMT when the * resource was created * @param \DateTime $dateUpdated The ISO 8601 date and time in GMT when the * resource was updated * @param string $attributes A valid JSON string that contains * application-specific data */ public function __construct($roleSid = Values::NONE, $lastConsumedMessageIndex = Values::NONE, $lastConsumptionTimestamp = Values::NONE, $dateCreated = Values::NONE, $dateUpdated = Values::NONE, $attributes = Values::NONE) { $this->options['roleSid'] = $roleSid; $this->options['lastConsumedMessageIndex'] = $lastConsumedMessageIndex; $this->options['lastConsumptionTimestamp'] = $lastConsumptionTimestamp; $this->options['dateCreated'] = $dateCreated; $this->options['dateUpdated'] = $dateUpdated; $this->options['attributes'] = $attributes; } /** * The SID of the [Role](https://www.twilio.com/docs/chat/rest/role-resource) to assign to the member. The default roles are those specified on the [Service](https://www.twilio.com/docs/chat/rest/service-resource). * * @param string $roleSid The SID of the Role to assign to the member * @return $this Fluent Builder */ public function setRoleSid($roleSid) { $this->options['roleSid'] = $roleSid; return $this; } /** * The index of the last [Message](https://www.twilio.com/docs/chat/rest/message-resource) in the [Channel](https://www.twilio.com/docs/chat/channels) that the Member has read. This parameter should only be used when recreating a Member from a backup/separate source. * * @param int $lastConsumedMessageIndex The index of the last Message in the * Channel the Member has read * @return $this Fluent Builder */ public function setLastConsumedMessageIndex($lastConsumedMessageIndex) { $this->options['lastConsumedMessageIndex'] = $lastConsumedMessageIndex; return $this; } /** * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) timestamp of the last [Message](https://www.twilio.com/docs/chat/rest/message-resource) read event for the Member within the [Channel](https://www.twilio.com/docs/chat/channels). * * @param \DateTime $lastConsumptionTimestamp The ISO 8601 based timestamp * string representing the datetime * of the last Message read event * for the member within the Channel * @return $this Fluent Builder */ public function setLastConsumptionTimestamp($lastConsumptionTimestamp) { $this->options['lastConsumptionTimestamp'] = $lastConsumptionTimestamp; return $this; } /** * The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was created. The default value is the current time set by the Chat service. Note that this parameter should only be used when a Member is being recreated from a backup/separate source. * * @param \DateTime $dateCreated The ISO 8601 date and time in GMT when the * resource was created * @return $this Fluent Builder */ public function setDateCreated($dateCreated) { $this->options['dateCreated'] = $dateCreated; return $this; } /** * The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was last updated. The default value is `null`. Note that this parameter should only be used when a Member is being recreated from a backup/separate source and where a Member was previously updated. * * @param \DateTime $dateUpdated The ISO 8601 date and time in GMT when the * resource was updated * @return $this Fluent Builder */ public function setDateUpdated($dateUpdated) { $this->options['dateUpdated'] = $dateUpdated; return $this; } /** * A valid JSON string that contains application-specific data. * * @param string $attributes A valid JSON string that contains * application-specific data * @return $this Fluent Builder */ public function setAttributes($attributes) { $this->options['attributes'] = $attributes; 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.Chat.V2.CreateMemberOptions ' . \implode(' ', $options) . ']'; } } class ReadMemberOptions extends Options { /** * @param string $identity The `identity` value of the resources to read */ public function __construct($identity = Values::NONE) { $this->options['identity'] = $identity; } /** * The [User](https://www.twilio.com/docs/chat/rest/user-resource)'s `identity` value of the Member resources to read. See [access tokens](https://www.twilio.com/docs/chat/create-tokens) for more details. * * @param string $identity The `identity` value of the resources to read * @return $this Fluent Builder */ public function setIdentity($identity) { $this->options['identity'] = $identity; 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.Chat.V2.ReadMemberOptions ' . \implode(' ', $options) . ']'; } } class UpdateMemberOptions extends Options { /** * @param string $roleSid The SID of the Role to assign to the member * @param int $lastConsumedMessageIndex The index of the last consumed Message * for the Channel for the Member * @param \DateTime $lastConsumptionTimestamp The ISO 8601 based timestamp * string representing the datetime * of the last Message read event * for the Member within the Channel * @param \DateTime $dateCreated The ISO 8601 date and time in GMT when the * resource was created * @param \DateTime $dateUpdated The ISO 8601 date and time in GMT when the * resource was updated * @param string $attributes A valid JSON string that contains * application-specific data */ public function __construct($roleSid = Values::NONE, $lastConsumedMessageIndex = Values::NONE, $lastConsumptionTimestamp = Values::NONE, $dateCreated = Values::NONE, $dateUpdated = Values::NONE, $attributes = Values::NONE) { $this->options['roleSid'] = $roleSid; $this->options['lastConsumedMessageIndex'] = $lastConsumedMessageIndex; $this->options['lastConsumptionTimestamp'] = $lastConsumptionTimestamp; $this->options['dateCreated'] = $dateCreated; $this->options['dateUpdated'] = $dateUpdated; $this->options['attributes'] = $attributes; } /** * The SID of the [Role](https://www.twilio.com/docs/chat/rest/role-resource) to assign to the member. The default roles are those specified on the [Service](https://www.twilio.com/docs/chat/rest/service-resource). * * @param string $roleSid The SID of the Role to assign to the member * @return $this Fluent Builder */ public function setRoleSid($roleSid) { $this->options['roleSid'] = $roleSid; return $this; } /** * The index of the last [Message](https://www.twilio.com/docs/chat/rest/message-resource) that the Member has read within the [Channel](https://www.twilio.com/docs/chat/channels). * * @param int $lastConsumedMessageIndex The index of the last consumed Message * for the Channel for the Member * @return $this Fluent Builder */ public function setLastConsumedMessageIndex($lastConsumedMessageIndex) { $this->options['lastConsumedMessageIndex'] = $lastConsumedMessageIndex; return $this; } /** * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) timestamp of the last [Message](https://www.twilio.com/docs/chat/rest/message-resource) read event for the Member within the [Channel](https://www.twilio.com/docs/chat/channels). * * @param \DateTime $lastConsumptionTimestamp The ISO 8601 based timestamp * string representing the datetime * of the last Message read event * for the Member within the Channel * @return $this Fluent Builder */ public function setLastConsumptionTimestamp($lastConsumptionTimestamp) { $this->options['lastConsumptionTimestamp'] = $lastConsumptionTimestamp; return $this; } /** * The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was created. The default value is the current time set by the Chat service. Note that this parameter should only be used when a Member is being recreated from a backup/separate source. * * @param \DateTime $dateCreated The ISO 8601 date and time in GMT when the * resource was created * @return $this Fluent Builder */ public function setDateCreated($dateCreated) { $this->options['dateCreated'] = $dateCreated; return $this; } /** * The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was last updated. * * @param \DateTime $dateUpdated The ISO 8601 date and time in GMT when the * resource was updated * @return $this Fluent Builder */ public function setDateUpdated($dateUpdated) { $this->options['dateUpdated'] = $dateUpdated; return $this; } /** * A valid JSON string that contains application-specific data. * * @param string $attributes A valid JSON string that contains * application-specific data * @return $this Fluent Builder */ public function setAttributes($attributes) { $this->options['attributes'] = $attributes; 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.Chat.V2.UpdateMemberOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Chat/V2/Service/Channel/MemberContext.php 0000644 00000007017 15002236443 0017707 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V2\Service\Channel; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class MemberContext extends InstanceContext { /** * Initialize the MemberContext * * @param \Twilio\Version $version Version that contains the resource * @param string $serviceSid The SID of the Service to fetch the resource from * @param string $channelSid The SID of the channel the member belongs to * @param string $sid The SID of the Member resource to fetch * @return \Twilio\Rest\Chat\V2\Service\Channel\MemberContext */ public function __construct(Version $version, $serviceSid, $channelSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, 'channelSid' => $channelSid, 'sid' => $sid, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Channels/' . \rawurlencode($channelSid) . '/Members/' . \rawurlencode($sid) . ''; } /** * Fetch a MemberInstance * * @return MemberInstance Fetched MemberInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new MemberInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid'], $this->solution['sid'] ); } /** * Deletes the MemberInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Update the MemberInstance * * @param array|Options $options Optional Arguments * @return MemberInstance Updated MemberInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { $options = new Values($options); $data = Values::of(array( 'RoleSid' => $options['roleSid'], 'LastConsumedMessageIndex' => $options['lastConsumedMessageIndex'], 'LastConsumptionTimestamp' => Serialize::iso8601DateTime($options['lastConsumptionTimestamp']), 'DateCreated' => Serialize::iso8601DateTime($options['dateCreated']), 'DateUpdated' => Serialize::iso8601DateTime($options['dateUpdated']), 'Attributes' => $options['attributes'], )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new MemberInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Chat.V2.MemberContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Chat/V2/Service/Channel/MessageList.php 0000644 00000015207 15002236443 0017353 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V2\Service\Channel; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class MessageList extends ListResource { /** * Construct the MessageList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Service that the resource is * associated with * @param string $channelSid The SID of the Channel the Message resource * belongs to * @return \Twilio\Rest\Chat\V2\Service\Channel\MessageList */ public function __construct(Version $version, $serviceSid, $channelSid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, 'channelSid' => $channelSid, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Channels/' . \rawurlencode($channelSid) . '/Messages'; } /** * Create a new MessageInstance * * @param array|Options $options Optional Arguments * @return MessageInstance Newly created MessageInstance * @throws TwilioException When an HTTP error occurs. */ public function create($options = array()) { $options = new Values($options); $data = Values::of(array( 'From' => $options['from'], 'Attributes' => $options['attributes'], 'DateCreated' => Serialize::iso8601DateTime($options['dateCreated']), 'DateUpdated' => Serialize::iso8601DateTime($options['dateUpdated']), 'LastUpdatedBy' => $options['lastUpdatedBy'], 'Body' => $options['body'], 'MediaSid' => $options['mediaSid'], )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new MessageInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid'] ); } /** * Streams MessageInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($options = array(), $limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads MessageInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return MessageInstance[] Array of results */ public function read($options = array(), $limit = null, $pageSize = null) { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Retrieve a single page of MessageInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of MessageInstance */ public function page($options = array(), $pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $options = new Values($options); $params = Values::of(array( 'Order' => $options['order'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new MessagePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of MessageInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of MessageInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new MessagePage($this->version, $response, $this->solution); } /** * Constructs a MessageContext * * @param string $sid The SID of the Message resource to fetch * @return \Twilio\Rest\Chat\V2\Service\Channel\MessageContext */ public function getContext($sid) { return new MessageContext( $this->version, $this->solution['serviceSid'], $this->solution['channelSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Chat.V2.MessageList]'; } } sdk/src/Twilio/Rest/Chat/V2/Service/Channel/MessageInstance.php 0000644 00000012433 15002236443 0020202 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V2\Service\Channel; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $accountSid * @property string $attributes * @property string $serviceSid * @property string $to * @property string $channelSid * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $lastUpdatedBy * @property bool $wasEdited * @property string $from * @property string $body * @property int $index * @property string $type * @property array $media * @property string $url */ class MessageInstance extends InstanceResource { /** * Initialize the MessageInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the Service that the resource is * associated with * @param string $channelSid The SID of the Channel the Message resource * belongs to * @param string $sid The SID of the Message resource to fetch * @return \Twilio\Rest\Chat\V2\Service\Channel\MessageInstance */ public function __construct(Version $version, array $payload, $serviceSid, $channelSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'attributes' => Values::array_get($payload, 'attributes'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'to' => Values::array_get($payload, 'to'), 'channelSid' => Values::array_get($payload, 'channel_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'lastUpdatedBy' => Values::array_get($payload, 'last_updated_by'), 'wasEdited' => Values::array_get($payload, 'was_edited'), 'from' => Values::array_get($payload, 'from'), 'body' => Values::array_get($payload, 'body'), 'index' => Values::array_get($payload, 'index'), 'type' => Values::array_get($payload, 'type'), 'media' => Values::array_get($payload, 'media'), 'url' => Values::array_get($payload, 'url'), ); $this->solution = array( 'serviceSid' => $serviceSid, 'channelSid' => $channelSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Chat\V2\Service\Channel\MessageContext Context for this * MessageInstance */ protected function proxy() { if (!$this->context) { $this->context = new MessageContext( $this->version, $this->solution['serviceSid'], $this->solution['channelSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch a MessageInstance * * @return MessageInstance Fetched MessageInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the MessageInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Update the MessageInstance * * @param array|Options $options Optional Arguments * @return MessageInstance Updated MessageInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Chat.V2.MessageInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Chat/V2/Service/Channel/WebhookPage.php 0000644 00000001522 15002236443 0017321 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V2\Service\Channel; use Twilio\Page; class WebhookPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new WebhookInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Chat.V2.WebhookPage]'; } } sdk/src/Twilio/Rest/Chat/V2/Service/Channel/MemberList.php 0000644 00000015515 15002236443 0017200 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V2\Service\Channel; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class MemberList extends ListResource { /** * Construct the MemberList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Service that the resource is * associated with * @param string $channelSid The SID of the Channel for the member * @return \Twilio\Rest\Chat\V2\Service\Channel\MemberList */ public function __construct(Version $version, $serviceSid, $channelSid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, 'channelSid' => $channelSid, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Channels/' . \rawurlencode($channelSid) . '/Members'; } /** * Create a new MemberInstance * * @param string $identity The `identity` value that identifies the new * resource's User * @param array|Options $options Optional Arguments * @return MemberInstance Newly created MemberInstance * @throws TwilioException When an HTTP error occurs. */ public function create($identity, $options = array()) { $options = new Values($options); $data = Values::of(array( 'Identity' => $identity, 'RoleSid' => $options['roleSid'], 'LastConsumedMessageIndex' => $options['lastConsumedMessageIndex'], 'LastConsumptionTimestamp' => Serialize::iso8601DateTime($options['lastConsumptionTimestamp']), 'DateCreated' => Serialize::iso8601DateTime($options['dateCreated']), 'DateUpdated' => Serialize::iso8601DateTime($options['dateUpdated']), 'Attributes' => $options['attributes'], )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new MemberInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid'] ); } /** * Streams MemberInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($options = array(), $limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads MemberInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return MemberInstance[] Array of results */ public function read($options = array(), $limit = null, $pageSize = null) { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Retrieve a single page of MemberInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of MemberInstance */ public function page($options = array(), $pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $options = new Values($options); $params = Values::of(array( 'Identity' => Serialize::map($options['identity'], function($e) { return $e; }), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new MemberPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of MemberInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of MemberInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new MemberPage($this->version, $response, $this->solution); } /** * Constructs a MemberContext * * @param string $sid The SID of the Member resource to fetch * @return \Twilio\Rest\Chat\V2\Service\Channel\MemberContext */ public function getContext($sid) { return new MemberContext( $this->version, $this->solution['serviceSid'], $this->solution['channelSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Chat.V2.MemberList]'; } } sdk/src/Twilio/Rest/Chat/V2/Service/Channel/InviteContext.php 0000644 00000004574 15002236443 0017743 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V2\Service\Channel; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; class InviteContext extends InstanceContext { /** * Initialize the InviteContext * * @param \Twilio\Version $version Version that contains the resource * @param string $serviceSid The SID of the Service to fetch the resource from * @param string $channelSid The SID of the Channel the resource to fetch * belongs to * @param string $sid The SID of the Invite resource to fetch * @return \Twilio\Rest\Chat\V2\Service\Channel\InviteContext */ public function __construct(Version $version, $serviceSid, $channelSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, 'channelSid' => $channelSid, 'sid' => $sid, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Channels/' . \rawurlencode($channelSid) . '/Invites/' . \rawurlencode($sid) . ''; } /** * Fetch a InviteInstance * * @return InviteInstance Fetched InviteInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new InviteInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid'], $this->solution['sid'] ); } /** * Deletes the InviteInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Chat.V2.InviteContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Chat/V2/Service/Channel/MemberPage.php 0000644 00000001517 15002236443 0017136 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V2\Service\Channel; use Twilio\Page; class MemberPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new MemberInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Chat.V2.MemberPage]'; } } sdk/src/Twilio/Rest/Chat/V2/Service/Channel/WebhookList.php 0000644 00000015053 15002236443 0017364 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V2\Service\Channel; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class WebhookList extends ListResource { /** * Construct the WebhookList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Service that the Channel Webhook * resource is associated with * @param string $channelSid The SID of the Channel the Channel Webhook * resource belongs to * @return \Twilio\Rest\Chat\V2\Service\Channel\WebhookList */ public function __construct(Version $version, $serviceSid, $channelSid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, 'channelSid' => $channelSid, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Channels/' . \rawurlencode($channelSid) . '/Webhooks'; } /** * Streams WebhookInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads WebhookInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return WebhookInstance[] Array of results */ public function read($limit = null, $pageSize = null) { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of WebhookInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of WebhookInstance */ public function page($pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $params = Values::of(array( 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new WebhookPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of WebhookInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of WebhookInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new WebhookPage($this->version, $response, $this->solution); } /** * Create a new WebhookInstance * * @param string $type The type of webhook * @param array|Options $options Optional Arguments * @return WebhookInstance Newly created WebhookInstance * @throws TwilioException When an HTTP error occurs. */ public function create($type, $options = array()) { $options = new Values($options); $data = Values::of(array( 'Type' => $type, 'Configuration.Url' => $options['configurationUrl'], 'Configuration.Method' => $options['configurationMethod'], 'Configuration.Filters' => Serialize::map($options['configurationFilters'], function($e) { return $e; }), 'Configuration.Triggers' => Serialize::map($options['configurationTriggers'], function($e) { return $e; }), 'Configuration.FlowSid' => $options['configurationFlowSid'], 'Configuration.RetryCount' => $options['configurationRetryCount'], )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new WebhookInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid'] ); } /** * Constructs a WebhookContext * * @param string $sid The SID of the Channel Webhook resource to fetch * @return \Twilio\Rest\Chat\V2\Service\Channel\WebhookContext */ public function getContext($sid) { return new WebhookContext( $this->version, $this->solution['serviceSid'], $this->solution['channelSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Chat.V2.WebhookList]'; } } sdk/src/Twilio/Rest/Chat/V2/Service/Channel/InviteList.php 0000644 00000014645 15002236443 0017232 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V2\Service\Channel; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class InviteList extends ListResource { /** * Construct the InviteList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Service that the resource is * associated with * @param string $channelSid The SID of the Channel the new resource belongs to * @return \Twilio\Rest\Chat\V2\Service\Channel\InviteList */ public function __construct(Version $version, $serviceSid, $channelSid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, 'channelSid' => $channelSid, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Channels/' . \rawurlencode($channelSid) . '/Invites'; } /** * Create a new InviteInstance * * @param string $identity The `identity` value that identifies the new * resource's User * @param array|Options $options Optional Arguments * @return InviteInstance Newly created InviteInstance * @throws TwilioException When an HTTP error occurs. */ public function create($identity, $options = array()) { $options = new Values($options); $data = Values::of(array('Identity' => $identity, 'RoleSid' => $options['roleSid'], )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new InviteInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid'] ); } /** * Streams InviteInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($options = array(), $limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads InviteInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return InviteInstance[] Array of results */ public function read($options = array(), $limit = null, $pageSize = null) { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Retrieve a single page of InviteInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of InviteInstance */ public function page($options = array(), $pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $options = new Values($options); $params = Values::of(array( 'Identity' => Serialize::map($options['identity'], function($e) { return $e; }), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new InvitePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of InviteInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of InviteInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new InvitePage($this->version, $response, $this->solution); } /** * Constructs a InviteContext * * @param string $sid The SID of the Invite resource to fetch * @return \Twilio\Rest\Chat\V2\Service\Channel\InviteContext */ public function getContext($sid) { return new InviteContext( $this->version, $this->solution['serviceSid'], $this->solution['channelSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Chat.V2.InviteList]'; } } sdk/src/Twilio/Rest/Chat/V2/Service/Channel/MessagePage.php 0000644 00000001522 15002236443 0017307 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V2\Service\Channel; use Twilio\Page; class MessagePage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new MessageInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Chat.V2.MessagePage]'; } } sdk/src/Twilio/Rest/Chat/V2/Service/Channel/WebhookContext.php 0000644 00000007330 15002236443 0020074 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V2\Service\Channel; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class WebhookContext extends InstanceContext { /** * Initialize the WebhookContext * * @param \Twilio\Version $version Version that contains the resource * @param string $serviceSid The SID of the Service with the Channel to fetch * the Webhook resource from * @param string $channelSid The SID of the Channel the resource to fetch * belongs to * @param string $sid The SID of the Channel Webhook resource to fetch * @return \Twilio\Rest\Chat\V2\Service\Channel\WebhookContext */ public function __construct(Version $version, $serviceSid, $channelSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, 'channelSid' => $channelSid, 'sid' => $sid, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Channels/' . \rawurlencode($channelSid) . '/Webhooks/' . \rawurlencode($sid) . ''; } /** * Fetch a WebhookInstance * * @return WebhookInstance Fetched WebhookInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new WebhookInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid'], $this->solution['sid'] ); } /** * Update the WebhookInstance * * @param array|Options $options Optional Arguments * @return WebhookInstance Updated WebhookInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { $options = new Values($options); $data = Values::of(array( 'Configuration.Url' => $options['configurationUrl'], 'Configuration.Method' => $options['configurationMethod'], 'Configuration.Filters' => Serialize::map($options['configurationFilters'], function($e) { return $e; }), 'Configuration.Triggers' => Serialize::map($options['configurationTriggers'], function($e) { return $e; }), 'Configuration.FlowSid' => $options['configurationFlowSid'], 'Configuration.RetryCount' => $options['configurationRetryCount'], )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new WebhookInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid'], $this->solution['sid'] ); } /** * Deletes the WebhookInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Chat.V2.WebhookContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Chat/V2/Service/Channel/InvitePage.php 0000644 00000001517 15002236443 0017165 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V2\Service\Channel; use Twilio\Page; class InvitePage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new InviteInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Chat.V2.InvitePage]'; } } sdk/src/Twilio/Rest/Chat/V2/Service/Channel/InviteOptions.php 0000644 00000005554 15002236443 0017751 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V2\Service\Channel; use Twilio\Options; use Twilio\Values; abstract class InviteOptions { /** * @param string $roleSid The Role assigned to the new member * @return CreateInviteOptions Options builder */ public static function create($roleSid = Values::NONE) { return new CreateInviteOptions($roleSid); } /** * @param string $identity The `identity` value of the resources to read * @return ReadInviteOptions Options builder */ public static function read($identity = Values::NONE) { return new ReadInviteOptions($identity); } } class CreateInviteOptions extends Options { /** * @param string $roleSid The Role assigned to the new member */ public function __construct($roleSid = Values::NONE) { $this->options['roleSid'] = $roleSid; } /** * The SID of the [Role](https://www.twilio.com/docs/chat/rest/role-resource) assigned to the new member. * * @param string $roleSid The Role assigned to the new member * @return $this Fluent Builder */ public function setRoleSid($roleSid) { $this->options['roleSid'] = $roleSid; 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.Chat.V2.CreateInviteOptions ' . \implode(' ', $options) . ']'; } } class ReadInviteOptions extends Options { /** * @param string $identity The `identity` value of the resources to read */ public function __construct($identity = Values::NONE) { $this->options['identity'] = $identity; } /** * The [User](https://www.twilio.com/docs/chat/rest/user-resource)'s `identity` value of the resources to read. See [access tokens](https://www.twilio.com/docs/chat/create-tokens) for more details. * * @param string $identity The `identity` value of the resources to read * @return $this Fluent Builder */ public function setIdentity($identity) { $this->options['identity'] = $identity; 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.Chat.V2.ReadInviteOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Chat/V2/Service/Channel/InviteInstance.php 0000644 00000010571 15002236443 0020055 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V2\Service\Channel; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $accountSid * @property string $channelSid * @property string $serviceSid * @property string $identity * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $roleSid * @property string $createdBy * @property string $url */ class InviteInstance extends InstanceResource { /** * Initialize the InviteInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the Service that the resource is * associated with * @param string $channelSid The SID of the Channel the new resource belongs to * @param string $sid The SID of the Invite resource to fetch * @return \Twilio\Rest\Chat\V2\Service\Channel\InviteInstance */ public function __construct(Version $version, array $payload, $serviceSid, $channelSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'channelSid' => Values::array_get($payload, 'channel_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'identity' => Values::array_get($payload, 'identity'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'roleSid' => Values::array_get($payload, 'role_sid'), 'createdBy' => Values::array_get($payload, 'created_by'), 'url' => Values::array_get($payload, 'url'), ); $this->solution = array( 'serviceSid' => $serviceSid, 'channelSid' => $channelSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Chat\V2\Service\Channel\InviteContext Context for this * InviteInstance */ protected function proxy() { if (!$this->context) { $this->context = new InviteContext( $this->version, $this->solution['serviceSid'], $this->solution['channelSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch a InviteInstance * * @return InviteInstance Fetched InviteInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the InviteInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Chat.V2.InviteInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Chat/V2/Service/Channel/MessageOptions.php 0000644 00000031323 15002236443 0020070 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V2\Service\Channel; use Twilio\Options; use Twilio\Values; abstract class MessageOptions { /** * @param string $from The Identity of the new message's author * @param string $attributes A valid JSON string that contains * application-specific data * @param \DateTime $dateCreated The ISO 8601 date and time in GMT when the * resource was created * @param \DateTime $dateUpdated The ISO 8601 date and time in GMT when the * resource was updated * @param string $lastUpdatedBy The Identity of the User who last updated the * Message * @param string $body The message to send to the channel * @param string $mediaSid The Media Sid to be attached to the new Message * @return CreateMessageOptions Options builder */ public static function create($from = Values::NONE, $attributes = Values::NONE, $dateCreated = Values::NONE, $dateUpdated = Values::NONE, $lastUpdatedBy = Values::NONE, $body = Values::NONE, $mediaSid = Values::NONE) { return new CreateMessageOptions($from, $attributes, $dateCreated, $dateUpdated, $lastUpdatedBy, $body, $mediaSid); } /** * @param string $order The sort order of the returned messages * @return ReadMessageOptions Options builder */ public static function read($order = Values::NONE) { return new ReadMessageOptions($order); } /** * @param string $body The message to send to the channel * @param string $attributes A valid JSON string that contains * application-specific data * @param \DateTime $dateCreated The ISO 8601 date and time in GMT when the * resource was created * @param \DateTime $dateUpdated The ISO 8601 date and time in GMT when the * resource was updated * @param string $lastUpdatedBy The Identity of the User who last updated the * Message, if applicable * @param string $from The Identity of the message's author * @return UpdateMessageOptions Options builder */ public static function update($body = Values::NONE, $attributes = Values::NONE, $dateCreated = Values::NONE, $dateUpdated = Values::NONE, $lastUpdatedBy = Values::NONE, $from = Values::NONE) { return new UpdateMessageOptions($body, $attributes, $dateCreated, $dateUpdated, $lastUpdatedBy, $from); } } class CreateMessageOptions extends Options { /** * @param string $from The Identity of the new message's author * @param string $attributes A valid JSON string that contains * application-specific data * @param \DateTime $dateCreated The ISO 8601 date and time in GMT when the * resource was created * @param \DateTime $dateUpdated The ISO 8601 date and time in GMT when the * resource was updated * @param string $lastUpdatedBy The Identity of the User who last updated the * Message * @param string $body The message to send to the channel * @param string $mediaSid The Media Sid to be attached to the new Message */ public function __construct($from = Values::NONE, $attributes = Values::NONE, $dateCreated = Values::NONE, $dateUpdated = Values::NONE, $lastUpdatedBy = Values::NONE, $body = Values::NONE, $mediaSid = Values::NONE) { $this->options['from'] = $from; $this->options['attributes'] = $attributes; $this->options['dateCreated'] = $dateCreated; $this->options['dateUpdated'] = $dateUpdated; $this->options['lastUpdatedBy'] = $lastUpdatedBy; $this->options['body'] = $body; $this->options['mediaSid'] = $mediaSid; } /** * The [Identity](https://www.twilio.com/docs/chat/identity) of the new message's author. The default value is `system`. * * @param string $from The Identity of the new message's author * @return $this Fluent Builder */ public function setFrom($from) { $this->options['from'] = $from; return $this; } /** * A valid JSON string that contains application-specific data. * * @param string $attributes A valid JSON string that contains * application-specific data * @return $this Fluent Builder */ public function setAttributes($attributes) { $this->options['attributes'] = $attributes; return $this; } /** * The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was created. The default value is the current time set by the Chat service. This parameter should only be used when a Chat's history is being recreated from a backup/separate source. * * @param \DateTime $dateCreated The ISO 8601 date and time in GMT when the * resource was created * @return $this Fluent Builder */ public function setDateCreated($dateCreated) { $this->options['dateCreated'] = $dateCreated; return $this; } /** * The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was last updated. * * @param \DateTime $dateUpdated The ISO 8601 date and time in GMT when the * resource was updated * @return $this Fluent Builder */ public function setDateUpdated($dateUpdated) { $this->options['dateUpdated'] = $dateUpdated; return $this; } /** * The [Identity](https://www.twilio.com/docs/chat/identity) of the User who last updated the Message, if applicable. * * @param string $lastUpdatedBy The Identity of the User who last updated the * Message * @return $this Fluent Builder */ public function setLastUpdatedBy($lastUpdatedBy) { $this->options['lastUpdatedBy'] = $lastUpdatedBy; return $this; } /** * The message to send to the channel. Can be an empty string or `null`, which sets the value as an empty string. You can send structured data in the body by serializing it as a string. * * @param string $body The message to send to the channel * @return $this Fluent Builder */ public function setBody($body) { $this->options['body'] = $body; return $this; } /** * The SID of the [Media](https://www.twilio.com/docs/chat/rest/media) to attach to the new Message. * * @param string $mediaSid The Media Sid to be attached to the new Message * @return $this Fluent Builder */ public function setMediaSid($mediaSid) { $this->options['mediaSid'] = $mediaSid; 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.Chat.V2.CreateMessageOptions ' . \implode(' ', $options) . ']'; } } class ReadMessageOptions extends Options { /** * @param string $order The sort order of the returned messages */ public function __construct($order = Values::NONE) { $this->options['order'] = $order; } /** * The sort order of the returned messages. Can be: `asc` (ascending) or `desc` (descending) with `asc` as the default. * * @param string $order The sort order of the returned messages * @return $this Fluent Builder */ public function setOrder($order) { $this->options['order'] = $order; 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.Chat.V2.ReadMessageOptions ' . \implode(' ', $options) . ']'; } } class UpdateMessageOptions extends Options { /** * @param string $body The message to send to the channel * @param string $attributes A valid JSON string that contains * application-specific data * @param \DateTime $dateCreated The ISO 8601 date and time in GMT when the * resource was created * @param \DateTime $dateUpdated The ISO 8601 date and time in GMT when the * resource was updated * @param string $lastUpdatedBy The Identity of the User who last updated the * Message, if applicable * @param string $from The Identity of the message's author */ public function __construct($body = Values::NONE, $attributes = Values::NONE, $dateCreated = Values::NONE, $dateUpdated = Values::NONE, $lastUpdatedBy = Values::NONE, $from = Values::NONE) { $this->options['body'] = $body; $this->options['attributes'] = $attributes; $this->options['dateCreated'] = $dateCreated; $this->options['dateUpdated'] = $dateUpdated; $this->options['lastUpdatedBy'] = $lastUpdatedBy; $this->options['from'] = $from; } /** * The message to send to the channel. Can be an empty string or `null`, which sets the value as an empty string. You can send structured data in the body by serializing it as a string. * * @param string $body The message to send to the channel * @return $this Fluent Builder */ public function setBody($body) { $this->options['body'] = $body; return $this; } /** * A valid JSON string that contains application-specific data. * * @param string $attributes A valid JSON string that contains * application-specific data * @return $this Fluent Builder */ public function setAttributes($attributes) { $this->options['attributes'] = $attributes; return $this; } /** * The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was created. The default value is the current time set by the Chat service. This parameter should only be used when a Chat's history is being recreated from a backup/separate source. * * @param \DateTime $dateCreated The ISO 8601 date and time in GMT when the * resource was created * @return $this Fluent Builder */ public function setDateCreated($dateCreated) { $this->options['dateCreated'] = $dateCreated; return $this; } /** * The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was last updated. * * @param \DateTime $dateUpdated The ISO 8601 date and time in GMT when the * resource was updated * @return $this Fluent Builder */ public function setDateUpdated($dateUpdated) { $this->options['dateUpdated'] = $dateUpdated; return $this; } /** * The [Identity](https://www.twilio.com/docs/chat/identity) of the User who last updated the Message, if applicable. * * @param string $lastUpdatedBy The Identity of the User who last updated the * Message, if applicable * @return $this Fluent Builder */ public function setLastUpdatedBy($lastUpdatedBy) { $this->options['lastUpdatedBy'] = $lastUpdatedBy; return $this; } /** * The [Identity](https://www.twilio.com/docs/chat/identity) of the message's author. * * @param string $from The Identity of the message's author * @return $this Fluent Builder */ public function setFrom($from) { $this->options['from'] = $from; 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.Chat.V2.UpdateMessageOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Chat/V2/Service/Channel/MemberInstance.php 0000644 00000012010 15002236443 0020014 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V2\Service\Channel; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $accountSid * @property string $channelSid * @property string $serviceSid * @property string $identity * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $roleSid * @property int $lastConsumedMessageIndex * @property \DateTime $lastConsumptionTimestamp * @property string $url * @property string $attributes */ class MemberInstance extends InstanceResource { /** * Initialize the MemberInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the Service that the resource is * associated with * @param string $channelSid The SID of the Channel for the member * @param string $sid The SID of the Member resource to fetch * @return \Twilio\Rest\Chat\V2\Service\Channel\MemberInstance */ public function __construct(Version $version, array $payload, $serviceSid, $channelSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'channelSid' => Values::array_get($payload, 'channel_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'identity' => Values::array_get($payload, 'identity'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'roleSid' => Values::array_get($payload, 'role_sid'), 'lastConsumedMessageIndex' => Values::array_get($payload, 'last_consumed_message_index'), 'lastConsumptionTimestamp' => Deserialize::dateTime(Values::array_get($payload, 'last_consumption_timestamp')), 'url' => Values::array_get($payload, 'url'), 'attributes' => Values::array_get($payload, 'attributes'), ); $this->solution = array( 'serviceSid' => $serviceSid, 'channelSid' => $channelSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Chat\V2\Service\Channel\MemberContext Context for this * MemberInstance */ protected function proxy() { if (!$this->context) { $this->context = new MemberContext( $this->version, $this->solution['serviceSid'], $this->solution['channelSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch a MemberInstance * * @return MemberInstance Fetched MemberInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the MemberInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Update the MemberInstance * * @param array|Options $options Optional Arguments * @return MemberInstance Updated MemberInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Chat.V2.MemberInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Chat/V2/ServiceContext.php 0000644 00000020607 15002236443 0015130 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V2; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Rest\Chat\V2\Service\BindingList; use Twilio\Rest\Chat\V2\Service\ChannelList; use Twilio\Rest\Chat\V2\Service\RoleList; use Twilio\Rest\Chat\V2\Service\UserList; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * @property \Twilio\Rest\Chat\V2\Service\ChannelList $channels * @property \Twilio\Rest\Chat\V2\Service\RoleList $roles * @property \Twilio\Rest\Chat\V2\Service\UserList $users * @property \Twilio\Rest\Chat\V2\Service\BindingList $bindings * @method \Twilio\Rest\Chat\V2\Service\ChannelContext channels(string $sid) * @method \Twilio\Rest\Chat\V2\Service\RoleContext roles(string $sid) * @method \Twilio\Rest\Chat\V2\Service\UserContext users(string $sid) * @method \Twilio\Rest\Chat\V2\Service\BindingContext bindings(string $sid) */ class ServiceContext extends InstanceContext { protected $_channels = null; protected $_roles = null; protected $_users = null; protected $_bindings = null; /** * Initialize the ServiceContext * * @param \Twilio\Version $version Version that contains the resource * @param string $sid The SID of the Service resource to fetch * @return \Twilio\Rest\Chat\V2\ServiceContext */ public function __construct(Version $version, $sid) { parent::__construct($version); // Path Solution $this->solution = array('sid' => $sid, ); $this->uri = '/Services/' . \rawurlencode($sid) . ''; } /** * Fetch a ServiceInstance * * @return ServiceInstance Fetched ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new ServiceInstance($this->version, $payload, $this->solution['sid']); } /** * Deletes the ServiceInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Update the ServiceInstance * * @param array|Options $options Optional Arguments * @return ServiceInstance Updated ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { $options = new Values($options); $data = Values::of(array( 'FriendlyName' => $options['friendlyName'], 'DefaultServiceRoleSid' => $options['defaultServiceRoleSid'], 'DefaultChannelRoleSid' => $options['defaultChannelRoleSid'], 'DefaultChannelCreatorRoleSid' => $options['defaultChannelCreatorRoleSid'], 'ReadStatusEnabled' => Serialize::booleanToString($options['readStatusEnabled']), 'ReachabilityEnabled' => Serialize::booleanToString($options['reachabilityEnabled']), 'TypingIndicatorTimeout' => $options['typingIndicatorTimeout'], 'ConsumptionReportInterval' => $options['consumptionReportInterval'], 'Notifications.NewMessage.Enabled' => Serialize::booleanToString($options['notificationsNewMessageEnabled']), 'Notifications.NewMessage.Template' => $options['notificationsNewMessageTemplate'], 'Notifications.NewMessage.Sound' => $options['notificationsNewMessageSound'], 'Notifications.NewMessage.BadgeCountEnabled' => Serialize::booleanToString($options['notificationsNewMessageBadgeCountEnabled']), 'Notifications.AddedToChannel.Enabled' => Serialize::booleanToString($options['notificationsAddedToChannelEnabled']), 'Notifications.AddedToChannel.Template' => $options['notificationsAddedToChannelTemplate'], 'Notifications.AddedToChannel.Sound' => $options['notificationsAddedToChannelSound'], 'Notifications.RemovedFromChannel.Enabled' => Serialize::booleanToString($options['notificationsRemovedFromChannelEnabled']), 'Notifications.RemovedFromChannel.Template' => $options['notificationsRemovedFromChannelTemplate'], 'Notifications.RemovedFromChannel.Sound' => $options['notificationsRemovedFromChannelSound'], 'Notifications.InvitedToChannel.Enabled' => Serialize::booleanToString($options['notificationsInvitedToChannelEnabled']), 'Notifications.InvitedToChannel.Template' => $options['notificationsInvitedToChannelTemplate'], 'Notifications.InvitedToChannel.Sound' => $options['notificationsInvitedToChannelSound'], 'PreWebhookUrl' => $options['preWebhookUrl'], 'PostWebhookUrl' => $options['postWebhookUrl'], 'WebhookMethod' => $options['webhookMethod'], 'WebhookFilters' => Serialize::map($options['webhookFilters'], function($e) { return $e; }), 'Limits.ChannelMembers' => $options['limitsChannelMembers'], 'Limits.UserChannels' => $options['limitsUserChannels'], 'Media.CompatibilityMessage' => $options['mediaCompatibilityMessage'], 'PreWebhookRetryCount' => $options['preWebhookRetryCount'], 'PostWebhookRetryCount' => $options['postWebhookRetryCount'], 'Notifications.LogEnabled' => Serialize::booleanToString($options['notificationsLogEnabled']), )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new ServiceInstance($this->version, $payload, $this->solution['sid']); } /** * Access the channels * * @return \Twilio\Rest\Chat\V2\Service\ChannelList */ protected function getChannels() { if (!$this->_channels) { $this->_channels = new ChannelList($this->version, $this->solution['sid']); } return $this->_channels; } /** * Access the roles * * @return \Twilio\Rest\Chat\V2\Service\RoleList */ protected function getRoles() { if (!$this->_roles) { $this->_roles = new RoleList($this->version, $this->solution['sid']); } return $this->_roles; } /** * Access the users * * @return \Twilio\Rest\Chat\V2\Service\UserList */ protected function getUsers() { if (!$this->_users) { $this->_users = new UserList($this->version, $this->solution['sid']); } return $this->_users; } /** * Access the bindings * * @return \Twilio\Rest\Chat\V2\Service\BindingList */ protected function getBindings() { if (!$this->_bindings) { $this->_bindings = new BindingList($this->version, $this->solution['sid']); } return $this->_bindings; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get($name) { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Chat.V2.ServiceContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Insights/V1.php 0000644 00000004343 15002236443 0013072 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Insights; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\Rest\Insights\V1\CallList; use Twilio\Version; /** * @property \Twilio\Rest\Insights\V1\CallList $calls * @method \Twilio\Rest\Insights\V1\CallContext calls(string $sid) */ class V1 extends Version { protected $_calls = null; /** * Construct the V1 version of Insights * * @param \Twilio\Domain $domain Domain that contains the version * @return \Twilio\Rest\Insights\V1 V1 version of Insights */ public function __construct(Domain $domain) { parent::__construct($domain); $this->version = 'v1'; } /** * @return \Twilio\Rest\Insights\V1\CallList */ protected function getCalls() { if (!$this->_calls) { $this->_calls = new CallList($this); } return $this->_calls; } /** * Magic getter to lazy load root resources * * @param string $name Resource to return * @return \Twilio\ListResource The requested resource * @throws TwilioException For unknown resource */ public function __get($name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown resource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Insights.V1]'; } } sdk/src/Twilio/Rest/Insights/V1/CallInstance.php 0000644 00000007073 15002236443 0015435 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Insights\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $sid * @property string $url * @property array $links */ class CallInstance extends InstanceResource { protected $_events = null; protected $_metrics = null; protected $_summary = null; /** * Initialize the CallInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The sid * @return \Twilio\Rest\Insights\V1\CallInstance */ public function __construct(Version $version, array $payload, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'sid' => Values::array_get($payload, 'sid'), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ); $this->solution = array('sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Insights\V1\CallContext Context for this CallInstance */ protected function proxy() { if (!$this->context) { $this->context = new CallContext($this->version, $this->solution['sid']); } return $this->context; } /** * Fetch a CallInstance * * @return CallInstance Fetched CallInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Access the events * * @return \Twilio\Rest\Insights\V1\Call\EventList */ protected function getEvents() { return $this->proxy()->events; } /** * Access the metrics * * @return \Twilio\Rest\Insights\V1\Call\MetricList */ protected function getMetrics() { return $this->proxy()->metrics; } /** * Access the summary * * @return \Twilio\Rest\Insights\V1\Call\CallSummaryList */ protected function getSummary() { return $this->proxy()->summary; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Insights.V1.CallInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Insights/V1/CallList.php 0000644 00000002300 15002236443 0014570 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Insights\V1; use Twilio\ListResource; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class CallList extends ListResource { /** * Construct the CallList * * @param Version $version Version that contains the resource * @return \Twilio\Rest\Insights\V1\CallList */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = array(); } /** * Constructs a CallContext * * @param string $sid The sid * @return \Twilio\Rest\Insights\V1\CallContext */ public function getContext($sid) { return new CallContext($this->version, $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Insights.V1.CallList]'; } } sdk/src/Twilio/Rest/Insights/V1/CallContext.php 0000644 00000010314 15002236443 0015305 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Insights\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Rest\Insights\V1\Call\CallSummaryList; use Twilio\Rest\Insights\V1\Call\EventList; use Twilio\Rest\Insights\V1\Call\MetricList; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property \Twilio\Rest\Insights\V1\Call\EventList $events * @property \Twilio\Rest\Insights\V1\Call\MetricList $metrics * @property \Twilio\Rest\Insights\V1\Call\CallSummaryList $summary * @method \Twilio\Rest\Insights\V1\Call\CallSummaryContext summary() */ class CallContext extends InstanceContext { protected $_events = null; protected $_metrics = null; protected $_summary = null; /** * Initialize the CallContext * * @param \Twilio\Version $version Version that contains the resource * @param string $sid The sid * @return \Twilio\Rest\Insights\V1\CallContext */ public function __construct(Version $version, $sid) { parent::__construct($version); // Path Solution $this->solution = array('sid' => $sid, ); $this->uri = '/Voice/' . \rawurlencode($sid) . ''; } /** * Fetch a CallInstance * * @return CallInstance Fetched CallInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new CallInstance($this->version, $payload, $this->solution['sid']); } /** * Access the events * * @return \Twilio\Rest\Insights\V1\Call\EventList */ protected function getEvents() { if (!$this->_events) { $this->_events = new EventList($this->version, $this->solution['sid']); } return $this->_events; } /** * Access the metrics * * @return \Twilio\Rest\Insights\V1\Call\MetricList */ protected function getMetrics() { if (!$this->_metrics) { $this->_metrics = new MetricList($this->version, $this->solution['sid']); } return $this->_metrics; } /** * Access the summary * * @return \Twilio\Rest\Insights\V1\Call\CallSummaryList */ protected function getSummary() { if (!$this->_summary) { $this->_summary = new CallSummaryList($this->version, $this->solution['sid']); } return $this->_summary; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get($name) { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Insights.V1.CallContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Insights/V1/CallPage.php 0000644 00000001624 15002236443 0014541 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Insights\V1; use Twilio\Page; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class CallPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new CallInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Insights.V1.CallPage]'; } } sdk/src/Twilio/Rest/Insights/V1/Call/EventOptions.php 0000644 00000002724 15002236443 0016403 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Insights\V1\Call; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ abstract class EventOptions { /** * @param string $edge The edge * @return ReadEventOptions Options builder */ public static function read($edge = Values::NONE) { return new ReadEventOptions($edge); } } class ReadEventOptions extends Options { /** * @param string $edge The edge */ public function __construct($edge = Values::NONE) { $this->options['edge'] = $edge; } /** * The edge * * @param string $edge The edge * @return $this Fluent Builder */ public function setEdge($edge) { $this->options['edge'] = $edge; 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.Insights.V1.ReadEventOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Insights/V1/Call/CallSummaryContext.php 0000644 00000004017 15002236443 0017541 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Insights\V1\Call; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class CallSummaryContext extends InstanceContext { /** * Initialize the CallSummaryContext * * @param \Twilio\Version $version Version that contains the resource * @param string $callSid The call_sid * @return \Twilio\Rest\Insights\V1\Call\CallSummaryContext */ public function __construct(Version $version, $callSid) { parent::__construct($version); // Path Solution $this->solution = array('callSid' => $callSid, ); $this->uri = '/Voice/' . \rawurlencode($callSid) . '/Summary'; } /** * Fetch a CallSummaryInstance * * @param array|Options $options Optional Arguments * @return CallSummaryInstance Fetched CallSummaryInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch($options = array()) { $options = new Values($options); $params = Values::of(array('ProcessingState' => $options['processingState'], )); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new CallSummaryInstance($this->version, $payload, $this->solution['callSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Insights.V1.CallSummaryContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Insights/V1/Call/CallSummaryList.php 0000644 00000002474 15002236443 0017035 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Insights\V1\Call; use Twilio\ListResource; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class CallSummaryList extends ListResource { /** * Construct the CallSummaryList * * @param Version $version Version that contains the resource * @param string $callSid The call_sid * @return \Twilio\Rest\Insights\V1\Call\CallSummaryList */ public function __construct(Version $version, $callSid) { parent::__construct($version); // Path Solution $this->solution = array('callSid' => $callSid, ); } /** * Constructs a CallSummaryContext * * @return \Twilio\Rest\Insights\V1\Call\CallSummaryContext */ public function getContext() { return new CallSummaryContext($this->version, $this->solution['callSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Insights.V1.CallSummaryList]'; } } sdk/src/Twilio/Rest/Insights/V1/Call/EventList.php 0000644 00000011720 15002236443 0015657 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Insights\V1\Call; use Twilio\ListResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class EventList extends ListResource { /** * Construct the EventList * * @param Version $version Version that contains the resource * @param string $callSid The call_sid * @return \Twilio\Rest\Insights\V1\Call\EventList */ public function __construct(Version $version, $callSid) { parent::__construct($version); // Path Solution $this->solution = array('callSid' => $callSid, ); $this->uri = '/Voice/' . \rawurlencode($callSid) . '/Events'; } /** * Streams EventInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($options = array(), $limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads EventInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return EventInstance[] Array of results */ public function read($options = array(), $limit = null, $pageSize = null) { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Retrieve a single page of EventInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of EventInstance */ public function page($options = array(), $pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $options = new Values($options); $params = Values::of(array( 'Edge' => $options['edge'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new EventPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of EventInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of EventInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new EventPage($this->version, $response, $this->solution); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Insights.V1.EventList]'; } } sdk/src/Twilio/Rest/Insights/V1/Call/CallSummaryPage.php 0000644 00000001712 15002236443 0016770 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Insights\V1\Call; use Twilio\Page; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class CallSummaryPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new CallSummaryInstance($this->version, $payload, $this->solution['callSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Insights.V1.CallSummaryPage]'; } } sdk/src/Twilio/Rest/Insights/V1/Call/CallSummaryOptions.php 0000644 00000003253 15002236443 0017551 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Insights\V1\Call; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ abstract class CallSummaryOptions { /** * @param string $processingState The processing_state * @return FetchCallSummaryOptions Options builder */ public static function fetch($processingState = Values::NONE) { return new FetchCallSummaryOptions($processingState); } } class FetchCallSummaryOptions extends Options { /** * @param string $processingState The processing_state */ public function __construct($processingState = Values::NONE) { $this->options['processingState'] = $processingState; } /** * The processing_state * * @param string $processingState The processing_state * @return $this Fluent Builder */ public function setProcessingState($processingState) { $this->options['processingState'] = $processingState; 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.Insights.V1.FetchCallSummaryOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Insights/V1/Call/CallSummaryInstance.php 0000644 00000011437 15002236443 0017665 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Insights\V1\Call; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $accountSid * @property string $callSid * @property string $callType * @property string $callState * @property string $processingState * @property \DateTime $startTime * @property \DateTime $endTime * @property int $duration * @property int $connectDuration * @property array $from * @property array $to * @property array $carrierEdge * @property array $clientEdge * @property array $sdkEdge * @property array $sipEdge * @property string $tags * @property string $url * @property array $attributes * @property array $properties */ class CallSummaryInstance extends InstanceResource { /** * Initialize the CallSummaryInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $callSid The call_sid * @return \Twilio\Rest\Insights\V1\Call\CallSummaryInstance */ public function __construct(Version $version, array $payload, $callSid) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'accountSid' => Values::array_get($payload, 'account_sid'), 'callSid' => Values::array_get($payload, 'call_sid'), 'callType' => Values::array_get($payload, 'call_type'), 'callState' => Values::array_get($payload, 'call_state'), 'processingState' => Values::array_get($payload, 'processing_state'), 'startTime' => Deserialize::dateTime(Values::array_get($payload, 'start_time')), 'endTime' => Deserialize::dateTime(Values::array_get($payload, 'end_time')), 'duration' => Values::array_get($payload, 'duration'), 'connectDuration' => Values::array_get($payload, 'connect_duration'), 'from' => Values::array_get($payload, 'from'), 'to' => Values::array_get($payload, 'to'), 'carrierEdge' => Values::array_get($payload, 'carrier_edge'), 'clientEdge' => Values::array_get($payload, 'client_edge'), 'sdkEdge' => Values::array_get($payload, 'sdk_edge'), 'sipEdge' => Values::array_get($payload, 'sip_edge'), 'tags' => Values::array_get($payload, 'tags'), 'url' => Values::array_get($payload, 'url'), 'attributes' => Values::array_get($payload, 'attributes'), 'properties' => Values::array_get($payload, 'properties'), ); $this->solution = array('callSid' => $callSid, ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Insights\V1\Call\CallSummaryContext Context for this * CallSummaryInstance */ protected function proxy() { if (!$this->context) { $this->context = new CallSummaryContext($this->version, $this->solution['callSid']); } return $this->context; } /** * Fetch a CallSummaryInstance * * @param array|Options $options Optional Arguments * @return CallSummaryInstance Fetched CallSummaryInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch($options = array()) { return $this->proxy()->fetch($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Insights.V1.CallSummaryInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Insights/V1/Call/EventInstance.php 0000644 00000005524 15002236443 0016515 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Insights\V1\Call; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $timestamp * @property string $callSid * @property string $accountSid * @property string $edge * @property string $group * @property string $level * @property string $name * @property array $carrierEdge * @property array $sipEdge * @property array $sdkEdge * @property array $clientEdge */ class EventInstance extends InstanceResource { /** * Initialize the EventInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $callSid The call_sid * @return \Twilio\Rest\Insights\V1\Call\EventInstance */ public function __construct(Version $version, array $payload, $callSid) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'timestamp' => Values::array_get($payload, 'timestamp'), 'callSid' => Values::array_get($payload, 'call_sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'edge' => Values::array_get($payload, 'edge'), 'group' => Values::array_get($payload, 'group'), 'level' => Values::array_get($payload, 'level'), 'name' => Values::array_get($payload, 'name'), 'carrierEdge' => Values::array_get($payload, 'carrier_edge'), 'sipEdge' => Values::array_get($payload, 'sip_edge'), 'sdkEdge' => Values::array_get($payload, 'sdk_edge'), 'clientEdge' => Values::array_get($payload, 'client_edge'), ); $this->solution = array('callSid' => $callSid, ); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Insights.V1.EventInstance]'; } } sdk/src/Twilio/Rest/Insights/V1/Call/MetricOptions.php 0000644 00000003645 15002236443 0016550 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Insights\V1\Call; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ abstract class MetricOptions { /** * @param string $edge The edge * @param string $direction The direction * @return ReadMetricOptions Options builder */ public static function read($edge = Values::NONE, $direction = Values::NONE) { return new ReadMetricOptions($edge, $direction); } } class ReadMetricOptions extends Options { /** * @param string $edge The edge * @param string $direction The direction */ public function __construct($edge = Values::NONE, $direction = Values::NONE) { $this->options['edge'] = $edge; $this->options['direction'] = $direction; } /** * The edge * * @param string $edge The edge * @return $this Fluent Builder */ public function setEdge($edge) { $this->options['edge'] = $edge; return $this; } /** * The direction * * @param string $direction The direction * @return $this Fluent Builder */ public function setDirection($direction) { $this->options['direction'] = $direction; 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.Insights.V1.ReadMetricOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Insights/V1/Call/MetricList.php 0000644 00000012020 15002236443 0016013 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Insights\V1\Call; use Twilio\ListResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class MetricList extends ListResource { /** * Construct the MetricList * * @param Version $version Version that contains the resource * @param string $callSid The call_sid * @return \Twilio\Rest\Insights\V1\Call\MetricList */ public function __construct(Version $version, $callSid) { parent::__construct($version); // Path Solution $this->solution = array('callSid' => $callSid, ); $this->uri = '/Voice/' . \rawurlencode($callSid) . '/Metrics'; } /** * Streams MetricInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($options = array(), $limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads MetricInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return MetricInstance[] Array of results */ public function read($options = array(), $limit = null, $pageSize = null) { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Retrieve a single page of MetricInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of MetricInstance */ public function page($options = array(), $pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $options = new Values($options); $params = Values::of(array( 'Edge' => $options['edge'], 'Direction' => $options['direction'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new MetricPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of MetricInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of MetricInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new MetricPage($this->version, $response, $this->solution); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Insights.V1.MetricList]'; } } sdk/src/Twilio/Rest/Insights/V1/Call/MetricPage.php 0000644 00000001673 15002236443 0015770 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Insights\V1\Call; use Twilio\Page; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class MetricPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new MetricInstance($this->version, $payload, $this->solution['callSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Insights.V1.MetricPage]'; } } sdk/src/Twilio/Rest/Insights/V1/Call/EventPage.php 0000644 00000001670 15002236443 0015623 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Insights\V1\Call; use Twilio\Page; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class EventPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new EventInstance($this->version, $payload, $this->solution['callSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Insights.V1.EventPage]'; } } sdk/src/Twilio/Rest/Insights/V1/Call/MetricInstance.php 0000644 00000005267 15002236443 0016663 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Insights\V1\Call; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $timestamp * @property string $callSid * @property string $accountSid * @property string $edge * @property string $direction * @property array $carrierEdge * @property array $sipEdge * @property array $sdkEdge * @property array $clientEdge */ class MetricInstance extends InstanceResource { /** * Initialize the MetricInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $callSid The call_sid * @return \Twilio\Rest\Insights\V1\Call\MetricInstance */ public function __construct(Version $version, array $payload, $callSid) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'timestamp' => Values::array_get($payload, 'timestamp'), 'callSid' => Values::array_get($payload, 'call_sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'edge' => Values::array_get($payload, 'edge'), 'direction' => Values::array_get($payload, 'direction'), 'carrierEdge' => Values::array_get($payload, 'carrier_edge'), 'sipEdge' => Values::array_get($payload, 'sip_edge'), 'sdkEdge' => Values::array_get($payload, 'sdk_edge'), 'clientEdge' => Values::array_get($payload, 'client_edge'), ); $this->solution = array('callSid' => $callSid, ); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Insights.V1.MetricInstance]'; } } sdk/src/Twilio/Rest/Lookups/V1.php 0000644 00000004466 15002236443 0012744 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Lookups; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\Rest\Lookups\V1\PhoneNumberList; use Twilio\Version; /** * @property \Twilio\Rest\Lookups\V1\PhoneNumberList $phoneNumbers * @method \Twilio\Rest\Lookups\V1\PhoneNumberContext phoneNumbers(string $phoneNumber) */ class V1 extends Version { protected $_phoneNumbers = null; /** * Construct the V1 version of Lookups * * @param \Twilio\Domain $domain Domain that contains the version * @return \Twilio\Rest\Lookups\V1 V1 version of Lookups */ public function __construct(Domain $domain) { parent::__construct($domain); $this->version = 'v1'; } /** * @return \Twilio\Rest\Lookups\V1\PhoneNumberList */ protected function getPhoneNumbers() { if (!$this->_phoneNumbers) { $this->_phoneNumbers = new PhoneNumberList($this); } return $this->_phoneNumbers; } /** * Magic getter to lazy load root resources * * @param string $name Resource to return * @return \Twilio\ListResource The requested resource * @throws TwilioException For unknown resource */ public function __get($name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown resource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Lookups.V1]'; } } sdk/src/Twilio/Rest/Lookups/V1/PhoneNumberPage.php 0000644 00000001334 15002236443 0015752 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Lookups\V1; use Twilio\Page; class PhoneNumberPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new PhoneNumberInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Lookups.V1.PhoneNumberPage]'; } } sdk/src/Twilio/Rest/Lookups/V1/PhoneNumberContext.php 0000644 00000004252 15002236443 0016524 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Lookups\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class PhoneNumberContext extends InstanceContext { /** * Initialize the PhoneNumberContext * * @param \Twilio\Version $version Version that contains the resource * @param string $phoneNumber The phone number to fetch in E.164 format * @return \Twilio\Rest\Lookups\V1\PhoneNumberContext */ public function __construct(Version $version, $phoneNumber) { parent::__construct($version); // Path Solution $this->solution = array('phoneNumber' => $phoneNumber, ); $this->uri = '/PhoneNumbers/' . \rawurlencode($phoneNumber) . ''; } /** * Fetch a PhoneNumberInstance * * @param array|Options $options Optional Arguments * @return PhoneNumberInstance Fetched PhoneNumberInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch($options = array()) { $options = new Values($options); $params = Values::of(array( 'CountryCode' => $options['countryCode'], 'Type' => Serialize::map($options['type'], function($e) { return $e; }), 'AddOns' => Serialize::map($options['addOns'], function($e) { return $e; }), )); $params = \array_merge($params, Serialize::prefixedCollapsibleMap($options['addOnsData'], 'AddOns')); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new PhoneNumberInstance($this->version, $payload, $this->solution['phoneNumber']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Lookups.V1.PhoneNumberContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Lookups/V1/PhoneNumberInstance.php 0000644 00000006716 15002236443 0016653 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Lookups\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property array $callerName * @property string $countryCode * @property string $phoneNumber * @property string $nationalFormat * @property array $carrier * @property array $addOns * @property string $url */ class PhoneNumberInstance extends InstanceResource { /** * Initialize the PhoneNumberInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $phoneNumber The phone number to fetch in E.164 format * @return \Twilio\Rest\Lookups\V1\PhoneNumberInstance */ public function __construct(Version $version, array $payload, $phoneNumber = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'callerName' => Values::array_get($payload, 'caller_name'), 'countryCode' => Values::array_get($payload, 'country_code'), 'phoneNumber' => Values::array_get($payload, 'phone_number'), 'nationalFormat' => Values::array_get($payload, 'national_format'), 'carrier' => Values::array_get($payload, 'carrier'), 'addOns' => Values::array_get($payload, 'add_ons'), 'url' => Values::array_get($payload, 'url'), ); $this->solution = array('phoneNumber' => $phoneNumber ?: $this->properties['phoneNumber'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Lookups\V1\PhoneNumberContext Context for this * PhoneNumberInstance */ protected function proxy() { if (!$this->context) { $this->context = new PhoneNumberContext($this->version, $this->solution['phoneNumber']); } return $this->context; } /** * Fetch a PhoneNumberInstance * * @param array|Options $options Optional Arguments * @return PhoneNumberInstance Fetched PhoneNumberInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch($options = array()) { return $this->proxy()->fetch($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Lookups.V1.PhoneNumberInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Lookups/V1/PhoneNumberOptions.php 0000644 00000010076 15002236443 0016534 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Lookups\V1; use Twilio\Options; use Twilio\Values; abstract class PhoneNumberOptions { /** * @param string $countryCode The ISO country code of the phone number * @param string $type The type of information to return * @param string $addOns The unique_name of an Add-on you would like to invoke * @param string $addOnsData Data specific to the add-on you would like to * invoke * @return FetchPhoneNumberOptions Options builder */ public static function fetch($countryCode = Values::NONE, $type = Values::NONE, $addOns = Values::NONE, $addOnsData = Values::NONE) { return new FetchPhoneNumberOptions($countryCode, $type, $addOns, $addOnsData); } } class FetchPhoneNumberOptions extends Options { /** * @param string $countryCode The ISO country code of the phone number * @param string $type The type of information to return * @param string $addOns The unique_name of an Add-on you would like to invoke * @param string $addOnsData Data specific to the add-on you would like to * invoke */ public function __construct($countryCode = Values::NONE, $type = Values::NONE, $addOns = Values::NONE, $addOnsData = Values::NONE) { $this->options['countryCode'] = $countryCode; $this->options['type'] = $type; $this->options['addOns'] = $addOns; $this->options['addOnsData'] = $addOnsData; } /** * The [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the phone number to fetch. This is used to specify the country when the phone number is provided in a national format. * * @param string $countryCode The ISO country code of the phone number * @return $this Fluent Builder */ public function setCountryCode($countryCode) { $this->options['countryCode'] = $countryCode; return $this; } /** * The type of information to return. Can be: `carrier` or `caller-name`. The default is null. Carrier information costs $0.005 per phone number looked up. Caller Name information is currently available only in the US and costs $0.01 per phone number looked up. To retrieve both types on information, specify this parameter twice; once with `carrier` and once with `caller-name` as the value. * * @param string $type The type of information to return * @return $this Fluent Builder */ public function setType($type) { $this->options['type'] = $type; return $this; } /** * The `unique_name` of an Add-on you would like to invoke. Can be the `unique_name` of an Add-on that is installed on your account. You can specify multiple instances of this parameter to invoke multiple Add-ons. For more information about Add-ons, see the [Add-ons documentation](https://www.twilio.com/docs/add-ons). * * @param string $addOns The unique_name of an Add-on you would like to invoke * @return $this Fluent Builder */ public function setAddOns($addOns) { $this->options['addOns'] = $addOns; return $this; } /** * Data specific to the add-on you would like to invoke. The content and format of this value depends on the add-on. * * @param string $addOnsData Data specific to the add-on you would like to * invoke * @return $this Fluent Builder */ public function setAddOnsData($addOnsData) { $this->options['addOnsData'] = $addOnsData; 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.Lookups.V1.FetchPhoneNumberOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Lookups/V1/PhoneNumberList.php 0000644 00000002134 15002236443 0016010 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Lookups\V1; use Twilio\ListResource; use Twilio\Version; class PhoneNumberList extends ListResource { /** * Construct the PhoneNumberList * * @param Version $version Version that contains the resource * @return \Twilio\Rest\Lookups\V1\PhoneNumberList */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = array(); } /** * Constructs a PhoneNumberContext * * @param string $phoneNumber The phone number to fetch in E.164 format * @return \Twilio\Rest\Lookups\V1\PhoneNumberContext */ public function getContext($phoneNumber) { return new PhoneNumberContext($this->version, $phoneNumber); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Lookups.V1.PhoneNumberList]'; } } sdk/src/Twilio/Rest/Chat.php 0000644 00000006652 15002236443 0011700 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\Rest\Chat\V1; use Twilio\Rest\Chat\V2; /** * @property \Twilio\Rest\Chat\V1 $v1 * @property \Twilio\Rest\Chat\V2 $v2 * @property \Twilio\Rest\Chat\V2\CredentialList $credentials * @property \Twilio\Rest\Chat\V2\ServiceList $services * @method \Twilio\Rest\Chat\V2\CredentialContext credentials(string $sid) * @method \Twilio\Rest\Chat\V2\ServiceContext services(string $sid) */ class Chat extends Domain { protected $_v1 = null; protected $_v2 = null; /** * Construct the Chat Domain * * @param \Twilio\Rest\Client $client Twilio\Rest\Client to communicate with * Twilio * @return \Twilio\Rest\Chat Domain for Chat */ public function __construct(Client $client) { parent::__construct($client); $this->baseUrl = 'https://chat.twilio.com'; } /** * @return \Twilio\Rest\Chat\V1 Version v1 of chat */ protected function getV1() { if (!$this->_v1) { $this->_v1 = new V1($this); } return $this->_v1; } /** * @return \Twilio\Rest\Chat\V2 Version v2 of chat */ protected function getV2() { if (!$this->_v2) { $this->_v2 = new V2($this); } return $this->_v2; } /** * Magic getter to lazy load version * * @param string $name Version to return * @return \Twilio\Version The requested version * @throws TwilioException For unknown versions */ public function __get($name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown version ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $method = 'context' . \ucfirst($name); if (\method_exists($this, $method)) { return \call_user_func_array(array($this, $method), $arguments); } throw new TwilioException('Unknown context ' . $name); } /** * @return \Twilio\Rest\Chat\V2\CredentialList */ protected function getCredentials() { return $this->v2->credentials; } /** * @param string $sid The SID of the Credential resource to fetch * @return \Twilio\Rest\Chat\V2\CredentialContext */ protected function contextCredentials($sid) { return $this->v2->credentials($sid); } /** * @return \Twilio\Rest\Chat\V2\ServiceList */ protected function getServices() { return $this->v2->services; } /** * @param string $sid The SID of the Service resource to fetch * @return \Twilio\Rest\Chat\V2\ServiceContext */ protected function contextServices($sid) { return $this->v2->services($sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Chat]'; } } sdk/src/Twilio/Rest/Monitor.php 0000644 00000006160 15002236443 0012442 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\Rest\Monitor\V1; /** * @property \Twilio\Rest\Monitor\V1 $v1 * @property \Twilio\Rest\Monitor\V1\AlertList $alerts * @property \Twilio\Rest\Monitor\V1\EventList $events * @method \Twilio\Rest\Monitor\V1\AlertContext alerts(string $sid) * @method \Twilio\Rest\Monitor\V1\EventContext events(string $sid) */ class Monitor extends Domain { protected $_v1 = null; /** * Construct the Monitor Domain * * @param \Twilio\Rest\Client $client Twilio\Rest\Client to communicate with * Twilio * @return \Twilio\Rest\Monitor Domain for Monitor */ public function __construct(Client $client) { parent::__construct($client); $this->baseUrl = 'https://monitor.twilio.com'; } /** * @return \Twilio\Rest\Monitor\V1 Version v1 of monitor */ protected function getV1() { if (!$this->_v1) { $this->_v1 = new V1($this); } return $this->_v1; } /** * Magic getter to lazy load version * * @param string $name Version to return * @return \Twilio\Version The requested version * @throws TwilioException For unknown versions */ public function __get($name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown version ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $method = 'context' . \ucfirst($name); if (\method_exists($this, $method)) { return \call_user_func_array(array($this, $method), $arguments); } throw new TwilioException('Unknown context ' . $name); } /** * @return \Twilio\Rest\Monitor\V1\AlertList */ protected function getAlerts() { return $this->v1->alerts; } /** * @param string $sid The SID that identifies the resource to fetch * @return \Twilio\Rest\Monitor\V1\AlertContext */ protected function contextAlerts($sid) { return $this->v1->alerts($sid); } /** * @return \Twilio\Rest\Monitor\V1\EventList */ protected function getEvents() { return $this->v1->events; } /** * @param string $sid The SID that identifies the resource to fetch * @return \Twilio\Rest\Monitor\V1\EventContext */ protected function contextEvents($sid) { return $this->v1->events($sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Monitor]'; } } sdk/src/Twilio/Rest/Autopilot.php 0000644 00000005303 15002236443 0012771 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\Rest\Autopilot\V1; /** * @property \Twilio\Rest\Autopilot\V1 $v1 * @property \Twilio\Rest\Autopilot\V1\AssistantList $assistants * @method \Twilio\Rest\Autopilot\V1\AssistantContext assistants(string $sid) */ class Autopilot extends Domain { protected $_v1 = null; /** * Construct the Autopilot Domain * * @param \Twilio\Rest\Client $client Twilio\Rest\Client to communicate with * Twilio * @return \Twilio\Rest\Autopilot Domain for Autopilot */ public function __construct(Client $client) { parent::__construct($client); $this->baseUrl = 'https://autopilot.twilio.com'; } /** * @return \Twilio\Rest\Autopilot\V1 Version v1 of autopilot */ protected function getV1() { if (!$this->_v1) { $this->_v1 = new V1($this); } return $this->_v1; } /** * Magic getter to lazy load version * * @param string $name Version to return * @return \Twilio\Version The requested version * @throws TwilioException For unknown versions */ public function __get($name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown version ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $method = 'context' . \ucfirst($name); if (\method_exists($this, $method)) { return \call_user_func_array(array($this, $method), $arguments); } throw new TwilioException('Unknown context ' . $name); } /** * @return \Twilio\Rest\Autopilot\V1\AssistantList */ protected function getAssistants() { return $this->v1->assistants; } /** * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Autopilot\V1\AssistantContext */ protected function contextAssistants($sid) { return $this->v1->assistants($sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Autopilot]'; } } sdk/src/Twilio/Rest/Fax.php 0000644 00000005071 15002236443 0011531 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\Rest\Fax\V1; /** * @property \Twilio\Rest\Fax\V1 $v1 * @property \Twilio\Rest\Fax\V1\FaxList $faxes * @method \Twilio\Rest\Fax\V1\FaxContext faxes(string $sid) */ class Fax extends Domain { protected $_v1 = null; /** * Construct the Fax Domain * * @param \Twilio\Rest\Client $client Twilio\Rest\Client to communicate with * Twilio * @return \Twilio\Rest\Fax Domain for Fax */ public function __construct(Client $client) { parent::__construct($client); $this->baseUrl = 'https://fax.twilio.com'; } /** * @return \Twilio\Rest\Fax\V1 Version v1 of fax */ protected function getV1() { if (!$this->_v1) { $this->_v1 = new V1($this); } return $this->_v1; } /** * Magic getter to lazy load version * * @param string $name Version to return * @return \Twilio\Version The requested version * @throws TwilioException For unknown versions */ public function __get($name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown version ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $method = 'context' . \ucfirst($name); if (\method_exists($this, $method)) { return \call_user_func_array(array($this, $method), $arguments); } throw new TwilioException('Unknown context ' . $name); } /** * @return \Twilio\Rest\Fax\V1\FaxList */ protected function getFaxes() { return $this->v1->faxes; } /** * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Fax\V1\FaxContext */ protected function contextFaxes($sid) { return $this->v1->faxes($sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Fax]'; } } sdk/src/Twilio/Rest/Wireless/V1.php 0000644 00000007016 15002236443 0013077 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Wireless; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\Rest\Wireless\V1\CommandList; use Twilio\Rest\Wireless\V1\RatePlanList; use Twilio\Rest\Wireless\V1\SimList; use Twilio\Rest\Wireless\V1\UsageRecordList; use Twilio\Version; /** * @property \Twilio\Rest\Wireless\V1\UsageRecordList $usageRecords * @property \Twilio\Rest\Wireless\V1\CommandList $commands * @property \Twilio\Rest\Wireless\V1\RatePlanList $ratePlans * @property \Twilio\Rest\Wireless\V1\SimList $sims * @method \Twilio\Rest\Wireless\V1\CommandContext commands(string $sid) * @method \Twilio\Rest\Wireless\V1\RatePlanContext ratePlans(string $sid) * @method \Twilio\Rest\Wireless\V1\SimContext sims(string $sid) */ class V1 extends Version { protected $_usageRecords = null; protected $_commands = null; protected $_ratePlans = null; protected $_sims = null; /** * Construct the V1 version of Wireless * * @param \Twilio\Domain $domain Domain that contains the version * @return \Twilio\Rest\Wireless\V1 V1 version of Wireless */ public function __construct(Domain $domain) { parent::__construct($domain); $this->version = 'v1'; } /** * @return \Twilio\Rest\Wireless\V1\UsageRecordList */ protected function getUsageRecords() { if (!$this->_usageRecords) { $this->_usageRecords = new UsageRecordList($this); } return $this->_usageRecords; } /** * @return \Twilio\Rest\Wireless\V1\CommandList */ protected function getCommands() { if (!$this->_commands) { $this->_commands = new CommandList($this); } return $this->_commands; } /** * @return \Twilio\Rest\Wireless\V1\RatePlanList */ protected function getRatePlans() { if (!$this->_ratePlans) { $this->_ratePlans = new RatePlanList($this); } return $this->_ratePlans; } /** * @return \Twilio\Rest\Wireless\V1\SimList */ protected function getSims() { if (!$this->_sims) { $this->_sims = new SimList($this); } return $this->_sims; } /** * Magic getter to lazy load root resources * * @param string $name Resource to return * @return \Twilio\ListResource The requested resource * @throws TwilioException For unknown resource */ public function __get($name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown resource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Wireless.V1]'; } } sdk/src/Twilio/Rest/Wireless/V1/SimPage.php 0000644 00000001306 15002236443 0014420 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Wireless\V1; use Twilio\Page; class SimPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new SimInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Wireless.V1.SimPage]'; } } sdk/src/Twilio/Rest/Wireless/V1/CommandContext.php 0000644 00000003573 15002236443 0016026 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Wireless\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; class CommandContext extends InstanceContext { /** * Initialize the CommandContext * * @param \Twilio\Version $version Version that contains the resource * @param string $sid The SID that identifies the resource to fetch * @return \Twilio\Rest\Wireless\V1\CommandContext */ public function __construct(Version $version, $sid) { parent::__construct($version); // Path Solution $this->solution = array('sid' => $sid, ); $this->uri = '/Commands/' . \rawurlencode($sid) . ''; } /** * Fetch a CommandInstance * * @return CommandInstance Fetched CommandInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new CommandInstance($this->version, $payload, $this->solution['sid']); } /** * Deletes the CommandInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Wireless.V1.CommandContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Wireless/V1/UsageRecordPage.php 0000644 00000001336 15002236443 0016076 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Wireless\V1; use Twilio\Page; class UsageRecordPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new UsageRecordInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Wireless.V1.UsageRecordPage]'; } } sdk/src/Twilio/Rest/Wireless/V1/Sim/DataSessionOptions.php 0000644 00000004666 15002236443 0017430 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Wireless\V1\Sim; use Twilio\Options; use Twilio\Values; abstract class DataSessionOptions { /** * @param \DateTime $end The date that the record ended, given as GMT in ISO * 8601 format * @param \DateTime $start The date that the Data Session started, given as GMT * in ISO 8601 format * @return ReadDataSessionOptions Options builder */ public static function read($end = Values::NONE, $start = Values::NONE) { return new ReadDataSessionOptions($end, $start); } } class ReadDataSessionOptions extends Options { /** * @param \DateTime $end The date that the record ended, given as GMT in ISO * 8601 format * @param \DateTime $start The date that the Data Session started, given as GMT * in ISO 8601 format */ public function __construct($end = Values::NONE, $start = Values::NONE) { $this->options['end'] = $end; $this->options['start'] = $start; } /** * The date that the record ended, given as GMT in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. * * @param \DateTime $end The date that the record ended, given as GMT in ISO * 8601 format * @return $this Fluent Builder */ public function setEnd($end) { $this->options['end'] = $end; return $this; } /** * The date that the Data Session started, given as GMT in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. * * @param \DateTime $start The date that the Data Session started, given as GMT * in ISO 8601 format * @return $this Fluent Builder */ public function setStart($start) { $this->options['start'] = $start; 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.Wireless.V1.ReadDataSessionOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Wireless/V1/Sim/DataSessionPage.php 0000644 00000001375 15002236443 0016643 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Wireless\V1\Sim; use Twilio\Page; class DataSessionPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new DataSessionInstance($this->version, $payload, $this->solution['simSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Wireless.V1.DataSessionPage]'; } } sdk/src/Twilio/Rest/Wireless/V1/Sim/UsageRecordPage.php 0000644 00000001375 15002236443 0016631 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Wireless\V1\Sim; use Twilio\Page; class UsageRecordPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new UsageRecordInstance($this->version, $payload, $this->solution['simSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Wireless.V1.UsageRecordPage]'; } } sdk/src/Twilio/Rest/Wireless/V1/Sim/DataSessionList.php 0000644 00000012020 15002236443 0016667 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Wireless\V1\Sim; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class DataSessionList extends ListResource { /** * Construct the DataSessionList * * @param Version $version Version that contains the resource * @param string $simSid The SID of the Sim resource that the Data Session is * for * @return \Twilio\Rest\Wireless\V1\Sim\DataSessionList */ public function __construct(Version $version, $simSid) { parent::__construct($version); // Path Solution $this->solution = array('simSid' => $simSid, ); $this->uri = '/Sims/' . \rawurlencode($simSid) . '/DataSessions'; } /** * Streams DataSessionInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($options = array(), $limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads DataSessionInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return DataSessionInstance[] Array of results */ public function read($options = array(), $limit = null, $pageSize = null) { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Retrieve a single page of DataSessionInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of DataSessionInstance */ public function page($options = array(), $pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $options = new Values($options); $params = Values::of(array( 'End' => Serialize::iso8601DateTime($options['end']), 'Start' => Serialize::iso8601DateTime($options['start']), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new DataSessionPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of DataSessionInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of DataSessionInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new DataSessionPage($this->version, $response, $this->solution); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Wireless.V1.DataSessionList]'; } } sdk/src/Twilio/Rest/Wireless/V1/Sim/UsageRecordOptions.php 0000644 00000006405 15002236443 0017407 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Wireless\V1\Sim; use Twilio\Options; use Twilio\Values; abstract class UsageRecordOptions { /** * @param \DateTime $end Only include usage that occurred on or before this date * @param \DateTime $start Only include usage that has occurred on or after * this date * @param string $granularity The time-based grouping that results are * aggregated by * @return ReadUsageRecordOptions Options builder */ public static function read($end = Values::NONE, $start = Values::NONE, $granularity = Values::NONE) { return new ReadUsageRecordOptions($end, $start, $granularity); } } class ReadUsageRecordOptions extends Options { /** * @param \DateTime $end Only include usage that occurred on or before this date * @param \DateTime $start Only include usage that has occurred on or after * this date * @param string $granularity The time-based grouping that results are * aggregated by */ public function __construct($end = Values::NONE, $start = Values::NONE, $granularity = Values::NONE) { $this->options['end'] = $end; $this->options['start'] = $start; $this->options['granularity'] = $granularity; } /** * Only include usage that occurred on or before this date, specified in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html). The default is the current time. * * @param \DateTime $end Only include usage that occurred on or before this date * @return $this Fluent Builder */ public function setEnd($end) { $this->options['end'] = $end; return $this; } /** * Only include usage that has occurred on or after this date, specified in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html). The default is one month before the `end` parameter value. * * @param \DateTime $start Only include usage that has occurred on or after * this date * @return $this Fluent Builder */ public function setStart($start) { $this->options['start'] = $start; return $this; } /** * How to summarize the usage by time. Can be: `daily`, `hourly`, or `all`. The default is `all`. A value of `all` returns one Usage Record that describes the usage for the entire period. * * @param string $granularity The time-based grouping that results are * aggregated by * @return $this Fluent Builder */ public function setGranularity($granularity) { $this->options['granularity'] = $granularity; 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.Wireless.V1.ReadUsageRecordOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Wireless/V1/Sim/UsageRecordList.php 0000644 00000012107 15002236443 0016663 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Wireless\V1\Sim; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class UsageRecordList extends ListResource { /** * Construct the UsageRecordList * * @param Version $version Version that contains the resource * @param string $simSid The SID of the Sim resource that this Usage Record is * for * @return \Twilio\Rest\Wireless\V1\Sim\UsageRecordList */ public function __construct(Version $version, $simSid) { parent::__construct($version); // Path Solution $this->solution = array('simSid' => $simSid, ); $this->uri = '/Sims/' . \rawurlencode($simSid) . '/UsageRecords'; } /** * Streams UsageRecordInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($options = array(), $limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads UsageRecordInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return UsageRecordInstance[] Array of results */ public function read($options = array(), $limit = null, $pageSize = null) { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Retrieve a single page of UsageRecordInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of UsageRecordInstance */ public function page($options = array(), $pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $options = new Values($options); $params = Values::of(array( 'End' => Serialize::iso8601DateTime($options['end']), 'Start' => Serialize::iso8601DateTime($options['start']), 'Granularity' => $options['granularity'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new UsageRecordPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of UsageRecordInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of UsageRecordInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new UsageRecordPage($this->version, $response, $this->solution); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Wireless.V1.UsageRecordList]'; } } sdk/src/Twilio/Rest/Wireless/V1/Sim/DataSessionInstance.php 0000644 00000006655 15002236443 0017541 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Wireless\V1\Sim; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $simSid * @property string $accountSid * @property string $radioLink * @property string $operatorMcc * @property string $operatorMnc * @property string $operatorCountry * @property string $operatorName * @property string $cellId * @property array $cellLocationEstimate * @property int $packetsUploaded * @property int $packetsDownloaded * @property \DateTime $lastUpdated * @property \DateTime $start * @property \DateTime $end * @property string $imei */ class DataSessionInstance extends InstanceResource { /** * Initialize the DataSessionInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $simSid The SID of the Sim resource that the Data Session is * for * @return \Twilio\Rest\Wireless\V1\Sim\DataSessionInstance */ public function __construct(Version $version, array $payload, $simSid) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'sid' => Values::array_get($payload, 'sid'), 'simSid' => Values::array_get($payload, 'sim_sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'radioLink' => Values::array_get($payload, 'radio_link'), 'operatorMcc' => Values::array_get($payload, 'operator_mcc'), 'operatorMnc' => Values::array_get($payload, 'operator_mnc'), 'operatorCountry' => Values::array_get($payload, 'operator_country'), 'operatorName' => Values::array_get($payload, 'operator_name'), 'cellId' => Values::array_get($payload, 'cell_id'), 'cellLocationEstimate' => Values::array_get($payload, 'cell_location_estimate'), 'packetsUploaded' => Values::array_get($payload, 'packets_uploaded'), 'packetsDownloaded' => Values::array_get($payload, 'packets_downloaded'), 'lastUpdated' => Deserialize::dateTime(Values::array_get($payload, 'last_updated')), 'start' => Deserialize::dateTime(Values::array_get($payload, 'start')), 'end' => Deserialize::dateTime(Values::array_get($payload, 'end')), 'imei' => Values::array_get($payload, 'imei'), ); $this->solution = array('simSid' => $simSid, ); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Wireless.V1.DataSessionInstance]'; } } sdk/src/Twilio/Rest/Wireless/V1/Sim/UsageRecordInstance.php 0000644 00000004252 15002236443 0017516 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Wireless\V1\Sim; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $simSid * @property string $accountSid * @property array $period * @property array $commands * @property array $data */ class UsageRecordInstance extends InstanceResource { /** * Initialize the UsageRecordInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $simSid The SID of the Sim resource that this Usage Record is * for * @return \Twilio\Rest\Wireless\V1\Sim\UsageRecordInstance */ public function __construct(Version $version, array $payload, $simSid) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'simSid' => Values::array_get($payload, 'sim_sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'period' => Values::array_get($payload, 'period'), 'commands' => Values::array_get($payload, 'commands'), 'data' => Values::array_get($payload, 'data'), ); $this->solution = array('simSid' => $simSid, ); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Wireless.V1.UsageRecordInstance]'; } } sdk/src/Twilio/Rest/Wireless/V1/SimList.php 0000644 00000012102 15002236443 0014453 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Wireless\V1; use Twilio\ListResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; class SimList extends ListResource { /** * Construct the SimList * * @param Version $version Version that contains the resource * @return \Twilio\Rest\Wireless\V1\SimList */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = array(); $this->uri = '/Sims'; } /** * Streams SimInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($options = array(), $limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads SimInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return SimInstance[] Array of results */ public function read($options = array(), $limit = null, $pageSize = null) { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Retrieve a single page of SimInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of SimInstance */ public function page($options = array(), $pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $options = new Values($options); $params = Values::of(array( 'Status' => $options['status'], 'Iccid' => $options['iccid'], 'RatePlan' => $options['ratePlan'], 'EId' => $options['eId'], 'SimRegistrationCode' => $options['simRegistrationCode'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new SimPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of SimInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of SimInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new SimPage($this->version, $response, $this->solution); } /** * Constructs a SimContext * * @param string $sid The SID of the Sim resource to fetch * @return \Twilio\Rest\Wireless\V1\SimContext */ public function getContext($sid) { return new SimContext($this->version, $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Wireless.V1.SimList]'; } } sdk/src/Twilio/Rest/Wireless/V1/SimContext.php 0000644 00000012730 15002236443 0015173 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Wireless\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Rest\Wireless\V1\Sim\DataSessionList; use Twilio\Rest\Wireless\V1\Sim\UsageRecordList; use Twilio\Values; use Twilio\Version; /** * @property \Twilio\Rest\Wireless\V1\Sim\UsageRecordList $usageRecords * @property \Twilio\Rest\Wireless\V1\Sim\DataSessionList $dataSessions */ class SimContext extends InstanceContext { protected $_usageRecords = null; protected $_dataSessions = null; /** * Initialize the SimContext * * @param \Twilio\Version $version Version that contains the resource * @param string $sid The SID of the Sim resource to fetch * @return \Twilio\Rest\Wireless\V1\SimContext */ public function __construct(Version $version, $sid) { parent::__construct($version); // Path Solution $this->solution = array('sid' => $sid, ); $this->uri = '/Sims/' . \rawurlencode($sid) . ''; } /** * Fetch a SimInstance * * @return SimInstance Fetched SimInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new SimInstance($this->version, $payload, $this->solution['sid']); } /** * Update the SimInstance * * @param array|Options $options Optional Arguments * @return SimInstance Updated SimInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { $options = new Values($options); $data = Values::of(array( 'UniqueName' => $options['uniqueName'], 'CallbackMethod' => $options['callbackMethod'], 'CallbackUrl' => $options['callbackUrl'], 'FriendlyName' => $options['friendlyName'], 'RatePlan' => $options['ratePlan'], 'Status' => $options['status'], 'CommandsCallbackMethod' => $options['commandsCallbackMethod'], 'CommandsCallbackUrl' => $options['commandsCallbackUrl'], 'SmsFallbackMethod' => $options['smsFallbackMethod'], 'SmsFallbackUrl' => $options['smsFallbackUrl'], 'SmsMethod' => $options['smsMethod'], 'SmsUrl' => $options['smsUrl'], 'VoiceFallbackMethod' => $options['voiceFallbackMethod'], 'VoiceFallbackUrl' => $options['voiceFallbackUrl'], 'VoiceMethod' => $options['voiceMethod'], 'VoiceUrl' => $options['voiceUrl'], 'ResetStatus' => $options['resetStatus'], 'AccountSid' => $options['accountSid'], )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new SimInstance($this->version, $payload, $this->solution['sid']); } /** * Deletes the SimInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Access the usageRecords * * @return \Twilio\Rest\Wireless\V1\Sim\UsageRecordList */ protected function getUsageRecords() { if (!$this->_usageRecords) { $this->_usageRecords = new UsageRecordList($this->version, $this->solution['sid']); } return $this->_usageRecords; } /** * Access the dataSessions * * @return \Twilio\Rest\Wireless\V1\Sim\DataSessionList */ protected function getDataSessions() { if (!$this->_dataSessions) { $this->_dataSessions = new DataSessionList($this->version, $this->solution['sid']); } return $this->_dataSessions; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get($name) { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Wireless.V1.SimContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Wireless/V1/CommandInstance.php 0000644 00000010144 15002236443 0016136 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Wireless\V1; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $accountSid * @property string $simSid * @property string $command * @property string $commandMode * @property string $transport * @property bool $deliveryReceiptRequested * @property string $status * @property string $direction * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $url */ class CommandInstance extends InstanceResource { /** * Initialize the CommandInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The SID that identifies the resource to fetch * @return \Twilio\Rest\Wireless\V1\CommandInstance */ public function __construct(Version $version, array $payload, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'simSid' => Values::array_get($payload, 'sim_sid'), 'command' => Values::array_get($payload, 'command'), 'commandMode' => Values::array_get($payload, 'command_mode'), 'transport' => Values::array_get($payload, 'transport'), 'deliveryReceiptRequested' => Values::array_get($payload, 'delivery_receipt_requested'), 'status' => Values::array_get($payload, 'status'), 'direction' => Values::array_get($payload, 'direction'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), ); $this->solution = array('sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Wireless\V1\CommandContext Context for this * CommandInstance */ protected function proxy() { if (!$this->context) { $this->context = new CommandContext($this->version, $this->solution['sid']); } return $this->context; } /** * Fetch a CommandInstance * * @return CommandInstance Fetched CommandInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the CommandInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Wireless.V1.CommandInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Wireless/V1/CommandPage.php 0000644 00000001322 15002236443 0015244 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Wireless\V1; use Twilio\Page; class CommandPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new CommandInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Wireless.V1.CommandPage]'; } } sdk/src/Twilio/Rest/Wireless/V1/RatePlanPage.php 0000644 00000001325 15002236443 0015377 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Wireless\V1; use Twilio\Page; class RatePlanPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new RatePlanInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Wireless.V1.RatePlanPage]'; } } sdk/src/Twilio/Rest/Wireless/V1/RatePlanOptions.php 0000644 00000034517 15002236443 0016167 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Wireless\V1; use Twilio\Options; use Twilio\Values; abstract class RatePlanOptions { /** * @param string $uniqueName An application-defined string that uniquely * identifies the resource * @param string $friendlyName A string to describe the resource * @param bool $dataEnabled Whether SIMs can use GPRS/3G/4G/LTE data * connectivity * @param int $dataLimit The total data usage in Megabytes that the Network * allows during one month on the home network * @param string $dataMetering The model used to meter data usage * @param bool $messagingEnabled Whether SIMs can make, send, and receive SMS * using Commands * @param bool $voiceEnabled Whether SIMs can make and receive voice calls * @param bool $nationalRoamingEnabled Whether SIMs can roam on networks other * than the home network in the United * States * @param string $internationalRoaming The services that SIMs capable of using * GPRS/3G/4G/LTE data connectivity can use * outside of the United States * @param int $nationalRoamingDataLimit The total data usage in Megabytes that * the Network allows during one month on * non-home networks in the United States * @param int $internationalRoamingDataLimit The total data usage (download and * upload combined) in Megabytes that * the Network allows during one * month when roaming outside the * United States * @return CreateRatePlanOptions Options builder */ public static function create($uniqueName = Values::NONE, $friendlyName = Values::NONE, $dataEnabled = Values::NONE, $dataLimit = Values::NONE, $dataMetering = Values::NONE, $messagingEnabled = Values::NONE, $voiceEnabled = Values::NONE, $nationalRoamingEnabled = Values::NONE, $internationalRoaming = Values::NONE, $nationalRoamingDataLimit = Values::NONE, $internationalRoamingDataLimit = Values::NONE) { return new CreateRatePlanOptions($uniqueName, $friendlyName, $dataEnabled, $dataLimit, $dataMetering, $messagingEnabled, $voiceEnabled, $nationalRoamingEnabled, $internationalRoaming, $nationalRoamingDataLimit, $internationalRoamingDataLimit); } /** * @param string $uniqueName An application-defined string that uniquely * identifies the resource * @param string $friendlyName A string to describe the resource * @return UpdateRatePlanOptions Options builder */ public static function update($uniqueName = Values::NONE, $friendlyName = Values::NONE) { return new UpdateRatePlanOptions($uniqueName, $friendlyName); } } class CreateRatePlanOptions extends Options { /** * @param string $uniqueName An application-defined string that uniquely * identifies the resource * @param string $friendlyName A string to describe the resource * @param bool $dataEnabled Whether SIMs can use GPRS/3G/4G/LTE data * connectivity * @param int $dataLimit The total data usage in Megabytes that the Network * allows during one month on the home network * @param string $dataMetering The model used to meter data usage * @param bool $messagingEnabled Whether SIMs can make, send, and receive SMS * using Commands * @param bool $voiceEnabled Whether SIMs can make and receive voice calls * @param bool $nationalRoamingEnabled Whether SIMs can roam on networks other * than the home network in the United * States * @param string $internationalRoaming The services that SIMs capable of using * GPRS/3G/4G/LTE data connectivity can use * outside of the United States * @param int $nationalRoamingDataLimit The total data usage in Megabytes that * the Network allows during one month on * non-home networks in the United States * @param int $internationalRoamingDataLimit The total data usage (download and * upload combined) in Megabytes that * the Network allows during one * month when roaming outside the * United States */ public function __construct($uniqueName = Values::NONE, $friendlyName = Values::NONE, $dataEnabled = Values::NONE, $dataLimit = Values::NONE, $dataMetering = Values::NONE, $messagingEnabled = Values::NONE, $voiceEnabled = Values::NONE, $nationalRoamingEnabled = Values::NONE, $internationalRoaming = Values::NONE, $nationalRoamingDataLimit = Values::NONE, $internationalRoamingDataLimit = Values::NONE) { $this->options['uniqueName'] = $uniqueName; $this->options['friendlyName'] = $friendlyName; $this->options['dataEnabled'] = $dataEnabled; $this->options['dataLimit'] = $dataLimit; $this->options['dataMetering'] = $dataMetering; $this->options['messagingEnabled'] = $messagingEnabled; $this->options['voiceEnabled'] = $voiceEnabled; $this->options['nationalRoamingEnabled'] = $nationalRoamingEnabled; $this->options['internationalRoaming'] = $internationalRoaming; $this->options['nationalRoamingDataLimit'] = $nationalRoamingDataLimit; $this->options['internationalRoamingDataLimit'] = $internationalRoamingDataLimit; } /** * An application-defined string that uniquely identifies the resource. It can be used in place of the resource's `sid` in the URL to address the resource. * * @param string $uniqueName An application-defined string that uniquely * identifies the resource * @return $this Fluent Builder */ public function setUniqueName($uniqueName) { $this->options['uniqueName'] = $uniqueName; return $this; } /** * A descriptive string that you create to describe the resource. It does not have to be unique. * * @param string $friendlyName A string to describe the resource * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * Whether SIMs can use GPRS/3G/4G/LTE data connectivity. * * @param bool $dataEnabled Whether SIMs can use GPRS/3G/4G/LTE data * connectivity * @return $this Fluent Builder */ public function setDataEnabled($dataEnabled) { $this->options['dataEnabled'] = $dataEnabled; return $this; } /** * The total data usage (download and upload combined) in Megabytes that the Network allows during one month on the home network (T-Mobile USA). The metering period begins the day of activation and ends on the same day in the following month. Can be up to 2TB and the default value is `1000`. * * @param int $dataLimit The total data usage in Megabytes that the Network * allows during one month on the home network * @return $this Fluent Builder */ public function setDataLimit($dataLimit) { $this->options['dataLimit'] = $dataLimit; return $this; } /** * The model used to meter data usage. Can be: `payg` and `quota-1`, `quota-10`, and `quota-50`. Learn more about the available [data metering models](https://www.twilio.com/docs/wireless/api/rateplan-resource#payg-vs-quota-data-plans). * * @param string $dataMetering The model used to meter data usage * @return $this Fluent Builder */ public function setDataMetering($dataMetering) { $this->options['dataMetering'] = $dataMetering; return $this; } /** * Whether SIMs can make, send, and receive SMS using [Commands](https://www.twilio.com/docs/wireless/api/command-resource). * * @param bool $messagingEnabled Whether SIMs can make, send, and receive SMS * using Commands * @return $this Fluent Builder */ public function setMessagingEnabled($messagingEnabled) { $this->options['messagingEnabled'] = $messagingEnabled; return $this; } /** * Whether SIMs can make and receive voice calls. * * @param bool $voiceEnabled Whether SIMs can make and receive voice calls * @return $this Fluent Builder */ public function setVoiceEnabled($voiceEnabled) { $this->options['voiceEnabled'] = $voiceEnabled; return $this; } /** * Whether SIMs can roam on networks other than the home network (T-Mobile USA) in the United States. See [national roaming](https://www.twilio.com/docs/wireless/api/rateplan-resource#national-roaming). * * @param bool $nationalRoamingEnabled Whether SIMs can roam on networks other * than the home network in the United * States * @return $this Fluent Builder */ public function setNationalRoamingEnabled($nationalRoamingEnabled) { $this->options['nationalRoamingEnabled'] = $nationalRoamingEnabled; return $this; } /** * The list of services that SIMs capable of using GPRS/3G/4G/LTE data connectivity can use outside of the United States. Can be: `data`, `voice`, and `messaging`. * * @param string $internationalRoaming The services that SIMs capable of using * GPRS/3G/4G/LTE data connectivity can use * outside of the United States * @return $this Fluent Builder */ public function setInternationalRoaming($internationalRoaming) { $this->options['internationalRoaming'] = $internationalRoaming; return $this; } /** * The total data usage (download and upload combined) in Megabytes that the Network allows during one month on non-home networks in the United States. The metering period begins the day of activation and ends on the same day in the following month. Can be up to 2TB. See [national roaming](https://www.twilio.com/docs/wireless/api/rateplan-resource#national-roaming) for more info. * * @param int $nationalRoamingDataLimit The total data usage in Megabytes that * the Network allows during one month on * non-home networks in the United States * @return $this Fluent Builder */ public function setNationalRoamingDataLimit($nationalRoamingDataLimit) { $this->options['nationalRoamingDataLimit'] = $nationalRoamingDataLimit; return $this; } /** * The total data usage (download and upload combined) in Megabytes that the Network allows during one month when roaming outside the United States. Can be up to 2TB. * * @param int $internationalRoamingDataLimit The total data usage (download and * upload combined) in Megabytes that * the Network allows during one * month when roaming outside the * United States * @return $this Fluent Builder */ public function setInternationalRoamingDataLimit($internationalRoamingDataLimit) { $this->options['internationalRoamingDataLimit'] = $internationalRoamingDataLimit; 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.Wireless.V1.CreateRatePlanOptions ' . \implode(' ', $options) . ']'; } } class UpdateRatePlanOptions extends Options { /** * @param string $uniqueName An application-defined string that uniquely * identifies the resource * @param string $friendlyName A string to describe the resource */ public function __construct($uniqueName = Values::NONE, $friendlyName = Values::NONE) { $this->options['uniqueName'] = $uniqueName; $this->options['friendlyName'] = $friendlyName; } /** * An application-defined string that uniquely identifies the resource. It can be used in place of the resource's `sid` in the URL to address the resource. * * @param string $uniqueName An application-defined string that uniquely * identifies the resource * @return $this Fluent Builder */ public function setUniqueName($uniqueName) { $this->options['uniqueName'] = $uniqueName; return $this; } /** * A descriptive string that you create to describe the resource. It does not have to be unique. * * @param string $friendlyName A string to describe the resource * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; 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.Wireless.V1.UpdateRatePlanOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Wireless/V1/RatePlanContext.php 0000644 00000005134 15002236443 0016151 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Wireless\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Values; use Twilio\Version; class RatePlanContext extends InstanceContext { /** * Initialize the RatePlanContext * * @param \Twilio\Version $version Version that contains the resource * @param string $sid The SID that identifies the resource to fetch * @return \Twilio\Rest\Wireless\V1\RatePlanContext */ public function __construct(Version $version, $sid) { parent::__construct($version); // Path Solution $this->solution = array('sid' => $sid, ); $this->uri = '/RatePlans/' . \rawurlencode($sid) . ''; } /** * Fetch a RatePlanInstance * * @return RatePlanInstance Fetched RatePlanInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new RatePlanInstance($this->version, $payload, $this->solution['sid']); } /** * Update the RatePlanInstance * * @param array|Options $options Optional Arguments * @return RatePlanInstance Updated RatePlanInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { $options = new Values($options); $data = Values::of(array( 'UniqueName' => $options['uniqueName'], 'FriendlyName' => $options['friendlyName'], )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new RatePlanInstance($this->version, $payload, $this->solution['sid']); } /** * Deletes the RatePlanInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Wireless.V1.RatePlanContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Wireless/V1/UsageRecordOptions.php 0000644 00000006360 15002236443 0016657 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Wireless\V1; use Twilio\Options; use Twilio\Values; abstract class UsageRecordOptions { /** * @param \DateTime $end Only include usage that has occurred on or before this * date * @param \DateTime $start Only include usage that has occurred on or after * this date * @param string $granularity The time-based grouping that results are * aggregated by * @return ReadUsageRecordOptions Options builder */ public static function read($end = Values::NONE, $start = Values::NONE, $granularity = Values::NONE) { return new ReadUsageRecordOptions($end, $start, $granularity); } } class ReadUsageRecordOptions extends Options { /** * @param \DateTime $end Only include usage that has occurred on or before this * date * @param \DateTime $start Only include usage that has occurred on or after * this date * @param string $granularity The time-based grouping that results are * aggregated by */ public function __construct($end = Values::NONE, $start = Values::NONE, $granularity = Values::NONE) { $this->options['end'] = $end; $this->options['start'] = $start; $this->options['granularity'] = $granularity; } /** * Only include usage that has occurred on or before this date. Format is [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html). * * @param \DateTime $end Only include usage that has occurred on or before this * date * @return $this Fluent Builder */ public function setEnd($end) { $this->options['end'] = $end; return $this; } /** * Only include usage that has occurred on or after this date. Format is [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html). * * @param \DateTime $start Only include usage that has occurred on or after * this date * @return $this Fluent Builder */ public function setStart($start) { $this->options['start'] = $start; return $this; } /** * How to summarize the usage by time. Can be: `daily`, `hourly`, or `all`. A value of `all` returns one Usage Record that describes the usage for the entire period. * * @param string $granularity The time-based grouping that results are * aggregated by * @return $this Fluent Builder */ public function setGranularity($granularity) { $this->options['granularity'] = $granularity; 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.Wireless.V1.ReadUsageRecordOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Wireless/V1/RatePlanList.php 0000644 00000014160 15002236443 0015437 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Wireless\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class RatePlanList extends ListResource { /** * Construct the RatePlanList * * @param Version $version Version that contains the resource * @return \Twilio\Rest\Wireless\V1\RatePlanList */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = array(); $this->uri = '/RatePlans'; } /** * Streams RatePlanInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads RatePlanInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return RatePlanInstance[] Array of results */ public function read($limit = null, $pageSize = null) { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of RatePlanInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of RatePlanInstance */ public function page($pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $params = Values::of(array( 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new RatePlanPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of RatePlanInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of RatePlanInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new RatePlanPage($this->version, $response, $this->solution); } /** * Create a new RatePlanInstance * * @param array|Options $options Optional Arguments * @return RatePlanInstance Newly created RatePlanInstance * @throws TwilioException When an HTTP error occurs. */ public function create($options = array()) { $options = new Values($options); $data = Values::of(array( 'UniqueName' => $options['uniqueName'], 'FriendlyName' => $options['friendlyName'], 'DataEnabled' => Serialize::booleanToString($options['dataEnabled']), 'DataLimit' => $options['dataLimit'], 'DataMetering' => $options['dataMetering'], 'MessagingEnabled' => Serialize::booleanToString($options['messagingEnabled']), 'VoiceEnabled' => Serialize::booleanToString($options['voiceEnabled']), 'NationalRoamingEnabled' => Serialize::booleanToString($options['nationalRoamingEnabled']), 'InternationalRoaming' => Serialize::map($options['internationalRoaming'], function($e) { return $e; }), 'NationalRoamingDataLimit' => $options['nationalRoamingDataLimit'], 'InternationalRoamingDataLimit' => $options['internationalRoamingDataLimit'], )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new RatePlanInstance($this->version, $payload); } /** * Constructs a RatePlanContext * * @param string $sid The SID that identifies the resource to fetch * @return \Twilio\Rest\Wireless\V1\RatePlanContext */ public function getContext($sid) { return new RatePlanContext($this->version, $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Wireless.V1.RatePlanList]'; } } sdk/src/Twilio/Rest/Wireless/V1/CommandList.php 0000644 00000014371 15002236443 0015313 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Wireless\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class CommandList extends ListResource { /** * Construct the CommandList * * @param Version $version Version that contains the resource * @return \Twilio\Rest\Wireless\V1\CommandList */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = array(); $this->uri = '/Commands'; } /** * Streams CommandInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($options = array(), $limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads CommandInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return CommandInstance[] Array of results */ public function read($options = array(), $limit = null, $pageSize = null) { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Retrieve a single page of CommandInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of CommandInstance */ public function page($options = array(), $pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $options = new Values($options); $params = Values::of(array( 'Sim' => $options['sim'], 'Status' => $options['status'], 'Direction' => $options['direction'], 'Transport' => $options['transport'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new CommandPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of CommandInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of CommandInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new CommandPage($this->version, $response, $this->solution); } /** * Create a new CommandInstance * * @param string $command The message body of the Command or a Base64 encoded * byte string in binary mode * @param array|Options $options Optional Arguments * @return CommandInstance Newly created CommandInstance * @throws TwilioException When an HTTP error occurs. */ public function create($command, $options = array()) { $options = new Values($options); $data = Values::of(array( 'Command' => $command, 'Sim' => $options['sim'], 'CallbackMethod' => $options['callbackMethod'], 'CallbackUrl' => $options['callbackUrl'], 'CommandMode' => $options['commandMode'], 'IncludeSid' => $options['includeSid'], 'DeliveryReceiptRequested' => Serialize::booleanToString($options['deliveryReceiptRequested']), )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new CommandInstance($this->version, $payload); } /** * Constructs a CommandContext * * @param string $sid The SID that identifies the resource to fetch * @return \Twilio\Rest\Wireless\V1\CommandContext */ public function getContext($sid) { return new CommandContext($this->version, $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Wireless.V1.CommandList]'; } } sdk/src/Twilio/Rest/Wireless/V1/UsageRecordList.php 0000644 00000011611 15002236443 0016132 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Wireless\V1; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class UsageRecordList extends ListResource { /** * Construct the UsageRecordList * * @param Version $version Version that contains the resource * @return \Twilio\Rest\Wireless\V1\UsageRecordList */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = array(); $this->uri = '/UsageRecords'; } /** * Streams UsageRecordInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($options = array(), $limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads UsageRecordInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return UsageRecordInstance[] Array of results */ public function read($options = array(), $limit = null, $pageSize = null) { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Retrieve a single page of UsageRecordInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of UsageRecordInstance */ public function page($options = array(), $pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $options = new Values($options); $params = Values::of(array( 'End' => Serialize::iso8601DateTime($options['end']), 'Start' => Serialize::iso8601DateTime($options['start']), 'Granularity' => $options['granularity'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new UsageRecordPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of UsageRecordInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of UsageRecordInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new UsageRecordPage($this->version, $response, $this->solution); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Wireless.V1.UsageRecordList]'; } } sdk/src/Twilio/Rest/Wireless/V1/SimInstance.php 0000644 00000014137 15002236443 0015316 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Wireless\V1; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $uniqueName * @property string $accountSid * @property string $ratePlanSid * @property string $friendlyName * @property string $iccid * @property string $eId * @property string $status * @property string $resetStatus * @property string $commandsCallbackUrl * @property string $commandsCallbackMethod * @property string $smsFallbackMethod * @property string $smsFallbackUrl * @property string $smsMethod * @property string $smsUrl * @property string $voiceFallbackMethod * @property string $voiceFallbackUrl * @property string $voiceMethod * @property string $voiceUrl * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $url * @property array $links * @property string $ipAddress */ class SimInstance extends InstanceResource { protected $_usageRecords = null; protected $_dataSessions = null; /** * Initialize the SimInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The SID of the Sim resource to fetch * @return \Twilio\Rest\Wireless\V1\SimInstance */ public function __construct(Version $version, array $payload, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'sid' => Values::array_get($payload, 'sid'), 'uniqueName' => Values::array_get($payload, 'unique_name'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'ratePlanSid' => Values::array_get($payload, 'rate_plan_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'iccid' => Values::array_get($payload, 'iccid'), 'eId' => Values::array_get($payload, 'e_id'), 'status' => Values::array_get($payload, 'status'), 'resetStatus' => Values::array_get($payload, 'reset_status'), 'commandsCallbackUrl' => Values::array_get($payload, 'commands_callback_url'), 'commandsCallbackMethod' => Values::array_get($payload, 'commands_callback_method'), 'smsFallbackMethod' => Values::array_get($payload, 'sms_fallback_method'), 'smsFallbackUrl' => Values::array_get($payload, 'sms_fallback_url'), 'smsMethod' => Values::array_get($payload, 'sms_method'), 'smsUrl' => Values::array_get($payload, 'sms_url'), 'voiceFallbackMethod' => Values::array_get($payload, 'voice_fallback_method'), 'voiceFallbackUrl' => Values::array_get($payload, 'voice_fallback_url'), 'voiceMethod' => Values::array_get($payload, 'voice_method'), 'voiceUrl' => Values::array_get($payload, 'voice_url'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), 'ipAddress' => Values::array_get($payload, 'ip_address'), ); $this->solution = array('sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Wireless\V1\SimContext Context for this SimInstance */ protected function proxy() { if (!$this->context) { $this->context = new SimContext($this->version, $this->solution['sid']); } return $this->context; } /** * Fetch a SimInstance * * @return SimInstance Fetched SimInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Update the SimInstance * * @param array|Options $options Optional Arguments * @return SimInstance Updated SimInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Deletes the SimInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Access the usageRecords * * @return \Twilio\Rest\Wireless\V1\Sim\UsageRecordList */ protected function getUsageRecords() { return $this->proxy()->usageRecords; } /** * Access the dataSessions * * @return \Twilio\Rest\Wireless\V1\Sim\DataSessionList */ protected function getDataSessions() { return $this->proxy()->dataSessions; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Wireless.V1.SimInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Wireless/V1/SimOptions.php 0000644 00000050654 15002236443 0015211 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Wireless\V1; use Twilio\Options; use Twilio\Values; abstract class SimOptions { /** * @param string $status Only return Sim resources with this status * @param string $iccid Only return Sim resources with this ICCID * @param string $ratePlan Only return Sim resources assigned to this RatePlan * resource * @param string $eId Deprecated * @param string $simRegistrationCode Only return Sim resources with this * registration code * @return ReadSimOptions Options builder */ public static function read($status = Values::NONE, $iccid = Values::NONE, $ratePlan = Values::NONE, $eId = Values::NONE, $simRegistrationCode = Values::NONE) { return new ReadSimOptions($status, $iccid, $ratePlan, $eId, $simRegistrationCode); } /** * @param string $uniqueName An application-defined string that uniquely * identifies the resource * @param string $callbackMethod The HTTP method we should use to call * callback_url * @param string $callbackUrl The URL we should call when the Sim resource has * finished updating * @param string $friendlyName A string to describe the Sim resource * @param string $ratePlan The SID or unique name of the RatePlan resource to * which the Sim resource should be assigned * @param string $status The new status of the Sim resource * @param string $commandsCallbackMethod The HTTP method we should use to call * commands_callback_url * @param string $commandsCallbackUrl The URL we should call when the SIM sends * a Command * @param string $smsFallbackMethod The HTTP method we should use to call * sms_fallback_url * @param string $smsFallbackUrl The URL we should call when an error occurs * while retrieving or executing the TwiML * requested from sms_url * @param string $smsMethod The HTTP method we should use to call sms_url * @param string $smsUrl The URL we should call when the SIM-connected device * sends an SMS message that is not a Command * @param string $voiceFallbackMethod The HTTP method we should use to call * voice_fallback_url * @param string $voiceFallbackUrl The URL we should call when an error occurs * while retrieving or executing the TwiML * requested from voice_url * @param string $voiceMethod The HTTP method we should use when we call * voice_url * @param string $voiceUrl The URL we should call when the SIM-connected device * makes a voice call * @param string $resetStatus Initiate a connectivity reset on a SIM * @param string $accountSid The SID of the Account to which the Sim resource * should belong * @return UpdateSimOptions Options builder */ public static function update($uniqueName = Values::NONE, $callbackMethod = Values::NONE, $callbackUrl = Values::NONE, $friendlyName = Values::NONE, $ratePlan = Values::NONE, $status = Values::NONE, $commandsCallbackMethod = Values::NONE, $commandsCallbackUrl = Values::NONE, $smsFallbackMethod = Values::NONE, $smsFallbackUrl = Values::NONE, $smsMethod = Values::NONE, $smsUrl = Values::NONE, $voiceFallbackMethod = Values::NONE, $voiceFallbackUrl = Values::NONE, $voiceMethod = Values::NONE, $voiceUrl = Values::NONE, $resetStatus = Values::NONE, $accountSid = Values::NONE) { return new UpdateSimOptions($uniqueName, $callbackMethod, $callbackUrl, $friendlyName, $ratePlan, $status, $commandsCallbackMethod, $commandsCallbackUrl, $smsFallbackMethod, $smsFallbackUrl, $smsMethod, $smsUrl, $voiceFallbackMethod, $voiceFallbackUrl, $voiceMethod, $voiceUrl, $resetStatus, $accountSid); } } class ReadSimOptions extends Options { /** * @param string $status Only return Sim resources with this status * @param string $iccid Only return Sim resources with this ICCID * @param string $ratePlan Only return Sim resources assigned to this RatePlan * resource * @param string $eId Deprecated * @param string $simRegistrationCode Only return Sim resources with this * registration code */ public function __construct($status = Values::NONE, $iccid = Values::NONE, $ratePlan = Values::NONE, $eId = Values::NONE, $simRegistrationCode = Values::NONE) { $this->options['status'] = $status; $this->options['iccid'] = $iccid; $this->options['ratePlan'] = $ratePlan; $this->options['eId'] = $eId; $this->options['simRegistrationCode'] = $simRegistrationCode; } /** * Only return Sim resources with this status. * * @param string $status Only return Sim resources with this status * @return $this Fluent Builder */ public function setStatus($status) { $this->options['status'] = $status; return $this; } /** * Only return Sim resources with this ICCID. This will return a list with a maximum size of 1. * * @param string $iccid Only return Sim resources with this ICCID * @return $this Fluent Builder */ public function setIccid($iccid) { $this->options['iccid'] = $iccid; return $this; } /** * The SID or unique name of a [RatePlan resource](https://www.twilio.com/docs/wireless/api/rateplan-resource). Only return Sim resources assigned to this RatePlan resource. * * @param string $ratePlan Only return Sim resources assigned to this RatePlan * resource * @return $this Fluent Builder */ public function setRatePlan($ratePlan) { $this->options['ratePlan'] = $ratePlan; return $this; } /** * Deprecated. * * @param string $eId Deprecated * @return $this Fluent Builder */ public function setEId($eId) { $this->options['eId'] = $eId; return $this; } /** * Only return Sim resources with this registration code. This will return a list with a maximum size of 1. * * @param string $simRegistrationCode Only return Sim resources with this * registration code * @return $this Fluent Builder */ public function setSimRegistrationCode($simRegistrationCode) { $this->options['simRegistrationCode'] = $simRegistrationCode; 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.Wireless.V1.ReadSimOptions ' . \implode(' ', $options) . ']'; } } class UpdateSimOptions extends Options { /** * @param string $uniqueName An application-defined string that uniquely * identifies the resource * @param string $callbackMethod The HTTP method we should use to call * callback_url * @param string $callbackUrl The URL we should call when the Sim resource has * finished updating * @param string $friendlyName A string to describe the Sim resource * @param string $ratePlan The SID or unique name of the RatePlan resource to * which the Sim resource should be assigned * @param string $status The new status of the Sim resource * @param string $commandsCallbackMethod The HTTP method we should use to call * commands_callback_url * @param string $commandsCallbackUrl The URL we should call when the SIM sends * a Command * @param string $smsFallbackMethod The HTTP method we should use to call * sms_fallback_url * @param string $smsFallbackUrl The URL we should call when an error occurs * while retrieving or executing the TwiML * requested from sms_url * @param string $smsMethod The HTTP method we should use to call sms_url * @param string $smsUrl The URL we should call when the SIM-connected device * sends an SMS message that is not a Command * @param string $voiceFallbackMethod The HTTP method we should use to call * voice_fallback_url * @param string $voiceFallbackUrl The URL we should call when an error occurs * while retrieving or executing the TwiML * requested from voice_url * @param string $voiceMethod The HTTP method we should use when we call * voice_url * @param string $voiceUrl The URL we should call when the SIM-connected device * makes a voice call * @param string $resetStatus Initiate a connectivity reset on a SIM * @param string $accountSid The SID of the Account to which the Sim resource * should belong */ public function __construct($uniqueName = Values::NONE, $callbackMethod = Values::NONE, $callbackUrl = Values::NONE, $friendlyName = Values::NONE, $ratePlan = Values::NONE, $status = Values::NONE, $commandsCallbackMethod = Values::NONE, $commandsCallbackUrl = Values::NONE, $smsFallbackMethod = Values::NONE, $smsFallbackUrl = Values::NONE, $smsMethod = Values::NONE, $smsUrl = Values::NONE, $voiceFallbackMethod = Values::NONE, $voiceFallbackUrl = Values::NONE, $voiceMethod = Values::NONE, $voiceUrl = Values::NONE, $resetStatus = Values::NONE, $accountSid = Values::NONE) { $this->options['uniqueName'] = $uniqueName; $this->options['callbackMethod'] = $callbackMethod; $this->options['callbackUrl'] = $callbackUrl; $this->options['friendlyName'] = $friendlyName; $this->options['ratePlan'] = $ratePlan; $this->options['status'] = $status; $this->options['commandsCallbackMethod'] = $commandsCallbackMethod; $this->options['commandsCallbackUrl'] = $commandsCallbackUrl; $this->options['smsFallbackMethod'] = $smsFallbackMethod; $this->options['smsFallbackUrl'] = $smsFallbackUrl; $this->options['smsMethod'] = $smsMethod; $this->options['smsUrl'] = $smsUrl; $this->options['voiceFallbackMethod'] = $voiceFallbackMethod; $this->options['voiceFallbackUrl'] = $voiceFallbackUrl; $this->options['voiceMethod'] = $voiceMethod; $this->options['voiceUrl'] = $voiceUrl; $this->options['resetStatus'] = $resetStatus; $this->options['accountSid'] = $accountSid; } /** * An application-defined string that uniquely identifies the resource. It can be used in place of the `sid` in the URL path to address the resource. * * @param string $uniqueName An application-defined string that uniquely * identifies the resource * @return $this Fluent Builder */ public function setUniqueName($uniqueName) { $this->options['uniqueName'] = $uniqueName; return $this; } /** * The HTTP method we should use to call `callback_url`. Can be: `POST` or `GET`. The default is `POST`. * * @param string $callbackMethod The HTTP method we should use to call * callback_url * @return $this Fluent Builder */ public function setCallbackMethod($callbackMethod) { $this->options['callbackMethod'] = $callbackMethod; return $this; } /** * The URL we should call using the `callback_url` when the SIM has finished updating. When the SIM transitions from `new` to `ready` or from any status to `deactivated`, we call this URL when the status changes to an intermediate status (`ready` or `deactivated`) and again when the status changes to its final status (`active` or `canceled`). * * @param string $callbackUrl The URL we should call when the Sim resource has * finished updating * @return $this Fluent Builder */ public function setCallbackUrl($callbackUrl) { $this->options['callbackUrl'] = $callbackUrl; return $this; } /** * A descriptive string that you create to describe the Sim resource. It does not need to be unique. * * @param string $friendlyName A string to describe the Sim resource * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The SID or unique name of the [RatePlan resource](https://www.twilio.com/docs/wireless/api/rateplan-resource) to which the Sim resource should be assigned. * * @param string $ratePlan The SID or unique name of the RatePlan resource to * which the Sim resource should be assigned * @return $this Fluent Builder */ public function setRatePlan($ratePlan) { $this->options['ratePlan'] = $ratePlan; return $this; } /** * The new status of the Sim resource. Can be: `ready`, `active`, `suspended`, or `deactivated`. * * @param string $status The new status of the Sim resource * @return $this Fluent Builder */ public function setStatus($status) { $this->options['status'] = $status; return $this; } /** * The HTTP method we should use to call `commands_callback_url`. Can be: `POST` or `GET`. The default is `POST`. * * @param string $commandsCallbackMethod The HTTP method we should use to call * commands_callback_url * @return $this Fluent Builder */ public function setCommandsCallbackMethod($commandsCallbackMethod) { $this->options['commandsCallbackMethod'] = $commandsCallbackMethod; return $this; } /** * The URL we should call using the `commands_callback_method` when the SIM sends a [Command](https://www.twilio.com/docs/wireless/api/command-resource). Your server should respond with an HTTP status code in the 200 range; any response body is ignored. * * @param string $commandsCallbackUrl The URL we should call when the SIM sends * a Command * @return $this Fluent Builder */ public function setCommandsCallbackUrl($commandsCallbackUrl) { $this->options['commandsCallbackUrl'] = $commandsCallbackUrl; return $this; } /** * The HTTP method we should use to call `sms_fallback_url`. Can be: `GET` or `POST`. Default is `POST`. * * @param string $smsFallbackMethod The HTTP method we should use to call * sms_fallback_url * @return $this Fluent Builder */ public function setSmsFallbackMethod($smsFallbackMethod) { $this->options['smsFallbackMethod'] = $smsFallbackMethod; return $this; } /** * The URL we should call using the `sms_fallback_method` when an error occurs while retrieving or executing the TwiML requested from `sms_url`. * * @param string $smsFallbackUrl The URL we should call when an error occurs * while retrieving or executing the TwiML * requested from sms_url * @return $this Fluent Builder */ public function setSmsFallbackUrl($smsFallbackUrl) { $this->options['smsFallbackUrl'] = $smsFallbackUrl; return $this; } /** * The HTTP method we should use to call `sms_url`. Can be: `GET` or `POST`. Default is `POST`. * * @param string $smsMethod The HTTP method we should use to call sms_url * @return $this Fluent Builder */ public function setSmsMethod($smsMethod) { $this->options['smsMethod'] = $smsMethod; return $this; } /** * The URL we should call using the `sms_method` when the SIM-connected device sends an SMS message that is not a [Command](https://www.twilio.com/docs/wireless/api/command-resource). * * @param string $smsUrl The URL we should call when the SIM-connected device * sends an SMS message that is not a Command * @return $this Fluent Builder */ public function setSmsUrl($smsUrl) { $this->options['smsUrl'] = $smsUrl; return $this; } /** * The HTTP method we should use to call `voice_fallback_url`. Can be: `GET` or `POST`. * * @param string $voiceFallbackMethod The HTTP method we should use to call * voice_fallback_url * @return $this Fluent Builder */ public function setVoiceFallbackMethod($voiceFallbackMethod) { $this->options['voiceFallbackMethod'] = $voiceFallbackMethod; return $this; } /** * The URL we should call using the `voice_fallback_method` when an error occurs while retrieving or executing the TwiML requested from `voice_url`. * * @param string $voiceFallbackUrl The URL we should call when an error occurs * while retrieving or executing the TwiML * requested from voice_url * @return $this Fluent Builder */ public function setVoiceFallbackUrl($voiceFallbackUrl) { $this->options['voiceFallbackUrl'] = $voiceFallbackUrl; return $this; } /** * The HTTP method we should use when we call `voice_url`. Can be: `GET` or `POST`. * * @param string $voiceMethod The HTTP method we should use when we call * voice_url * @return $this Fluent Builder */ public function setVoiceMethod($voiceMethod) { $this->options['voiceMethod'] = $voiceMethod; return $this; } /** * The URL we should call using the `voice_method` when the SIM-connected device makes a voice call. * * @param string $voiceUrl The URL we should call when the SIM-connected device * makes a voice call * @return $this Fluent Builder */ public function setVoiceUrl($voiceUrl) { $this->options['voiceUrl'] = $voiceUrl; return $this; } /** * Initiate a connectivity reset on the SIM. Set to `resetting` to initiate a connectivity reset on the SIM. No other value is valid. * * @param string $resetStatus Initiate a connectivity reset on a SIM * @return $this Fluent Builder */ public function setResetStatus($resetStatus) { $this->options['resetStatus'] = $resetStatus; return $this; } /** * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) to which the Sim resource should belong. The Account SID can only be that of the requesting Account or that of a [Subaccount](https://www.twilio.com/docs/iam/api/subaccounts) of the requesting Account. Only valid when the Sim resource's status is `new`. For more information, see the [Move SIMs between Subaccounts documentation](https://www.twilio.com/docs/wireless/api/sim-resource#move-sims-between-subaccounts). * * @param string $accountSid The SID of the Account to which the Sim resource * should belong * @return $this Fluent Builder */ public function setAccountSid($accountSid) { $this->options['accountSid'] = $accountSid; 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.Wireless.V1.UpdateSimOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Wireless/V1/RatePlanInstance.php 0000644 00000012056 15002236443 0016272 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Wireless\V1; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $uniqueName * @property string $accountSid * @property string $friendlyName * @property bool $dataEnabled * @property string $dataMetering * @property int $dataLimit * @property bool $messagingEnabled * @property bool $voiceEnabled * @property bool $nationalRoamingEnabled * @property int $nationalRoamingDataLimit * @property string $internationalRoaming * @property int $internationalRoamingDataLimit * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $url */ class RatePlanInstance extends InstanceResource { /** * Initialize the RatePlanInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The SID that identifies the resource to fetch * @return \Twilio\Rest\Wireless\V1\RatePlanInstance */ public function __construct(Version $version, array $payload, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'sid' => Values::array_get($payload, 'sid'), 'uniqueName' => Values::array_get($payload, 'unique_name'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'dataEnabled' => Values::array_get($payload, 'data_enabled'), 'dataMetering' => Values::array_get($payload, 'data_metering'), 'dataLimit' => Values::array_get($payload, 'data_limit'), 'messagingEnabled' => Values::array_get($payload, 'messaging_enabled'), 'voiceEnabled' => Values::array_get($payload, 'voice_enabled'), 'nationalRoamingEnabled' => Values::array_get($payload, 'national_roaming_enabled'), 'nationalRoamingDataLimit' => Values::array_get($payload, 'national_roaming_data_limit'), 'internationalRoaming' => Values::array_get($payload, 'international_roaming'), 'internationalRoamingDataLimit' => Values::array_get($payload, 'international_roaming_data_limit'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), ); $this->solution = array('sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Wireless\V1\RatePlanContext Context for this * RatePlanInstance */ protected function proxy() { if (!$this->context) { $this->context = new RatePlanContext($this->version, $this->solution['sid']); } return $this->context; } /** * Fetch a RatePlanInstance * * @return RatePlanInstance Fetched RatePlanInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Update the RatePlanInstance * * @param array|Options $options Optional Arguments * @return RatePlanInstance Updated RatePlanInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Deletes the RatePlanInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Wireless.V1.RatePlanInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Wireless/V1/UsageRecordInstance.php 0000644 00000003664 15002236443 0016774 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Wireless\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property array $period * @property array $commands * @property array $data */ class UsageRecordInstance extends InstanceResource { /** * Initialize the UsageRecordInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @return \Twilio\Rest\Wireless\V1\UsageRecordInstance */ public function __construct(Version $version, array $payload) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'accountSid' => Values::array_get($payload, 'account_sid'), 'period' => Values::array_get($payload, 'period'), 'commands' => Values::array_get($payload, 'commands'), 'data' => Values::array_get($payload, 'data'), ); $this->solution = array(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Wireless.V1.UsageRecordInstance]'; } } sdk/src/Twilio/Rest/Wireless/V1/CommandOptions.php 0000644 00000022112 15002236443 0016023 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Wireless\V1; use Twilio\Options; use Twilio\Values; abstract class CommandOptions { /** * @param string $sim The sid or unique_name of the Sim resources to read * @param string $status The status of the resources to read * @param string $direction Only return Commands with this direction value * @param string $transport Only return Commands with this transport value * @return ReadCommandOptions Options builder */ public static function read($sim = Values::NONE, $status = Values::NONE, $direction = Values::NONE, $transport = Values::NONE) { return new ReadCommandOptions($sim, $status, $direction, $transport); } /** * @param string $sim The sid or unique_name of the SIM to send the Command to * @param string $callbackMethod The HTTP method we use to call callback_url * @param string $callbackUrl he URL we call when the Command has finished * sending * @param string $commandMode The mode to use when sending the SMS message * @param string $includeSid Whether to include the SID of the command in the * message body * @param bool $deliveryReceiptRequested Whether to request delivery receipt * from the recipient * @return CreateCommandOptions Options builder */ public static function create($sim = Values::NONE, $callbackMethod = Values::NONE, $callbackUrl = Values::NONE, $commandMode = Values::NONE, $includeSid = Values::NONE, $deliveryReceiptRequested = Values::NONE) { return new CreateCommandOptions($sim, $callbackMethod, $callbackUrl, $commandMode, $includeSid, $deliveryReceiptRequested); } } class ReadCommandOptions extends Options { /** * @param string $sim The sid or unique_name of the Sim resources to read * @param string $status The status of the resources to read * @param string $direction Only return Commands with this direction value * @param string $transport Only return Commands with this transport value */ public function __construct($sim = Values::NONE, $status = Values::NONE, $direction = Values::NONE, $transport = Values::NONE) { $this->options['sim'] = $sim; $this->options['status'] = $status; $this->options['direction'] = $direction; $this->options['transport'] = $transport; } /** * The `sid` or `unique_name` of the [Sim resources](https://www.twilio.com/docs/wireless/api/sim-resource) to read. * * @param string $sim The sid or unique_name of the Sim resources to read * @return $this Fluent Builder */ public function setSim($sim) { $this->options['sim'] = $sim; return $this; } /** * The status of the resources to read. Can be: `queued`, `sent`, `delivered`, `received`, or `failed`. * * @param string $status The status of the resources to read * @return $this Fluent Builder */ public function setStatus($status) { $this->options['status'] = $status; return $this; } /** * Only return Commands with this direction value. * * @param string $direction Only return Commands with this direction value * @return $this Fluent Builder */ public function setDirection($direction) { $this->options['direction'] = $direction; return $this; } /** * Only return Commands with this transport value. Can be: `sms` or `ip`. * * @param string $transport Only return Commands with this transport value * @return $this Fluent Builder */ public function setTransport($transport) { $this->options['transport'] = $transport; 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.Wireless.V1.ReadCommandOptions ' . \implode(' ', $options) . ']'; } } class CreateCommandOptions extends Options { /** * @param string $sim The sid or unique_name of the SIM to send the Command to * @param string $callbackMethod The HTTP method we use to call callback_url * @param string $callbackUrl he URL we call when the Command has finished * sending * @param string $commandMode The mode to use when sending the SMS message * @param string $includeSid Whether to include the SID of the command in the * message body * @param bool $deliveryReceiptRequested Whether to request delivery receipt * from the recipient */ public function __construct($sim = Values::NONE, $callbackMethod = Values::NONE, $callbackUrl = Values::NONE, $commandMode = Values::NONE, $includeSid = Values::NONE, $deliveryReceiptRequested = Values::NONE) { $this->options['sim'] = $sim; $this->options['callbackMethod'] = $callbackMethod; $this->options['callbackUrl'] = $callbackUrl; $this->options['commandMode'] = $commandMode; $this->options['includeSid'] = $includeSid; $this->options['deliveryReceiptRequested'] = $deliveryReceiptRequested; } /** * The `sid` or `unique_name` of the [SIM](https://www.twilio.com/docs/wireless/api/sim-resource) to send the Command to. * * @param string $sim The sid or unique_name of the SIM to send the Command to * @return $this Fluent Builder */ public function setSim($sim) { $this->options['sim'] = $sim; return $this; } /** * The HTTP method we use to call `callback_url`. Can be: `POST` or `GET`, and the default is `POST`. * * @param string $callbackMethod The HTTP method we use to call callback_url * @return $this Fluent Builder */ public function setCallbackMethod($callbackMethod) { $this->options['callbackMethod'] = $callbackMethod; return $this; } /** * The URL we call using the `callback_url` when the Command has finished sending, whether the command was delivered or it failed. * * @param string $callbackUrl he URL we call when the Command has finished * sending * @return $this Fluent Builder */ public function setCallbackUrl($callbackUrl) { $this->options['callbackUrl'] = $callbackUrl; return $this; } /** * The mode to use when sending the SMS message. Can be: `text` or `binary`. The default SMS mode is `text`. * * @param string $commandMode The mode to use when sending the SMS message * @return $this Fluent Builder */ public function setCommandMode($commandMode) { $this->options['commandMode'] = $commandMode; return $this; } /** * Whether to include the SID of the command in the message body. Can be: `none`, `start`, or `end`, and the default behavior is `none`. When sending a Command to a SIM in text mode, we can automatically include the SID of the Command in the message body, which could be used to ensure that the device does not process the same Command more than once. A value of `start` will prepend the message with the Command SID, and `end` will append it to the end, separating the Command SID from the message body with a space. The length of the Command SID is included in the 160 character limit so the SMS body must be 128 characters or less before the Command SID is included. * * @param string $includeSid Whether to include the SID of the command in the * message body * @return $this Fluent Builder */ public function setIncludeSid($includeSid) { $this->options['includeSid'] = $includeSid; return $this; } /** * Whether to request delivery receipt from the recipient. For Commands that request delivery receipt, the Command state transitions to 'delivered' once the server has received a delivery receipt from the device. The default value is `true`. * * @param bool $deliveryReceiptRequested Whether to request delivery receipt * from the recipient * @return $this Fluent Builder */ public function setDeliveryReceiptRequested($deliveryReceiptRequested) { $this->options['deliveryReceiptRequested'] = $deliveryReceiptRequested; 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.Wireless.V1.CreateCommandOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Lookups.php 0000644 00000005326 15002236443 0012452 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\Rest\Lookups\V1; /** * @property \Twilio\Rest\Lookups\V1 $v1 * @property \Twilio\Rest\Lookups\V1\PhoneNumberList $phoneNumbers * @method \Twilio\Rest\Lookups\V1\PhoneNumberContext phoneNumbers(string $phoneNumber) */ class Lookups extends Domain { protected $_v1 = null; /** * Construct the Lookups Domain * * @param \Twilio\Rest\Client $client Twilio\Rest\Client to communicate with * Twilio * @return \Twilio\Rest\Lookups Domain for Lookups */ public function __construct(Client $client) { parent::__construct($client); $this->baseUrl = 'https://lookups.twilio.com'; } /** * @return \Twilio\Rest\Lookups\V1 Version v1 of lookups */ protected function getV1() { if (!$this->_v1) { $this->_v1 = new V1($this); } return $this->_v1; } /** * Magic getter to lazy load version * * @param string $name Version to return * @return \Twilio\Version The requested version * @throws TwilioException For unknown versions */ public function __get($name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown version ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $method = 'context' . \ucfirst($name); if (\method_exists($this, $method)) { return \call_user_func_array(array($this, $method), $arguments); } throw new TwilioException('Unknown context ' . $name); } /** * @return \Twilio\Rest\Lookups\V1\PhoneNumberList */ protected function getPhoneNumbers() { return $this->v1->phoneNumbers; } /** * @param string $phoneNumber The phone number to fetch in E.164 format * @return \Twilio\Rest\Lookups\V1\PhoneNumberContext */ protected function contextPhoneNumbers($phoneNumber) { return $this->v1->phoneNumbers($phoneNumber); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Lookups]'; } } sdk/src/Twilio/Rest/Studio.php 0000644 00000005146 15002236443 0012265 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\Rest\Studio\V1; /** * @property \Twilio\Rest\Studio\V1 $v1 * @property \Twilio\Rest\Studio\V1\FlowList $flows * @method \Twilio\Rest\Studio\V1\FlowContext flows(string $sid) */ class Studio extends Domain { protected $_v1 = null; /** * Construct the Studio Domain * * @param \Twilio\Rest\Client $client Twilio\Rest\Client to communicate with * Twilio * @return \Twilio\Rest\Studio Domain for Studio */ public function __construct(Client $client) { parent::__construct($client); $this->baseUrl = 'https://studio.twilio.com'; } /** * @return \Twilio\Rest\Studio\V1 Version v1 of studio */ protected function getV1() { if (!$this->_v1) { $this->_v1 = new V1($this); } return $this->_v1; } /** * Magic getter to lazy load version * * @param string $name Version to return * @return \Twilio\Version The requested version * @throws TwilioException For unknown versions */ public function __get($name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown version ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $method = 'context' . \ucfirst($name); if (\method_exists($this, $method)) { return \call_user_func_array(array($this, $method), $arguments); } throw new TwilioException('Unknown context ' . $name); } /** * @return \Twilio\Rest\Studio\V1\FlowList */ protected function getFlows() { return $this->v1->flows; } /** * @param string $sid The SID that identifies the resource to fetch * @return \Twilio\Rest\Studio\V1\FlowContext */ protected function contextFlows($sid) { return $this->v1->flows($sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Studio]'; } } sdk/src/Twilio/Rest/Insights.php 0000644 00000005134 15002236443 0012603 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\Rest\Insights\V1; /** * @property \Twilio\Rest\Insights\V1 $v1 * @property \Twilio\Rest\Insights\V1\CallList $calls * @method \Twilio\Rest\Insights\V1\CallContext calls(string $sid) */ class Insights extends Domain { protected $_v1 = null; /** * Construct the Insights Domain * * @param \Twilio\Rest\Client $client Twilio\Rest\Client to communicate with * Twilio * @return \Twilio\Rest\Insights Domain for Insights */ public function __construct(Client $client) { parent::__construct($client); $this->baseUrl = 'https://insights.twilio.com'; } /** * @return \Twilio\Rest\Insights\V1 Version v1 of insights */ protected function getV1() { if (!$this->_v1) { $this->_v1 = new V1($this); } return $this->_v1; } /** * Magic getter to lazy load version * * @param string $name Version to return * @return \Twilio\Version The requested version * @throws TwilioException For unknown versions */ public function __get($name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown version ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $method = 'context' . \ucfirst($name); if (\method_exists($this, $method)) { return \call_user_func_array(array($this, $method), $arguments); } throw new TwilioException('Unknown context ' . $name); } /** * @return \Twilio\Rest\Insights\V1\CallList */ protected function getCalls() { return $this->v1->calls; } /** * @param string $sid The sid * @return \Twilio\Rest\Insights\V1\CallContext */ protected function contextCalls($sid) { return $this->v1->calls($sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Insights]'; } } sdk/src/Twilio/Rest/Notify.php 0000644 00000006246 15002236443 0012270 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\Rest\Notify\V1; /** * @property \Twilio\Rest\Notify\V1 $v1 * @property \Twilio\Rest\Notify\V1\CredentialList $credentials * @property \Twilio\Rest\Notify\V1\ServiceList $services * @method \Twilio\Rest\Notify\V1\CredentialContext credentials(string $sid) * @method \Twilio\Rest\Notify\V1\ServiceContext services(string $sid) */ class Notify extends Domain { protected $_v1 = null; /** * Construct the Notify Domain * * @param \Twilio\Rest\Client $client Twilio\Rest\Client to communicate with * Twilio * @return \Twilio\Rest\Notify Domain for Notify */ public function __construct(Client $client) { parent::__construct($client); $this->baseUrl = 'https://notify.twilio.com'; } /** * @return \Twilio\Rest\Notify\V1 Version v1 of notify */ protected function getV1() { if (!$this->_v1) { $this->_v1 = new V1($this); } return $this->_v1; } /** * Magic getter to lazy load version * * @param string $name Version to return * @return \Twilio\Version The requested version * @throws TwilioException For unknown versions */ public function __get($name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown version ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $method = 'context' . \ucfirst($name); if (\method_exists($this, $method)) { return \call_user_func_array(array($this, $method), $arguments); } throw new TwilioException('Unknown context ' . $name); } /** * @return \Twilio\Rest\Notify\V1\CredentialList */ protected function getCredentials() { return $this->v1->credentials; } /** * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Notify\V1\CredentialContext */ protected function contextCredentials($sid) { return $this->v1->credentials($sid); } /** * @return \Twilio\Rest\Notify\V1\ServiceList */ protected function getServices() { return $this->v1->services; } /** * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Notify\V1\ServiceContext */ protected function contextServices($sid) { return $this->v1->services($sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Notify]'; } } sdk/src/Twilio/Rest/Client.php 0000644 00000071336 15002236443 0012240 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest; use Twilio\Exceptions\ConfigurationException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Client as HttpClient; use Twilio\Http\CurlClient; use Twilio\VersionInfo; /** * A client for accessing the Twilio API. * * @property \Twilio\Rest\Accounts $accounts * @property \Twilio\Rest\Api $api * @property \Twilio\Rest\Authy $authy * @property \Twilio\Rest\Autopilot $autopilot * @property \Twilio\Rest\Chat $chat * @property \Twilio\Rest\Conversations $conversations * @property \Twilio\Rest\Fax $fax * @property \Twilio\Rest\FlexApi $flexApi * @property \Twilio\Rest\Insights $insights * @property \Twilio\Rest\IpMessaging $ipMessaging * @property \Twilio\Rest\Lookups $lookups * @property \Twilio\Rest\Messaging $messaging * @property \Twilio\Rest\Monitor $monitor * @property \Twilio\Rest\Notify $notify * @property \Twilio\Rest\Preview $preview * @property \Twilio\Rest\Pricing $pricing * @property \Twilio\Rest\Proxy $proxy * @property \Twilio\Rest\Serverless $serverless * @property \Twilio\Rest\Studio $studio * @property \Twilio\Rest\Sync $sync * @property \Twilio\Rest\Taskrouter $taskrouter * @property \Twilio\Rest\Trunking $trunking * @property \Twilio\Rest\Verify $verify * @property \Twilio\Rest\Video $video * @property \Twilio\Rest\Voice $voice * @property \Twilio\Rest\Wireless $wireless * @property \Twilio\Rest\Api\V2010\AccountInstance $account * @property \Twilio\Rest\Api\V2010\Account\AddressList $addresses * @property \Twilio\Rest\Api\V2010\Account\ApplicationList $applications * @property \Twilio\Rest\Api\V2010\Account\AuthorizedConnectAppList $authorizedConnectApps * @property \Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountryList $availablePhoneNumbers * @property \Twilio\Rest\Api\V2010\Account\BalanceList $balance * @property \Twilio\Rest\Api\V2010\Account\CallList $calls * @property \Twilio\Rest\Api\V2010\Account\ConferenceList $conferences * @property \Twilio\Rest\Api\V2010\Account\ConnectAppList $connectApps * @property \Twilio\Rest\Api\V2010\Account\IncomingPhoneNumberList $incomingPhoneNumbers * @property \Twilio\Rest\Api\V2010\Account\KeyList $keys * @property \Twilio\Rest\Api\V2010\Account\MessageList $messages * @property \Twilio\Rest\Api\V2010\Account\NewKeyList $newKeys * @property \Twilio\Rest\Api\V2010\Account\NewSigningKeyList $newSigningKeys * @property \Twilio\Rest\Api\V2010\Account\NotificationList $notifications * @property \Twilio\Rest\Api\V2010\Account\OutgoingCallerIdList $outgoingCallerIds * @property \Twilio\Rest\Api\V2010\Account\QueueList $queues * @property \Twilio\Rest\Api\V2010\Account\RecordingList $recordings * @property \Twilio\Rest\Api\V2010\Account\SigningKeyList $signingKeys * @property \Twilio\Rest\Api\V2010\Account\SipList $sip * @property \Twilio\Rest\Api\V2010\Account\ShortCodeList $shortCodes * @property \Twilio\Rest\Api\V2010\Account\TokenList $tokens * @property \Twilio\Rest\Api\V2010\Account\TranscriptionList $transcriptions * @property \Twilio\Rest\Api\V2010\Account\UsageList $usage * @property \Twilio\Rest\Api\V2010\Account\ValidationRequestList $validationRequests * @method \Twilio\Rest\Api\V2010\AccountContext accounts(string $sid) * @method \Twilio\Rest\Api\V2010\Account\AddressContext addresses(string $sid) * @method \Twilio\Rest\Api\V2010\Account\ApplicationContext applications(string $sid) * @method \Twilio\Rest\Api\V2010\Account\AuthorizedConnectAppContext authorizedConnectApps(string $connectAppSid) * @method \Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountryContext availablePhoneNumbers(string $countryCode) * @method \Twilio\Rest\Api\V2010\Account\CallContext calls(string $sid) * @method \Twilio\Rest\Api\V2010\Account\ConferenceContext conferences(string $sid) * @method \Twilio\Rest\Api\V2010\Account\ConnectAppContext connectApps(string $sid) * @method \Twilio\Rest\Api\V2010\Account\IncomingPhoneNumberContext incomingPhoneNumbers(string $sid) * @method \Twilio\Rest\Api\V2010\Account\KeyContext keys(string $sid) * @method \Twilio\Rest\Api\V2010\Account\MessageContext messages(string $sid) * @method \Twilio\Rest\Api\V2010\Account\NotificationContext notifications(string $sid) * @method \Twilio\Rest\Api\V2010\Account\OutgoingCallerIdContext outgoingCallerIds(string $sid) * @method \Twilio\Rest\Api\V2010\Account\QueueContext queues(string $sid) * @method \Twilio\Rest\Api\V2010\Account\RecordingContext recordings(string $sid) * @method \Twilio\Rest\Api\V2010\Account\SigningKeyContext signingKeys(string $sid) * @method \Twilio\Rest\Api\V2010\Account\ShortCodeContext shortCodes(string $sid) * @method \Twilio\Rest\Api\V2010\Account\TranscriptionContext transcriptions(string $sid) */ class Client { const ENV_ACCOUNT_SID = "TWILIO_ACCOUNT_SID"; const ENV_AUTH_TOKEN = "TWILIO_AUTH_TOKEN"; protected $username; protected $password; protected $accountSid; protected $region; protected $httpClient; protected $_account; protected $_accounts = null; protected $_api = null; protected $_authy = null; protected $_autopilot = null; protected $_chat = null; protected $_conversations = null; protected $_fax = null; protected $_flexApi = null; protected $_insights = null; protected $_ipMessaging = null; protected $_lookups = null; protected $_messaging = null; protected $_monitor = null; protected $_notify = null; protected $_preview = null; protected $_pricing = null; protected $_proxy = null; protected $_serverless = null; protected $_studio = null; protected $_sync = null; protected $_taskrouter = null; protected $_trunking = null; protected $_verify = null; protected $_video = null; protected $_voice = null; protected $_wireless = null; /** * Initializes the Twilio Client * * @param string $username Username to authenticate with * @param string $password Password to authenticate with * @param string $accountSid Account Sid to authenticate with, defaults to * $username * @param string $region Region to send requests to, defaults to no region * selection * @param \Twilio\Http\Client $httpClient HttpClient, defaults to CurlClient * @param mixed[] $environment Environment to look for auth details, defaults * to $_ENV * @return \Twilio\Rest\Client Twilio Client * @throws ConfigurationException If valid authentication is not present */ public function __construct($username = null, $password = null, $accountSid = null, $region = null, HttpClient $httpClient = null, $environment = null) { if (\is_null($environment)) { $environment = $_ENV; } if ($username) { $this->username = $username; } else { if (\array_key_exists(self::ENV_ACCOUNT_SID, $environment)) { $this->username = $environment[self::ENV_ACCOUNT_SID]; } } if ($password) { $this->password = $password; } else { if (\array_key_exists(self::ENV_AUTH_TOKEN, $environment)) { $this->password = $environment[self::ENV_AUTH_TOKEN]; } } if (!$this->username || !$this->password) { throw new ConfigurationException("Credentials are required to create a Client"); } $this->accountSid = $accountSid ?: $this->username; $this->region = $region; if ($httpClient) { $this->httpClient = $httpClient; } else { $this->httpClient = new CurlClient(); } } /** * Makes a request to the Twilio API using the configured http client * Authentication information is automatically added if none is provided * * @param string $method HTTP Method * @param string $uri Fully qualified url * @param string[] $params Query string parameters * @param string[] $data POST body data * @param string[] $headers HTTP Headers * @param string $username User for Authentication * @param string $password Password for Authentication * @param int $timeout Timeout in seconds * @return \Twilio\Http\Response Response from the Twilio API */ public function request($method, $uri, $params = array(), $data = array(), $headers = array(), $username = null, $password = null, $timeout = null) { $username = $username ? $username : $this->username; $password = $password ? $password : $this->password; $headers['User-Agent'] = 'twilio-php/' . VersionInfo::string() . ' (PHP ' . \phpversion() . ')'; $headers['Accept-Charset'] = 'utf-8'; if ($method == 'POST' && !\array_key_exists('Content-Type', $headers)) { $headers['Content-Type'] = 'application/x-www-form-urlencoded'; } if (!\array_key_exists('Accept', $headers)) { $headers['Accept'] = 'application/json'; } if ($this->region) { list($head, $tail) = \explode('.', $uri, 2); if (\strpos($tail, $this->region) !== 0) { $uri = \implode('.', array($head, $this->region, $tail)); } } return $this->getHttpClient()->request( $method, $uri, $params, $data, $headers, $username, $password, $timeout ); } /** * Retrieve the Username * * @return string Current Username */ public function getUsername() { return $this->username; } /** * Retrieve the Password * * @return string Current Password */ public function getPassword() { return $this->password; } /** * Retrieve the AccountSid * * @return string Current AccountSid */ public function getAccountSid() { return $this->accountSid; } /** * Retrieve the Region * * @return string Current Region */ public function getRegion() { return $this->region; } /** * Retrieve the HttpClient * * @return \Twilio\Http\Client Current HttpClient */ public function getHttpClient() { return $this->httpClient; } /** * Set the HttpClient * * @param \Twilio\Http\Client $httpClient HttpClient to use */ public function setHttpClient(HttpClient $httpClient) { $this->httpClient = $httpClient; } /** * Access the Accounts Twilio Domain * * @return \Twilio\Rest\Accounts Accounts Twilio Domain */ protected function getAccounts() { if (!$this->_accounts) { $this->_accounts = new Accounts($this); } return $this->_accounts; } /** * Access the Api Twilio Domain * * @return \Twilio\Rest\Api Api Twilio Domain */ protected function getApi() { if (!$this->_api) { $this->_api = new Api($this); } return $this->_api; } /** * @return \Twilio\Rest\Api\V2010\AccountContext Account provided as the * authenticating account */ public function getAccount() { return $this->api->v2010->account; } /** * @return \Twilio\Rest\Api\V2010\Account\AddressList */ protected function getAddresses() { return $this->api->v2010->account->addresses; } /** * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Api\V2010\Account\AddressContext */ protected function contextAddresses($sid) { return $this->api->v2010->account->addresses($sid); } /** * @return \Twilio\Rest\Api\V2010\Account\ApplicationList */ protected function getApplications() { return $this->api->v2010->account->applications; } /** * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Api\V2010\Account\ApplicationContext */ protected function contextApplications($sid) { return $this->api->v2010->account->applications($sid); } /** * @return \Twilio\Rest\Api\V2010\Account\AuthorizedConnectAppList */ protected function getAuthorizedConnectApps() { return $this->api->v2010->account->authorizedConnectApps; } /** * @param string $connectAppSid The SID of the Connect App to fetch * @return \Twilio\Rest\Api\V2010\Account\AuthorizedConnectAppContext */ protected function contextAuthorizedConnectApps($connectAppSid) { return $this->api->v2010->account->authorizedConnectApps($connectAppSid); } /** * @return \Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountryList */ protected function getAvailablePhoneNumbers() { return $this->api->v2010->account->availablePhoneNumbers; } /** * @param string $countryCode The ISO country code of the country to fetch * available phone number information about * @return \Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountryContext */ protected function contextAvailablePhoneNumbers($countryCode) { return $this->api->v2010->account->availablePhoneNumbers($countryCode); } /** * @return \Twilio\Rest\Api\V2010\Account\BalanceList */ protected function getBalance() { return $this->api->v2010->account->balance; } /** * @return \Twilio\Rest\Api\V2010\Account\CallList */ protected function getCalls() { return $this->api->v2010->account->calls; } /** * @param string $sid The SID of the Call resource to fetch * @return \Twilio\Rest\Api\V2010\Account\CallContext */ protected function contextCalls($sid) { return $this->api->v2010->account->calls($sid); } /** * @return \Twilio\Rest\Api\V2010\Account\ConferenceList */ protected function getConferences() { return $this->api->v2010->account->conferences; } /** * @param string $sid The unique string that identifies this resource * @return \Twilio\Rest\Api\V2010\Account\ConferenceContext */ protected function contextConferences($sid) { return $this->api->v2010->account->conferences($sid); } /** * @return \Twilio\Rest\Api\V2010\Account\ConnectAppList */ protected function getConnectApps() { return $this->api->v2010->account->connectApps; } /** * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Api\V2010\Account\ConnectAppContext */ protected function contextConnectApps($sid) { return $this->api->v2010->account->connectApps($sid); } /** * @return \Twilio\Rest\Api\V2010\Account\IncomingPhoneNumberList */ protected function getIncomingPhoneNumbers() { return $this->api->v2010->account->incomingPhoneNumbers; } /** * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Api\V2010\Account\IncomingPhoneNumberContext */ protected function contextIncomingPhoneNumbers($sid) { return $this->api->v2010->account->incomingPhoneNumbers($sid); } /** * @return \Twilio\Rest\Api\V2010\Account\KeyList */ protected function getKeys() { return $this->api->v2010->account->keys; } /** * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Api\V2010\Account\KeyContext */ protected function contextKeys($sid) { return $this->api->v2010->account->keys($sid); } /** * @return \Twilio\Rest\Api\V2010\Account\MessageList */ protected function getMessages() { return $this->api->v2010->account->messages; } /** * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Api\V2010\Account\MessageContext */ protected function contextMessages($sid) { return $this->api->v2010->account->messages($sid); } /** * @return \Twilio\Rest\Api\V2010\Account\NewKeyList */ protected function getNewKeys() { return $this->api->v2010->account->newKeys; } /** * @return \Twilio\Rest\Api\V2010\Account\NewSigningKeyList */ protected function getNewSigningKeys() { return $this->api->v2010->account->newSigningKeys; } /** * @return \Twilio\Rest\Api\V2010\Account\NotificationList */ protected function getNotifications() { return $this->api->v2010->account->notifications; } /** * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Api\V2010\Account\NotificationContext */ protected function contextNotifications($sid) { return $this->api->v2010->account->notifications($sid); } /** * @return \Twilio\Rest\Api\V2010\Account\OutgoingCallerIdList */ protected function getOutgoingCallerIds() { return $this->api->v2010->account->outgoingCallerIds; } /** * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Api\V2010\Account\OutgoingCallerIdContext */ protected function contextOutgoingCallerIds($sid) { return $this->api->v2010->account->outgoingCallerIds($sid); } /** * @return \Twilio\Rest\Api\V2010\Account\QueueList */ protected function getQueues() { return $this->api->v2010->account->queues; } /** * @param string $sid The unique string that identifies this resource * @return \Twilio\Rest\Api\V2010\Account\QueueContext */ protected function contextQueues($sid) { return $this->api->v2010->account->queues($sid); } /** * @return \Twilio\Rest\Api\V2010\Account\RecordingList */ protected function getRecordings() { return $this->api->v2010->account->recordings; } /** * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Api\V2010\Account\RecordingContext */ protected function contextRecordings($sid) { return $this->api->v2010->account->recordings($sid); } /** * @return \Twilio\Rest\Api\V2010\Account\SigningKeyList */ protected function getSigningKeys() { return $this->api->v2010->account->signingKeys; } /** * @param string $sid The sid * @return \Twilio\Rest\Api\V2010\Account\SigningKeyContext */ protected function contextSigningKeys($sid) { return $this->api->v2010->account->signingKeys($sid); } /** * @return \Twilio\Rest\Api\V2010\Account\SipList */ protected function getSip() { return $this->api->v2010->account->sip; } /** * @return \Twilio\Rest\Api\V2010\Account\ShortCodeList */ protected function getShortCodes() { return $this->api->v2010->account->shortCodes; } /** * @param string $sid The unique string that identifies this resource * @return \Twilio\Rest\Api\V2010\Account\ShortCodeContext */ protected function contextShortCodes($sid) { return $this->api->v2010->account->shortCodes($sid); } /** * @return \Twilio\Rest\Api\V2010\Account\TokenList */ protected function getTokens() { return $this->api->v2010->account->tokens; } /** * @return \Twilio\Rest\Api\V2010\Account\TranscriptionList */ protected function getTranscriptions() { return $this->api->v2010->account->transcriptions; } /** * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Api\V2010\Account\TranscriptionContext */ protected function contextTranscriptions($sid) { return $this->api->v2010->account->transcriptions($sid); } /** * @return \Twilio\Rest\Api\V2010\Account\UsageList */ protected function getUsage() { return $this->api->v2010->account->usage; } /** * @return \Twilio\Rest\Api\V2010\Account\ValidationRequestList */ protected function getValidationRequests() { return $this->api->v2010->account->validationRequests; } /** * Access the Authy Twilio Domain * * @return \Twilio\Rest\Authy Authy Twilio Domain */ protected function getAuthy() { if (!$this->_authy) { $this->_authy = new Authy($this); } return $this->_authy; } /** * Access the Autopilot Twilio Domain * * @return \Twilio\Rest\Autopilot Autopilot Twilio Domain */ protected function getAutopilot() { if (!$this->_autopilot) { $this->_autopilot = new Autopilot($this); } return $this->_autopilot; } /** * Access the Chat Twilio Domain * * @return \Twilio\Rest\Chat Chat Twilio Domain */ protected function getChat() { if (!$this->_chat) { $this->_chat = new Chat($this); } return $this->_chat; } /** * Access the Conversations Twilio Domain * * @return \Twilio\Rest\Conversations Conversations Twilio Domain */ protected function getConversations() { if (!$this->_conversations) { $this->_conversations = new Conversations($this); } return $this->_conversations; } /** * Access the Fax Twilio Domain * * @return \Twilio\Rest\Fax Fax Twilio Domain */ protected function getFax() { if (!$this->_fax) { $this->_fax = new Fax($this); } return $this->_fax; } /** * Access the FlexApi Twilio Domain * * @return \Twilio\Rest\FlexApi FlexApi Twilio Domain */ protected function getFlexApi() { if (!$this->_flexApi) { $this->_flexApi = new FlexApi($this); } return $this->_flexApi; } /** * Access the Insights Twilio Domain * * @return \Twilio\Rest\Insights Insights Twilio Domain */ protected function getInsights() { if (!$this->_insights) { $this->_insights = new Insights($this); } return $this->_insights; } /** * Access the IpMessaging Twilio Domain * * @return \Twilio\Rest\IpMessaging IpMessaging Twilio Domain */ protected function getIpMessaging() { if (!$this->_ipMessaging) { $this->_ipMessaging = new IpMessaging($this); } return $this->_ipMessaging; } /** * Access the Lookups Twilio Domain * * @return \Twilio\Rest\Lookups Lookups Twilio Domain */ protected function getLookups() { if (!$this->_lookups) { $this->_lookups = new Lookups($this); } return $this->_lookups; } /** * Access the Messaging Twilio Domain * * @return \Twilio\Rest\Messaging Messaging Twilio Domain */ protected function getMessaging() { if (!$this->_messaging) { $this->_messaging = new Messaging($this); } return $this->_messaging; } /** * Access the Monitor Twilio Domain * * @return \Twilio\Rest\Monitor Monitor Twilio Domain */ protected function getMonitor() { if (!$this->_monitor) { $this->_monitor = new Monitor($this); } return $this->_monitor; } /** * Access the Notify Twilio Domain * * @return \Twilio\Rest\Notify Notify Twilio Domain */ protected function getNotify() { if (!$this->_notify) { $this->_notify = new Notify($this); } return $this->_notify; } /** * Access the Preview Twilio Domain * * @return \Twilio\Rest\Preview Preview Twilio Domain */ protected function getPreview() { if (!$this->_preview) { $this->_preview = new Preview($this); } return $this->_preview; } /** * Access the Pricing Twilio Domain * * @return \Twilio\Rest\Pricing Pricing Twilio Domain */ protected function getPricing() { if (!$this->_pricing) { $this->_pricing = new Pricing($this); } return $this->_pricing; } /** * Access the Proxy Twilio Domain * * @return \Twilio\Rest\Proxy Proxy Twilio Domain */ protected function getProxy() { if (!$this->_proxy) { $this->_proxy = new Proxy($this); } return $this->_proxy; } /** * Access the Serverless Twilio Domain * * @return \Twilio\Rest\Serverless Serverless Twilio Domain */ protected function getServerless() { if (!$this->_serverless) { $this->_serverless = new Serverless($this); } return $this->_serverless; } /** * Access the Studio Twilio Domain * * @return \Twilio\Rest\Studio Studio Twilio Domain */ protected function getStudio() { if (!$this->_studio) { $this->_studio = new Studio($this); } return $this->_studio; } /** * Access the Sync Twilio Domain * * @return \Twilio\Rest\Sync Sync Twilio Domain */ protected function getSync() { if (!$this->_sync) { $this->_sync = new Sync($this); } return $this->_sync; } /** * Access the Taskrouter Twilio Domain * * @return \Twilio\Rest\Taskrouter Taskrouter Twilio Domain */ protected function getTaskrouter() { if (!$this->_taskrouter) { $this->_taskrouter = new Taskrouter($this); } return $this->_taskrouter; } /** * Access the Trunking Twilio Domain * * @return \Twilio\Rest\Trunking Trunking Twilio Domain */ protected function getTrunking() { if (!$this->_trunking) { $this->_trunking = new Trunking($this); } return $this->_trunking; } /** * Access the Verify Twilio Domain * * @return \Twilio\Rest\Verify Verify Twilio Domain */ protected function getVerify() { if (!$this->_verify) { $this->_verify = new Verify($this); } return $this->_verify; } /** * Access the Video Twilio Domain * * @return \Twilio\Rest\Video Video Twilio Domain */ protected function getVideo() { if (!$this->_video) { $this->_video = new Video($this); } return $this->_video; } /** * Access the Voice Twilio Domain * * @return \Twilio\Rest\Voice Voice Twilio Domain */ protected function getVoice() { if (!$this->_voice) { $this->_voice = new Voice($this); } return $this->_voice; } /** * Access the Wireless Twilio Domain * * @return \Twilio\Rest\Wireless Wireless Twilio Domain */ protected function getWireless() { if (!$this->_wireless) { $this->_wireless = new Wireless($this); } return $this->_wireless; } /** * Magic getter to lazy load domains * * @param string $name Domain to return * @return \Twilio\Domain The requested domain * @throws TwilioException For unknown domains */ public function __get($name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown domain ' . $name); } /** * Magic call to lazy load contexts * * @param string $name Context to return * @param mixed[] $arguments Context to return * @return \Twilio\InstanceContext The requested context * @throws TwilioException For unknown contexts */ public function __call($name, $arguments) { $method = 'context' . \ucfirst($name); if (\method_exists($this, $method)) { return \call_user_func_array(array($this, $method), $arguments); } throw new TwilioException('Unknown context ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Client ' . $this->getAccountSid() . ']'; } /** * Validates connection to new SSL certificate endpoint * * @param CurlClient $client * @throws TwilioException if request fails */ public function validateSslCertificate($client) { $response = $client->request('GET', 'https://api.twilio.com:8443'); if ($response->getStatusCode() < 200 || $response->getStatusCode() > 300) { throw new TwilioException("Failed to validate SSL certificate"); } } } sdk/src/Twilio/Rest/Pricing/V1.php 0000644 00000005702 15002236443 0012675 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Pricing; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\Rest\Pricing\V1\MessagingList; use Twilio\Rest\Pricing\V1\PhoneNumberList; use Twilio\Rest\Pricing\V1\VoiceList; use Twilio\Version; /** * @property \Twilio\Rest\Pricing\V1\MessagingList $messaging * @property \Twilio\Rest\Pricing\V1\PhoneNumberList $phoneNumbers * @property \Twilio\Rest\Pricing\V1\VoiceList $voice */ class V1 extends Version { protected $_messaging = null; protected $_phoneNumbers = null; protected $_voice = null; /** * Construct the V1 version of Pricing * * @param \Twilio\Domain $domain Domain that contains the version * @return \Twilio\Rest\Pricing\V1 V1 version of Pricing */ public function __construct(Domain $domain) { parent::__construct($domain); $this->version = 'v1'; } /** * @return \Twilio\Rest\Pricing\V1\MessagingList */ protected function getMessaging() { if (!$this->_messaging) { $this->_messaging = new MessagingList($this); } return $this->_messaging; } /** * @return \Twilio\Rest\Pricing\V1\PhoneNumberList */ protected function getPhoneNumbers() { if (!$this->_phoneNumbers) { $this->_phoneNumbers = new PhoneNumberList($this); } return $this->_phoneNumbers; } /** * @return \Twilio\Rest\Pricing\V1\VoiceList */ protected function getVoice() { if (!$this->_voice) { $this->_voice = new VoiceList($this); } return $this->_voice; } /** * Magic getter to lazy load root resources * * @param string $name Resource to return * @return \Twilio\ListResource The requested resource * @throws TwilioException For unknown resource */ public function __get($name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown resource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Pricing.V1]'; } } sdk/src/Twilio/Rest/Pricing/V1/VoicePage.php 0000644 00000001312 15002236443 0014530 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Pricing\V1; use Twilio\Page; class VoicePage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new VoiceInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Pricing.V1.VoicePage]'; } } sdk/src/Twilio/Rest/Pricing/V1/Voice/NumberContext.php 0000644 00000003150 15002236443 0016532 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Pricing\V1\Voice; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; class NumberContext extends InstanceContext { /** * Initialize the NumberContext * * @param \Twilio\Version $version Version that contains the resource * @param string $number The phone number to fetch * @return \Twilio\Rest\Pricing\V1\Voice\NumberContext */ public function __construct(Version $version, $number) { parent::__construct($version); // Path Solution $this->solution = array('number' => $number, ); $this->uri = '/Voice/Numbers/' . \rawurlencode($number) . ''; } /** * Fetch a NumberInstance * * @return NumberInstance Fetched NumberInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new NumberInstance($this->version, $payload, $this->solution['number']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Pricing.V1.NumberContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Pricing/V1/Voice/CountryPage.php 0000644 00000001326 15002236443 0016200 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Pricing\V1\Voice; use Twilio\Page; class CountryPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new CountryInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Pricing.V1.CountryPage]'; } } sdk/src/Twilio/Rest/Pricing/V1/Voice/NumberInstance.php 0000644 00000006461 15002236443 0016662 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Pricing\V1\Voice; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $number * @property string $country * @property string $isoCountry * @property string $outboundCallPrice * @property string $inboundCallPrice * @property string $priceUnit * @property string $url */ class NumberInstance extends InstanceResource { /** * Initialize the NumberInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $number The phone number to fetch * @return \Twilio\Rest\Pricing\V1\Voice\NumberInstance */ public function __construct(Version $version, array $payload, $number = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'number' => Values::array_get($payload, 'number'), 'country' => Values::array_get($payload, 'country'), 'isoCountry' => Values::array_get($payload, 'iso_country'), 'outboundCallPrice' => Values::array_get($payload, 'outbound_call_price'), 'inboundCallPrice' => Values::array_get($payload, 'inbound_call_price'), 'priceUnit' => Values::array_get($payload, 'price_unit'), 'url' => Values::array_get($payload, 'url'), ); $this->solution = array('number' => $number ?: $this->properties['number'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Pricing\V1\Voice\NumberContext Context for this * NumberInstance */ protected function proxy() { if (!$this->context) { $this->context = new NumberContext($this->version, $this->solution['number']); } return $this->context; } /** * Fetch a NumberInstance * * @return NumberInstance Fetched NumberInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Pricing.V1.NumberInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Pricing/V1/Voice/CountryList.php 0000644 00000011171 15002236443 0016236 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Pricing\V1\Voice; use Twilio\ListResource; use Twilio\Values; use Twilio\Version; class CountryList extends ListResource { /** * Construct the CountryList * * @param Version $version Version that contains the resource * @return \Twilio\Rest\Pricing\V1\Voice\CountryList */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = array(); $this->uri = '/Voice/Countries'; } /** * Streams CountryInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads CountryInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return CountryInstance[] Array of results */ public function read($limit = null, $pageSize = null) { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of CountryInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of CountryInstance */ public function page($pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $params = Values::of(array( 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new CountryPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of CountryInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of CountryInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new CountryPage($this->version, $response, $this->solution); } /** * Constructs a CountryContext * * @param string $isoCountry The ISO country code * @return \Twilio\Rest\Pricing\V1\Voice\CountryContext */ public function getContext($isoCountry) { return new CountryContext($this->version, $isoCountry); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Pricing.V1.CountryList]'; } } sdk/src/Twilio/Rest/Pricing/V1/Voice/NumberList.php 0000644 00000002054 15002236443 0016023 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Pricing\V1\Voice; use Twilio\ListResource; use Twilio\Version; class NumberList extends ListResource { /** * Construct the NumberList * * @param Version $version Version that contains the resource * @return \Twilio\Rest\Pricing\V1\Voice\NumberList */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = array(); } /** * Constructs a NumberContext * * @param string $number The phone number to fetch * @return \Twilio\Rest\Pricing\V1\Voice\NumberContext */ public function getContext($number) { return new NumberContext($this->version, $number); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Pricing.V1.NumberList]'; } } sdk/src/Twilio/Rest/Pricing/V1/Voice/NumberPage.php 0000644 00000001323 15002236443 0015762 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Pricing\V1\Voice; use Twilio\Page; class NumberPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new NumberInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Pricing.V1.NumberPage]'; } } sdk/src/Twilio/Rest/Pricing/V1/Voice/CountryContext.php 0000644 00000003205 15002236443 0016746 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Pricing\V1\Voice; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; class CountryContext extends InstanceContext { /** * Initialize the CountryContext * * @param \Twilio\Version $version Version that contains the resource * @param string $isoCountry The ISO country code * @return \Twilio\Rest\Pricing\V1\Voice\CountryContext */ public function __construct(Version $version, $isoCountry) { parent::__construct($version); // Path Solution $this->solution = array('isoCountry' => $isoCountry, ); $this->uri = '/Voice/Countries/' . \rawurlencode($isoCountry) . ''; } /** * Fetch a CountryInstance * * @return CountryInstance Fetched CountryInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new CountryInstance($this->version, $payload, $this->solution['isoCountry']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Pricing.V1.CountryContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Pricing/V1/Voice/CountryInstance.php 0000644 00000006400 15002236443 0017066 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Pricing\V1\Voice; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $country * @property string $isoCountry * @property string $outboundPrefixPrices * @property string $inboundCallPrices * @property string $priceUnit * @property string $url */ class CountryInstance extends InstanceResource { /** * Initialize the CountryInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $isoCountry The ISO country code * @return \Twilio\Rest\Pricing\V1\Voice\CountryInstance */ public function __construct(Version $version, array $payload, $isoCountry = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'country' => Values::array_get($payload, 'country'), 'isoCountry' => Values::array_get($payload, 'iso_country'), 'outboundPrefixPrices' => Values::array_get($payload, 'outbound_prefix_prices'), 'inboundCallPrices' => Values::array_get($payload, 'inbound_call_prices'), 'priceUnit' => Values::array_get($payload, 'price_unit'), 'url' => Values::array_get($payload, 'url'), ); $this->solution = array('isoCountry' => $isoCountry ?: $this->properties['isoCountry'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Pricing\V1\Voice\CountryContext Context for this * CountryInstance */ protected function proxy() { if (!$this->context) { $this->context = new CountryContext($this->version, $this->solution['isoCountry']); } return $this->context; } /** * Fetch a CountryInstance * * @return CountryInstance Fetched CountryInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Pricing.V1.CountryInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Pricing/V1/MessagingList.php 0000644 00000004546 15002236443 0015453 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Pricing\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Rest\Pricing\V1\Messaging\CountryList; use Twilio\Version; /** * @property \Twilio\Rest\Pricing\V1\Messaging\CountryList $countries * @method \Twilio\Rest\Pricing\V1\Messaging\CountryContext countries(string $isoCountry) */ class MessagingList extends ListResource { protected $_countries = null; /** * Construct the MessagingList * * @param Version $version Version that contains the resource * @return \Twilio\Rest\Pricing\V1\MessagingList */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = array(); } /** * Access the countries */ protected function getCountries() { if (!$this->_countries) { $this->_countries = new CountryList($this->version); } return $this->_countries; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get($name) { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Pricing.V1.MessagingList]'; } } sdk/src/Twilio/Rest/Pricing/V1/PhoneNumberPage.php 0000644 00000001334 15002236443 0015711 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Pricing\V1; use Twilio\Page; class PhoneNumberPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new PhoneNumberInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Pricing.V1.PhoneNumberPage]'; } } sdk/src/Twilio/Rest/Pricing/V1/VoiceInstance.php 0000644 00000003441 15002236443 0015425 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Pricing\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $name * @property string $url * @property array $links */ class VoiceInstance extends InstanceResource { /** * Initialize the VoiceInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @return \Twilio\Rest\Pricing\V1\VoiceInstance */ public function __construct(Version $version, array $payload) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'name' => Values::array_get($payload, 'name'), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ); $this->solution = array(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Pricing.V1.VoiceInstance]'; } } sdk/src/Twilio/Rest/Pricing/V1/MessagingInstance.php 0000644 00000003461 15002236443 0016277 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Pricing\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $name * @property string $url * @property array $links */ class MessagingInstance extends InstanceResource { /** * Initialize the MessagingInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @return \Twilio\Rest\Pricing\V1\MessagingInstance */ public function __construct(Version $version, array $payload) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'name' => Values::array_get($payload, 'name'), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ); $this->solution = array(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Pricing.V1.MessagingInstance]'; } } sdk/src/Twilio/Rest/Pricing/V1/VoiceList.php 0000644 00000005405 15002236443 0014576 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Pricing\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Rest\Pricing\V1\Voice\CountryList; use Twilio\Rest\Pricing\V1\Voice\NumberList; use Twilio\Version; /** * @property \Twilio\Rest\Pricing\V1\Voice\NumberList $numbers * @property \Twilio\Rest\Pricing\V1\Voice\CountryList $countries * @method \Twilio\Rest\Pricing\V1\Voice\NumberContext numbers(string $number) * @method \Twilio\Rest\Pricing\V1\Voice\CountryContext countries(string $isoCountry) */ class VoiceList extends ListResource { protected $_numbers = null; protected $_countries = null; /** * Construct the VoiceList * * @param Version $version Version that contains the resource * @return \Twilio\Rest\Pricing\V1\VoiceList */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = array(); } /** * Access the numbers */ protected function getNumbers() { if (!$this->_numbers) { $this->_numbers = new NumberList($this->version); } return $this->_numbers; } /** * Access the countries */ protected function getCountries() { if (!$this->_countries) { $this->_countries = new CountryList($this->version); } return $this->_countries; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get($name) { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Pricing.V1.VoiceList]'; } } sdk/src/Twilio/Rest/Pricing/V1/PhoneNumber/CountryPage.php 0000644 00000001334 15002236443 0017354 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Pricing\V1\PhoneNumber; use Twilio\Page; class CountryPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new CountryInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Pricing.V1.CountryPage]'; } } sdk/src/Twilio/Rest/Pricing/V1/PhoneNumber/CountryList.php 0000644 00000011222 15002236443 0017410 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Pricing\V1\PhoneNumber; use Twilio\ListResource; use Twilio\Values; use Twilio\Version; class CountryList extends ListResource { /** * Construct the CountryList * * @param Version $version Version that contains the resource * @return \Twilio\Rest\Pricing\V1\PhoneNumber\CountryList */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = array(); $this->uri = '/PhoneNumbers/Countries'; } /** * Streams CountryInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads CountryInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return CountryInstance[] Array of results */ public function read($limit = null, $pageSize = null) { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of CountryInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of CountryInstance */ public function page($pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $params = Values::of(array( 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new CountryPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of CountryInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of CountryInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new CountryPage($this->version, $response, $this->solution); } /** * Constructs a CountryContext * * @param string $isoCountry The ISO country code * @return \Twilio\Rest\Pricing\V1\PhoneNumber\CountryContext */ public function getContext($isoCountry) { return new CountryContext($this->version, $isoCountry); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Pricing.V1.CountryList]'; } } sdk/src/Twilio/Rest/Pricing/V1/PhoneNumber/CountryContext.php 0000644 00000003230 15002236443 0020121 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Pricing\V1\PhoneNumber; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; class CountryContext extends InstanceContext { /** * Initialize the CountryContext * * @param \Twilio\Version $version Version that contains the resource * @param string $isoCountry The ISO country code * @return \Twilio\Rest\Pricing\V1\PhoneNumber\CountryContext */ public function __construct(Version $version, $isoCountry) { parent::__construct($version); // Path Solution $this->solution = array('isoCountry' => $isoCountry, ); $this->uri = '/PhoneNumbers/Countries/' . \rawurlencode($isoCountry) . ''; } /** * Fetch a CountryInstance * * @return CountryInstance Fetched CountryInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new CountryInstance($this->version, $payload, $this->solution['isoCountry']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Pricing.V1.CountryContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Pricing/V1/PhoneNumber/CountryInstance.php 0000644 00000006221 15002236443 0020244 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Pricing\V1\PhoneNumber; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $country * @property string $isoCountry * @property string $phoneNumberPrices * @property string $priceUnit * @property string $url */ class CountryInstance extends InstanceResource { /** * Initialize the CountryInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $isoCountry The ISO country code * @return \Twilio\Rest\Pricing\V1\PhoneNumber\CountryInstance */ public function __construct(Version $version, array $payload, $isoCountry = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'country' => Values::array_get($payload, 'country'), 'isoCountry' => Values::array_get($payload, 'iso_country'), 'phoneNumberPrices' => Values::array_get($payload, 'phone_number_prices'), 'priceUnit' => Values::array_get($payload, 'price_unit'), 'url' => Values::array_get($payload, 'url'), ); $this->solution = array('isoCountry' => $isoCountry ?: $this->properties['isoCountry'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Pricing\V1\PhoneNumber\CountryContext Context for this * CountryInstance */ protected function proxy() { if (!$this->context) { $this->context = new CountryContext($this->version, $this->solution['isoCountry']); } return $this->context; } /** * Fetch a CountryInstance * * @return CountryInstance Fetched CountryInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Pricing.V1.CountryInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Pricing/V1/PhoneNumberInstance.php 0000644 00000003471 15002236443 0016605 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Pricing\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $name * @property string $url * @property array $links */ class PhoneNumberInstance extends InstanceResource { /** * Initialize the PhoneNumberInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @return \Twilio\Rest\Pricing\V1\PhoneNumberInstance */ public function __construct(Version $version, array $payload) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'name' => Values::array_get($payload, 'name'), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ); $this->solution = array(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Pricing.V1.PhoneNumberInstance]'; } } sdk/src/Twilio/Rest/Pricing/V1/Messaging/CountryPage.php 0000644 00000001332 15002236443 0017045 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Pricing\V1\Messaging; use Twilio\Page; class CountryPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new CountryInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Pricing.V1.CountryPage]'; } } sdk/src/Twilio/Rest/Pricing/V1/Messaging/CountryList.php 0000644 00000011211 15002236443 0017101 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Pricing\V1\Messaging; use Twilio\ListResource; use Twilio\Values; use Twilio\Version; class CountryList extends ListResource { /** * Construct the CountryList * * @param Version $version Version that contains the resource * @return \Twilio\Rest\Pricing\V1\Messaging\CountryList */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = array(); $this->uri = '/Messaging/Countries'; } /** * Streams CountryInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads CountryInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return CountryInstance[] Array of results */ public function read($limit = null, $pageSize = null) { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of CountryInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of CountryInstance */ public function page($pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $params = Values::of(array( 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new CountryPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of CountryInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of CountryInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new CountryPage($this->version, $response, $this->solution); } /** * Constructs a CountryContext * * @param string $isoCountry The ISO country code * @return \Twilio\Rest\Pricing\V1\Messaging\CountryContext */ public function getContext($isoCountry) { return new CountryContext($this->version, $isoCountry); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Pricing.V1.CountryList]'; } } sdk/src/Twilio/Rest/Pricing/V1/Messaging/CountryContext.php 0000644 00000003221 15002236443 0017614 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Pricing\V1\Messaging; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; class CountryContext extends InstanceContext { /** * Initialize the CountryContext * * @param \Twilio\Version $version Version that contains the resource * @param string $isoCountry The ISO country code * @return \Twilio\Rest\Pricing\V1\Messaging\CountryContext */ public function __construct(Version $version, $isoCountry) { parent::__construct($version); // Path Solution $this->solution = array('isoCountry' => $isoCountry, ); $this->uri = '/Messaging/Countries/' . \rawurlencode($isoCountry) . ''; } /** * Fetch a CountryInstance * * @return CountryInstance Fetched CountryInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new CountryInstance($this->version, $payload, $this->solution['isoCountry']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Pricing.V1.CountryContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Pricing/V1/Messaging/CountryInstance.php 0000644 00000006404 15002236443 0017742 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Pricing\V1\Messaging; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $country * @property string $isoCountry * @property string $outboundSmsPrices * @property string $inboundSmsPrices * @property string $priceUnit * @property string $url */ class CountryInstance extends InstanceResource { /** * Initialize the CountryInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $isoCountry The ISO country code * @return \Twilio\Rest\Pricing\V1\Messaging\CountryInstance */ public function __construct(Version $version, array $payload, $isoCountry = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'country' => Values::array_get($payload, 'country'), 'isoCountry' => Values::array_get($payload, 'iso_country'), 'outboundSmsPrices' => Values::array_get($payload, 'outbound_sms_prices'), 'inboundSmsPrices' => Values::array_get($payload, 'inbound_sms_prices'), 'priceUnit' => Values::array_get($payload, 'price_unit'), 'url' => Values::array_get($payload, 'url'), ); $this->solution = array('isoCountry' => $isoCountry ?: $this->properties['isoCountry'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Pricing\V1\Messaging\CountryContext Context for this * CountryInstance */ protected function proxy() { if (!$this->context) { $this->context = new CountryContext($this->version, $this->solution['isoCountry']); } return $this->context; } /** * Fetch a CountryInstance * * @return CountryInstance Fetched CountryInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Pricing.V1.CountryInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Pricing/V1/PhoneNumberList.php 0000644 00000004564 15002236443 0015760 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Pricing\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Rest\Pricing\V1\PhoneNumber\CountryList; use Twilio\Version; /** * @property \Twilio\Rest\Pricing\V1\PhoneNumber\CountryList $countries * @method \Twilio\Rest\Pricing\V1\PhoneNumber\CountryContext countries(string $isoCountry) */ class PhoneNumberList extends ListResource { protected $_countries = null; /** * Construct the PhoneNumberList * * @param Version $version Version that contains the resource * @return \Twilio\Rest\Pricing\V1\PhoneNumberList */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = array(); } /** * Access the countries */ protected function getCountries() { if (!$this->_countries) { $this->_countries = new CountryList($this->version); } return $this->_countries; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get($name) { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Pricing.V1.PhoneNumberList]'; } } sdk/src/Twilio/Rest/Pricing/V1/MessagingPage.php 0000644 00000001326 15002236443 0015405 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Pricing\V1; use Twilio\Page; class MessagingPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new MessagingInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Pricing.V1.MessagingPage]'; } } sdk/src/Twilio/Rest/Pricing/V2.php 0000644 00000004234 15002236443 0012675 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Pricing; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\Rest\Pricing\V2\VoiceList; use Twilio\Version; /** * @property \Twilio\Rest\Pricing\V2\VoiceList $voice */ class V2 extends Version { protected $_voice = null; /** * Construct the V2 version of Pricing * * @param \Twilio\Domain $domain Domain that contains the version * @return \Twilio\Rest\Pricing\V2 V2 version of Pricing */ public function __construct(Domain $domain) { parent::__construct($domain); $this->version = 'v2'; } /** * @return \Twilio\Rest\Pricing\V2\VoiceList */ protected function getVoice() { if (!$this->_voice) { $this->_voice = new VoiceList($this); } return $this->_voice; } /** * Magic getter to lazy load root resources * * @param string $name Resource to return * @return \Twilio\ListResource The requested resource * @throws TwilioException For unknown resource */ public function __get($name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown resource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Pricing.V2]'; } } sdk/src/Twilio/Rest/Pricing/V2/VoicePage.php 0000644 00000001312 15002236443 0014531 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Pricing\V2; use Twilio\Page; class VoicePage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new VoiceInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Pricing.V2.VoicePage]'; } } sdk/src/Twilio/Rest/Pricing/V2/Voice/NumberOptions.php 0000644 00000003655 15002236443 0016554 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Pricing\V2\Voice; use Twilio\Options; use Twilio\Values; abstract class NumberOptions { /** * @param string $originationNumber The origination number for which to fetch * pricing information * @return FetchNumberOptions Options builder */ public static function fetch($originationNumber = Values::NONE) { return new FetchNumberOptions($originationNumber); } } class FetchNumberOptions extends Options { /** * @param string $originationNumber The origination number for which to fetch * pricing information */ public function __construct($originationNumber = Values::NONE) { $this->options['originationNumber'] = $originationNumber; } /** * The origination phone number, in [E.164](https://www.twilio.com/docs/glossary/what-e164) format, for which to fetch the origin-based voice pricing information. E.164 format consists of a + followed by the country code and subscriber number. * * @param string $originationNumber The origination number for which to fetch * pricing information * @return $this Fluent Builder */ public function setOriginationNumber($originationNumber) { $this->options['originationNumber'] = $originationNumber; 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.Pricing.V2.FetchNumberOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Pricing/V2/Voice/NumberContext.php 0000644 00000003664 15002236443 0016545 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Pricing\V2\Voice; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Values; use Twilio\Version; class NumberContext extends InstanceContext { /** * Initialize the NumberContext * * @param \Twilio\Version $version Version that contains the resource * @param string $destinationNumber The destination number for which to fetch * pricing information * @return \Twilio\Rest\Pricing\V2\Voice\NumberContext */ public function __construct(Version $version, $destinationNumber) { parent::__construct($version); // Path Solution $this->solution = array('destinationNumber' => $destinationNumber, ); $this->uri = '/Voice/Numbers/' . \rawurlencode($destinationNumber) . ''; } /** * Fetch a NumberInstance * * @param array|Options $options Optional Arguments * @return NumberInstance Fetched NumberInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch($options = array()) { $options = new Values($options); $params = Values::of(array('OriginationNumber' => $options['originationNumber'], )); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new NumberInstance($this->version, $payload, $this->solution['destinationNumber']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Pricing.V2.NumberContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Pricing/V2/Voice/CountryPage.php 0000644 00000001326 15002236443 0016201 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Pricing\V2\Voice; use Twilio\Page; class CountryPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new CountryInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Pricing.V2.CountryPage]'; } } sdk/src/Twilio/Rest/Pricing/V2/Voice/NumberInstance.php 0000644 00000007334 15002236443 0016663 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Pricing\V2\Voice; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $destinationNumber * @property string $originationNumber * @property string $country * @property string $isoCountry * @property string $outboundCallPrices * @property string $inboundCallPrice * @property string $priceUnit * @property string $url */ class NumberInstance extends InstanceResource { /** * Initialize the NumberInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $destinationNumber The destination number for which to fetch * pricing information * @return \Twilio\Rest\Pricing\V2\Voice\NumberInstance */ public function __construct(Version $version, array $payload, $destinationNumber = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'destinationNumber' => Values::array_get($payload, 'destination_number'), 'originationNumber' => Values::array_get($payload, 'origination_number'), 'country' => Values::array_get($payload, 'country'), 'isoCountry' => Values::array_get($payload, 'iso_country'), 'outboundCallPrices' => Values::array_get($payload, 'outbound_call_prices'), 'inboundCallPrice' => Values::array_get($payload, 'inbound_call_price'), 'priceUnit' => Values::array_get($payload, 'price_unit'), 'url' => Values::array_get($payload, 'url'), ); $this->solution = array( 'destinationNumber' => $destinationNumber ?: $this->properties['destinationNumber'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Pricing\V2\Voice\NumberContext Context for this * NumberInstance */ protected function proxy() { if (!$this->context) { $this->context = new NumberContext($this->version, $this->solution['destinationNumber']); } return $this->context; } /** * Fetch a NumberInstance * * @param array|Options $options Optional Arguments * @return NumberInstance Fetched NumberInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch($options = array()) { return $this->proxy()->fetch($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Pricing.V2.NumberInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Pricing/V2/Voice/CountryList.php 0000644 00000011276 15002236443 0016245 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Pricing\V2\Voice; use Twilio\ListResource; use Twilio\Values; use Twilio\Version; class CountryList extends ListResource { /** * Construct the CountryList * * @param Version $version Version that contains the resource * @return \Twilio\Rest\Pricing\V2\Voice\CountryList */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = array(); $this->uri = '/Voice/Countries'; } /** * Streams CountryInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads CountryInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return CountryInstance[] Array of results */ public function read($limit = null, $pageSize = null) { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of CountryInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of CountryInstance */ public function page($pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $params = Values::of(array( 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new CountryPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of CountryInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of CountryInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new CountryPage($this->version, $response, $this->solution); } /** * Constructs a CountryContext * * @param string $isoCountry The ISO country code of the pricing information to * fetch * @return \Twilio\Rest\Pricing\V2\Voice\CountryContext */ public function getContext($isoCountry) { return new CountryContext($this->version, $isoCountry); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Pricing.V2.CountryList]'; } } sdk/src/Twilio/Rest/Pricing/V2/Voice/NumberList.php 0000644 00000002231 15002236443 0016021 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Pricing\V2\Voice; use Twilio\ListResource; use Twilio\Version; class NumberList extends ListResource { /** * Construct the NumberList * * @param Version $version Version that contains the resource * @return \Twilio\Rest\Pricing\V2\Voice\NumberList */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = array(); } /** * Constructs a NumberContext * * @param string $destinationNumber The destination number for which to fetch * pricing information * @return \Twilio\Rest\Pricing\V2\Voice\NumberContext */ public function getContext($destinationNumber) { return new NumberContext($this->version, $destinationNumber); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Pricing.V2.NumberList]'; } } sdk/src/Twilio/Rest/Pricing/V2/Voice/NumberPage.php 0000644 00000001323 15002236443 0015763 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Pricing\V2\Voice; use Twilio\Page; class NumberPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new NumberInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Pricing.V2.NumberPage]'; } } sdk/src/Twilio/Rest/Pricing/V2/Voice/CountryContext.php 0000644 00000003312 15002236443 0016746 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Pricing\V2\Voice; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; class CountryContext extends InstanceContext { /** * Initialize the CountryContext * * @param \Twilio\Version $version Version that contains the resource * @param string $isoCountry The ISO country code of the pricing information to * fetch * @return \Twilio\Rest\Pricing\V2\Voice\CountryContext */ public function __construct(Version $version, $isoCountry) { parent::__construct($version); // Path Solution $this->solution = array('isoCountry' => $isoCountry, ); $this->uri = '/Voice/Countries/' . \rawurlencode($isoCountry) . ''; } /** * Fetch a CountryInstance * * @return CountryInstance Fetched CountryInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new CountryInstance($this->version, $payload, $this->solution['isoCountry']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Pricing.V2.CountryContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Pricing/V2/Voice/CountryInstance.php 0000644 00000006505 15002236443 0017075 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Pricing\V2\Voice; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $country * @property string $isoCountry * @property string $outboundPrefixPrices * @property string $inboundCallPrices * @property string $priceUnit * @property string $url */ class CountryInstance extends InstanceResource { /** * Initialize the CountryInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $isoCountry The ISO country code of the pricing information to * fetch * @return \Twilio\Rest\Pricing\V2\Voice\CountryInstance */ public function __construct(Version $version, array $payload, $isoCountry = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'country' => Values::array_get($payload, 'country'), 'isoCountry' => Values::array_get($payload, 'iso_country'), 'outboundPrefixPrices' => Values::array_get($payload, 'outbound_prefix_prices'), 'inboundCallPrices' => Values::array_get($payload, 'inbound_call_prices'), 'priceUnit' => Values::array_get($payload, 'price_unit'), 'url' => Values::array_get($payload, 'url'), ); $this->solution = array('isoCountry' => $isoCountry ?: $this->properties['isoCountry'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Pricing\V2\Voice\CountryContext Context for this * CountryInstance */ protected function proxy() { if (!$this->context) { $this->context = new CountryContext($this->version, $this->solution['isoCountry']); } return $this->context; } /** * Fetch a CountryInstance * * @return CountryInstance Fetched CountryInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Pricing.V2.CountryInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Pricing/V2/VoiceInstance.php 0000644 00000003441 15002236443 0015426 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Pricing\V2; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $name * @property string $url * @property array $links */ class VoiceInstance extends InstanceResource { /** * Initialize the VoiceInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @return \Twilio\Rest\Pricing\V2\VoiceInstance */ public function __construct(Version $version, array $payload) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'name' => Values::array_get($payload, 'name'), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ); $this->solution = array(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Pricing.V2.VoiceInstance]'; } } sdk/src/Twilio/Rest/Pricing/V2/VoiceList.php 0000644 00000005420 15002236443 0014574 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Pricing\V2; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Rest\Pricing\V2\Voice\CountryList; use Twilio\Rest\Pricing\V2\Voice\NumberList; use Twilio\Version; /** * @property \Twilio\Rest\Pricing\V2\Voice\CountryList $countries * @property \Twilio\Rest\Pricing\V2\Voice\NumberList $numbers * @method \Twilio\Rest\Pricing\V2\Voice\CountryContext countries(string $isoCountry) * @method \Twilio\Rest\Pricing\V2\Voice\NumberContext numbers(string $destinationNumber) */ class VoiceList extends ListResource { protected $_countries = null; protected $_numbers = null; /** * Construct the VoiceList * * @param Version $version Version that contains the resource * @return \Twilio\Rest\Pricing\V2\VoiceList */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = array(); } /** * Access the countries */ protected function getCountries() { if (!$this->_countries) { $this->_countries = new CountryList($this->version); } return $this->_countries; } /** * Access the numbers */ protected function getNumbers() { if (!$this->_numbers) { $this->_numbers = new NumberList($this->version); } return $this->_numbers; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get($name) { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Pricing.V2.VoiceList]'; } } sdk/src/Twilio/Rest/Authy/V1.php 0000644 00000005205 15002236443 0012372 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Authy; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\Rest\Authy\V1\FormList; use Twilio\Rest\Authy\V1\ServiceList; use Twilio\Version; /** * @property \Twilio\Rest\Authy\V1\FormList $forms * @property \Twilio\Rest\Authy\V1\ServiceList $services * @method \Twilio\Rest\Authy\V1\FormContext forms(string $formType) * @method \Twilio\Rest\Authy\V1\ServiceContext services(string $sid) */ class V1 extends Version { protected $_forms = null; protected $_services = null; /** * Construct the V1 version of Authy * * @param \Twilio\Domain $domain Domain that contains the version * @return \Twilio\Rest\Authy\V1 V1 version of Authy */ public function __construct(Domain $domain) { parent::__construct($domain); $this->version = 'v1'; } /** * @return \Twilio\Rest\Authy\V1\FormList */ protected function getForms() { if (!$this->_forms) { $this->_forms = new FormList($this); } return $this->_forms; } /** * @return \Twilio\Rest\Authy\V1\ServiceList */ protected function getServices() { if (!$this->_services) { $this->_services = new ServiceList($this); } return $this->_services; } /** * Magic getter to lazy load root resources * * @param string $name Resource to return * @return \Twilio\ListResource The requested resource * @throws TwilioException For unknown resource */ public function __get($name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown resource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Authy.V1]'; } } sdk/src/Twilio/Rest/Authy/V1/ServiceOptions.php 0000644 00000003352 15002236443 0015347 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Authy\V1; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ abstract class ServiceOptions { /** * @param string $friendlyName A human readable description of this resource. * @return UpdateServiceOptions Options builder */ public static function update($friendlyName = Values::NONE) { return new UpdateServiceOptions($friendlyName); } } class UpdateServiceOptions extends Options { /** * @param string $friendlyName A human readable description of this resource. */ public function __construct($friendlyName = Values::NONE) { $this->options['friendlyName'] = $friendlyName; } /** * A human readable description of this resource, up to 64 characters. * * @param string $friendlyName A human readable description of this resource. * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; 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.Authy.V1.UpdateServiceOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Authy/V1/FormContext.php 0000644 00000003421 15002236443 0014640 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Authy\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class FormContext extends InstanceContext { /** * Initialize the FormContext * * @param \Twilio\Version $version Version that contains the resource * @param string $formType The Type of this Form * @return \Twilio\Rest\Authy\V1\FormContext */ public function __construct(Version $version, $formType) { parent::__construct($version); // Path Solution $this->solution = array('formType' => $formType, ); $this->uri = '/Forms/' . \rawurlencode($formType) . ''; } /** * Fetch a FormInstance * * @return FormInstance Fetched FormInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new FormInstance($this->version, $payload, $this->solution['formType']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Authy.V1.FormContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Authy/V1/FormPage.php 0000644 00000001616 15002236443 0014074 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Authy\V1; use Twilio\Page; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class FormPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new FormInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Authy.V1.FormPage]'; } } sdk/src/Twilio/Rest/Authy/V1/ServiceList.php 0000644 00000012626 15002236443 0014633 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Authy\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class ServiceList extends ListResource { /** * Construct the ServiceList * * @param Version $version Version that contains the resource * @return \Twilio\Rest\Authy\V1\ServiceList */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = array(); $this->uri = '/Services'; } /** * Create a new ServiceInstance * * @param string $friendlyName A human readable description of this resource. * @return ServiceInstance Newly created ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function create($friendlyName) { $data = Values::of(array('FriendlyName' => $friendlyName, )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new ServiceInstance($this->version, $payload); } /** * Streams ServiceInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads ServiceInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return ServiceInstance[] Array of results */ public function read($limit = null, $pageSize = null) { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of ServiceInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of ServiceInstance */ public function page($pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $params = Values::of(array( 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new ServicePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of ServiceInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of ServiceInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new ServicePage($this->version, $response, $this->solution); } /** * Constructs a ServiceContext * * @param string $sid A string that uniquely identifies this Service. * @return \Twilio\Rest\Authy\V1\ServiceContext */ public function getContext($sid) { return new ServiceContext($this->version, $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Authy.V1.ServiceList]'; } } sdk/src/Twilio/Rest/Authy/V1/ServicePage.php 0000644 00000001627 15002236443 0014573 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Authy\V1; use Twilio\Page; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class ServicePage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new ServiceInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Authy.V1.ServicePage]'; } } sdk/src/Twilio/Rest/Authy/V1/ServiceInstance.php 0000644 00000010427 15002236443 0015461 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Authy\V1; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $sid * @property string $friendlyName * @property string $accountSid * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $url * @property array $links */ class ServiceInstance extends InstanceResource { protected $_entities = null; /** * Initialize the ServiceInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid A string that uniquely identifies this Service. * @return \Twilio\Rest\Authy\V1\ServiceInstance */ public function __construct(Version $version, array $payload, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'sid' => Values::array_get($payload, 'sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ); $this->solution = array('sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Authy\V1\ServiceContext Context for this ServiceInstance */ protected function proxy() { if (!$this->context) { $this->context = new ServiceContext($this->version, $this->solution['sid']); } return $this->context; } /** * Deletes the ServiceInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Fetch a ServiceInstance * * @return ServiceInstance Fetched ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Update the ServiceInstance * * @param array|Options $options Optional Arguments * @return ServiceInstance Updated ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Access the entities * * @return \Twilio\Rest\Authy\V1\Service\EntityList */ protected function getEntities() { return $this->proxy()->entities; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Authy.V1.ServiceInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Authy/V1/FormList.php 0000644 00000002321 15002236443 0014125 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Authy\V1; use Twilio\ListResource; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class FormList extends ListResource { /** * Construct the FormList * * @param Version $version Version that contains the resource * @return \Twilio\Rest\Authy\V1\FormList */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = array(); } /** * Constructs a FormContext * * @param string $formType The Type of this Form * @return \Twilio\Rest\Authy\V1\FormContext */ public function getContext($formType) { return new FormContext($this->version, $formType); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Authy.V1.FormList]'; } } sdk/src/Twilio/Rest/Authy/V1/Service/Entity/FactorOptions.php 0000644 00000003620 15002236443 0020037 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Authy\V1\Service\Entity; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ abstract class FactorOptions { /** * @param string $authPayload Optional payload to verify the Factor for the * first time * @return UpdateFactorOptions Options builder */ public static function update($authPayload = Values::NONE) { return new UpdateFactorOptions($authPayload); } } class UpdateFactorOptions extends Options { /** * @param string $authPayload Optional payload to verify the Factor for the * first time */ public function __construct($authPayload = Values::NONE) { $this->options['authPayload'] = $authPayload; } /** * The optional payload needed to verify the Factor for the first time. E.g. for a TOTP, the numeric code. * * @param string $authPayload Optional payload to verify the Factor for the * first time * @return $this Fluent Builder */ public function setAuthPayload($authPayload) { $this->options['authPayload'] = $authPayload; 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.Authy.V1.UpdateFactorOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Authy/V1/Service/Entity/FactorInstance.php 0000644 00000012545 15002236443 0020156 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Authy\V1\Service\Entity; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $sid * @property string $accountSid * @property string $serviceSid * @property string $entitySid * @property string $identity * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $friendlyName * @property string $status * @property string $factorType * @property string $factorStrength * @property string $url * @property array $links */ class FactorInstance extends InstanceResource { protected $_challenges = null; /** * Initialize the FactorInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid Service Sid. * @param string $identity Unique identity of the Entity * @param string $sid A string that uniquely identifies this Factor. * @return \Twilio\Rest\Authy\V1\Service\Entity\FactorInstance */ public function __construct(Version $version, array $payload, $serviceSid, $identity, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'entitySid' => Values::array_get($payload, 'entity_sid'), 'identity' => Values::array_get($payload, 'identity'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'status' => Values::array_get($payload, 'status'), 'factorType' => Values::array_get($payload, 'factor_type'), 'factorStrength' => Values::array_get($payload, 'factor_strength'), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ); $this->solution = array( 'serviceSid' => $serviceSid, 'identity' => $identity, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Authy\V1\Service\Entity\FactorContext Context for this * FactorInstance */ protected function proxy() { if (!$this->context) { $this->context = new FactorContext( $this->version, $this->solution['serviceSid'], $this->solution['identity'], $this->solution['sid'] ); } return $this->context; } /** * Deletes the FactorInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Fetch a FactorInstance * * @return FactorInstance Fetched FactorInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Update the FactorInstance * * @param array|Options $options Optional Arguments * @return FactorInstance Updated FactorInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Access the challenges * * @return \Twilio\Rest\Authy\V1\Service\Entity\Factor\ChallengeList */ protected function getChallenges() { return $this->proxy()->challenges; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Authy.V1.FactorInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Authy/V1/Service/Entity/Factor/ChallengeContext.php 0000644 00000007125 15002236443 0021716 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Authy\V1\Service\Entity\Factor; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class ChallengeContext extends InstanceContext { /** * Initialize the ChallengeContext * * @param \Twilio\Version $version Version that contains the resource * @param string $serviceSid Service Sid. * @param string $identity Unique identity of the Entity * @param string $factorSid Factor Sid. * @param string $sid A string that uniquely identifies this Challenge, or * `latest`. * @return \Twilio\Rest\Authy\V1\Service\Entity\Factor\ChallengeContext */ public function __construct(Version $version, $serviceSid, $identity, $factorSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array( 'serviceSid' => $serviceSid, 'identity' => $identity, 'factorSid' => $factorSid, 'sid' => $sid, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Entities/' . \rawurlencode($identity) . '/Factors/' . \rawurlencode($factorSid) . '/Challenges/' . \rawurlencode($sid) . ''; } /** * Deletes the ChallengeInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Fetch a ChallengeInstance * * @return ChallengeInstance Fetched ChallengeInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new ChallengeInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['identity'], $this->solution['factorSid'], $this->solution['sid'] ); } /** * Update the ChallengeInstance * * @param array|Options $options Optional Arguments * @return ChallengeInstance Updated ChallengeInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { $options = new Values($options); $data = Values::of(array('AuthPayload' => $options['authPayload'], )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new ChallengeInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['identity'], $this->solution['factorSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Authy.V1.ChallengeContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Authy/V1/Service/Entity/Factor/ChallengeOptions.php 0000644 00000011300 15002236443 0021713 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Authy\V1\Service\Entity\Factor; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ abstract class ChallengeOptions { /** * @param \DateTime $expirationDate The future date in which this Challenge * will expire * @param string $details Public details provided to contextualize the Challenge * @param string $hiddenDetails Hidden details provided to contextualize the * Challenge * @return CreateChallengeOptions Options builder */ public static function create($expirationDate = Values::NONE, $details = Values::NONE, $hiddenDetails = Values::NONE) { return new CreateChallengeOptions($expirationDate, $details, $hiddenDetails); } /** * @param string $authPayload Optional payload to verify the Challenge * @return UpdateChallengeOptions Options builder */ public static function update($authPayload = Values::NONE) { return new UpdateChallengeOptions($authPayload); } } class CreateChallengeOptions extends Options { /** * @param \DateTime $expirationDate The future date in which this Challenge * will expire * @param string $details Public details provided to contextualize the Challenge * @param string $hiddenDetails Hidden details provided to contextualize the * Challenge */ public function __construct($expirationDate = Values::NONE, $details = Values::NONE, $hiddenDetails = Values::NONE) { $this->options['expirationDate'] = $expirationDate; $this->options['details'] = $details; $this->options['hiddenDetails'] = $hiddenDetails; } /** * The future date in which this Challenge will expire, given in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. * * @param \DateTime $expirationDate The future date in which this Challenge * will expire * @return $this Fluent Builder */ public function setExpirationDate($expirationDate) { $this->options['expirationDate'] = $expirationDate; return $this; } /** * Details provided to give context about the Challenge. Shown to the end user. * * @param string $details Public details provided to contextualize the Challenge * @return $this Fluent Builder */ public function setDetails($details) { $this->options['details'] = $details; return $this; } /** * Details provided to give context about the Challenge. Not shown to the end user. * * @param string $hiddenDetails Hidden details provided to contextualize the * Challenge * @return $this Fluent Builder */ public function setHiddenDetails($hiddenDetails) { $this->options['hiddenDetails'] = $hiddenDetails; 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.Authy.V1.CreateChallengeOptions ' . \implode(' ', $options) . ']'; } } class UpdateChallengeOptions extends Options { /** * @param string $authPayload Optional payload to verify the Challenge */ public function __construct($authPayload = Values::NONE) { $this->options['authPayload'] = $authPayload; } /** * The optional payload needed to verify the Challenge. E.g., a TOTP would use the numeric code. * * @param string $authPayload Optional payload to verify the Challenge * @return $this Fluent Builder */ public function setAuthPayload($authPayload) { $this->options['authPayload'] = $authPayload; 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.Authy.V1.UpdateChallengeOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Authy/V1/Service/Entity/Factor/ChallengeInstance.php 0000644 00000014000 15002236443 0022024 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Authy\V1\Service\Entity\Factor; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $sid * @property string $accountSid * @property string $serviceSid * @property string $entitySid * @property string $identity * @property string $factorSid * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property \DateTime $dateResponded * @property \DateTime $expirationDate * @property string $status * @property string $respondedReason * @property string $details * @property string $hiddenDetails * @property string $factorType * @property string $factorStrength * @property string $url */ class ChallengeInstance extends InstanceResource { /** * Initialize the ChallengeInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid Service Sid. * @param string $identity Unique identity of the Entity * @param string $factorSid Factor Sid. * @param string $sid A string that uniquely identifies this Challenge, or * `latest`. * @return \Twilio\Rest\Authy\V1\Service\Entity\Factor\ChallengeInstance */ public function __construct(Version $version, array $payload, $serviceSid, $identity, $factorSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'entitySid' => Values::array_get($payload, 'entity_sid'), 'identity' => Values::array_get($payload, 'identity'), 'factorSid' => Values::array_get($payload, 'factor_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'dateResponded' => Deserialize::dateTime(Values::array_get($payload, 'date_responded')), 'expirationDate' => Deserialize::dateTime(Values::array_get($payload, 'expiration_date')), 'status' => Values::array_get($payload, 'status'), 'respondedReason' => Values::array_get($payload, 'responded_reason'), 'details' => Values::array_get($payload, 'details'), 'hiddenDetails' => Values::array_get($payload, 'hidden_details'), 'factorType' => Values::array_get($payload, 'factor_type'), 'factorStrength' => Values::array_get($payload, 'factor_strength'), 'url' => Values::array_get($payload, 'url'), ); $this->solution = array( 'serviceSid' => $serviceSid, 'identity' => $identity, 'factorSid' => $factorSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Authy\V1\Service\Entity\Factor\ChallengeContext Context * for * this * ChallengeInstance */ protected function proxy() { if (!$this->context) { $this->context = new ChallengeContext( $this->version, $this->solution['serviceSid'], $this->solution['identity'], $this->solution['factorSid'], $this->solution['sid'] ); } return $this->context; } /** * Deletes the ChallengeInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Fetch a ChallengeInstance * * @return ChallengeInstance Fetched ChallengeInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Update the ChallengeInstance * * @param array|Options $options Optional Arguments * @return ChallengeInstance Updated ChallengeInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Authy.V1.ChallengeInstance ' . \implode(' ', $context) . ']'; } }sdk/src/Twilio/Rest/Authy/V1/Service/Entity/Factor/ChallengeList.php 0000644 00000005767 15002236443 0021217 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Authy\V1\Service\Entity\Factor; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class ChallengeList extends ListResource { /** * Construct the ChallengeList * * @param Version $version Version that contains the resource * @param string $serviceSid Service Sid. * @param string $identity Unique identity of the Entity * @param string $factorSid Factor Sid. * @return \Twilio\Rest\Authy\V1\Service\Entity\Factor\ChallengeList */ public function __construct(Version $version, $serviceSid, $identity, $factorSid) { parent::__construct($version); // Path Solution $this->solution = array( 'serviceSid' => $serviceSid, 'identity' => $identity, 'factorSid' => $factorSid, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Entities/' . \rawurlencode($identity) . '/Factors/' . \rawurlencode($factorSid) . '/Challenges'; } /** * Create a new ChallengeInstance * * @param array|Options $options Optional Arguments * @return ChallengeInstance Newly created ChallengeInstance * @throws TwilioException When an HTTP error occurs. */ public function create($options = array()) { $options = new Values($options); $data = Values::of(array( 'ExpirationDate' => Serialize::iso8601DateTime($options['expirationDate']), 'Details' => $options['details'], 'HiddenDetails' => $options['hiddenDetails'], )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new ChallengeInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['identity'], $this->solution['factorSid'] ); } /** * Constructs a ChallengeContext * * @param string $sid A string that uniquely identifies this Challenge, or * `latest`. * @return \Twilio\Rest\Authy\V1\Service\Entity\Factor\ChallengeContext */ public function getContext($sid) { return new ChallengeContext( $this->version, $this->solution['serviceSid'], $this->solution['identity'], $this->solution['factorSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Authy.V1.ChallengeList]'; } } sdk/src/Twilio/Rest/Authy/V1/Service/Entity/Factor/ChallengePage.php 0000644 00000002123 15002236443 0021137 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Authy\V1\Service\Entity\Factor; use Twilio\Page; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class ChallengePage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new ChallengeInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['identity'], $this->solution['factorSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Authy.V1.ChallengePage]'; } } sdk/src/Twilio/Rest/Authy/V1/Service/Entity/FactorContext.php 0000644 00000012047 15002236443 0020033 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Authy\V1\Service\Entity; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Rest\Authy\V1\Service\Entity\Factor\ChallengeList; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property \Twilio\Rest\Authy\V1\Service\Entity\Factor\ChallengeList $challenges * @method \Twilio\Rest\Authy\V1\Service\Entity\Factor\ChallengeContext challenges(string $sid) */ class FactorContext extends InstanceContext { protected $_challenges = null; /** * Initialize the FactorContext * * @param \Twilio\Version $version Version that contains the resource * @param string $serviceSid Service Sid. * @param string $identity Unique identity of the Entity * @param string $sid A string that uniquely identifies this Factor. * @return \Twilio\Rest\Authy\V1\Service\Entity\FactorContext */ public function __construct(Version $version, $serviceSid, $identity, $sid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, 'identity' => $identity, 'sid' => $sid, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Entities/' . \rawurlencode($identity) . '/Factors/' . \rawurlencode($sid) . ''; } /** * Deletes the FactorInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Fetch a FactorInstance * * @return FactorInstance Fetched FactorInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new FactorInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['identity'], $this->solution['sid'] ); } /** * Update the FactorInstance * * @param array|Options $options Optional Arguments * @return FactorInstance Updated FactorInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { $options = new Values($options); $data = Values::of(array('AuthPayload' => $options['authPayload'], )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new FactorInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['identity'], $this->solution['sid'] ); } /** * Access the challenges * * @return \Twilio\Rest\Authy\V1\Service\Entity\Factor\ChallengeList */ protected function getChallenges() { if (!$this->_challenges) { $this->_challenges = new ChallengeList( $this->version, $this->solution['serviceSid'], $this->solution['identity'], $this->solution['sid'] ); } return $this->_challenges; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get($name) { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Authy.V1.FactorContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Authy/V1/Service/Entity/FactorList.php 0000644 00000014212 15002236443 0017316 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Authy\V1\Service\Entity; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class FactorList extends ListResource { /** * Construct the FactorList * * @param Version $version Version that contains the resource * @param string $serviceSid Service Sid. * @param string $identity Unique identity of the Entity * @return \Twilio\Rest\Authy\V1\Service\Entity\FactorList */ public function __construct(Version $version, $serviceSid, $identity) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, 'identity' => $identity, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Entities/' . \rawurlencode($identity) . '/Factors'; } /** * Create a new FactorInstance * * @param string $binding A unique binding for this Factor * @param string $friendlyName The friendly name of this Factor * @param string $factorType The Type of this Factor * @return FactorInstance Newly created FactorInstance * @throws TwilioException When an HTTP error occurs. */ public function create($binding, $friendlyName, $factorType) { $data = Values::of(array( 'Binding' => $binding, 'FriendlyName' => $friendlyName, 'FactorType' => $factorType, )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new FactorInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['identity'] ); } /** * Streams FactorInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads FactorInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return FactorInstance[] Array of results */ public function read($limit = null, $pageSize = null) { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of FactorInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of FactorInstance */ public function page($pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $params = Values::of(array( 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new FactorPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of FactorInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of FactorInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new FactorPage($this->version, $response, $this->solution); } /** * Constructs a FactorContext * * @param string $sid A string that uniquely identifies this Factor. * @return \Twilio\Rest\Authy\V1\Service\Entity\FactorContext */ public function getContext($sid) { return new FactorContext( $this->version, $this->solution['serviceSid'], $this->solution['identity'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Authy.V1.FactorList]'; } } sdk/src/Twilio/Rest/Authy/V1/Service/Entity/FactorPage.php 0000644 00000002031 15002236443 0017253 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Authy\V1\Service\Entity; use Twilio\Page; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class FactorPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new FactorInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['identity'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Authy.V1.FactorPage]'; } } sdk/src/Twilio/Rest/Authy/V1/Service/EntityInstance.php 0000644 00000010500 15002236443 0016725 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Authy\V1\Service; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $sid * @property string $identity * @property string $accountSid * @property string $serviceSid * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $url * @property array $links */ class EntityInstance extends InstanceResource { protected $_factors = null; /** * Initialize the EntityInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid Service Sid. * @param string $identity Unique identity of the Entity * @return \Twilio\Rest\Authy\V1\Service\EntityInstance */ public function __construct(Version $version, array $payload, $serviceSid, $identity = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'sid' => Values::array_get($payload, 'sid'), 'identity' => Values::array_get($payload, 'identity'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ); $this->solution = array( 'serviceSid' => $serviceSid, 'identity' => $identity ?: $this->properties['identity'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Authy\V1\Service\EntityContext Context for this * EntityInstance */ protected function proxy() { if (!$this->context) { $this->context = new EntityContext( $this->version, $this->solution['serviceSid'], $this->solution['identity'] ); } return $this->context; } /** * Deletes the EntityInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Fetch a EntityInstance * * @return EntityInstance Fetched EntityInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Access the factors * * @return \Twilio\Rest\Authy\V1\Service\Entity\FactorList */ protected function getFactors() { return $this->proxy()->factors; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Authy.V1.EntityInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Authy/V1/Service/EntityList.php 0000644 00000013070 15002236443 0016101 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Authy\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class EntityList extends ListResource { /** * Construct the EntityList * * @param Version $version Version that contains the resource * @param string $serviceSid Service Sid. * @return \Twilio\Rest\Authy\V1\Service\EntityList */ public function __construct(Version $version, $serviceSid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Entities'; } /** * Create a new EntityInstance * * @param string $identity Unique identity of the Entity * @return EntityInstance Newly created EntityInstance * @throws TwilioException When an HTTP error occurs. */ public function create($identity) { $data = Values::of(array('Identity' => $identity, )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new EntityInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Streams EntityInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads EntityInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return EntityInstance[] Array of results */ public function read($limit = null, $pageSize = null) { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of EntityInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of EntityInstance */ public function page($pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $params = Values::of(array( 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new EntityPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of EntityInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of EntityInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new EntityPage($this->version, $response, $this->solution); } /** * Constructs a EntityContext * * @param string $identity Unique identity of the Entity * @return \Twilio\Rest\Authy\V1\Service\EntityContext */ public function getContext($identity) { return new EntityContext($this->version, $this->solution['serviceSid'], $identity); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Authy.V1.EntityList]'; } } sdk/src/Twilio/Rest/Authy/V1/Service/EntityContext.php 0000644 00000010002 15002236443 0016602 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Authy\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Rest\Authy\V1\Service\Entity\FactorList; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property \Twilio\Rest\Authy\V1\Service\Entity\FactorList $factors * @method \Twilio\Rest\Authy\V1\Service\Entity\FactorContext factors(string $sid) */ class EntityContext extends InstanceContext { protected $_factors = null; /** * Initialize the EntityContext * * @param \Twilio\Version $version Version that contains the resource * @param string $serviceSid Service Sid. * @param string $identity Unique identity of the Entity * @return \Twilio\Rest\Authy\V1\Service\EntityContext */ public function __construct(Version $version, $serviceSid, $identity) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, 'identity' => $identity, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Entities/' . \rawurlencode($identity) . ''; } /** * Deletes the EntityInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Fetch a EntityInstance * * @return EntityInstance Fetched EntityInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new EntityInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['identity'] ); } /** * Access the factors * * @return \Twilio\Rest\Authy\V1\Service\Entity\FactorList */ protected function getFactors() { if (!$this->_factors) { $this->_factors = new FactorList( $this->version, $this->solution['serviceSid'], $this->solution['identity'] ); } return $this->_factors; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get($name) { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Authy.V1.EntityContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Authy/V1/Service/EntityPage.php 0000644 00000001673 15002236443 0016050 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Authy\V1\Service; use Twilio\Page; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class EntityPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new EntityInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Authy.V1.EntityPage]'; } } sdk/src/Twilio/Rest/Authy/V1/ServiceContext.php 0000644 00000010453 15002236443 0015340 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Authy\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Rest\Authy\V1\Service\EntityList; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property \Twilio\Rest\Authy\V1\Service\EntityList $entities * @method \Twilio\Rest\Authy\V1\Service\EntityContext entities(string $identity) */ class ServiceContext extends InstanceContext { protected $_entities = null; /** * Initialize the ServiceContext * * @param \Twilio\Version $version Version that contains the resource * @param string $sid A string that uniquely identifies this Service. * @return \Twilio\Rest\Authy\V1\ServiceContext */ public function __construct(Version $version, $sid) { parent::__construct($version); // Path Solution $this->solution = array('sid' => $sid, ); $this->uri = '/Services/' . \rawurlencode($sid) . ''; } /** * Deletes the ServiceInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Fetch a ServiceInstance * * @return ServiceInstance Fetched ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new ServiceInstance($this->version, $payload, $this->solution['sid']); } /** * Update the ServiceInstance * * @param array|Options $options Optional Arguments * @return ServiceInstance Updated ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { $options = new Values($options); $data = Values::of(array('FriendlyName' => $options['friendlyName'], )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new ServiceInstance($this->version, $payload, $this->solution['sid']); } /** * Access the entities * * @return \Twilio\Rest\Authy\V1\Service\EntityList */ protected function getEntities() { if (!$this->_entities) { $this->_entities = new EntityList($this->version, $this->solution['sid']); } return $this->_entities; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get($name) { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Authy.V1.ServiceContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Authy/V1/FormInstance.php 0000644 00000006061 15002236443 0014763 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Authy\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $formType * @property array $forms * @property array $formMeta * @property string $url */ class FormInstance extends InstanceResource { /** * Initialize the FormInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $formType The Type of this Form * @return \Twilio\Rest\Authy\V1\FormInstance */ public function __construct(Version $version, array $payload, $formType = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'formType' => Values::array_get($payload, 'form_type'), 'forms' => Values::array_get($payload, 'forms'), 'formMeta' => Values::array_get($payload, 'form_meta'), 'url' => Values::array_get($payload, 'url'), ); $this->solution = array('formType' => $formType ?: $this->properties['formType'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Authy\V1\FormContext Context for this FormInstance */ protected function proxy() { if (!$this->context) { $this->context = new FormContext($this->version, $this->solution['formType']); } return $this->context; } /** * Fetch a FormInstance * * @return FormInstance Fetched FormInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Authy.V1.FormInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Taskrouter/V1.php 0000644 00000004461 15002236443 0013446 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\Rest\Taskrouter\V1\WorkspaceList; use Twilio\Version; /** * @property \Twilio\Rest\Taskrouter\V1\WorkspaceList $workspaces * @method \Twilio\Rest\Taskrouter\V1\WorkspaceContext workspaces(string $sid) */ class V1 extends Version { protected $_workspaces = null; /** * Construct the V1 version of Taskrouter * * @param \Twilio\Domain $domain Domain that contains the version * @return \Twilio\Rest\Taskrouter\V1 V1 version of Taskrouter */ public function __construct(Domain $domain) { parent::__construct($domain); $this->version = 'v1'; } /** * @return \Twilio\Rest\Taskrouter\V1\WorkspaceList */ protected function getWorkspaces() { if (!$this->_workspaces) { $this->_workspaces = new WorkspaceList($this); } return $this->_workspaces; } /** * Magic getter to lazy load root resources * * @param string $name Resource to return * @return \Twilio\ListResource The requested resource * @throws TwilioException For unknown resource */ public function __get($name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown resource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Taskrouter.V1]'; } } sdk/src/Twilio/Rest/Taskrouter/V1/WorkspaceInstance.php 0000644 00000016606 15002236443 0017075 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $defaultActivityName * @property string $defaultActivitySid * @property string $eventCallbackUrl * @property string $eventsFilter * @property string $friendlyName * @property bool $multiTaskEnabled * @property string $sid * @property string $timeoutActivityName * @property string $timeoutActivitySid * @property string $prioritizeQueueOrder * @property string $url * @property array $links */ class WorkspaceInstance extends InstanceResource { protected $_activities = null; protected $_events = null; protected $_tasks = null; protected $_taskQueues = null; protected $_workers = null; protected $_workflows = null; protected $_statistics = null; protected $_realTimeStatistics = null; protected $_cumulativeStatistics = null; protected $_taskChannels = null; /** * Initialize the WorkspaceInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The SID of the resource to fetch * @return \Twilio\Rest\Taskrouter\V1\WorkspaceInstance */ public function __construct(Version $version, array $payload, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'accountSid' => Values::array_get($payload, 'account_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'defaultActivityName' => Values::array_get($payload, 'default_activity_name'), 'defaultActivitySid' => Values::array_get($payload, 'default_activity_sid'), 'eventCallbackUrl' => Values::array_get($payload, 'event_callback_url'), 'eventsFilter' => Values::array_get($payload, 'events_filter'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'multiTaskEnabled' => Values::array_get($payload, 'multi_task_enabled'), 'sid' => Values::array_get($payload, 'sid'), 'timeoutActivityName' => Values::array_get($payload, 'timeout_activity_name'), 'timeoutActivitySid' => Values::array_get($payload, 'timeout_activity_sid'), 'prioritizeQueueOrder' => Values::array_get($payload, 'prioritize_queue_order'), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ); $this->solution = array('sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Taskrouter\V1\WorkspaceContext Context for this * WorkspaceInstance */ protected function proxy() { if (!$this->context) { $this->context = new WorkspaceContext($this->version, $this->solution['sid']); } return $this->context; } /** * Fetch a WorkspaceInstance * * @return WorkspaceInstance Fetched WorkspaceInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Update the WorkspaceInstance * * @param array|Options $options Optional Arguments * @return WorkspaceInstance Updated WorkspaceInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Deletes the WorkspaceInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Access the activities * * @return \Twilio\Rest\Taskrouter\V1\Workspace\ActivityList */ protected function getActivities() { return $this->proxy()->activities; } /** * Access the events * * @return \Twilio\Rest\Taskrouter\V1\Workspace\EventList */ protected function getEvents() { return $this->proxy()->events; } /** * Access the tasks * * @return \Twilio\Rest\Taskrouter\V1\Workspace\TaskList */ protected function getTasks() { return $this->proxy()->tasks; } /** * Access the taskQueues * * @return \Twilio\Rest\Taskrouter\V1\Workspace\TaskQueueList */ protected function getTaskQueues() { return $this->proxy()->taskQueues; } /** * Access the workers * * @return \Twilio\Rest\Taskrouter\V1\Workspace\WorkerList */ protected function getWorkers() { return $this->proxy()->workers; } /** * Access the workflows * * @return \Twilio\Rest\Taskrouter\V1\Workspace\WorkflowList */ protected function getWorkflows() { return $this->proxy()->workflows; } /** * Access the statistics * * @return \Twilio\Rest\Taskrouter\V1\Workspace\WorkspaceStatisticsList */ protected function getStatistics() { return $this->proxy()->statistics; } /** * Access the realTimeStatistics * * @return \Twilio\Rest\Taskrouter\V1\Workspace\WorkspaceRealTimeStatisticsList */ protected function getRealTimeStatistics() { return $this->proxy()->realTimeStatistics; } /** * Access the cumulativeStatistics * * @return \Twilio\Rest\Taskrouter\V1\Workspace\WorkspaceCumulativeStatisticsList */ protected function getCumulativeStatistics() { return $this->proxy()->cumulativeStatistics; } /** * Access the taskChannels * * @return \Twilio\Rest\Taskrouter\V1\Workspace\TaskChannelList */ protected function getTaskChannels() { return $this->proxy()->taskChannels; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Taskrouter.V1.WorkspaceInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Taskrouter/V1/WorkspaceOptions.php 0000644 00000036411 15002236443 0016760 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1; use Twilio\Options; use Twilio\Values; abstract class WorkspaceOptions { /** * @param string $defaultActivitySid The SID of the Activity that will be used * when new Workers are created in the * Workspace * @param string $eventCallbackUrl The URL we should call when an event occurs * @param string $eventsFilter The list of Workspace events for which to call * event_callback_url * @param string $friendlyName A string to describe the Workspace resource * @param bool $multiTaskEnabled Whether multi-tasking is enabled * @param string $timeoutActivitySid The SID of the Activity that will be * assigned to a Worker when a Task * reservation times out without a response * @param string $prioritizeQueueOrder The type of TaskQueue to prioritize when * Workers are receiving Tasks from both * types of TaskQueues * @return UpdateWorkspaceOptions Options builder */ public static function update($defaultActivitySid = Values::NONE, $eventCallbackUrl = Values::NONE, $eventsFilter = Values::NONE, $friendlyName = Values::NONE, $multiTaskEnabled = Values::NONE, $timeoutActivitySid = Values::NONE, $prioritizeQueueOrder = Values::NONE) { return new UpdateWorkspaceOptions($defaultActivitySid, $eventCallbackUrl, $eventsFilter, $friendlyName, $multiTaskEnabled, $timeoutActivitySid, $prioritizeQueueOrder); } /** * @param string $friendlyName The friendly_name of the Workspace resources to * read * @return ReadWorkspaceOptions Options builder */ public static function read($friendlyName = Values::NONE) { return new ReadWorkspaceOptions($friendlyName); } /** * @param string $eventCallbackUrl The URL we should call when an event occurs * @param string $eventsFilter The list of Workspace events for which to call * event_callback_url * @param bool $multiTaskEnabled Whether multi-tasking is enabled * @param string $template An available template name * @param string $prioritizeQueueOrder The type of TaskQueue to prioritize when * Workers are receiving Tasks from both * types of TaskQueues * @return CreateWorkspaceOptions Options builder */ public static function create($eventCallbackUrl = Values::NONE, $eventsFilter = Values::NONE, $multiTaskEnabled = Values::NONE, $template = Values::NONE, $prioritizeQueueOrder = Values::NONE) { return new CreateWorkspaceOptions($eventCallbackUrl, $eventsFilter, $multiTaskEnabled, $template, $prioritizeQueueOrder); } } class UpdateWorkspaceOptions extends Options { /** * @param string $defaultActivitySid The SID of the Activity that will be used * when new Workers are created in the * Workspace * @param string $eventCallbackUrl The URL we should call when an event occurs * @param string $eventsFilter The list of Workspace events for which to call * event_callback_url * @param string $friendlyName A string to describe the Workspace resource * @param bool $multiTaskEnabled Whether multi-tasking is enabled * @param string $timeoutActivitySid The SID of the Activity that will be * assigned to a Worker when a Task * reservation times out without a response * @param string $prioritizeQueueOrder The type of TaskQueue to prioritize when * Workers are receiving Tasks from both * types of TaskQueues */ public function __construct($defaultActivitySid = Values::NONE, $eventCallbackUrl = Values::NONE, $eventsFilter = Values::NONE, $friendlyName = Values::NONE, $multiTaskEnabled = Values::NONE, $timeoutActivitySid = Values::NONE, $prioritizeQueueOrder = Values::NONE) { $this->options['defaultActivitySid'] = $defaultActivitySid; $this->options['eventCallbackUrl'] = $eventCallbackUrl; $this->options['eventsFilter'] = $eventsFilter; $this->options['friendlyName'] = $friendlyName; $this->options['multiTaskEnabled'] = $multiTaskEnabled; $this->options['timeoutActivitySid'] = $timeoutActivitySid; $this->options['prioritizeQueueOrder'] = $prioritizeQueueOrder; } /** * The SID of the Activity that will be used when new Workers are created in the Workspace. * * @param string $defaultActivitySid The SID of the Activity that will be used * when new Workers are created in the * Workspace * @return $this Fluent Builder */ public function setDefaultActivitySid($defaultActivitySid) { $this->options['defaultActivitySid'] = $defaultActivitySid; return $this; } /** * The URL we should call when an event occurs. See [Workspace Events](https://www.twilio.com/docs/taskrouter/api/event) for more information. * * @param string $eventCallbackUrl The URL we should call when an event occurs * @return $this Fluent Builder */ public function setEventCallbackUrl($eventCallbackUrl) { $this->options['eventCallbackUrl'] = $eventCallbackUrl; return $this; } /** * The list of Workspace events for which to call event_callback_url. For example if `EventsFilter=task.created,task.canceled,worker.activity.update`, then TaskRouter will call event_callback_url only when a task is created, canceled, or a Worker activity is updated. * * @param string $eventsFilter The list of Workspace events for which to call * event_callback_url * @return $this Fluent Builder */ public function setEventsFilter($eventsFilter) { $this->options['eventsFilter'] = $eventsFilter; return $this; } /** * A descriptive string that you create to describe the Workspace resource. For example: `Sales Call Center` or `Customer Support Team`. * * @param string $friendlyName A string to describe the Workspace resource * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * Whether to enable multi-tasking. Can be: `true` to enable multi-tasking, or `false` to disable it. The default is `false`. Multi-tasking allows Workers to handle multiple Tasks simultaneously. When enabled (`true`), each Worker can receive parallel reservations up to the per-channel maximums defined in the Workers section. Otherwise, each Worker will only receive a new reservation when the previous task is completed. Learn more at [Multitasking][https://www.twilio.com/docs/taskrouter/multitasking]. * * @param bool $multiTaskEnabled Whether multi-tasking is enabled * @return $this Fluent Builder */ public function setMultiTaskEnabled($multiTaskEnabled) { $this->options['multiTaskEnabled'] = $multiTaskEnabled; return $this; } /** * The SID of the Activity that will be assigned to a Worker when a Task reservation times out without a response. * * @param string $timeoutActivitySid The SID of the Activity that will be * assigned to a Worker when a Task * reservation times out without a response * @return $this Fluent Builder */ public function setTimeoutActivitySid($timeoutActivitySid) { $this->options['timeoutActivitySid'] = $timeoutActivitySid; return $this; } /** * The type of TaskQueue to prioritize when Workers are receiving Tasks from both types of TaskQueues. Can be: `LIFO` or `FIFO` and the default is `FIFO`. For more information, see [Queue Ordering][https://www.twilio.com/docs/taskrouter/queue-ordering-last-first-out-lifo]. * * @param string $prioritizeQueueOrder The type of TaskQueue to prioritize when * Workers are receiving Tasks from both * types of TaskQueues * @return $this Fluent Builder */ public function setPrioritizeQueueOrder($prioritizeQueueOrder) { $this->options['prioritizeQueueOrder'] = $prioritizeQueueOrder; 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.Taskrouter.V1.UpdateWorkspaceOptions ' . \implode(' ', $options) . ']'; } } class ReadWorkspaceOptions extends Options { /** * @param string $friendlyName The friendly_name of the Workspace resources to * read */ public function __construct($friendlyName = Values::NONE) { $this->options['friendlyName'] = $friendlyName; } /** * The `friendly_name` of the Workspace resources to read. For example `Customer Support` or `2014 Election Campaign`. * * @param string $friendlyName The friendly_name of the Workspace resources to * read * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; 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.Taskrouter.V1.ReadWorkspaceOptions ' . \implode(' ', $options) . ']'; } } class CreateWorkspaceOptions extends Options { /** * @param string $eventCallbackUrl The URL we should call when an event occurs * @param string $eventsFilter The list of Workspace events for which to call * event_callback_url * @param bool $multiTaskEnabled Whether multi-tasking is enabled * @param string $template An available template name * @param string $prioritizeQueueOrder The type of TaskQueue to prioritize when * Workers are receiving Tasks from both * types of TaskQueues */ public function __construct($eventCallbackUrl = Values::NONE, $eventsFilter = Values::NONE, $multiTaskEnabled = Values::NONE, $template = Values::NONE, $prioritizeQueueOrder = Values::NONE) { $this->options['eventCallbackUrl'] = $eventCallbackUrl; $this->options['eventsFilter'] = $eventsFilter; $this->options['multiTaskEnabled'] = $multiTaskEnabled; $this->options['template'] = $template; $this->options['prioritizeQueueOrder'] = $prioritizeQueueOrder; } /** * The URL we should call when an event occurs. If provided, the Workspace will publish events to this URL, for example, to collect data for reporting. See [Workspace Events](https://www.twilio.com/docs/taskrouter/api/event) for more information. * * @param string $eventCallbackUrl The URL we should call when an event occurs * @return $this Fluent Builder */ public function setEventCallbackUrl($eventCallbackUrl) { $this->options['eventCallbackUrl'] = $eventCallbackUrl; return $this; } /** * The list of Workspace events for which to call event_callback_url. For example if `EventsFilter=task.created,task.canceled,worker.activity.update`, then TaskRouter will call event_callback_url only when a task is created, canceled, or a Worker activity is updated. * * @param string $eventsFilter The list of Workspace events for which to call * event_callback_url * @return $this Fluent Builder */ public function setEventsFilter($eventsFilter) { $this->options['eventsFilter'] = $eventsFilter; return $this; } /** * Whether to enable multi-tasking. Can be: `true` to enable multi-tasking, or `false` to disable it. The default is `false`. Multi-tasking allows Workers to handle multiple Tasks simultaneously. When enabled (`true`), each Worker can receive parallel reservations up to the per-channel maximums defined in the Workers section. Otherwise, each Worker will only receive a new reservation when the previous task is completed. Learn more at [Multitasking][https://www.twilio.com/docs/taskrouter/multitasking]. * * @param bool $multiTaskEnabled Whether multi-tasking is enabled * @return $this Fluent Builder */ public function setMultiTaskEnabled($multiTaskEnabled) { $this->options['multiTaskEnabled'] = $multiTaskEnabled; return $this; } /** * An available template name. Can be: `NONE` or `FIFO` and the default is `NONE`. Pre-configures the Workspace with the Workflow and Activities specified in the template. `NONE` will create a Workspace with only a set of default activities. `FIFO` will configure TaskRouter with a set of default activities and a single TaskQueue for first-in, first-out distribution, which can be useful when you are getting started with TaskRouter. * * @param string $template An available template name * @return $this Fluent Builder */ public function setTemplate($template) { $this->options['template'] = $template; return $this; } /** * The type of TaskQueue to prioritize when Workers are receiving Tasks from both types of TaskQueues. Can be: `LIFO` or `FIFO` and the default is `FIFO`. For more information, see [Queue Ordering][https://www.twilio.com/docs/taskrouter/queue-ordering-last-first-out-lifo]. * * @param string $prioritizeQueueOrder The type of TaskQueue to prioritize when * Workers are receiving Tasks from both * types of TaskQueues * @return $this Fluent Builder */ public function setPrioritizeQueueOrder($prioritizeQueueOrder) { $this->options['prioritizeQueueOrder'] = $prioritizeQueueOrder; 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.Taskrouter.V1.CreateWorkspaceOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Taskrouter/V1/WorkspacePage.php 0000644 00000001334 15002236443 0016175 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1; use Twilio\Page; class WorkspacePage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new WorkspaceInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Taskrouter.V1.WorkspacePage]'; } } sdk/src/Twilio/Rest/Taskrouter/V1/WorkspaceContext.php 0000644 00000024217 15002236443 0016752 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Rest\Taskrouter\V1\Workspace\ActivityList; use Twilio\Rest\Taskrouter\V1\Workspace\EventList; use Twilio\Rest\Taskrouter\V1\Workspace\TaskChannelList; use Twilio\Rest\Taskrouter\V1\Workspace\TaskList; use Twilio\Rest\Taskrouter\V1\Workspace\TaskQueueList; use Twilio\Rest\Taskrouter\V1\Workspace\WorkerList; use Twilio\Rest\Taskrouter\V1\Workspace\WorkflowList; use Twilio\Rest\Taskrouter\V1\Workspace\WorkspaceCumulativeStatisticsList; use Twilio\Rest\Taskrouter\V1\Workspace\WorkspaceRealTimeStatisticsList; use Twilio\Rest\Taskrouter\V1\Workspace\WorkspaceStatisticsList; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * @property \Twilio\Rest\Taskrouter\V1\Workspace\ActivityList $activities * @property \Twilio\Rest\Taskrouter\V1\Workspace\EventList $events * @property \Twilio\Rest\Taskrouter\V1\Workspace\TaskList $tasks * @property \Twilio\Rest\Taskrouter\V1\Workspace\TaskQueueList $taskQueues * @property \Twilio\Rest\Taskrouter\V1\Workspace\WorkerList $workers * @property \Twilio\Rest\Taskrouter\V1\Workspace\WorkflowList $workflows * @property \Twilio\Rest\Taskrouter\V1\Workspace\WorkspaceStatisticsList $statistics * @property \Twilio\Rest\Taskrouter\V1\Workspace\WorkspaceRealTimeStatisticsList $realTimeStatistics * @property \Twilio\Rest\Taskrouter\V1\Workspace\WorkspaceCumulativeStatisticsList $cumulativeStatistics * @property \Twilio\Rest\Taskrouter\V1\Workspace\TaskChannelList $taskChannels * @method \Twilio\Rest\Taskrouter\V1\Workspace\ActivityContext activities(string $sid) * @method \Twilio\Rest\Taskrouter\V1\Workspace\EventContext events(string $sid) * @method \Twilio\Rest\Taskrouter\V1\Workspace\TaskContext tasks(string $sid) * @method \Twilio\Rest\Taskrouter\V1\Workspace\TaskQueueContext taskQueues(string $sid) * @method \Twilio\Rest\Taskrouter\V1\Workspace\WorkerContext workers(string $sid) * @method \Twilio\Rest\Taskrouter\V1\Workspace\WorkflowContext workflows(string $sid) * @method \Twilio\Rest\Taskrouter\V1\Workspace\WorkspaceStatisticsContext statistics() * @method \Twilio\Rest\Taskrouter\V1\Workspace\WorkspaceRealTimeStatisticsContext realTimeStatistics() * @method \Twilio\Rest\Taskrouter\V1\Workspace\WorkspaceCumulativeStatisticsContext cumulativeStatistics() * @method \Twilio\Rest\Taskrouter\V1\Workspace\TaskChannelContext taskChannels(string $sid) */ class WorkspaceContext extends InstanceContext { protected $_activities = null; protected $_events = null; protected $_tasks = null; protected $_taskQueues = null; protected $_workers = null; protected $_workflows = null; protected $_statistics = null; protected $_realTimeStatistics = null; protected $_cumulativeStatistics = null; protected $_taskChannels = null; /** * Initialize the WorkspaceContext * * @param \Twilio\Version $version Version that contains the resource * @param string $sid The SID of the resource to fetch * @return \Twilio\Rest\Taskrouter\V1\WorkspaceContext */ public function __construct(Version $version, $sid) { parent::__construct($version); // Path Solution $this->solution = array('sid' => $sid, ); $this->uri = '/Workspaces/' . \rawurlencode($sid) . ''; } /** * Fetch a WorkspaceInstance * * @return WorkspaceInstance Fetched WorkspaceInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new WorkspaceInstance($this->version, $payload, $this->solution['sid']); } /** * Update the WorkspaceInstance * * @param array|Options $options Optional Arguments * @return WorkspaceInstance Updated WorkspaceInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { $options = new Values($options); $data = Values::of(array( 'DefaultActivitySid' => $options['defaultActivitySid'], 'EventCallbackUrl' => $options['eventCallbackUrl'], 'EventsFilter' => $options['eventsFilter'], 'FriendlyName' => $options['friendlyName'], 'MultiTaskEnabled' => Serialize::booleanToString($options['multiTaskEnabled']), 'TimeoutActivitySid' => $options['timeoutActivitySid'], 'PrioritizeQueueOrder' => $options['prioritizeQueueOrder'], )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new WorkspaceInstance($this->version, $payload, $this->solution['sid']); } /** * Deletes the WorkspaceInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Access the activities * * @return \Twilio\Rest\Taskrouter\V1\Workspace\ActivityList */ protected function getActivities() { if (!$this->_activities) { $this->_activities = new ActivityList($this->version, $this->solution['sid']); } return $this->_activities; } /** * Access the events * * @return \Twilio\Rest\Taskrouter\V1\Workspace\EventList */ protected function getEvents() { if (!$this->_events) { $this->_events = new EventList($this->version, $this->solution['sid']); } return $this->_events; } /** * Access the tasks * * @return \Twilio\Rest\Taskrouter\V1\Workspace\TaskList */ protected function getTasks() { if (!$this->_tasks) { $this->_tasks = new TaskList($this->version, $this->solution['sid']); } return $this->_tasks; } /** * Access the taskQueues * * @return \Twilio\Rest\Taskrouter\V1\Workspace\TaskQueueList */ protected function getTaskQueues() { if (!$this->_taskQueues) { $this->_taskQueues = new TaskQueueList($this->version, $this->solution['sid']); } return $this->_taskQueues; } /** * Access the workers * * @return \Twilio\Rest\Taskrouter\V1\Workspace\WorkerList */ protected function getWorkers() { if (!$this->_workers) { $this->_workers = new WorkerList($this->version, $this->solution['sid']); } return $this->_workers; } /** * Access the workflows * * @return \Twilio\Rest\Taskrouter\V1\Workspace\WorkflowList */ protected function getWorkflows() { if (!$this->_workflows) { $this->_workflows = new WorkflowList($this->version, $this->solution['sid']); } return $this->_workflows; } /** * Access the statistics * * @return \Twilio\Rest\Taskrouter\V1\Workspace\WorkspaceStatisticsList */ protected function getStatistics() { if (!$this->_statistics) { $this->_statistics = new WorkspaceStatisticsList($this->version, $this->solution['sid']); } return $this->_statistics; } /** * Access the realTimeStatistics * * @return \Twilio\Rest\Taskrouter\V1\Workspace\WorkspaceRealTimeStatisticsList */ protected function getRealTimeStatistics() { if (!$this->_realTimeStatistics) { $this->_realTimeStatistics = new WorkspaceRealTimeStatisticsList( $this->version, $this->solution['sid'] ); } return $this->_realTimeStatistics; } /** * Access the cumulativeStatistics * * @return \Twilio\Rest\Taskrouter\V1\Workspace\WorkspaceCumulativeStatisticsList */ protected function getCumulativeStatistics() { if (!$this->_cumulativeStatistics) { $this->_cumulativeStatistics = new WorkspaceCumulativeStatisticsList( $this->version, $this->solution['sid'] ); } return $this->_cumulativeStatistics; } /** * Access the taskChannels * * @return \Twilio\Rest\Taskrouter\V1\Workspace\TaskChannelList */ protected function getTaskChannels() { if (!$this->_taskChannels) { $this->_taskChannels = new TaskChannelList($this->version, $this->solution['sid']); } return $this->_taskChannels; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get($name) { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Taskrouter.V1.WorkspaceContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Taskrouter/V1/WorkspaceList.php 0000644 00000014121 15002236443 0016232 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class WorkspaceList extends ListResource { /** * Construct the WorkspaceList * * @param Version $version Version that contains the resource * @return \Twilio\Rest\Taskrouter\V1\WorkspaceList */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = array(); $this->uri = '/Workspaces'; } /** * Streams WorkspaceInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($options = array(), $limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads WorkspaceInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return WorkspaceInstance[] Array of results */ public function read($options = array(), $limit = null, $pageSize = null) { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Retrieve a single page of WorkspaceInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of WorkspaceInstance */ public function page($options = array(), $pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $options = new Values($options); $params = Values::of(array( 'FriendlyName' => $options['friendlyName'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new WorkspacePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of WorkspaceInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of WorkspaceInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new WorkspacePage($this->version, $response, $this->solution); } /** * Create a new WorkspaceInstance * * @param string $friendlyName A string to describe the Workspace resource * @param array|Options $options Optional Arguments * @return WorkspaceInstance Newly created WorkspaceInstance * @throws TwilioException When an HTTP error occurs. */ public function create($friendlyName, $options = array()) { $options = new Values($options); $data = Values::of(array( 'FriendlyName' => $friendlyName, 'EventCallbackUrl' => $options['eventCallbackUrl'], 'EventsFilter' => $options['eventsFilter'], 'MultiTaskEnabled' => Serialize::booleanToString($options['multiTaskEnabled']), 'Template' => $options['template'], 'PrioritizeQueueOrder' => $options['prioritizeQueueOrder'], )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new WorkspaceInstance($this->version, $payload); } /** * Constructs a WorkspaceContext * * @param string $sid The SID of the resource to fetch * @return \Twilio\Rest\Taskrouter\V1\WorkspaceContext */ public function getContext($sid) { return new WorkspaceContext($this->version, $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Taskrouter.V1.WorkspaceList]'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/ActivityList.php 0000644 00000014252 15002236443 0020033 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class ActivityList extends ListResource { /** * Construct the ActivityList * * @param Version $version Version that contains the resource * @param string $workspaceSid The SID of the Workspace that contains the * Activity * @return \Twilio\Rest\Taskrouter\V1\Workspace\ActivityList */ public function __construct(Version $version, $workspaceSid) { parent::__construct($version); // Path Solution $this->solution = array('workspaceSid' => $workspaceSid, ); $this->uri = '/Workspaces/' . \rawurlencode($workspaceSid) . '/Activities'; } /** * Streams ActivityInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($options = array(), $limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads ActivityInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return ActivityInstance[] Array of results */ public function read($options = array(), $limit = null, $pageSize = null) { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Retrieve a single page of ActivityInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of ActivityInstance */ public function page($options = array(), $pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $options = new Values($options); $params = Values::of(array( 'FriendlyName' => $options['friendlyName'], 'Available' => $options['available'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new ActivityPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of ActivityInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of ActivityInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new ActivityPage($this->version, $response, $this->solution); } /** * Create a new ActivityInstance * * @param string $friendlyName A string to describe the Activity resource * @param array|Options $options Optional Arguments * @return ActivityInstance Newly created ActivityInstance * @throws TwilioException When an HTTP error occurs. */ public function create($friendlyName, $options = array()) { $options = new Values($options); $data = Values::of(array( 'FriendlyName' => $friendlyName, 'Available' => Serialize::booleanToString($options['available']), )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new ActivityInstance($this->version, $payload, $this->solution['workspaceSid']); } /** * Constructs a ActivityContext * * @param string $sid The SID of the resource to fetch * @return \Twilio\Rest\Taskrouter\V1\Workspace\ActivityContext */ public function getContext($sid) { return new ActivityContext($this->version, $this->solution['workspaceSid'], $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Taskrouter.V1.ActivityList]'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/ActivityInstance.php 0000644 00000010651 15002236443 0020663 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property bool $available * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $friendlyName * @property string $sid * @property string $workspaceSid * @property string $url */ class ActivityInstance extends InstanceResource { /** * Initialize the ActivityInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $workspaceSid The SID of the Workspace that contains the * Activity * @param string $sid The SID of the resource to fetch * @return \Twilio\Rest\Taskrouter\V1\Workspace\ActivityInstance */ public function __construct(Version $version, array $payload, $workspaceSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'accountSid' => Values::array_get($payload, 'account_sid'), 'available' => Values::array_get($payload, 'available'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'sid' => Values::array_get($payload, 'sid'), 'workspaceSid' => Values::array_get($payload, 'workspace_sid'), 'url' => Values::array_get($payload, 'url'), ); $this->solution = array('workspaceSid' => $workspaceSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Taskrouter\V1\Workspace\ActivityContext Context for * this * ActivityInstance */ protected function proxy() { if (!$this->context) { $this->context = new ActivityContext( $this->version, $this->solution['workspaceSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch a ActivityInstance * * @return ActivityInstance Fetched ActivityInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Update the ActivityInstance * * @param array|Options $options Optional Arguments * @return ActivityInstance Updated ActivityInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Deletes the ActivityInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Taskrouter.V1.ActivityInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkerInstance.php 0000644 00000014310 15002236443 0020334 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property string $activityName * @property string $activitySid * @property string $attributes * @property bool $available * @property \DateTime $dateCreated * @property \DateTime $dateStatusChanged * @property \DateTime $dateUpdated * @property string $friendlyName * @property string $sid * @property string $workspaceSid * @property string $url * @property array $links */ class WorkerInstance extends InstanceResource { protected $_realTimeStatistics = null; protected $_cumulativeStatistics = null; protected $_statistics = null; protected $_reservations = null; protected $_workerChannels = null; /** * Initialize the WorkerInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $workspaceSid The SID of the Workspace that contains the Worker * @param string $sid The SID of the resource to fetch * @return \Twilio\Rest\Taskrouter\V1\Workspace\WorkerInstance */ public function __construct(Version $version, array $payload, $workspaceSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'accountSid' => Values::array_get($payload, 'account_sid'), 'activityName' => Values::array_get($payload, 'activity_name'), 'activitySid' => Values::array_get($payload, 'activity_sid'), 'attributes' => Values::array_get($payload, 'attributes'), 'available' => Values::array_get($payload, 'available'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateStatusChanged' => Deserialize::dateTime(Values::array_get($payload, 'date_status_changed')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'sid' => Values::array_get($payload, 'sid'), 'workspaceSid' => Values::array_get($payload, 'workspace_sid'), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ); $this->solution = array('workspaceSid' => $workspaceSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Taskrouter\V1\Workspace\WorkerContext Context for this * WorkerInstance */ protected function proxy() { if (!$this->context) { $this->context = new WorkerContext( $this->version, $this->solution['workspaceSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch a WorkerInstance * * @return WorkerInstance Fetched WorkerInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Update the WorkerInstance * * @param array|Options $options Optional Arguments * @return WorkerInstance Updated WorkerInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Deletes the WorkerInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Access the realTimeStatistics * * @return \Twilio\Rest\Taskrouter\V1\Workspace\Worker\WorkersRealTimeStatisticsList */ protected function getRealTimeStatistics() { return $this->proxy()->realTimeStatistics; } /** * Access the cumulativeStatistics * * @return \Twilio\Rest\Taskrouter\V1\Workspace\Worker\WorkersCumulativeStatisticsList */ protected function getCumulativeStatistics() { return $this->proxy()->cumulativeStatistics; } /** * Access the statistics * * @return \Twilio\Rest\Taskrouter\V1\Workspace\Worker\WorkerStatisticsList */ protected function getStatistics() { return $this->proxy()->statistics; } /** * Access the reservations * * @return \Twilio\Rest\Taskrouter\V1\Workspace\Worker\ReservationList */ protected function getReservations() { return $this->proxy()->reservations; } /** * Access the workerChannels * * @return \Twilio\Rest\Taskrouter\V1\Workspace\Worker\WorkerChannelList */ protected function getWorkerChannels() { return $this->proxy()->workerChannels; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Taskrouter.V1.WorkerInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/ActivityPage.php 0000644 00000001404 15002236443 0017767 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace; use Twilio\Page; class ActivityPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new ActivityInstance($this->version, $payload, $this->solution['workspaceSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Taskrouter.V1.ActivityPage]'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowRealTimeStatisticsInstance.php 0000644 00000010622 15002236443 0026207 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\Workflow; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property int $longestTaskWaitingAge * @property string $longestTaskWaitingSid * @property array $tasksByPriority * @property array $tasksByStatus * @property int $totalTasks * @property string $workflowSid * @property string $workspaceSid * @property string $url */ class WorkflowRealTimeStatisticsInstance extends InstanceResource { /** * Initialize the WorkflowRealTimeStatisticsInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $workspaceSid The SID of the Workspace that contains the * Workflow. * @param string $workflowSid Returns the list of Tasks that are being * controlled by the Workflow with the specified SID * value * @return \Twilio\Rest\Taskrouter\V1\Workspace\Workflow\WorkflowRealTimeStatisticsInstance */ public function __construct(Version $version, array $payload, $workspaceSid, $workflowSid) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'accountSid' => Values::array_get($payload, 'account_sid'), 'longestTaskWaitingAge' => Values::array_get($payload, 'longest_task_waiting_age'), 'longestTaskWaitingSid' => Values::array_get($payload, 'longest_task_waiting_sid'), 'tasksByPriority' => Values::array_get($payload, 'tasks_by_priority'), 'tasksByStatus' => Values::array_get($payload, 'tasks_by_status'), 'totalTasks' => Values::array_get($payload, 'total_tasks'), 'workflowSid' => Values::array_get($payload, 'workflow_sid'), 'workspaceSid' => Values::array_get($payload, 'workspace_sid'), 'url' => Values::array_get($payload, 'url'), ); $this->solution = array('workspaceSid' => $workspaceSid, 'workflowSid' => $workflowSid, ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Taskrouter\V1\Workspace\Workflow\WorkflowRealTimeStatisticsContext Context for this * WorkflowRealTimeStatisticsInstance */ protected function proxy() { if (!$this->context) { $this->context = new WorkflowRealTimeStatisticsContext( $this->version, $this->solution['workspaceSid'], $this->solution['workflowSid'] ); } return $this->context; } /** * Fetch a WorkflowRealTimeStatisticsInstance * * @param array|Options $options Optional Arguments * @return WorkflowRealTimeStatisticsInstance Fetched * WorkflowRealTimeStatisticsInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch($options = array()) { return $this->proxy()->fetch($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Taskrouter.V1.WorkflowRealTimeStatisticsInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowStatisticsList.php 0000644 00000003171 15002236443 0023734 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\Workflow; use Twilio\ListResource; use Twilio\Version; class WorkflowStatisticsList extends ListResource { /** * Construct the WorkflowStatisticsList * * @param Version $version Version that contains the resource * @param string $workspaceSid The SID of the Workspace that contains the * Workflow * @param string $workflowSid Returns the list of Tasks that are being * controlled by the Workflow with the specified SID * value * @return \Twilio\Rest\Taskrouter\V1\Workspace\Workflow\WorkflowStatisticsList */ public function __construct(Version $version, $workspaceSid, $workflowSid) { parent::__construct($version); // Path Solution $this->solution = array('workspaceSid' => $workspaceSid, 'workflowSid' => $workflowSid, ); } /** * Constructs a WorkflowStatisticsContext * * @return \Twilio\Rest\Taskrouter\V1\Workspace\Workflow\WorkflowStatisticsContext */ public function getContext() { return new WorkflowStatisticsContext( $this->version, $this->solution['workspaceSid'], $this->solution['workflowSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Taskrouter.V1.WorkflowStatisticsList]'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowStatisticsOptions.php 0000644 00000013227 15002236443 0024457 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\Workflow; use Twilio\Options; use Twilio\Values; abstract class WorkflowStatisticsOptions { /** * @param int $minutes Only calculate statistics since this many minutes in the * past * @param \DateTime $startDate Only calculate statistics from on or after this * date * @param \DateTime $endDate Only calculate statistics from this date and time * and earlier * @param string $taskChannel Only calculate real-time statistics on this * TaskChannel. * @param string $splitByWaitTime A comma separated list of values that * describes the thresholds to calculate * statistics on * @return FetchWorkflowStatisticsOptions Options builder */ public static function fetch($minutes = Values::NONE, $startDate = Values::NONE, $endDate = Values::NONE, $taskChannel = Values::NONE, $splitByWaitTime = Values::NONE) { return new FetchWorkflowStatisticsOptions($minutes, $startDate, $endDate, $taskChannel, $splitByWaitTime); } } class FetchWorkflowStatisticsOptions extends Options { /** * @param int $minutes Only calculate statistics since this many minutes in the * past * @param \DateTime $startDate Only calculate statistics from on or after this * date * @param \DateTime $endDate Only calculate statistics from this date and time * and earlier * @param string $taskChannel Only calculate real-time statistics on this * TaskChannel. * @param string $splitByWaitTime A comma separated list of values that * describes the thresholds to calculate * statistics on */ public function __construct($minutes = Values::NONE, $startDate = Values::NONE, $endDate = Values::NONE, $taskChannel = Values::NONE, $splitByWaitTime = Values::NONE) { $this->options['minutes'] = $minutes; $this->options['startDate'] = $startDate; $this->options['endDate'] = $endDate; $this->options['taskChannel'] = $taskChannel; $this->options['splitByWaitTime'] = $splitByWaitTime; } /** * Only calculate statistics since this many minutes in the past. The default 15 minutes. This is helpful for displaying statistics for the last 15 minutes, 240 minutes (4 hours), and 480 minutes (8 hours) to see trends. * * @param int $minutes Only calculate statistics since this many minutes in the * past * @return $this Fluent Builder */ public function setMinutes($minutes) { $this->options['minutes'] = $minutes; return $this; } /** * Only calculate statistics from this date and time and later, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. * * @param \DateTime $startDate Only calculate statistics from on or after this * date * @return $this Fluent Builder */ public function setStartDate($startDate) { $this->options['startDate'] = $startDate; return $this; } /** * Only calculate statistics from this date and time and earlier, specified in GMT as an [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time. * * @param \DateTime $endDate Only calculate statistics from this date and time * and earlier * @return $this Fluent Builder */ public function setEndDate($endDate) { $this->options['endDate'] = $endDate; return $this; } /** * Only calculate real-time statistics on this TaskChannel. Can be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`. * * @param string $taskChannel Only calculate real-time statistics on this * TaskChannel. * @return $this Fluent Builder */ public function setTaskChannel($taskChannel) { $this->options['taskChannel'] = $taskChannel; return $this; } /** * A comma separated list of values that describes the thresholds, in seconds, to calculate statistics on. For each threshold specified, the number of Tasks canceled and reservations accepted above and below the specified thresholds in seconds are computed. For example, `5,30` would show splits of Tasks that were canceled or accepted before and after 5 seconds and before and after 30 seconds. This can be used to show short abandoned Tasks or Tasks that failed to meet an SLA. * * @param string $splitByWaitTime A comma separated list of values that * describes the thresholds to calculate * statistics on * @return $this Fluent Builder */ public function setSplitByWaitTime($splitByWaitTime) { $this->options['splitByWaitTime'] = $splitByWaitTime; 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.Taskrouter.V1.FetchWorkflowStatisticsOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowCumulativeStatisticsOptions.php 0000644 00000013262 15002236443 0026515 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\Workflow; use Twilio\Options; use Twilio\Values; abstract class WorkflowCumulativeStatisticsOptions { /** * @param \DateTime $endDate Only include usage that occurred on or before this * date * @param int $minutes Only calculate statistics since this many minutes in the * past * @param \DateTime $startDate Only calculate statistics from on or after this * date * @param string $taskChannel Only calculate cumulative statistics on this * TaskChannel * @param string $splitByWaitTime A comma separated list of values that * describes the thresholds to calculate * statistics on * @return FetchWorkflowCumulativeStatisticsOptions Options builder */ public static function fetch($endDate = Values::NONE, $minutes = Values::NONE, $startDate = Values::NONE, $taskChannel = Values::NONE, $splitByWaitTime = Values::NONE) { return new FetchWorkflowCumulativeStatisticsOptions($endDate, $minutes, $startDate, $taskChannel, $splitByWaitTime); } } class FetchWorkflowCumulativeStatisticsOptions extends Options { /** * @param \DateTime $endDate Only include usage that occurred on or before this * date * @param int $minutes Only calculate statistics since this many minutes in the * past * @param \DateTime $startDate Only calculate statistics from on or after this * date * @param string $taskChannel Only calculate cumulative statistics on this * TaskChannel * @param string $splitByWaitTime A comma separated list of values that * describes the thresholds to calculate * statistics on */ public function __construct($endDate = Values::NONE, $minutes = Values::NONE, $startDate = Values::NONE, $taskChannel = Values::NONE, $splitByWaitTime = Values::NONE) { $this->options['endDate'] = $endDate; $this->options['minutes'] = $minutes; $this->options['startDate'] = $startDate; $this->options['taskChannel'] = $taskChannel; $this->options['splitByWaitTime'] = $splitByWaitTime; } /** * Only include usage that occurred on or before this date, specified in GMT as an [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time. * * @param \DateTime $endDate Only include usage that occurred on or before this * date * @return $this Fluent Builder */ public function setEndDate($endDate) { $this->options['endDate'] = $endDate; return $this; } /** * Only calculate statistics since this many minutes in the past. The default 15 minutes. This is helpful for displaying statistics for the last 15 minutes, 240 minutes (4 hours), and 480 minutes (8 hours) to see trends. * * @param int $minutes Only calculate statistics since this many minutes in the * past * @return $this Fluent Builder */ public function setMinutes($minutes) { $this->options['minutes'] = $minutes; return $this; } /** * Only calculate statistics from this date and time and later, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. * * @param \DateTime $startDate Only calculate statistics from on or after this * date * @return $this Fluent Builder */ public function setStartDate($startDate) { $this->options['startDate'] = $startDate; return $this; } /** * Only calculate cumulative statistics on this TaskChannel. Can be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`. * * @param string $taskChannel Only calculate cumulative statistics on this * TaskChannel * @return $this Fluent Builder */ public function setTaskChannel($taskChannel) { $this->options['taskChannel'] = $taskChannel; return $this; } /** * A comma separated list of values that describes the thresholds, in seconds, to calculate statistics on. For each threshold specified, the number of Tasks canceled and reservations accepted above and below the specified thresholds in seconds are computed. For example, `5,30` would show splits of Tasks that were canceled or accepted before and after 5 seconds and before and after 30 seconds. This can be used to show short abandoned Tasks or Tasks that failed to meet an SLA. * * @param string $splitByWaitTime A comma separated list of values that * describes the thresholds to calculate * statistics on * @return $this Fluent Builder */ public function setSplitByWaitTime($splitByWaitTime) { $this->options['splitByWaitTime'] = $splitByWaitTime; 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.Taskrouter.V1.FetchWorkflowCumulativeStatisticsOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowStatisticsPage.php 0000644 00000001605 15002236443 0023675 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\Workflow; use Twilio\Page; class WorkflowStatisticsPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new WorkflowStatisticsInstance( $this->version, $payload, $this->solution['workspaceSid'], $this->solution['workflowSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Taskrouter.V1.WorkflowStatisticsPage]'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowCumulativeStatisticsContext.php 0000644 00000005477 15002236443 0026517 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\Workflow; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class WorkflowCumulativeStatisticsContext extends InstanceContext { /** * Initialize the WorkflowCumulativeStatisticsContext * * @param \Twilio\Version $version Version that contains the resource * @param string $workspaceSid The SID of the Workspace with the resource to * fetch * @param string $workflowSid Returns the list of Tasks that are being * controlled by the Workflow with the specified Sid * value * @return \Twilio\Rest\Taskrouter\V1\Workspace\Workflow\WorkflowCumulativeStatisticsContext */ public function __construct(Version $version, $workspaceSid, $workflowSid) { parent::__construct($version); // Path Solution $this->solution = array('workspaceSid' => $workspaceSid, 'workflowSid' => $workflowSid, ); $this->uri = '/Workspaces/' . \rawurlencode($workspaceSid) . '/Workflows/' . \rawurlencode($workflowSid) . '/CumulativeStatistics'; } /** * Fetch a WorkflowCumulativeStatisticsInstance * * @param array|Options $options Optional Arguments * @return WorkflowCumulativeStatisticsInstance Fetched * WorkflowCumulativeStatisticsInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch($options = array()) { $options = new Values($options); $params = Values::of(array( 'EndDate' => Serialize::iso8601DateTime($options['endDate']), 'Minutes' => $options['minutes'], 'StartDate' => Serialize::iso8601DateTime($options['startDate']), 'TaskChannel' => $options['taskChannel'], 'SplitByWaitTime' => $options['splitByWaitTime'], )); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new WorkflowCumulativeStatisticsInstance( $this->version, $payload, $this->solution['workspaceSid'], $this->solution['workflowSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Taskrouter.V1.WorkflowCumulativeStatisticsContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowCumulativeStatisticsList.php 0000644 00000003300 15002236443 0025765 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\Workflow; use Twilio\ListResource; use Twilio\Version; class WorkflowCumulativeStatisticsList extends ListResource { /** * Construct the WorkflowCumulativeStatisticsList * * @param Version $version Version that contains the resource * @param string $workspaceSid The SID of the Workspace that contains the * Workflow. * @param string $workflowSid Returns the list of Tasks that are being * controlled by the Workflow with the specified Sid * value * @return \Twilio\Rest\Taskrouter\V1\Workspace\Workflow\WorkflowCumulativeStatisticsList */ public function __construct(Version $version, $workspaceSid, $workflowSid) { parent::__construct($version); // Path Solution $this->solution = array('workspaceSid' => $workspaceSid, 'workflowSid' => $workflowSid, ); } /** * Constructs a WorkflowCumulativeStatisticsContext * * @return \Twilio\Rest\Taskrouter\V1\Workspace\Workflow\WorkflowCumulativeStatisticsContext */ public function getContext() { return new WorkflowCumulativeStatisticsContext( $this->version, $this->solution['workspaceSid'], $this->solution['workflowSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Taskrouter.V1.WorkflowCumulativeStatisticsList]'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowStatisticsContext.php 0000644 00000005261 15002236443 0024447 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\Workflow; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class WorkflowStatisticsContext extends InstanceContext { /** * Initialize the WorkflowStatisticsContext * * @param \Twilio\Version $version Version that contains the resource * @param string $workspaceSid The SID of the Workspace with the Workflow to * fetch * @param string $workflowSid Returns the list of Tasks that are being * controlled by the Workflow with the specified SID * value * @return \Twilio\Rest\Taskrouter\V1\Workspace\Workflow\WorkflowStatisticsContext */ public function __construct(Version $version, $workspaceSid, $workflowSid) { parent::__construct($version); // Path Solution $this->solution = array('workspaceSid' => $workspaceSid, 'workflowSid' => $workflowSid, ); $this->uri = '/Workspaces/' . \rawurlencode($workspaceSid) . '/Workflows/' . \rawurlencode($workflowSid) . '/Statistics'; } /** * Fetch a WorkflowStatisticsInstance * * @param array|Options $options Optional Arguments * @return WorkflowStatisticsInstance Fetched WorkflowStatisticsInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch($options = array()) { $options = new Values($options); $params = Values::of(array( 'Minutes' => $options['minutes'], 'StartDate' => Serialize::iso8601DateTime($options['startDate']), 'EndDate' => Serialize::iso8601DateTime($options['endDate']), 'TaskChannel' => $options['taskChannel'], 'SplitByWaitTime' => $options['splitByWaitTime'], )); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new WorkflowStatisticsInstance( $this->version, $payload, $this->solution['workspaceSid'], $this->solution['workflowSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Taskrouter.V1.WorkflowStatisticsContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowRealTimeStatisticsList.php 0000644 00000003262 15002236443 0025360 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\Workflow; use Twilio\ListResource; use Twilio\Version; class WorkflowRealTimeStatisticsList extends ListResource { /** * Construct the WorkflowRealTimeStatisticsList * * @param Version $version Version that contains the resource * @param string $workspaceSid The SID of the Workspace that contains the * Workflow. * @param string $workflowSid Returns the list of Tasks that are being * controlled by the Workflow with the specified SID * value * @return \Twilio\Rest\Taskrouter\V1\Workspace\Workflow\WorkflowRealTimeStatisticsList */ public function __construct(Version $version, $workspaceSid, $workflowSid) { parent::__construct($version); // Path Solution $this->solution = array('workspaceSid' => $workspaceSid, 'workflowSid' => $workflowSid, ); } /** * Constructs a WorkflowRealTimeStatisticsContext * * @return \Twilio\Rest\Taskrouter\V1\Workspace\Workflow\WorkflowRealTimeStatisticsContext */ public function getContext() { return new WorkflowRealTimeStatisticsContext( $this->version, $this->solution['workspaceSid'], $this->solution['workflowSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Taskrouter.V1.WorkflowRealTimeStatisticsList]'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowStatisticsInstance.php 0000644 00000007555 15002236443 0024577 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\Workflow; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property array $cumulative * @property array $realtime * @property string $workflowSid * @property string $workspaceSid * @property string $url */ class WorkflowStatisticsInstance extends InstanceResource { /** * Initialize the WorkflowStatisticsInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $workspaceSid The SID of the Workspace that contains the * Workflow * @param string $workflowSid Returns the list of Tasks that are being * controlled by the Workflow with the specified SID * value * @return \Twilio\Rest\Taskrouter\V1\Workspace\Workflow\WorkflowStatisticsInstance */ public function __construct(Version $version, array $payload, $workspaceSid, $workflowSid) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'accountSid' => Values::array_get($payload, 'account_sid'), 'cumulative' => Values::array_get($payload, 'cumulative'), 'realtime' => Values::array_get($payload, 'realtime'), 'workflowSid' => Values::array_get($payload, 'workflow_sid'), 'workspaceSid' => Values::array_get($payload, 'workspace_sid'), 'url' => Values::array_get($payload, 'url'), ); $this->solution = array('workspaceSid' => $workspaceSid, 'workflowSid' => $workflowSid, ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Taskrouter\V1\Workspace\Workflow\WorkflowStatisticsContext Context for this * WorkflowStatisticsInstance */ protected function proxy() { if (!$this->context) { $this->context = new WorkflowStatisticsContext( $this->version, $this->solution['workspaceSid'], $this->solution['workflowSid'] ); } return $this->context; } /** * Fetch a WorkflowStatisticsInstance * * @param array|Options $options Optional Arguments * @return WorkflowStatisticsInstance Fetched WorkflowStatisticsInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch($options = array()) { return $this->proxy()->fetch($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Taskrouter.V1.WorkflowStatisticsInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowCumulativeStatisticsInstance.php 0000644 00000014102 15002236443 0026620 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\Workflow; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property int $avgTaskAcceptanceTime * @property \DateTime $startTime * @property \DateTime $endTime * @property int $reservationsCreated * @property int $reservationsAccepted * @property int $reservationsRejected * @property int $reservationsTimedOut * @property int $reservationsCanceled * @property int $reservationsRescinded * @property array $splitByWaitTime * @property array $waitDurationUntilAccepted * @property array $waitDurationUntilCanceled * @property int $tasksCanceled * @property int $tasksCompleted * @property int $tasksEntered * @property int $tasksDeleted * @property int $tasksMoved * @property int $tasksTimedOutInWorkflow * @property string $workflowSid * @property string $workspaceSid * @property string $url */ class WorkflowCumulativeStatisticsInstance extends InstanceResource { /** * Initialize the WorkflowCumulativeStatisticsInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $workspaceSid The SID of the Workspace that contains the * Workflow. * @param string $workflowSid Returns the list of Tasks that are being * controlled by the Workflow with the specified Sid * value * @return \Twilio\Rest\Taskrouter\V1\Workspace\Workflow\WorkflowCumulativeStatisticsInstance */ public function __construct(Version $version, array $payload, $workspaceSid, $workflowSid) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'accountSid' => Values::array_get($payload, 'account_sid'), 'avgTaskAcceptanceTime' => Values::array_get($payload, 'avg_task_acceptance_time'), 'startTime' => Deserialize::dateTime(Values::array_get($payload, 'start_time')), 'endTime' => Deserialize::dateTime(Values::array_get($payload, 'end_time')), 'reservationsCreated' => Values::array_get($payload, 'reservations_created'), 'reservationsAccepted' => Values::array_get($payload, 'reservations_accepted'), 'reservationsRejected' => Values::array_get($payload, 'reservations_rejected'), 'reservationsTimedOut' => Values::array_get($payload, 'reservations_timed_out'), 'reservationsCanceled' => Values::array_get($payload, 'reservations_canceled'), 'reservationsRescinded' => Values::array_get($payload, 'reservations_rescinded'), 'splitByWaitTime' => Values::array_get($payload, 'split_by_wait_time'), 'waitDurationUntilAccepted' => Values::array_get($payload, 'wait_duration_until_accepted'), 'waitDurationUntilCanceled' => Values::array_get($payload, 'wait_duration_until_canceled'), 'tasksCanceled' => Values::array_get($payload, 'tasks_canceled'), 'tasksCompleted' => Values::array_get($payload, 'tasks_completed'), 'tasksEntered' => Values::array_get($payload, 'tasks_entered'), 'tasksDeleted' => Values::array_get($payload, 'tasks_deleted'), 'tasksMoved' => Values::array_get($payload, 'tasks_moved'), 'tasksTimedOutInWorkflow' => Values::array_get($payload, 'tasks_timed_out_in_workflow'), 'workflowSid' => Values::array_get($payload, 'workflow_sid'), 'workspaceSid' => Values::array_get($payload, 'workspace_sid'), 'url' => Values::array_get($payload, 'url'), ); $this->solution = array('workspaceSid' => $workspaceSid, 'workflowSid' => $workflowSid, ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Taskrouter\V1\Workspace\Workflow\WorkflowCumulativeStatisticsContext Context for this * WorkflowCumulativeStatisticsInstance */ protected function proxy() { if (!$this->context) { $this->context = new WorkflowCumulativeStatisticsContext( $this->version, $this->solution['workspaceSid'], $this->solution['workflowSid'] ); } return $this->context; } /** * Fetch a WorkflowCumulativeStatisticsInstance * * @param array|Options $options Optional Arguments * @return WorkflowCumulativeStatisticsInstance Fetched * WorkflowCumulativeStatisticsInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch($options = array()) { return $this->proxy()->fetch($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Taskrouter.V1.WorkflowCumulativeStatisticsInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowCumulativeStatisticsPage.php 0000644 00000001643 15002236443 0025736 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\Workflow; use Twilio\Page; class WorkflowCumulativeStatisticsPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new WorkflowCumulativeStatisticsInstance( $this->version, $payload, $this->solution['workspaceSid'], $this->solution['workflowSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Taskrouter.V1.WorkflowCumulativeStatisticsPage]'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowRealTimeStatisticsOptions.php 0000644 00000003531 15002236443 0026077 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\Workflow; use Twilio\Options; use Twilio\Values; abstract class WorkflowRealTimeStatisticsOptions { /** * @param string $taskChannel Only calculate real-time statistics on this * TaskChannel * @return FetchWorkflowRealTimeStatisticsOptions Options builder */ public static function fetch($taskChannel = Values::NONE) { return new FetchWorkflowRealTimeStatisticsOptions($taskChannel); } } class FetchWorkflowRealTimeStatisticsOptions extends Options { /** * @param string $taskChannel Only calculate real-time statistics on this * TaskChannel */ public function __construct($taskChannel = Values::NONE) { $this->options['taskChannel'] = $taskChannel; } /** * Only calculate real-time statistics on this TaskChannel. Can be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`. * * @param string $taskChannel Only calculate real-time statistics on this * TaskChannel * @return $this Fluent Builder */ public function setTaskChannel($taskChannel) { $this->options['taskChannel'] = $taskChannel; 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.Taskrouter.V1.FetchWorkflowRealTimeStatisticsOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowRealTimeStatisticsContext.php 0000644 00000004774 15002236443 0026102 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\Workflow; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Values; use Twilio\Version; class WorkflowRealTimeStatisticsContext extends InstanceContext { /** * Initialize the WorkflowRealTimeStatisticsContext * * @param \Twilio\Version $version Version that contains the resource * @param string $workspaceSid The SID of the Workspace with the Workflow to * fetch * @param string $workflowSid Returns the list of Tasks that are being * controlled by the Workflow with the specified SID * value * @return \Twilio\Rest\Taskrouter\V1\Workspace\Workflow\WorkflowRealTimeStatisticsContext */ public function __construct(Version $version, $workspaceSid, $workflowSid) { parent::__construct($version); // Path Solution $this->solution = array('workspaceSid' => $workspaceSid, 'workflowSid' => $workflowSid, ); $this->uri = '/Workspaces/' . \rawurlencode($workspaceSid) . '/Workflows/' . \rawurlencode($workflowSid) . '/RealTimeStatistics'; } /** * Fetch a WorkflowRealTimeStatisticsInstance * * @param array|Options $options Optional Arguments * @return WorkflowRealTimeStatisticsInstance Fetched * WorkflowRealTimeStatisticsInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch($options = array()) { $options = new Values($options); $params = Values::of(array('TaskChannel' => $options['taskChannel'], )); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new WorkflowRealTimeStatisticsInstance( $this->version, $payload, $this->solution['workspaceSid'], $this->solution['workflowSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Taskrouter.V1.WorkflowRealTimeStatisticsContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowRealTimeStatisticsPage.php 0000644 00000001635 15002236443 0025323 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\Workflow; use Twilio\Page; class WorkflowRealTimeStatisticsPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new WorkflowRealTimeStatisticsInstance( $this->version, $payload, $this->solution['workspaceSid'], $this->solution['workflowSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Taskrouter.V1.WorkflowRealTimeStatisticsPage]'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/EventOptions.php 0000644 00000020070 15002236443 0020033 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace; use Twilio\Options; use Twilio\Values; abstract class EventOptions { /** * @param \DateTime $endDate Only include usage that occurred on or before this * date * @param string $eventType The type of Events to read * @param int $minutes The period of events to read in minutes * @param string $reservationSid The SID of the Reservation with the Events to * read * @param \DateTime $startDate Only include Events from on or after this date * @param string $taskQueueSid The SID of the TaskQueue with the Events to read * @param string $taskSid The SID of the Task with the Events to read * @param string $workerSid The SID of the Worker with the Events to read * @param string $workflowSid The SID of the Worker with the Events to read * @param string $taskChannel The TaskChannel with the Events to read * @param string $sid The unique string that identifies the resource * @return ReadEventOptions Options builder */ public static function read($endDate = Values::NONE, $eventType = Values::NONE, $minutes = Values::NONE, $reservationSid = Values::NONE, $startDate = Values::NONE, $taskQueueSid = Values::NONE, $taskSid = Values::NONE, $workerSid = Values::NONE, $workflowSid = Values::NONE, $taskChannel = Values::NONE, $sid = Values::NONE) { return new ReadEventOptions($endDate, $eventType, $minutes, $reservationSid, $startDate, $taskQueueSid, $taskSid, $workerSid, $workflowSid, $taskChannel, $sid); } } class ReadEventOptions extends Options { /** * @param \DateTime $endDate Only include usage that occurred on or before this * date * @param string $eventType The type of Events to read * @param int $minutes The period of events to read in minutes * @param string $reservationSid The SID of the Reservation with the Events to * read * @param \DateTime $startDate Only include Events from on or after this date * @param string $taskQueueSid The SID of the TaskQueue with the Events to read * @param string $taskSid The SID of the Task with the Events to read * @param string $workerSid The SID of the Worker with the Events to read * @param string $workflowSid The SID of the Worker with the Events to read * @param string $taskChannel The TaskChannel with the Events to read * @param string $sid The unique string that identifies the resource */ public function __construct($endDate = Values::NONE, $eventType = Values::NONE, $minutes = Values::NONE, $reservationSid = Values::NONE, $startDate = Values::NONE, $taskQueueSid = Values::NONE, $taskSid = Values::NONE, $workerSid = Values::NONE, $workflowSid = Values::NONE, $taskChannel = Values::NONE, $sid = Values::NONE) { $this->options['endDate'] = $endDate; $this->options['eventType'] = $eventType; $this->options['minutes'] = $minutes; $this->options['reservationSid'] = $reservationSid; $this->options['startDate'] = $startDate; $this->options['taskQueueSid'] = $taskQueueSid; $this->options['taskSid'] = $taskSid; $this->options['workerSid'] = $workerSid; $this->options['workflowSid'] = $workflowSid; $this->options['taskChannel'] = $taskChannel; $this->options['sid'] = $sid; } /** * Only include Events that occurred on or before this date, specified in GMT as an [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time. * * @param \DateTime $endDate Only include usage that occurred on or before this * date * @return $this Fluent Builder */ public function setEndDate($endDate) { $this->options['endDate'] = $endDate; return $this; } /** * The type of Events to read. Returns only Events of the type specified. * * @param string $eventType The type of Events to read * @return $this Fluent Builder */ public function setEventType($eventType) { $this->options['eventType'] = $eventType; return $this; } /** * The period of events to read in minutes. Returns only Events that occurred since this many minutes in the past. The default is `15` minutes. * * @param int $minutes The period of events to read in minutes * @return $this Fluent Builder */ public function setMinutes($minutes) { $this->options['minutes'] = $minutes; return $this; } /** * The SID of the Reservation with the Events to read. Returns only Events that pertain to the specified Reservation. * * @param string $reservationSid The SID of the Reservation with the Events to * read * @return $this Fluent Builder */ public function setReservationSid($reservationSid) { $this->options['reservationSid'] = $reservationSid; return $this; } /** * Only include Events from on or after this date and time, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. * * @param \DateTime $startDate Only include Events from on or after this date * @return $this Fluent Builder */ public function setStartDate($startDate) { $this->options['startDate'] = $startDate; return $this; } /** * The SID of the TaskQueue with the Events to read. Returns only the Events that pertain to the specified TaskQueue. * * @param string $taskQueueSid The SID of the TaskQueue with the Events to read * @return $this Fluent Builder */ public function setTaskQueueSid($taskQueueSid) { $this->options['taskQueueSid'] = $taskQueueSid; return $this; } /** * The SID of the Task with the Events to read. Returns only the Events that pertain to the specified Task. * * @param string $taskSid The SID of the Task with the Events to read * @return $this Fluent Builder */ public function setTaskSid($taskSid) { $this->options['taskSid'] = $taskSid; return $this; } /** * The SID of the Worker with the Events to read. Returns only the Events that pertain to the specified Worker. * * @param string $workerSid The SID of the Worker with the Events to read * @return $this Fluent Builder */ public function setWorkerSid($workerSid) { $this->options['workerSid'] = $workerSid; return $this; } /** * The SID of the Workflow with the Events to read. Returns only the Events that pertain to the specified Workflow. * * @param string $workflowSid The SID of the Worker with the Events to read * @return $this Fluent Builder */ public function setWorkflowSid($workflowSid) { $this->options['workflowSid'] = $workflowSid; return $this; } /** * The TaskChannel with the Events to read. Returns only the Events that pertain to the specified TaskChannel. * * @param string $taskChannel The TaskChannel with the Events to read * @return $this Fluent Builder */ public function setTaskChannel($taskChannel) { $this->options['taskChannel'] = $taskChannel; return $this; } /** * The SID of the Event resource to read. * * @param string $sid The unique string that identifies the resource * @return $this Fluent Builder */ public function setSid($sid) { $this->options['sid'] = $sid; 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.Taskrouter.V1.ReadEventOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkflowPage.php 0000644 00000001404 15002236443 0020005 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace; use Twilio\Page; class WorkflowPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new WorkflowInstance($this->version, $payload, $this->solution['workspaceSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Taskrouter.V1.WorkflowPage]'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceStatisticsList.php 0000644 00000002345 15002236443 0022250 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace; use Twilio\ListResource; use Twilio\Version; class WorkspaceStatisticsList extends ListResource { /** * Construct the WorkspaceStatisticsList * * @param Version $version Version that contains the resource * @param string $workspaceSid The SID of the Workspace * @return \Twilio\Rest\Taskrouter\V1\Workspace\WorkspaceStatisticsList */ public function __construct(Version $version, $workspaceSid) { parent::__construct($version); // Path Solution $this->solution = array('workspaceSid' => $workspaceSid, ); } /** * Constructs a WorkspaceStatisticsContext * * @return \Twilio\Rest\Taskrouter\V1\Workspace\WorkspaceStatisticsContext */ public function getContext() { return new WorkspaceStatisticsContext($this->version, $this->solution['workspaceSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Taskrouter.V1.WorkspaceStatisticsList]'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueuePage.php 0000644 00000001407 15002236443 0020105 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace; use Twilio\Page; class TaskQueuePage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new TaskQueueInstance($this->version, $payload, $this->solution['workspaceSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Taskrouter.V1.TaskQueuePage]'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceCumulativeStatisticsList.php 0000644 00000002453 15002236443 0024307 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace; use Twilio\ListResource; use Twilio\Version; class WorkspaceCumulativeStatisticsList extends ListResource { /** * Construct the WorkspaceCumulativeStatisticsList * * @param Version $version Version that contains the resource * @param string $workspaceSid The SID of the Workspace * @return \Twilio\Rest\Taskrouter\V1\Workspace\WorkspaceCumulativeStatisticsList */ public function __construct(Version $version, $workspaceSid) { parent::__construct($version); // Path Solution $this->solution = array('workspaceSid' => $workspaceSid, ); } /** * Constructs a WorkspaceCumulativeStatisticsContext * * @return \Twilio\Rest\Taskrouter\V1\Workspace\WorkspaceCumulativeStatisticsContext */ public function getContext() { return new WorkspaceCumulativeStatisticsContext($this->version, $this->solution['workspaceSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Taskrouter.V1.WorkspaceCumulativeStatisticsList]'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskOptions.php 0000644 00000043562 15002236443 0017667 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace; use Twilio\Options; use Twilio\Values; abstract class TaskOptions { /** * @param string $attributes The JSON string that describes the custom * attributes of the task * @param string $assignmentStatus The new status of the task * @param string $reason The reason that the Task was canceled or complete * @param int $priority The Task's new priority value * @param string $taskChannel When MultiTasking is enabled, specify the * TaskChannel with the task to update * @return UpdateTaskOptions Options builder */ public static function update($attributes = Values::NONE, $assignmentStatus = Values::NONE, $reason = Values::NONE, $priority = Values::NONE, $taskChannel = Values::NONE) { return new UpdateTaskOptions($attributes, $assignmentStatus, $reason, $priority, $taskChannel); } /** * @param int $priority The priority value of the Tasks to read * @param string $assignmentStatus Returns the list of all Tasks in the * Workspace with the specified * assignment_status * @param string $workflowSid The SID of the Workflow with the Tasks to read * @param string $workflowName The friendly name of the Workflow with the Tasks * to read * @param string $taskQueueSid The SID of the TaskQueue with the Tasks to read * @param string $taskQueueName The friendly_name of the TaskQueue with the * Tasks to read * @param string $evaluateTaskAttributes The task attributes of the Tasks to * read * @param string $ordering Controls the order of the Tasks returned * @param bool $hasAddons Whether to read Tasks with addons * @return ReadTaskOptions Options builder */ public static function read($priority = Values::NONE, $assignmentStatus = Values::NONE, $workflowSid = Values::NONE, $workflowName = Values::NONE, $taskQueueSid = Values::NONE, $taskQueueName = Values::NONE, $evaluateTaskAttributes = Values::NONE, $ordering = Values::NONE, $hasAddons = Values::NONE) { return new ReadTaskOptions($priority, $assignmentStatus, $workflowSid, $workflowName, $taskQueueSid, $taskQueueName, $evaluateTaskAttributes, $ordering, $hasAddons); } /** * @param int $timeout The amount of time in seconds the task is allowed to live * @param int $priority The priority to assign the new task and override the * default * @param string $taskChannel When MultiTasking is enabled specify the * TaskChannel by passing either its unique_name or * SID * @param string $workflowSid The SID of the Workflow that you would like to * handle routing for the new Task * @param string $attributes A URL-encoded JSON string describing the * attributes of the task * @return CreateTaskOptions Options builder */ public static function create($timeout = Values::NONE, $priority = Values::NONE, $taskChannel = Values::NONE, $workflowSid = Values::NONE, $attributes = Values::NONE) { return new CreateTaskOptions($timeout, $priority, $taskChannel, $workflowSid, $attributes); } } class UpdateTaskOptions extends Options { /** * @param string $attributes The JSON string that describes the custom * attributes of the task * @param string $assignmentStatus The new status of the task * @param string $reason The reason that the Task was canceled or complete * @param int $priority The Task's new priority value * @param string $taskChannel When MultiTasking is enabled, specify the * TaskChannel with the task to update */ public function __construct($attributes = Values::NONE, $assignmentStatus = Values::NONE, $reason = Values::NONE, $priority = Values::NONE, $taskChannel = Values::NONE) { $this->options['attributes'] = $attributes; $this->options['assignmentStatus'] = $assignmentStatus; $this->options['reason'] = $reason; $this->options['priority'] = $priority; $this->options['taskChannel'] = $taskChannel; } /** * The JSON string that describes the custom attributes of the task. * * @param string $attributes The JSON string that describes the custom * attributes of the task * @return $this Fluent Builder */ public function setAttributes($attributes) { $this->options['attributes'] = $attributes; return $this; } /** * The new status of the task. Can be: `canceled`, to cancel a Task that is currently `pending` or `reserved`; `wrapping`, to move the Task to wrapup state; or `completed`, to move a Task to the completed state. * * @param string $assignmentStatus The new status of the task * @return $this Fluent Builder */ public function setAssignmentStatus($assignmentStatus) { $this->options['assignmentStatus'] = $assignmentStatus; return $this; } /** * The reason that the Task was canceled or completed. This parameter is required only if the Task is canceled or completed. Setting this value queues the task for deletion and logs the reason. * * @param string $reason The reason that the Task was canceled or complete * @return $this Fluent Builder */ public function setReason($reason) { $this->options['reason'] = $reason; return $this; } /** * The Task's new priority value. When supplied, the Task takes on the specified priority unless it matches a Workflow Target with a Priority set. * * @param int $priority The Task's new priority value * @return $this Fluent Builder */ public function setPriority($priority) { $this->options['priority'] = $priority; return $this; } /** * When MultiTasking is enabled, specify the TaskChannel with the task to update. Can be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`. * * @param string $taskChannel When MultiTasking is enabled, specify the * TaskChannel with the task to update * @return $this Fluent Builder */ public function setTaskChannel($taskChannel) { $this->options['taskChannel'] = $taskChannel; 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.Taskrouter.V1.UpdateTaskOptions ' . \implode(' ', $options) . ']'; } } class ReadTaskOptions extends Options { /** * @param int $priority The priority value of the Tasks to read * @param string $assignmentStatus Returns the list of all Tasks in the * Workspace with the specified * assignment_status * @param string $workflowSid The SID of the Workflow with the Tasks to read * @param string $workflowName The friendly name of the Workflow with the Tasks * to read * @param string $taskQueueSid The SID of the TaskQueue with the Tasks to read * @param string $taskQueueName The friendly_name of the TaskQueue with the * Tasks to read * @param string $evaluateTaskAttributes The task attributes of the Tasks to * read * @param string $ordering Controls the order of the Tasks returned * @param bool $hasAddons Whether to read Tasks with addons */ public function __construct($priority = Values::NONE, $assignmentStatus = Values::NONE, $workflowSid = Values::NONE, $workflowName = Values::NONE, $taskQueueSid = Values::NONE, $taskQueueName = Values::NONE, $evaluateTaskAttributes = Values::NONE, $ordering = Values::NONE, $hasAddons = Values::NONE) { $this->options['priority'] = $priority; $this->options['assignmentStatus'] = $assignmentStatus; $this->options['workflowSid'] = $workflowSid; $this->options['workflowName'] = $workflowName; $this->options['taskQueueSid'] = $taskQueueSid; $this->options['taskQueueName'] = $taskQueueName; $this->options['evaluateTaskAttributes'] = $evaluateTaskAttributes; $this->options['ordering'] = $ordering; $this->options['hasAddons'] = $hasAddons; } /** * The priority value of the Tasks to read. Returns the list of all Tasks in the Workspace with the specified priority. * * @param int $priority The priority value of the Tasks to read * @return $this Fluent Builder */ public function setPriority($priority) { $this->options['priority'] = $priority; return $this; } /** * The `assignment_status` of the Tasks to read. Can be: `pending`, `reserved`, `assigned`, `canceled`, and `completed`. Returns all Tasks in the Workspace with the specified `assignment_status`. * * @param string $assignmentStatus Returns the list of all Tasks in the * Workspace with the specified * assignment_status * @return $this Fluent Builder */ public function setAssignmentStatus($assignmentStatus) { $this->options['assignmentStatus'] = $assignmentStatus; return $this; } /** * The SID of the Workflow with the Tasks to read. Returns the Tasks controlled by the Workflow identified by this SID. * * @param string $workflowSid The SID of the Workflow with the Tasks to read * @return $this Fluent Builder */ public function setWorkflowSid($workflowSid) { $this->options['workflowSid'] = $workflowSid; return $this; } /** * The friendly name of the Workflow with the Tasks to read. Returns the Tasks controlled by the Workflow identified by this friendly name. * * @param string $workflowName The friendly name of the Workflow with the Tasks * to read * @return $this Fluent Builder */ public function setWorkflowName($workflowName) { $this->options['workflowName'] = $workflowName; return $this; } /** * The SID of the TaskQueue with the Tasks to read. Returns the Tasks waiting in the TaskQueue identified by this SID. * * @param string $taskQueueSid The SID of the TaskQueue with the Tasks to read * @return $this Fluent Builder */ public function setTaskQueueSid($taskQueueSid) { $this->options['taskQueueSid'] = $taskQueueSid; return $this; } /** * The `friendly_name` of the TaskQueue with the Tasks to read. Returns the Tasks waiting in the TaskQueue identified by this friendly name. * * @param string $taskQueueName The friendly_name of the TaskQueue with the * Tasks to read * @return $this Fluent Builder */ public function setTaskQueueName($taskQueueName) { $this->options['taskQueueName'] = $taskQueueName; return $this; } /** * The attributes of the Tasks to read. Returns the Tasks that match the attributes specified in this parameter. * * @param string $evaluateTaskAttributes The task attributes of the Tasks to * read * @return $this Fluent Builder */ public function setEvaluateTaskAttributes($evaluateTaskAttributes) { $this->options['evaluateTaskAttributes'] = $evaluateTaskAttributes; return $this; } /** * How to order the returned Task resources. y default, Tasks are sorted by ascending DateCreated. This value is specified as: `Attribute:Order`, where `Attribute` can be either `Priority` or `DateCreated` and `Order` can be either `asc` or `desc`. For example, `Priority:desc` returns Tasks ordered in descending order of their Priority. Multiple sort orders can be specified in a comma-separated list such as `Priority:desc,DateCreated:asc`, which returns the Tasks in descending Priority order and ascending DateCreated Order. * * @param string $ordering Controls the order of the Tasks returned * @return $this Fluent Builder */ public function setOrdering($ordering) { $this->options['ordering'] = $ordering; return $this; } /** * Whether to read Tasks with addons. If `true`, returns only Tasks with addons. If `false`, returns only Tasks without addons. * * @param bool $hasAddons Whether to read Tasks with addons * @return $this Fluent Builder */ public function setHasAddons($hasAddons) { $this->options['hasAddons'] = $hasAddons; 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.Taskrouter.V1.ReadTaskOptions ' . \implode(' ', $options) . ']'; } } class CreateTaskOptions extends Options { /** * @param int $timeout The amount of time in seconds the task is allowed to live * @param int $priority The priority to assign the new task and override the * default * @param string $taskChannel When MultiTasking is enabled specify the * TaskChannel by passing either its unique_name or * SID * @param string $workflowSid The SID of the Workflow that you would like to * handle routing for the new Task * @param string $attributes A URL-encoded JSON string describing the * attributes of the task */ public function __construct($timeout = Values::NONE, $priority = Values::NONE, $taskChannel = Values::NONE, $workflowSid = Values::NONE, $attributes = Values::NONE) { $this->options['timeout'] = $timeout; $this->options['priority'] = $priority; $this->options['taskChannel'] = $taskChannel; $this->options['workflowSid'] = $workflowSid; $this->options['attributes'] = $attributes; } /** * The amount of time in seconds the new task is allowed to live. Can be up to a maximum of 2 weeks (1,209,600 seconds). The default value is 24 hours (86,400 seconds). On timeout, the `task.canceled` event will fire with description `Task TTL Exceeded`. * * @param int $timeout The amount of time in seconds the task is allowed to live * @return $this Fluent Builder */ public function setTimeout($timeout) { $this->options['timeout'] = $timeout; return $this; } /** * The priority to assign the new task and override the default. When supplied, the new Task will have this priority unless it matches a Workflow Target with a Priority set. When not supplied, the new Task will have the priority of the matching Workflow Target. * * @param int $priority The priority to assign the new task and override the * default * @return $this Fluent Builder */ public function setPriority($priority) { $this->options['priority'] = $priority; return $this; } /** * When MultiTasking is enabled, specify the TaskChannel by passing either its `unique_name` or `sid`. Default value is `default`. * * @param string $taskChannel When MultiTasking is enabled specify the * TaskChannel by passing either its unique_name or * SID * @return $this Fluent Builder */ public function setTaskChannel($taskChannel) { $this->options['taskChannel'] = $taskChannel; return $this; } /** * The SID of the Workflow that you would like to handle routing for the new Task. If there is only one Workflow defined for the Workspace that you are posting the new task to, this parameter is optional. * * @param string $workflowSid The SID of the Workflow that you would like to * handle routing for the new Task * @return $this Fluent Builder */ public function setWorkflowSid($workflowSid) { $this->options['workflowSid'] = $workflowSid; return $this; } /** * A URL-encoded JSON string with the attributes of the new task. This value is passed to the Workflow's `assignment_callback_url` when the Task is assigned to a Worker. For example: `{ "task_type": "call", "twilio_call_sid": "CAxxx", "customer_ticket_number": "12345" }`. * * @param string $attributes A URL-encoded JSON string describing the * attributes of the task * @return $this Fluent Builder */ public function setAttributes($attributes) { $this->options['attributes'] = $attributes; 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.Taskrouter.V1.CreateTaskOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkerOptions.php 0000644 00000030745 15002236443 0020235 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace; use Twilio\Options; use Twilio\Values; abstract class WorkerOptions { /** * @param string $activityName The activity_name of the Worker resources to read * @param string $activitySid The activity_sid of the Worker resources to read * @param string $available Whether to return Worker resources that are * available or unavailable * @param string $friendlyName The friendly_name of the Worker resources to read * @param string $targetWorkersExpression Filter by Workers that would match an * expression on a TaskQueue * @param string $taskQueueName The friendly_name of the TaskQueue that the * Workers to read are eligible for * @param string $taskQueueSid The SID of the TaskQueue that the Workers to * read are eligible for * @return ReadWorkerOptions Options builder */ public static function read($activityName = Values::NONE, $activitySid = Values::NONE, $available = Values::NONE, $friendlyName = Values::NONE, $targetWorkersExpression = Values::NONE, $taskQueueName = Values::NONE, $taskQueueSid = Values::NONE) { return new ReadWorkerOptions($activityName, $activitySid, $available, $friendlyName, $targetWorkersExpression, $taskQueueName, $taskQueueSid); } /** * @param string $activitySid The SID of a valid Activity that describes the * new Worker's initial state * @param string $attributes A valid JSON string that describes the new Worker * @return CreateWorkerOptions Options builder */ public static function create($activitySid = Values::NONE, $attributes = Values::NONE) { return new CreateWorkerOptions($activitySid, $attributes); } /** * @param string $activitySid The SID of the Activity that describes the * Worker's initial state * @param string $attributes The JSON string that describes the Worker * @param string $friendlyName A string to describe the Worker * @param bool $rejectPendingReservations Whether to reject pending reservations * @return UpdateWorkerOptions Options builder */ public static function update($activitySid = Values::NONE, $attributes = Values::NONE, $friendlyName = Values::NONE, $rejectPendingReservations = Values::NONE) { return new UpdateWorkerOptions($activitySid, $attributes, $friendlyName, $rejectPendingReservations); } } class ReadWorkerOptions extends Options { /** * @param string $activityName The activity_name of the Worker resources to read * @param string $activitySid The activity_sid of the Worker resources to read * @param string $available Whether to return Worker resources that are * available or unavailable * @param string $friendlyName The friendly_name of the Worker resources to read * @param string $targetWorkersExpression Filter by Workers that would match an * expression on a TaskQueue * @param string $taskQueueName The friendly_name of the TaskQueue that the * Workers to read are eligible for * @param string $taskQueueSid The SID of the TaskQueue that the Workers to * read are eligible for */ public function __construct($activityName = Values::NONE, $activitySid = Values::NONE, $available = Values::NONE, $friendlyName = Values::NONE, $targetWorkersExpression = Values::NONE, $taskQueueName = Values::NONE, $taskQueueSid = Values::NONE) { $this->options['activityName'] = $activityName; $this->options['activitySid'] = $activitySid; $this->options['available'] = $available; $this->options['friendlyName'] = $friendlyName; $this->options['targetWorkersExpression'] = $targetWorkersExpression; $this->options['taskQueueName'] = $taskQueueName; $this->options['taskQueueSid'] = $taskQueueSid; } /** * The `activity_name` of the Worker resources to read. * * @param string $activityName The activity_name of the Worker resources to read * @return $this Fluent Builder */ public function setActivityName($activityName) { $this->options['activityName'] = $activityName; return $this; } /** * The `activity_sid` of the Worker resources to read. * * @param string $activitySid The activity_sid of the Worker resources to read * @return $this Fluent Builder */ public function setActivitySid($activitySid) { $this->options['activitySid'] = $activitySid; return $this; } /** * Whether to return only Worker resources that are available or unavailable. Can be `true`, `1`, or `yes` to return Worker resources that are available, and `false`, or any value returns the Worker resources that are not available. * * @param string $available Whether to return Worker resources that are * available or unavailable * @return $this Fluent Builder */ public function setAvailable($available) { $this->options['available'] = $available; return $this; } /** * The `friendly_name` of the Worker resources to read. * * @param string $friendlyName The friendly_name of the Worker resources to read * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * Filter by Workers that would match an expression on a TaskQueue. This is helpful for debugging which Workers would match a potential queue. * * @param string $targetWorkersExpression Filter by Workers that would match an * expression on a TaskQueue * @return $this Fluent Builder */ public function setTargetWorkersExpression($targetWorkersExpression) { $this->options['targetWorkersExpression'] = $targetWorkersExpression; return $this; } /** * The `friendly_name` of the TaskQueue that the Workers to read are eligible for. * * @param string $taskQueueName The friendly_name of the TaskQueue that the * Workers to read are eligible for * @return $this Fluent Builder */ public function setTaskQueueName($taskQueueName) { $this->options['taskQueueName'] = $taskQueueName; return $this; } /** * The SID of the TaskQueue that the Workers to read are eligible for. * * @param string $taskQueueSid The SID of the TaskQueue that the Workers to * read are eligible for * @return $this Fluent Builder */ public function setTaskQueueSid($taskQueueSid) { $this->options['taskQueueSid'] = $taskQueueSid; 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.Taskrouter.V1.ReadWorkerOptions ' . \implode(' ', $options) . ']'; } } class CreateWorkerOptions extends Options { /** * @param string $activitySid The SID of a valid Activity that describes the * new Worker's initial state * @param string $attributes A valid JSON string that describes the new Worker */ public function __construct($activitySid = Values::NONE, $attributes = Values::NONE) { $this->options['activitySid'] = $activitySid; $this->options['attributes'] = $attributes; } /** * The SID of a valid Activity that will describe the new Worker's initial state. See [Activities](https://www.twilio.com/docs/taskrouter/api/activity) for more information. If not provided, the new Worker's initial state is the `default_activity_sid` configured on the Workspace. * * @param string $activitySid The SID of a valid Activity that describes the * new Worker's initial state * @return $this Fluent Builder */ public function setActivitySid($activitySid) { $this->options['activitySid'] = $activitySid; return $this; } /** * A valid JSON string that describes the new Worker. For example: `{ "email": "Bob@example.com", "phone": "+5095551234" }`. This data is passed to the `assignment_callback_url` when TaskRouter assigns a Task to the Worker. Defaults to {}. * * @param string $attributes A valid JSON string that describes the new Worker * @return $this Fluent Builder */ public function setAttributes($attributes) { $this->options['attributes'] = $attributes; 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.Taskrouter.V1.CreateWorkerOptions ' . \implode(' ', $options) . ']'; } } class UpdateWorkerOptions extends Options { /** * @param string $activitySid The SID of the Activity that describes the * Worker's initial state * @param string $attributes The JSON string that describes the Worker * @param string $friendlyName A string to describe the Worker * @param bool $rejectPendingReservations Whether to reject pending reservations */ public function __construct($activitySid = Values::NONE, $attributes = Values::NONE, $friendlyName = Values::NONE, $rejectPendingReservations = Values::NONE) { $this->options['activitySid'] = $activitySid; $this->options['attributes'] = $attributes; $this->options['friendlyName'] = $friendlyName; $this->options['rejectPendingReservations'] = $rejectPendingReservations; } /** * The SID of a valid Activity that will describe the Worker's initial state. See [Activities](https://www.twilio.com/docs/taskrouter/api/activity) for more information. * * @param string $activitySid The SID of the Activity that describes the * Worker's initial state * @return $this Fluent Builder */ public function setActivitySid($activitySid) { $this->options['activitySid'] = $activitySid; return $this; } /** * The JSON string that describes the Worker. For example: `{ "email": "Bob@example.com", "phone": "+5095551234" }`. This data is passed to the `assignment_callback_url` when TaskRouter assigns a Task to the Worker. Defaults to {}. * * @param string $attributes The JSON string that describes the Worker * @return $this Fluent Builder */ public function setAttributes($attributes) { $this->options['attributes'] = $attributes; return $this; } /** * A descriptive string that you create to describe the Worker. It can be up to 64 characters long. * * @param string $friendlyName A string to describe the Worker * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * Whether to reject pending reservations. * * @param bool $rejectPendingReservations Whether to reject pending reservations * @return $this Fluent Builder */ public function setRejectPendingReservations($rejectPendingReservations) { $this->options['rejectPendingReservations'] = $rejectPendingReservations; 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.Taskrouter.V1.UpdateWorkerOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Task/ReservationContext.php 0000644 00000015231 15002236443 0022151 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\Task; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class ReservationContext extends InstanceContext { /** * Initialize the ReservationContext * * @param \Twilio\Version $version Version that contains the resource * @param string $workspaceSid The SID of the Workspace with the * TaskReservation resource to fetch * @param string $taskSid The SID of the reserved Task resource with the * TaskReservation resource to fetch * @param string $sid The SID of the TaskReservation resource to fetch * @return \Twilio\Rest\Taskrouter\V1\Workspace\Task\ReservationContext */ public function __construct(Version $version, $workspaceSid, $taskSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array('workspaceSid' => $workspaceSid, 'taskSid' => $taskSid, 'sid' => $sid, ); $this->uri = '/Workspaces/' . \rawurlencode($workspaceSid) . '/Tasks/' . \rawurlencode($taskSid) . '/Reservations/' . \rawurlencode($sid) . ''; } /** * Fetch a ReservationInstance * * @return ReservationInstance Fetched ReservationInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new ReservationInstance( $this->version, $payload, $this->solution['workspaceSid'], $this->solution['taskSid'], $this->solution['sid'] ); } /** * Update the ReservationInstance * * @param array|Options $options Optional Arguments * @return ReservationInstance Updated ReservationInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { $options = new Values($options); $data = Values::of(array( 'ReservationStatus' => $options['reservationStatus'], 'WorkerActivitySid' => $options['workerActivitySid'], 'Instruction' => $options['instruction'], 'DequeuePostWorkActivitySid' => $options['dequeuePostWorkActivitySid'], 'DequeueFrom' => $options['dequeueFrom'], 'DequeueRecord' => $options['dequeueRecord'], 'DequeueTimeout' => $options['dequeueTimeout'], 'DequeueTo' => $options['dequeueTo'], 'DequeueStatusCallbackUrl' => $options['dequeueStatusCallbackUrl'], 'CallFrom' => $options['callFrom'], 'CallRecord' => $options['callRecord'], 'CallTimeout' => $options['callTimeout'], 'CallTo' => $options['callTo'], 'CallUrl' => $options['callUrl'], 'CallStatusCallbackUrl' => $options['callStatusCallbackUrl'], 'CallAccept' => Serialize::booleanToString($options['callAccept']), 'RedirectCallSid' => $options['redirectCallSid'], 'RedirectAccept' => Serialize::booleanToString($options['redirectAccept']), 'RedirectUrl' => $options['redirectUrl'], 'To' => $options['to'], 'From' => $options['from'], 'StatusCallback' => $options['statusCallback'], 'StatusCallbackMethod' => $options['statusCallbackMethod'], 'StatusCallbackEvent' => Serialize::map($options['statusCallbackEvent'], function($e) { return $e; }), 'Timeout' => $options['timeout'], 'Record' => Serialize::booleanToString($options['record']), 'Muted' => Serialize::booleanToString($options['muted']), 'Beep' => $options['beep'], 'StartConferenceOnEnter' => Serialize::booleanToString($options['startConferenceOnEnter']), 'EndConferenceOnExit' => Serialize::booleanToString($options['endConferenceOnExit']), 'WaitUrl' => $options['waitUrl'], 'WaitMethod' => $options['waitMethod'], 'EarlyMedia' => Serialize::booleanToString($options['earlyMedia']), 'MaxParticipants' => $options['maxParticipants'], 'ConferenceStatusCallback' => $options['conferenceStatusCallback'], 'ConferenceStatusCallbackMethod' => $options['conferenceStatusCallbackMethod'], 'ConferenceStatusCallbackEvent' => Serialize::map($options['conferenceStatusCallbackEvent'], function($e) { return $e; }), 'ConferenceRecord' => $options['conferenceRecord'], 'ConferenceTrim' => $options['conferenceTrim'], 'RecordingChannels' => $options['recordingChannels'], 'RecordingStatusCallback' => $options['recordingStatusCallback'], 'RecordingStatusCallbackMethod' => $options['recordingStatusCallbackMethod'], 'ConferenceRecordingStatusCallback' => $options['conferenceRecordingStatusCallback'], 'ConferenceRecordingStatusCallbackMethod' => $options['conferenceRecordingStatusCallbackMethod'], 'Region' => $options['region'], 'SipAuthUsername' => $options['sipAuthUsername'], 'SipAuthPassword' => $options['sipAuthPassword'], 'DequeueStatusCallbackEvent' => Serialize::map($options['dequeueStatusCallbackEvent'], function($e) { return $e; }), 'PostWorkActivitySid' => $options['postWorkActivitySid'], 'SupervisorMode' => $options['supervisorMode'], 'Supervisor' => $options['supervisor'], 'EndConferenceOnCustomerExit' => Serialize::booleanToString($options['endConferenceOnCustomerExit']), 'BeepOnCustomerEntrance' => Serialize::booleanToString($options['beepOnCustomerEntrance']), )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new ReservationInstance( $this->version, $payload, $this->solution['workspaceSid'], $this->solution['taskSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Taskrouter.V1.ReservationContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Task/ReservationPage.php 0000644 00000001550 15002236443 0021400 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\Task; use Twilio\Page; class ReservationPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new ReservationInstance( $this->version, $payload, $this->solution['workspaceSid'], $this->solution['taskSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Taskrouter.V1.ReservationPage]'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Task/ReservationInstance.php 0000644 00000011476 15002236443 0022300 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\Task; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $reservationStatus * @property string $sid * @property string $taskSid * @property string $workerName * @property string $workerSid * @property string $workspaceSid * @property string $url * @property array $links */ class ReservationInstance extends InstanceResource { /** * Initialize the ReservationInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $workspaceSid The SID of the Workspace that this task is * contained within. * @param string $taskSid The SID of the reserved Task resource * @param string $sid The SID of the TaskReservation resource to fetch * @return \Twilio\Rest\Taskrouter\V1\Workspace\Task\ReservationInstance */ public function __construct(Version $version, array $payload, $workspaceSid, $taskSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'accountSid' => Values::array_get($payload, 'account_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'reservationStatus' => Values::array_get($payload, 'reservation_status'), 'sid' => Values::array_get($payload, 'sid'), 'taskSid' => Values::array_get($payload, 'task_sid'), 'workerName' => Values::array_get($payload, 'worker_name'), 'workerSid' => Values::array_get($payload, 'worker_sid'), 'workspaceSid' => Values::array_get($payload, 'workspace_sid'), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ); $this->solution = array( 'workspaceSid' => $workspaceSid, 'taskSid' => $taskSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Taskrouter\V1\Workspace\Task\ReservationContext Context * for * this * ReservationInstance */ protected function proxy() { if (!$this->context) { $this->context = new ReservationContext( $this->version, $this->solution['workspaceSid'], $this->solution['taskSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch a ReservationInstance * * @return ReservationInstance Fetched ReservationInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Update the ReservationInstance * * @param array|Options $options Optional Arguments * @return ReservationInstance Updated ReservationInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Taskrouter.V1.ReservationInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Task/ReservationList.php 0000644 00000013100 15002236443 0021431 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\Task; use Twilio\ListResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; class ReservationList extends ListResource { /** * Construct the ReservationList * * @param Version $version Version that contains the resource * @param string $workspaceSid The SID of the Workspace that this task is * contained within. * @param string $taskSid The SID of the reserved Task resource * @return \Twilio\Rest\Taskrouter\V1\Workspace\Task\ReservationList */ public function __construct(Version $version, $workspaceSid, $taskSid) { parent::__construct($version); // Path Solution $this->solution = array('workspaceSid' => $workspaceSid, 'taskSid' => $taskSid, ); $this->uri = '/Workspaces/' . \rawurlencode($workspaceSid) . '/Tasks/' . \rawurlencode($taskSid) . '/Reservations'; } /** * Streams ReservationInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($options = array(), $limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads ReservationInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return ReservationInstance[] Array of results */ public function read($options = array(), $limit = null, $pageSize = null) { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Retrieve a single page of ReservationInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of ReservationInstance */ public function page($options = array(), $pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $options = new Values($options); $params = Values::of(array( 'ReservationStatus' => $options['reservationStatus'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new ReservationPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of ReservationInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of ReservationInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new ReservationPage($this->version, $response, $this->solution); } /** * Constructs a ReservationContext * * @param string $sid The SID of the TaskReservation resource to fetch * @return \Twilio\Rest\Taskrouter\V1\Workspace\Task\ReservationContext */ public function getContext($sid) { return new ReservationContext( $this->version, $this->solution['workspaceSid'], $this->solution['taskSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Taskrouter.V1.ReservationList]'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Task/ReservationOptions.php 0000644 00000143130 15002236443 0022160 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\Task; use Twilio\Options; use Twilio\Values; abstract class ReservationOptions { /** * @param string $reservationStatus Returns the list of reservations for a task * with a specified ReservationStatus * @return ReadReservationOptions Options builder */ public static function read($reservationStatus = Values::NONE) { return new ReadReservationOptions($reservationStatus); } /** * @param string $reservationStatus The new status of the reservation * @param string $workerActivitySid The new worker activity SID if rejecting a * reservation * @param string $instruction The assignment instruction for reservation * @param string $dequeuePostWorkActivitySid The SID of the Activity resource * to start after executing a Dequeue * instruction * @param string $dequeueFrom The Caller ID of the call to the worker when * executing a Dequeue instruction * @param string $dequeueRecord Whether to record both legs of a call when * executing a Dequeue instruction * @param int $dequeueTimeout Timeout for call when executing a Dequeue * instruction * @param string $dequeueTo The Contact URI of the worker when executing a * Dequeue instruction * @param string $dequeueStatusCallbackUrl The Callback URL for completed call * event when executing a Dequeue * instruction * @param string $callFrom The Caller ID of the outbound call when executing a * Call instruction * @param string $callRecord Whether to record both legs of a call when * executing a Call instruction * @param int $callTimeout Timeout for call when executing a Call instruction * @param string $callTo The Contact URI of the worker when executing a Call * instruction * @param string $callUrl TwiML URI executed on answering the worker's leg as a * result of the Call instruction * @param string $callStatusCallbackUrl The URL to call for the completed call * event when executing a Call instruction * @param bool $callAccept Whether to accept a reservation when executing a * Call instruction * @param string $redirectCallSid The Call SID of the call parked in the queue * when executing a Redirect instruction * @param bool $redirectAccept Whether the reservation should be accepted when * executing a Redirect instruction * @param string $redirectUrl TwiML URI to redirect the call to when executing * the Redirect instruction * @param string $to The Contact URI of the worker when executing a Conference * instruction * @param string $from The Caller ID of the call to the worker when executing a * Conference instruction * @param string $statusCallback The URL we should call to send status * information to your application * @param string $statusCallbackMethod The HTTP method we should use to call * status_callback * @param string $statusCallbackEvent The call progress events that we will * send to status_callback * @param int $timeout Timeout for call when executing a Conference instruction * @param bool $record Whether to record the participant and their conferences * @param bool $muted Whether to mute the agent * @param string $beep Whether to play a notification beep when the participant * joins * @param bool $startConferenceOnEnter Whether the conference starts when the * participant joins the conference * @param bool $endConferenceOnExit Whether to end the conference when the * agent leaves * @param string $waitUrl URL that hosts pre-conference hold music * @param string $waitMethod The HTTP method we should use to call `wait_url` * @param bool $earlyMedia Whether agents can hear the state of the outbound * call * @param int $maxParticipants The maximum number of agent conference * participants * @param string $conferenceStatusCallback The callback URL for conference * events * @param string $conferenceStatusCallbackMethod HTTP method for requesting * `conference_status_callback` * URL * @param string $conferenceStatusCallbackEvent The conference status events * that we will send to * conference_status_callback * @param string $conferenceRecord Whether to record the conference the * participant is joining * @param string $conferenceTrim How to trim leading and trailing silence from * your recorded conference audio files * @param string $recordingChannels Specify `mono` or `dual` recording channels * @param string $recordingStatusCallback The URL that we should call using the * `recording_status_callback_method` * when the recording status changes * @param string $recordingStatusCallbackMethod The HTTP method we should use * when we call * `recording_status_callback` * @param string $conferenceRecordingStatusCallback The URL we should call * using the * `conference_recording_status_callback_method` when the conference recording is available * @param string $conferenceRecordingStatusCallbackMethod The HTTP method we * should use to call * `conference_recording_status_callback` * @param string $region The region where we should mix the conference audio * @param string $sipAuthUsername The SIP username used for authentication * @param string $sipAuthPassword The SIP password for authentication * @param string $dequeueStatusCallbackEvent The Call progress events sent via * webhooks as a result of a Dequeue * instruction * @param string $postWorkActivitySid The new worker activity SID after * executing a Conference instruction * @param string $supervisorMode The Supervisor mode when executing the * Supervise instruction * @param string $supervisor The Supervisor SID/URI when executing the * Supervise instruction * @param bool $endConferenceOnCustomerExit Whether to end the conference when * the customer leaves * @param bool $beepOnCustomerEntrance Whether to play a notification beep when * the customer joins * @return UpdateReservationOptions Options builder */ public static function update($reservationStatus = Values::NONE, $workerActivitySid = Values::NONE, $instruction = Values::NONE, $dequeuePostWorkActivitySid = Values::NONE, $dequeueFrom = Values::NONE, $dequeueRecord = Values::NONE, $dequeueTimeout = Values::NONE, $dequeueTo = Values::NONE, $dequeueStatusCallbackUrl = Values::NONE, $callFrom = Values::NONE, $callRecord = Values::NONE, $callTimeout = Values::NONE, $callTo = Values::NONE, $callUrl = Values::NONE, $callStatusCallbackUrl = Values::NONE, $callAccept = Values::NONE, $redirectCallSid = Values::NONE, $redirectAccept = Values::NONE, $redirectUrl = Values::NONE, $to = Values::NONE, $from = Values::NONE, $statusCallback = Values::NONE, $statusCallbackMethod = Values::NONE, $statusCallbackEvent = Values::NONE, $timeout = Values::NONE, $record = Values::NONE, $muted = Values::NONE, $beep = Values::NONE, $startConferenceOnEnter = Values::NONE, $endConferenceOnExit = Values::NONE, $waitUrl = Values::NONE, $waitMethod = Values::NONE, $earlyMedia = Values::NONE, $maxParticipants = Values::NONE, $conferenceStatusCallback = Values::NONE, $conferenceStatusCallbackMethod = Values::NONE, $conferenceStatusCallbackEvent = Values::NONE, $conferenceRecord = Values::NONE, $conferenceTrim = Values::NONE, $recordingChannels = Values::NONE, $recordingStatusCallback = Values::NONE, $recordingStatusCallbackMethod = Values::NONE, $conferenceRecordingStatusCallback = Values::NONE, $conferenceRecordingStatusCallbackMethod = Values::NONE, $region = Values::NONE, $sipAuthUsername = Values::NONE, $sipAuthPassword = Values::NONE, $dequeueStatusCallbackEvent = Values::NONE, $postWorkActivitySid = Values::NONE, $supervisorMode = Values::NONE, $supervisor = Values::NONE, $endConferenceOnCustomerExit = Values::NONE, $beepOnCustomerEntrance = Values::NONE) { return new UpdateReservationOptions($reservationStatus, $workerActivitySid, $instruction, $dequeuePostWorkActivitySid, $dequeueFrom, $dequeueRecord, $dequeueTimeout, $dequeueTo, $dequeueStatusCallbackUrl, $callFrom, $callRecord, $callTimeout, $callTo, $callUrl, $callStatusCallbackUrl, $callAccept, $redirectCallSid, $redirectAccept, $redirectUrl, $to, $from, $statusCallback, $statusCallbackMethod, $statusCallbackEvent, $timeout, $record, $muted, $beep, $startConferenceOnEnter, $endConferenceOnExit, $waitUrl, $waitMethod, $earlyMedia, $maxParticipants, $conferenceStatusCallback, $conferenceStatusCallbackMethod, $conferenceStatusCallbackEvent, $conferenceRecord, $conferenceTrim, $recordingChannels, $recordingStatusCallback, $recordingStatusCallbackMethod, $conferenceRecordingStatusCallback, $conferenceRecordingStatusCallbackMethod, $region, $sipAuthUsername, $sipAuthPassword, $dequeueStatusCallbackEvent, $postWorkActivitySid, $supervisorMode, $supervisor, $endConferenceOnCustomerExit, $beepOnCustomerEntrance); } } class ReadReservationOptions extends Options { /** * @param string $reservationStatus Returns the list of reservations for a task * with a specified ReservationStatus */ public function __construct($reservationStatus = Values::NONE) { $this->options['reservationStatus'] = $reservationStatus; } /** * Returns the list of reservations for a task with a specified ReservationStatus. Can be: `pending`, `accepted`, `rejected`, or `timeout`. * * @param string $reservationStatus Returns the list of reservations for a task * with a specified ReservationStatus * @return $this Fluent Builder */ public function setReservationStatus($reservationStatus) { $this->options['reservationStatus'] = $reservationStatus; 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.Taskrouter.V1.ReadReservationOptions ' . \implode(' ', $options) . ']'; } } class UpdateReservationOptions extends Options { /** * @param string $reservationStatus The new status of the reservation * @param string $workerActivitySid The new worker activity SID if rejecting a * reservation * @param string $instruction The assignment instruction for reservation * @param string $dequeuePostWorkActivitySid The SID of the Activity resource * to start after executing a Dequeue * instruction * @param string $dequeueFrom The Caller ID of the call to the worker when * executing a Dequeue instruction * @param string $dequeueRecord Whether to record both legs of a call when * executing a Dequeue instruction * @param int $dequeueTimeout Timeout for call when executing a Dequeue * instruction * @param string $dequeueTo The Contact URI of the worker when executing a * Dequeue instruction * @param string $dequeueStatusCallbackUrl The Callback URL for completed call * event when executing a Dequeue * instruction * @param string $callFrom The Caller ID of the outbound call when executing a * Call instruction * @param string $callRecord Whether to record both legs of a call when * executing a Call instruction * @param int $callTimeout Timeout for call when executing a Call instruction * @param string $callTo The Contact URI of the worker when executing a Call * instruction * @param string $callUrl TwiML URI executed on answering the worker's leg as a * result of the Call instruction * @param string $callStatusCallbackUrl The URL to call for the completed call * event when executing a Call instruction * @param bool $callAccept Whether to accept a reservation when executing a * Call instruction * @param string $redirectCallSid The Call SID of the call parked in the queue * when executing a Redirect instruction * @param bool $redirectAccept Whether the reservation should be accepted when * executing a Redirect instruction * @param string $redirectUrl TwiML URI to redirect the call to when executing * the Redirect instruction * @param string $to The Contact URI of the worker when executing a Conference * instruction * @param string $from The Caller ID of the call to the worker when executing a * Conference instruction * @param string $statusCallback The URL we should call to send status * information to your application * @param string $statusCallbackMethod The HTTP method we should use to call * status_callback * @param string $statusCallbackEvent The call progress events that we will * send to status_callback * @param int $timeout Timeout for call when executing a Conference instruction * @param bool $record Whether to record the participant and their conferences * @param bool $muted Whether to mute the agent * @param string $beep Whether to play a notification beep when the participant * joins * @param bool $startConferenceOnEnter Whether the conference starts when the * participant joins the conference * @param bool $endConferenceOnExit Whether to end the conference when the * agent leaves * @param string $waitUrl URL that hosts pre-conference hold music * @param string $waitMethod The HTTP method we should use to call `wait_url` * @param bool $earlyMedia Whether agents can hear the state of the outbound * call * @param int $maxParticipants The maximum number of agent conference * participants * @param string $conferenceStatusCallback The callback URL for conference * events * @param string $conferenceStatusCallbackMethod HTTP method for requesting * `conference_status_callback` * URL * @param string $conferenceStatusCallbackEvent The conference status events * that we will send to * conference_status_callback * @param string $conferenceRecord Whether to record the conference the * participant is joining * @param string $conferenceTrim How to trim leading and trailing silence from * your recorded conference audio files * @param string $recordingChannels Specify `mono` or `dual` recording channels * @param string $recordingStatusCallback The URL that we should call using the * `recording_status_callback_method` * when the recording status changes * @param string $recordingStatusCallbackMethod The HTTP method we should use * when we call * `recording_status_callback` * @param string $conferenceRecordingStatusCallback The URL we should call * using the * `conference_recording_status_callback_method` when the conference recording is available * @param string $conferenceRecordingStatusCallbackMethod The HTTP method we * should use to call * `conference_recording_status_callback` * @param string $region The region where we should mix the conference audio * @param string $sipAuthUsername The SIP username used for authentication * @param string $sipAuthPassword The SIP password for authentication * @param string $dequeueStatusCallbackEvent The Call progress events sent via * webhooks as a result of a Dequeue * instruction * @param string $postWorkActivitySid The new worker activity SID after * executing a Conference instruction * @param string $supervisorMode The Supervisor mode when executing the * Supervise instruction * @param string $supervisor The Supervisor SID/URI when executing the * Supervise instruction * @param bool $endConferenceOnCustomerExit Whether to end the conference when * the customer leaves * @param bool $beepOnCustomerEntrance Whether to play a notification beep when * the customer joins */ public function __construct($reservationStatus = Values::NONE, $workerActivitySid = Values::NONE, $instruction = Values::NONE, $dequeuePostWorkActivitySid = Values::NONE, $dequeueFrom = Values::NONE, $dequeueRecord = Values::NONE, $dequeueTimeout = Values::NONE, $dequeueTo = Values::NONE, $dequeueStatusCallbackUrl = Values::NONE, $callFrom = Values::NONE, $callRecord = Values::NONE, $callTimeout = Values::NONE, $callTo = Values::NONE, $callUrl = Values::NONE, $callStatusCallbackUrl = Values::NONE, $callAccept = Values::NONE, $redirectCallSid = Values::NONE, $redirectAccept = Values::NONE, $redirectUrl = Values::NONE, $to = Values::NONE, $from = Values::NONE, $statusCallback = Values::NONE, $statusCallbackMethod = Values::NONE, $statusCallbackEvent = Values::NONE, $timeout = Values::NONE, $record = Values::NONE, $muted = Values::NONE, $beep = Values::NONE, $startConferenceOnEnter = Values::NONE, $endConferenceOnExit = Values::NONE, $waitUrl = Values::NONE, $waitMethod = Values::NONE, $earlyMedia = Values::NONE, $maxParticipants = Values::NONE, $conferenceStatusCallback = Values::NONE, $conferenceStatusCallbackMethod = Values::NONE, $conferenceStatusCallbackEvent = Values::NONE, $conferenceRecord = Values::NONE, $conferenceTrim = Values::NONE, $recordingChannels = Values::NONE, $recordingStatusCallback = Values::NONE, $recordingStatusCallbackMethod = Values::NONE, $conferenceRecordingStatusCallback = Values::NONE, $conferenceRecordingStatusCallbackMethod = Values::NONE, $region = Values::NONE, $sipAuthUsername = Values::NONE, $sipAuthPassword = Values::NONE, $dequeueStatusCallbackEvent = Values::NONE, $postWorkActivitySid = Values::NONE, $supervisorMode = Values::NONE, $supervisor = Values::NONE, $endConferenceOnCustomerExit = Values::NONE, $beepOnCustomerEntrance = Values::NONE) { $this->options['reservationStatus'] = $reservationStatus; $this->options['workerActivitySid'] = $workerActivitySid; $this->options['instruction'] = $instruction; $this->options['dequeuePostWorkActivitySid'] = $dequeuePostWorkActivitySid; $this->options['dequeueFrom'] = $dequeueFrom; $this->options['dequeueRecord'] = $dequeueRecord; $this->options['dequeueTimeout'] = $dequeueTimeout; $this->options['dequeueTo'] = $dequeueTo; $this->options['dequeueStatusCallbackUrl'] = $dequeueStatusCallbackUrl; $this->options['callFrom'] = $callFrom; $this->options['callRecord'] = $callRecord; $this->options['callTimeout'] = $callTimeout; $this->options['callTo'] = $callTo; $this->options['callUrl'] = $callUrl; $this->options['callStatusCallbackUrl'] = $callStatusCallbackUrl; $this->options['callAccept'] = $callAccept; $this->options['redirectCallSid'] = $redirectCallSid; $this->options['redirectAccept'] = $redirectAccept; $this->options['redirectUrl'] = $redirectUrl; $this->options['to'] = $to; $this->options['from'] = $from; $this->options['statusCallback'] = $statusCallback; $this->options['statusCallbackMethod'] = $statusCallbackMethod; $this->options['statusCallbackEvent'] = $statusCallbackEvent; $this->options['timeout'] = $timeout; $this->options['record'] = $record; $this->options['muted'] = $muted; $this->options['beep'] = $beep; $this->options['startConferenceOnEnter'] = $startConferenceOnEnter; $this->options['endConferenceOnExit'] = $endConferenceOnExit; $this->options['waitUrl'] = $waitUrl; $this->options['waitMethod'] = $waitMethod; $this->options['earlyMedia'] = $earlyMedia; $this->options['maxParticipants'] = $maxParticipants; $this->options['conferenceStatusCallback'] = $conferenceStatusCallback; $this->options['conferenceStatusCallbackMethod'] = $conferenceStatusCallbackMethod; $this->options['conferenceStatusCallbackEvent'] = $conferenceStatusCallbackEvent; $this->options['conferenceRecord'] = $conferenceRecord; $this->options['conferenceTrim'] = $conferenceTrim; $this->options['recordingChannels'] = $recordingChannels; $this->options['recordingStatusCallback'] = $recordingStatusCallback; $this->options['recordingStatusCallbackMethod'] = $recordingStatusCallbackMethod; $this->options['conferenceRecordingStatusCallback'] = $conferenceRecordingStatusCallback; $this->options['conferenceRecordingStatusCallbackMethod'] = $conferenceRecordingStatusCallbackMethod; $this->options['region'] = $region; $this->options['sipAuthUsername'] = $sipAuthUsername; $this->options['sipAuthPassword'] = $sipAuthPassword; $this->options['dequeueStatusCallbackEvent'] = $dequeueStatusCallbackEvent; $this->options['postWorkActivitySid'] = $postWorkActivitySid; $this->options['supervisorMode'] = $supervisorMode; $this->options['supervisor'] = $supervisor; $this->options['endConferenceOnCustomerExit'] = $endConferenceOnCustomerExit; $this->options['beepOnCustomerEntrance'] = $beepOnCustomerEntrance; } /** * The new status of the reservation. Can be: `pending`, `accepted`, `rejected`, or `timeout`. * * @param string $reservationStatus The new status of the reservation * @return $this Fluent Builder */ public function setReservationStatus($reservationStatus) { $this->options['reservationStatus'] = $reservationStatus; return $this; } /** * The new worker activity SID if rejecting a reservation. * * @param string $workerActivitySid The new worker activity SID if rejecting a * reservation * @return $this Fluent Builder */ public function setWorkerActivitySid($workerActivitySid) { $this->options['workerActivitySid'] = $workerActivitySid; return $this; } /** * The assignment instruction for reservation. * * @param string $instruction The assignment instruction for reservation * @return $this Fluent Builder */ public function setInstruction($instruction) { $this->options['instruction'] = $instruction; return $this; } /** * The SID of the Activity resource to start after executing a Dequeue instruction. * * @param string $dequeuePostWorkActivitySid The SID of the Activity resource * to start after executing a Dequeue * instruction * @return $this Fluent Builder */ public function setDequeuePostWorkActivitySid($dequeuePostWorkActivitySid) { $this->options['dequeuePostWorkActivitySid'] = $dequeuePostWorkActivitySid; return $this; } /** * The Caller ID of the call to the worker when executing a Dequeue instruction. * * @param string $dequeueFrom The Caller ID of the call to the worker when * executing a Dequeue instruction * @return $this Fluent Builder */ public function setDequeueFrom($dequeueFrom) { $this->options['dequeueFrom'] = $dequeueFrom; return $this; } /** * Whether to record both legs of a call when executing a Dequeue instruction or which leg to record. * * @param string $dequeueRecord Whether to record both legs of a call when * executing a Dequeue instruction * @return $this Fluent Builder */ public function setDequeueRecord($dequeueRecord) { $this->options['dequeueRecord'] = $dequeueRecord; return $this; } /** * Timeout for call when executing a Dequeue instruction. * * @param int $dequeueTimeout Timeout for call when executing a Dequeue * instruction * @return $this Fluent Builder */ public function setDequeueTimeout($dequeueTimeout) { $this->options['dequeueTimeout'] = $dequeueTimeout; return $this; } /** * The Contact URI of the worker when executing a Dequeue instruction. Can be the URI of the Twilio Client, the SIP URI for Programmable SIP, or the [E.164](https://www.twilio.com/docs/glossary/what-e164) formatted phone number, depending on the destination. * * @param string $dequeueTo The Contact URI of the worker when executing a * Dequeue instruction * @return $this Fluent Builder */ public function setDequeueTo($dequeueTo) { $this->options['dequeueTo'] = $dequeueTo; return $this; } /** * The Callback URL for completed call event when executing a Dequeue instruction. * * @param string $dequeueStatusCallbackUrl The Callback URL for completed call * event when executing a Dequeue * instruction * @return $this Fluent Builder */ public function setDequeueStatusCallbackUrl($dequeueStatusCallbackUrl) { $this->options['dequeueStatusCallbackUrl'] = $dequeueStatusCallbackUrl; return $this; } /** * The Caller ID of the outbound call when executing a Call instruction. * * @param string $callFrom The Caller ID of the outbound call when executing a * Call instruction * @return $this Fluent Builder */ public function setCallFrom($callFrom) { $this->options['callFrom'] = $callFrom; return $this; } /** * Whether to record both legs of a call when executing a Call instruction or which leg to record. * * @param string $callRecord Whether to record both legs of a call when * executing a Call instruction * @return $this Fluent Builder */ public function setCallRecord($callRecord) { $this->options['callRecord'] = $callRecord; return $this; } /** * Timeout for call when executing a Call instruction. * * @param int $callTimeout Timeout for call when executing a Call instruction * @return $this Fluent Builder */ public function setCallTimeout($callTimeout) { $this->options['callTimeout'] = $callTimeout; return $this; } /** * The Contact URI of the worker when executing a Call instruction. Can be the URI of the Twilio Client, the SIP URI for Programmable SIP, or the [E.164](https://www.twilio.com/docs/glossary/what-e164) formatted phone number, depending on the destination. * * @param string $callTo The Contact URI of the worker when executing a Call * instruction * @return $this Fluent Builder */ public function setCallTo($callTo) { $this->options['callTo'] = $callTo; return $this; } /** * TwiML URI executed on answering the worker's leg as a result of the Call instruction. * * @param string $callUrl TwiML URI executed on answering the worker's leg as a * result of the Call instruction * @return $this Fluent Builder */ public function setCallUrl($callUrl) { $this->options['callUrl'] = $callUrl; return $this; } /** * The URL to call for the completed call event when executing a Call instruction. * * @param string $callStatusCallbackUrl The URL to call for the completed call * event when executing a Call instruction * @return $this Fluent Builder */ public function setCallStatusCallbackUrl($callStatusCallbackUrl) { $this->options['callStatusCallbackUrl'] = $callStatusCallbackUrl; return $this; } /** * Whether to accept a reservation when executing a Call instruction. * * @param bool $callAccept Whether to accept a reservation when executing a * Call instruction * @return $this Fluent Builder */ public function setCallAccept($callAccept) { $this->options['callAccept'] = $callAccept; return $this; } /** * The Call SID of the call parked in the queue when executing a Redirect instruction. * * @param string $redirectCallSid The Call SID of the call parked in the queue * when executing a Redirect instruction * @return $this Fluent Builder */ public function setRedirectCallSid($redirectCallSid) { $this->options['redirectCallSid'] = $redirectCallSid; return $this; } /** * Whether the reservation should be accepted when executing a Redirect instruction. * * @param bool $redirectAccept Whether the reservation should be accepted when * executing a Redirect instruction * @return $this Fluent Builder */ public function setRedirectAccept($redirectAccept) { $this->options['redirectAccept'] = $redirectAccept; return $this; } /** * TwiML URI to redirect the call to when executing the Redirect instruction. * * @param string $redirectUrl TwiML URI to redirect the call to when executing * the Redirect instruction * @return $this Fluent Builder */ public function setRedirectUrl($redirectUrl) { $this->options['redirectUrl'] = $redirectUrl; return $this; } /** * The Contact URI of the worker when executing a Conference instruction. Can be the URI of the Twilio Client, the SIP URI for Programmable SIP, or the [E.164](https://www.twilio.com/docs/glossary/what-e164) formatted phone number, depending on the destination. * * @param string $to The Contact URI of the worker when executing a Conference * instruction * @return $this Fluent Builder */ public function setTo($to) { $this->options['to'] = $to; return $this; } /** * The Caller ID of the call to the worker when executing a Conference instruction. * * @param string $from The Caller ID of the call to the worker when executing a * Conference instruction * @return $this Fluent Builder */ public function setFrom($from) { $this->options['from'] = $from; return $this; } /** * The URL we should call using the `status_callback_method` to send status information to your application. * * @param string $statusCallback The URL we should call to send status * information to your application * @return $this Fluent Builder */ public function setStatusCallback($statusCallback) { $this->options['statusCallback'] = $statusCallback; return $this; } /** * The HTTP method we should use to call `status_callback`. Can be: `POST` or `GET` and the default is `POST`. * * @param string $statusCallbackMethod The HTTP method we should use to call * status_callback * @return $this Fluent Builder */ public function setStatusCallbackMethod($statusCallbackMethod) { $this->options['statusCallbackMethod'] = $statusCallbackMethod; return $this; } /** * The call progress events that we will send to `status_callback`. Can be: `initiated`, `ringing`, `answered`, or `completed`. * * @param string $statusCallbackEvent The call progress events that we will * send to status_callback * @return $this Fluent Builder */ public function setStatusCallbackEvent($statusCallbackEvent) { $this->options['statusCallbackEvent'] = $statusCallbackEvent; return $this; } /** * Timeout for call when executing a Conference instruction. * * @param int $timeout Timeout for call when executing a Conference instruction * @return $this Fluent Builder */ public function setTimeout($timeout) { $this->options['timeout'] = $timeout; return $this; } /** * Whether to record the participant and their conferences, including the time between conferences. The default is `false`. * * @param bool $record Whether to record the participant and their conferences * @return $this Fluent Builder */ public function setRecord($record) { $this->options['record'] = $record; return $this; } /** * Whether the agent is muted in the conference. The default is `false`. * * @param bool $muted Whether to mute the agent * @return $this Fluent Builder */ public function setMuted($muted) { $this->options['muted'] = $muted; return $this; } /** * Whether to play a notification beep when the participant joins or when to play a beep. Can be: `true`, `false`, `onEnter`, or `onExit`. The default value is `true`. * * @param string $beep Whether to play a notification beep when the participant * joins * @return $this Fluent Builder */ public function setBeep($beep) { $this->options['beep'] = $beep; return $this; } /** * Whether to start the conference when the participant joins, if it has not already started. The default is `true`. If `false` and the conference has not started, the participant is muted and hears background music until another participant starts the conference. * * @param bool $startConferenceOnEnter Whether the conference starts when the * participant joins the conference * @return $this Fluent Builder */ public function setStartConferenceOnEnter($startConferenceOnEnter) { $this->options['startConferenceOnEnter'] = $startConferenceOnEnter; return $this; } /** * Whether to end the conference when the agent leaves. * * @param bool $endConferenceOnExit Whether to end the conference when the * agent leaves * @return $this Fluent Builder */ public function setEndConferenceOnExit($endConferenceOnExit) { $this->options['endConferenceOnExit'] = $endConferenceOnExit; return $this; } /** * The URL we should call using the `wait_method` for the music to play while participants are waiting for the conference to start. The default value is the URL of our standard hold music. [Learn more about hold music](https://www.twilio.com/labs/twimlets/holdmusic). * * @param string $waitUrl URL that hosts pre-conference hold music * @return $this Fluent Builder */ public function setWaitUrl($waitUrl) { $this->options['waitUrl'] = $waitUrl; return $this; } /** * The HTTP method we should use to call `wait_url`. Can be `GET` or `POST` and the default is `POST`. When using a static audio file, this should be `GET` so that we can cache the file. * * @param string $waitMethod The HTTP method we should use to call `wait_url` * @return $this Fluent Builder */ public function setWaitMethod($waitMethod) { $this->options['waitMethod'] = $waitMethod; return $this; } /** * Whether to allow an agent to hear the state of the outbound call, including ringing or disconnect messages. The default is `true`. * * @param bool $earlyMedia Whether agents can hear the state of the outbound * call * @return $this Fluent Builder */ public function setEarlyMedia($earlyMedia) { $this->options['earlyMedia'] = $earlyMedia; return $this; } /** * The maximum number of participants in the conference. Can be a positive integer from `2` to `250`. The default value is `250`. * * @param int $maxParticipants The maximum number of agent conference * participants * @return $this Fluent Builder */ public function setMaxParticipants($maxParticipants) { $this->options['maxParticipants'] = $maxParticipants; return $this; } /** * The URL we should call using the `conference_status_callback_method` when the conference events in `conference_status_callback_event` occur. Only the value set by the first participant to join the conference is used. Subsequent `conference_status_callback` values are ignored. * * @param string $conferenceStatusCallback The callback URL for conference * events * @return $this Fluent Builder */ public function setConferenceStatusCallback($conferenceStatusCallback) { $this->options['conferenceStatusCallback'] = $conferenceStatusCallback; return $this; } /** * The HTTP method we should use to call `conference_status_callback`. Can be: `GET` or `POST` and defaults to `POST`. * * @param string $conferenceStatusCallbackMethod HTTP method for requesting * `conference_status_callback` * URL * @return $this Fluent Builder */ public function setConferenceStatusCallbackMethod($conferenceStatusCallbackMethod) { $this->options['conferenceStatusCallbackMethod'] = $conferenceStatusCallbackMethod; return $this; } /** * The conference status events that we will send to `conference_status_callback`. Can be: `start`, `end`, `join`, `leave`, `mute`, `hold`, `speaker`. * * @param string $conferenceStatusCallbackEvent The conference status events * that we will send to * conference_status_callback * @return $this Fluent Builder */ public function setConferenceStatusCallbackEvent($conferenceStatusCallbackEvent) { $this->options['conferenceStatusCallbackEvent'] = $conferenceStatusCallbackEvent; return $this; } /** * Whether to record the conference the participant is joining or when to record the conference. Can be: `true`, `false`, `record-from-start`, and `do-not-record`. The default value is `false`. * * @param string $conferenceRecord Whether to record the conference the * participant is joining * @return $this Fluent Builder */ public function setConferenceRecord($conferenceRecord) { $this->options['conferenceRecord'] = $conferenceRecord; return $this; } /** * How to trim the leading and trailing silence from your recorded conference audio files. Can be: `trim-silence` or `do-not-trim` and defaults to `trim-silence`. * * @param string $conferenceTrim How to trim leading and trailing silence from * your recorded conference audio files * @return $this Fluent Builder */ public function setConferenceTrim($conferenceTrim) { $this->options['conferenceTrim'] = $conferenceTrim; return $this; } /** * The recording channels for the final recording. Can be: `mono` or `dual` and the default is `mono`. * * @param string $recordingChannels Specify `mono` or `dual` recording channels * @return $this Fluent Builder */ public function setRecordingChannels($recordingChannels) { $this->options['recordingChannels'] = $recordingChannels; return $this; } /** * The URL that we should call using the `recording_status_callback_method` when the recording status changes. * * @param string $recordingStatusCallback The URL that we should call using the * `recording_status_callback_method` * when the recording status changes * @return $this Fluent Builder */ public function setRecordingStatusCallback($recordingStatusCallback) { $this->options['recordingStatusCallback'] = $recordingStatusCallback; return $this; } /** * The HTTP method we should use when we call `recording_status_callback`. Can be: `GET` or `POST` and defaults to `POST`. * * @param string $recordingStatusCallbackMethod The HTTP method we should use * when we call * `recording_status_callback` * @return $this Fluent Builder */ public function setRecordingStatusCallbackMethod($recordingStatusCallbackMethod) { $this->options['recordingStatusCallbackMethod'] = $recordingStatusCallbackMethod; return $this; } /** * The URL we should call using the `conference_recording_status_callback_method` when the conference recording is available. * * @param string $conferenceRecordingStatusCallback The URL we should call * using the * `conference_recording_status_callback_method` when the conference recording is available * @return $this Fluent Builder */ public function setConferenceRecordingStatusCallback($conferenceRecordingStatusCallback) { $this->options['conferenceRecordingStatusCallback'] = $conferenceRecordingStatusCallback; return $this; } /** * The HTTP method we should use to call `conference_recording_status_callback`. Can be: `GET` or `POST` and defaults to `POST`. * * @param string $conferenceRecordingStatusCallbackMethod The HTTP method we * should use to call * `conference_recording_status_callback` * @return $this Fluent Builder */ public function setConferenceRecordingStatusCallbackMethod($conferenceRecordingStatusCallbackMethod) { $this->options['conferenceRecordingStatusCallbackMethod'] = $conferenceRecordingStatusCallbackMethod; return $this; } /** * The [region](https://support.twilio.com/hc/en-us/articles/223132167-How-global-low-latency-routing-and-region-selection-work-for-conferences-and-Client-calls) where we should mix the recorded audio. Can be:`us1`, `ie1`, `de1`, `sg1`, `br1`, `au1`, or `jp1`. * * @param string $region The region where we should mix the conference audio * @return $this Fluent Builder */ public function setRegion($region) { $this->options['region'] = $region; return $this; } /** * The SIP username used for authentication. * * @param string $sipAuthUsername The SIP username used for authentication * @return $this Fluent Builder */ public function setSipAuthUsername($sipAuthUsername) { $this->options['sipAuthUsername'] = $sipAuthUsername; return $this; } /** * The SIP password for authentication. * * @param string $sipAuthPassword The SIP password for authentication * @return $this Fluent Builder */ public function setSipAuthPassword($sipAuthPassword) { $this->options['sipAuthPassword'] = $sipAuthPassword; return $this; } /** * The Call progress events sent via webhooks as a result of a Dequeue instruction. * * @param string $dequeueStatusCallbackEvent The Call progress events sent via * webhooks as a result of a Dequeue * instruction * @return $this Fluent Builder */ public function setDequeueStatusCallbackEvent($dequeueStatusCallbackEvent) { $this->options['dequeueStatusCallbackEvent'] = $dequeueStatusCallbackEvent; return $this; } /** * The new worker activity SID after executing a Conference instruction. * * @param string $postWorkActivitySid The new worker activity SID after * executing a Conference instruction * @return $this Fluent Builder */ public function setPostWorkActivitySid($postWorkActivitySid) { $this->options['postWorkActivitySid'] = $postWorkActivitySid; return $this; } /** * The Supervisor mode when executing the Supervise instruction. * * @param string $supervisorMode The Supervisor mode when executing the * Supervise instruction * @return $this Fluent Builder */ public function setSupervisorMode($supervisorMode) { $this->options['supervisorMode'] = $supervisorMode; return $this; } /** * The Supervisor SID/URI when executing the Supervise instruction. * * @param string $supervisor The Supervisor SID/URI when executing the * Supervise instruction * @return $this Fluent Builder */ public function setSupervisor($supervisor) { $this->options['supervisor'] = $supervisor; return $this; } /** * Whether to end the conference when the customer leaves. * * @param bool $endConferenceOnCustomerExit Whether to end the conference when * the customer leaves * @return $this Fluent Builder */ public function setEndConferenceOnCustomerExit($endConferenceOnCustomerExit) { $this->options['endConferenceOnCustomerExit'] = $endConferenceOnCustomerExit; return $this; } /** * Whether to play a notification beep when the customer joins. * * @param bool $beepOnCustomerEntrance Whether to play a notification beep when * the customer joins * @return $this Fluent Builder */ public function setBeepOnCustomerEntrance($beepOnCustomerEntrance) { $this->options['beepOnCustomerEntrance'] = $beepOnCustomerEntrance; 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.Taskrouter.V1.UpdateReservationOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueueOptions.php 0000644 00000036241 15002236443 0020670 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace; use Twilio\Options; use Twilio\Values; abstract class TaskQueueOptions { /** * @param string $friendlyName A string to describe the resource * @param string $targetWorkers A string describing the Worker selection * criteria for any Tasks that enter the TaskQueue * @param string $reservationActivitySid The SID of the Activity to assign * Workers when a task is reserved for * them * @param string $assignmentActivitySid The SID of the Activity to assign * Workers when a task is assigned for them * @param int $maxReservedWorkers The maximum number of Workers to create * reservations for the assignment of a task * while in the queue * @param string $taskOrder How Tasks will be assigned to Workers * @return UpdateTaskQueueOptions Options builder */ public static function update($friendlyName = Values::NONE, $targetWorkers = Values::NONE, $reservationActivitySid = Values::NONE, $assignmentActivitySid = Values::NONE, $maxReservedWorkers = Values::NONE, $taskOrder = Values::NONE) { return new UpdateTaskQueueOptions($friendlyName, $targetWorkers, $reservationActivitySid, $assignmentActivitySid, $maxReservedWorkers, $taskOrder); } /** * @param string $friendlyName The friendly_name of the TaskQueue resources to * read * @param string $evaluateWorkerAttributes The attributes of the Workers to read * @param string $workerSid The SID of the Worker with the TaskQueue resources * to read * @return ReadTaskQueueOptions Options builder */ public static function read($friendlyName = Values::NONE, $evaluateWorkerAttributes = Values::NONE, $workerSid = Values::NONE) { return new ReadTaskQueueOptions($friendlyName, $evaluateWorkerAttributes, $workerSid); } /** * @param string $targetWorkers A string describing the Worker selection * criteria for any Tasks that enter the TaskQueue * @param int $maxReservedWorkers The maximum number of Workers to reserve * @param string $taskOrder How Tasks will be assigned to Workers * @param string $reservationActivitySid The SID of the Activity to assign * Workers when a task is reserved for * them * @param string $assignmentActivitySid The SID of the Activity to assign * Workers once a task is assigned to them * @return CreateTaskQueueOptions Options builder */ public static function create($targetWorkers = Values::NONE, $maxReservedWorkers = Values::NONE, $taskOrder = Values::NONE, $reservationActivitySid = Values::NONE, $assignmentActivitySid = Values::NONE) { return new CreateTaskQueueOptions($targetWorkers, $maxReservedWorkers, $taskOrder, $reservationActivitySid, $assignmentActivitySid); } } class UpdateTaskQueueOptions extends Options { /** * @param string $friendlyName A string to describe the resource * @param string $targetWorkers A string describing the Worker selection * criteria for any Tasks that enter the TaskQueue * @param string $reservationActivitySid The SID of the Activity to assign * Workers when a task is reserved for * them * @param string $assignmentActivitySid The SID of the Activity to assign * Workers when a task is assigned for them * @param int $maxReservedWorkers The maximum number of Workers to create * reservations for the assignment of a task * while in the queue * @param string $taskOrder How Tasks will be assigned to Workers */ public function __construct($friendlyName = Values::NONE, $targetWorkers = Values::NONE, $reservationActivitySid = Values::NONE, $assignmentActivitySid = Values::NONE, $maxReservedWorkers = Values::NONE, $taskOrder = Values::NONE) { $this->options['friendlyName'] = $friendlyName; $this->options['targetWorkers'] = $targetWorkers; $this->options['reservationActivitySid'] = $reservationActivitySid; $this->options['assignmentActivitySid'] = $assignmentActivitySid; $this->options['maxReservedWorkers'] = $maxReservedWorkers; $this->options['taskOrder'] = $taskOrder; } /** * A descriptive string that you create to describe the TaskQueue. For example `Support-Tier 1`, `Sales`, or `Escalation`. * * @param string $friendlyName A string to describe the resource * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * A string describing the Worker selection criteria for any Tasks that enter the TaskQueue. For example '"language" == "spanish"' If no TargetWorkers parameter is provided, Tasks will wait in the queue until they are either deleted or moved to another queue. Additional examples on how to describing Worker selection criteria below. * * @param string $targetWorkers A string describing the Worker selection * criteria for any Tasks that enter the TaskQueue * @return $this Fluent Builder */ public function setTargetWorkers($targetWorkers) { $this->options['targetWorkers'] = $targetWorkers; return $this; } /** * The SID of the Activity to assign Workers when a task is reserved for them. * * @param string $reservationActivitySid The SID of the Activity to assign * Workers when a task is reserved for * them * @return $this Fluent Builder */ public function setReservationActivitySid($reservationActivitySid) { $this->options['reservationActivitySid'] = $reservationActivitySid; return $this; } /** * The SID of the Activity to assign Workers when a task is assigned for them. * * @param string $assignmentActivitySid The SID of the Activity to assign * Workers when a task is assigned for them * @return $this Fluent Builder */ public function setAssignmentActivitySid($assignmentActivitySid) { $this->options['assignmentActivitySid'] = $assignmentActivitySid; return $this; } /** * The maximum number of Workers to create reservations for the assignment of a task while in the queue. Maximum of 50. * * @param int $maxReservedWorkers The maximum number of Workers to create * reservations for the assignment of a task * while in the queue * @return $this Fluent Builder */ public function setMaxReservedWorkers($maxReservedWorkers) { $this->options['maxReservedWorkers'] = $maxReservedWorkers; return $this; } /** * How Tasks will be assigned to Workers. Can be: `FIFO` or `LIFO` and the default is `FIFO`. Use `FIFO` to assign the oldest task first and `LIFO` to assign the most recent task first. For more information, see [Queue Ordering](https://www.twilio.com/docs/taskrouter/queue-ordering-last-first-out-lifo). * * @param string $taskOrder How Tasks will be assigned to Workers * @return $this Fluent Builder */ public function setTaskOrder($taskOrder) { $this->options['taskOrder'] = $taskOrder; 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.Taskrouter.V1.UpdateTaskQueueOptions ' . \implode(' ', $options) . ']'; } } class ReadTaskQueueOptions extends Options { /** * @param string $friendlyName The friendly_name of the TaskQueue resources to * read * @param string $evaluateWorkerAttributes The attributes of the Workers to read * @param string $workerSid The SID of the Worker with the TaskQueue resources * to read */ public function __construct($friendlyName = Values::NONE, $evaluateWorkerAttributes = Values::NONE, $workerSid = Values::NONE) { $this->options['friendlyName'] = $friendlyName; $this->options['evaluateWorkerAttributes'] = $evaluateWorkerAttributes; $this->options['workerSid'] = $workerSid; } /** * The `friendly_name` of the TaskQueue resources to read. * * @param string $friendlyName The friendly_name of the TaskQueue resources to * read * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The attributes of the Workers to read. Returns the TaskQueues with Workers that match the attributes specified in this parameter. * * @param string $evaluateWorkerAttributes The attributes of the Workers to read * @return $this Fluent Builder */ public function setEvaluateWorkerAttributes($evaluateWorkerAttributes) { $this->options['evaluateWorkerAttributes'] = $evaluateWorkerAttributes; return $this; } /** * The SID of the Worker with the TaskQueue resources to read. * * @param string $workerSid The SID of the Worker with the TaskQueue resources * to read * @return $this Fluent Builder */ public function setWorkerSid($workerSid) { $this->options['workerSid'] = $workerSid; 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.Taskrouter.V1.ReadTaskQueueOptions ' . \implode(' ', $options) . ']'; } } class CreateTaskQueueOptions extends Options { /** * @param string $targetWorkers A string describing the Worker selection * criteria for any Tasks that enter the TaskQueue * @param int $maxReservedWorkers The maximum number of Workers to reserve * @param string $taskOrder How Tasks will be assigned to Workers * @param string $reservationActivitySid The SID of the Activity to assign * Workers when a task is reserved for * them * @param string $assignmentActivitySid The SID of the Activity to assign * Workers once a task is assigned to them */ public function __construct($targetWorkers = Values::NONE, $maxReservedWorkers = Values::NONE, $taskOrder = Values::NONE, $reservationActivitySid = Values::NONE, $assignmentActivitySid = Values::NONE) { $this->options['targetWorkers'] = $targetWorkers; $this->options['maxReservedWorkers'] = $maxReservedWorkers; $this->options['taskOrder'] = $taskOrder; $this->options['reservationActivitySid'] = $reservationActivitySid; $this->options['assignmentActivitySid'] = $assignmentActivitySid; } /** * A string that describes the Worker selection criteria for any Tasks that enter the TaskQueue. For example, `'"language" == "spanish"'`. The default value is `1==1`. If this value is empty, Tasks will wait in the TaskQueue until they are deleted or moved to another TaskQueue. For more information about Worker selection, see [Describing Worker selection criteria](https://www.twilio.com/docs/taskrouter/api/taskqueues#target-workers). * * @param string $targetWorkers A string describing the Worker selection * criteria for any Tasks that enter the TaskQueue * @return $this Fluent Builder */ public function setTargetWorkers($targetWorkers) { $this->options['targetWorkers'] = $targetWorkers; return $this; } /** * The maximum number of Workers to reserve for the assignment of a Task in the queue. Can be an integer between 1 and 50, inclusive and defaults to 1. * * @param int $maxReservedWorkers The maximum number of Workers to reserve * @return $this Fluent Builder */ public function setMaxReservedWorkers($maxReservedWorkers) { $this->options['maxReservedWorkers'] = $maxReservedWorkers; return $this; } /** * How Tasks will be assigned to Workers. Set this parameter to `LIFO` to assign most recently created Task first or FIFO to assign the oldest Task first. Default is `FIFO`. [Click here](https://www.twilio.com/docs/taskrouter/queue-ordering-last-first-out-lifo) to learn more. * * @param string $taskOrder How Tasks will be assigned to Workers * @return $this Fluent Builder */ public function setTaskOrder($taskOrder) { $this->options['taskOrder'] = $taskOrder; return $this; } /** * The SID of the Activity to assign Workers when a task is reserved for them. * * @param string $reservationActivitySid The SID of the Activity to assign * Workers when a task is reserved for * them * @return $this Fluent Builder */ public function setReservationActivitySid($reservationActivitySid) { $this->options['reservationActivitySid'] = $reservationActivitySid; return $this; } /** * The SID of the Activity to assign Workers when a task is assigned to them. * * @param string $assignmentActivitySid The SID of the Activity to assign * Workers once a task is assigned to them * @return $this Fluent Builder */ public function setAssignmentActivitySid($assignmentActivitySid) { $this->options['assignmentActivitySid'] = $assignmentActivitySid; 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.Taskrouter.V1.CreateTaskQueueOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceRealTimeStatisticsList.php 0000644 00000002435 15002236443 0023673 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace; use Twilio\ListResource; use Twilio\Version; class WorkspaceRealTimeStatisticsList extends ListResource { /** * Construct the WorkspaceRealTimeStatisticsList * * @param Version $version Version that contains the resource * @param string $workspaceSid The SID of the Workspace * @return \Twilio\Rest\Taskrouter\V1\Workspace\WorkspaceRealTimeStatisticsList */ public function __construct(Version $version, $workspaceSid) { parent::__construct($version); // Path Solution $this->solution = array('workspaceSid' => $workspaceSid, ); } /** * Constructs a WorkspaceRealTimeStatisticsContext * * @return \Twilio\Rest\Taskrouter\V1\Workspace\WorkspaceRealTimeStatisticsContext */ public function getContext() { return new WorkspaceRealTimeStatisticsContext($this->version, $this->solution['workspaceSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Taskrouter.V1.WorkspaceRealTimeStatisticsList]'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskChannelPage.php 0000644 00000001415 15002236443 0020370 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace; use Twilio\Page; class TaskChannelPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new TaskChannelInstance($this->version, $payload, $this->solution['workspaceSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Taskrouter.V1.TaskChannelPage]'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/EventList.php 0000644 00000013335 15002236443 0017321 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class EventList extends ListResource { /** * Construct the EventList * * @param Version $version Version that contains the resource * @param string $workspaceSid The SID of the Workspace that contains the Event * @return \Twilio\Rest\Taskrouter\V1\Workspace\EventList */ public function __construct(Version $version, $workspaceSid) { parent::__construct($version); // Path Solution $this->solution = array('workspaceSid' => $workspaceSid, ); $this->uri = '/Workspaces/' . \rawurlencode($workspaceSid) . '/Events'; } /** * Streams EventInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($options = array(), $limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads EventInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return EventInstance[] Array of results */ public function read($options = array(), $limit = null, $pageSize = null) { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Retrieve a single page of EventInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of EventInstance */ public function page($options = array(), $pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $options = new Values($options); $params = Values::of(array( 'EndDate' => Serialize::iso8601DateTime($options['endDate']), 'EventType' => $options['eventType'], 'Minutes' => $options['minutes'], 'ReservationSid' => $options['reservationSid'], 'StartDate' => Serialize::iso8601DateTime($options['startDate']), 'TaskQueueSid' => $options['taskQueueSid'], 'TaskSid' => $options['taskSid'], 'WorkerSid' => $options['workerSid'], 'WorkflowSid' => $options['workflowSid'], 'TaskChannel' => $options['taskChannel'], 'Sid' => $options['sid'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new EventPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of EventInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of EventInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new EventPage($this->version, $response, $this->solution); } /** * Constructs a EventContext * * @param string $sid The SID of the resource to fetch * @return \Twilio\Rest\Taskrouter\V1\Workspace\EventContext */ public function getContext($sid) { return new EventContext($this->version, $this->solution['workspaceSid'], $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Taskrouter.V1.EventList]'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/ActivityContext.php 0000644 00000005673 15002236443 0020553 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Values; use Twilio\Version; class ActivityContext extends InstanceContext { /** * Initialize the ActivityContext * * @param \Twilio\Version $version Version that contains the resource * @param string $workspaceSid The SID of the Workspace with the Activity * resources to fetch * @param string $sid The SID of the resource to fetch * @return \Twilio\Rest\Taskrouter\V1\Workspace\ActivityContext */ public function __construct(Version $version, $workspaceSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array('workspaceSid' => $workspaceSid, 'sid' => $sid, ); $this->uri = '/Workspaces/' . \rawurlencode($workspaceSid) . '/Activities/' . \rawurlencode($sid) . ''; } /** * Fetch a ActivityInstance * * @return ActivityInstance Fetched ActivityInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new ActivityInstance( $this->version, $payload, $this->solution['workspaceSid'], $this->solution['sid'] ); } /** * Update the ActivityInstance * * @param array|Options $options Optional Arguments * @return ActivityInstance Updated ActivityInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { $options = new Values($options); $data = Values::of(array('FriendlyName' => $options['friendlyName'], )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new ActivityInstance( $this->version, $payload, $this->solution['workspaceSid'], $this->solution['sid'] ); } /** * Deletes the ActivityInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Taskrouter.V1.ActivityContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueueInstance.php 0000644 00000014244 15002236443 0021000 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property string $assignmentActivitySid * @property string $assignmentActivityName * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $friendlyName * @property int $maxReservedWorkers * @property string $reservationActivitySid * @property string $reservationActivityName * @property string $sid * @property string $targetWorkers * @property string $taskOrder * @property string $url * @property string $workspaceSid * @property array $links */ class TaskQueueInstance extends InstanceResource { protected $_statistics = null; protected $_realTimeStatistics = null; protected $_cumulativeStatistics = null; /** * Initialize the TaskQueueInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $workspaceSid The SID of the Workspace that contains the * TaskQueue * @param string $sid The SID of the resource to * @return \Twilio\Rest\Taskrouter\V1\Workspace\TaskQueueInstance */ public function __construct(Version $version, array $payload, $workspaceSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'accountSid' => Values::array_get($payload, 'account_sid'), 'assignmentActivitySid' => Values::array_get($payload, 'assignment_activity_sid'), 'assignmentActivityName' => Values::array_get($payload, 'assignment_activity_name'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'maxReservedWorkers' => Values::array_get($payload, 'max_reserved_workers'), 'reservationActivitySid' => Values::array_get($payload, 'reservation_activity_sid'), 'reservationActivityName' => Values::array_get($payload, 'reservation_activity_name'), 'sid' => Values::array_get($payload, 'sid'), 'targetWorkers' => Values::array_get($payload, 'target_workers'), 'taskOrder' => Values::array_get($payload, 'task_order'), 'url' => Values::array_get($payload, 'url'), 'workspaceSid' => Values::array_get($payload, 'workspace_sid'), 'links' => Values::array_get($payload, 'links'), ); $this->solution = array('workspaceSid' => $workspaceSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Taskrouter\V1\Workspace\TaskQueueContext Context for * this * TaskQueueInstance */ protected function proxy() { if (!$this->context) { $this->context = new TaskQueueContext( $this->version, $this->solution['workspaceSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch a TaskQueueInstance * * @return TaskQueueInstance Fetched TaskQueueInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Update the TaskQueueInstance * * @param array|Options $options Optional Arguments * @return TaskQueueInstance Updated TaskQueueInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Deletes the TaskQueueInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Access the statistics * * @return \Twilio\Rest\Taskrouter\V1\Workspace\TaskQueue\TaskQueueStatisticsList */ protected function getStatistics() { return $this->proxy()->statistics; } /** * Access the realTimeStatistics * * @return \Twilio\Rest\Taskrouter\V1\Workspace\TaskQueue\TaskQueueRealTimeStatisticsList */ protected function getRealTimeStatistics() { return $this->proxy()->realTimeStatistics; } /** * Access the cumulativeStatistics * * @return \Twilio\Rest\Taskrouter\V1\Workspace\TaskQueue\TaskQueueCumulativeStatisticsList */ protected function getCumulativeStatistics() { return $this->proxy()->cumulativeStatistics; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Taskrouter.V1.TaskQueueInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkflowOptions.php 0000644 00000031745 15002236443 0020577 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace; use Twilio\Options; use Twilio\Values; abstract class WorkflowOptions { /** * @param string $friendlyName descriptive string that you create to describe * the Workflow resource * @param string $assignmentCallbackUrl The URL from your application that will * process task assignment events * @param string $fallbackAssignmentCallbackUrl The URL that we should call * when a call to the * `assignment_callback_url` fails * @param string $configuration A JSON string that contains the rules to apply * to the Workflow * @param int $taskReservationTimeout How long TaskRouter will wait for a * confirmation response from your * application after it assigns a Task to a * Worker * @param string $reEvaluateTasks Whether or not to re-evaluate Tasks * @return UpdateWorkflowOptions Options builder */ public static function update($friendlyName = Values::NONE, $assignmentCallbackUrl = Values::NONE, $fallbackAssignmentCallbackUrl = Values::NONE, $configuration = Values::NONE, $taskReservationTimeout = Values::NONE, $reEvaluateTasks = Values::NONE) { return new UpdateWorkflowOptions($friendlyName, $assignmentCallbackUrl, $fallbackAssignmentCallbackUrl, $configuration, $taskReservationTimeout, $reEvaluateTasks); } /** * @param string $friendlyName The friendly_name of the Workflow resources to * read * @return ReadWorkflowOptions Options builder */ public static function read($friendlyName = Values::NONE) { return new ReadWorkflowOptions($friendlyName); } /** * @param string $assignmentCallbackUrl The URL from your application that will * process task assignment events * @param string $fallbackAssignmentCallbackUrl The URL that we should call * when a call to the * `assignment_callback_url` fails * @param int $taskReservationTimeout How long TaskRouter will wait for a * confirmation response from your * application after it assigns a Task to a * Worker * @return CreateWorkflowOptions Options builder */ public static function create($assignmentCallbackUrl = Values::NONE, $fallbackAssignmentCallbackUrl = Values::NONE, $taskReservationTimeout = Values::NONE) { return new CreateWorkflowOptions($assignmentCallbackUrl, $fallbackAssignmentCallbackUrl, $taskReservationTimeout); } } class UpdateWorkflowOptions extends Options { /** * @param string $friendlyName descriptive string that you create to describe * the Workflow resource * @param string $assignmentCallbackUrl The URL from your application that will * process task assignment events * @param string $fallbackAssignmentCallbackUrl The URL that we should call * when a call to the * `assignment_callback_url` fails * @param string $configuration A JSON string that contains the rules to apply * to the Workflow * @param int $taskReservationTimeout How long TaskRouter will wait for a * confirmation response from your * application after it assigns a Task to a * Worker * @param string $reEvaluateTasks Whether or not to re-evaluate Tasks */ public function __construct($friendlyName = Values::NONE, $assignmentCallbackUrl = Values::NONE, $fallbackAssignmentCallbackUrl = Values::NONE, $configuration = Values::NONE, $taskReservationTimeout = Values::NONE, $reEvaluateTasks = Values::NONE) { $this->options['friendlyName'] = $friendlyName; $this->options['assignmentCallbackUrl'] = $assignmentCallbackUrl; $this->options['fallbackAssignmentCallbackUrl'] = $fallbackAssignmentCallbackUrl; $this->options['configuration'] = $configuration; $this->options['taskReservationTimeout'] = $taskReservationTimeout; $this->options['reEvaluateTasks'] = $reEvaluateTasks; } /** * A descriptive string that you create to describe the Workflow resource. For example, `Inbound Call Workflow` or `2014 Outbound Campaign`. * * @param string $friendlyName descriptive string that you create to describe * the Workflow resource * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The URL from your application that will process task assignment events. See [Handling Task Assignment Callback](https://www.twilio.com/docs/taskrouter/handle-assignment-callbacks) for more details. * * @param string $assignmentCallbackUrl The URL from your application that will * process task assignment events * @return $this Fluent Builder */ public function setAssignmentCallbackUrl($assignmentCallbackUrl) { $this->options['assignmentCallbackUrl'] = $assignmentCallbackUrl; return $this; } /** * The URL that we should call when a call to the `assignment_callback_url` fails. * * @param string $fallbackAssignmentCallbackUrl The URL that we should call * when a call to the * `assignment_callback_url` fails * @return $this Fluent Builder */ public function setFallbackAssignmentCallbackUrl($fallbackAssignmentCallbackUrl) { $this->options['fallbackAssignmentCallbackUrl'] = $fallbackAssignmentCallbackUrl; return $this; } /** * A JSON string that contains the rules to apply to the Workflow. See [Configuring Workflows](https://www.twilio.com/docs/taskrouter/workflow-configuration) for more information. * * @param string $configuration A JSON string that contains the rules to apply * to the Workflow * @return $this Fluent Builder */ public function setConfiguration($configuration) { $this->options['configuration'] = $configuration; return $this; } /** * How long TaskRouter will wait for a confirmation response from your application after it assigns a Task to a Worker. Can be up to `86,400` (24 hours) and the default is `120`. * * @param int $taskReservationTimeout How long TaskRouter will wait for a * confirmation response from your * application after it assigns a Task to a * Worker * @return $this Fluent Builder */ public function setTaskReservationTimeout($taskReservationTimeout) { $this->options['taskReservationTimeout'] = $taskReservationTimeout; return $this; } /** * Whether or not to re-evaluate Tasks. The default is `false`, which means Tasks in the Workflow will not be processed through the assignment loop again. * * @param string $reEvaluateTasks Whether or not to re-evaluate Tasks * @return $this Fluent Builder */ public function setReEvaluateTasks($reEvaluateTasks) { $this->options['reEvaluateTasks'] = $reEvaluateTasks; 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.Taskrouter.V1.UpdateWorkflowOptions ' . \implode(' ', $options) . ']'; } } class ReadWorkflowOptions extends Options { /** * @param string $friendlyName The friendly_name of the Workflow resources to * read */ public function __construct($friendlyName = Values::NONE) { $this->options['friendlyName'] = $friendlyName; } /** * The `friendly_name` of the Workflow resources to read. * * @param string $friendlyName The friendly_name of the Workflow resources to * read * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; 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.Taskrouter.V1.ReadWorkflowOptions ' . \implode(' ', $options) . ']'; } } class CreateWorkflowOptions extends Options { /** * @param string $assignmentCallbackUrl The URL from your application that will * process task assignment events * @param string $fallbackAssignmentCallbackUrl The URL that we should call * when a call to the * `assignment_callback_url` fails * @param int $taskReservationTimeout How long TaskRouter will wait for a * confirmation response from your * application after it assigns a Task to a * Worker */ public function __construct($assignmentCallbackUrl = Values::NONE, $fallbackAssignmentCallbackUrl = Values::NONE, $taskReservationTimeout = Values::NONE) { $this->options['assignmentCallbackUrl'] = $assignmentCallbackUrl; $this->options['fallbackAssignmentCallbackUrl'] = $fallbackAssignmentCallbackUrl; $this->options['taskReservationTimeout'] = $taskReservationTimeout; } /** * The URL from your application that will process task assignment events. See [Handling Task Assignment Callback](https://www.twilio.com/docs/taskrouter/handle-assignment-callbacks) for more details. * * @param string $assignmentCallbackUrl The URL from your application that will * process task assignment events * @return $this Fluent Builder */ public function setAssignmentCallbackUrl($assignmentCallbackUrl) { $this->options['assignmentCallbackUrl'] = $assignmentCallbackUrl; return $this; } /** * The URL that we should call when a call to the `assignment_callback_url` fails. * * @param string $fallbackAssignmentCallbackUrl The URL that we should call * when a call to the * `assignment_callback_url` fails * @return $this Fluent Builder */ public function setFallbackAssignmentCallbackUrl($fallbackAssignmentCallbackUrl) { $this->options['fallbackAssignmentCallbackUrl'] = $fallbackAssignmentCallbackUrl; return $this; } /** * How long TaskRouter will wait for a confirmation response from your application after it assigns a Task to a Worker. Can be up to `86,400` (24 hours) and the default is `120`. * * @param int $taskReservationTimeout How long TaskRouter will wait for a * confirmation response from your * application after it assigns a Task to a * Worker * @return $this Fluent Builder */ public function setTaskReservationTimeout($taskReservationTimeout) { $this->options['taskReservationTimeout'] = $taskReservationTimeout; 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.Taskrouter.V1.CreateWorkflowOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkerPage.php 0000644 00000001376 15002236443 0017454 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace; use Twilio\Page; class WorkerPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new WorkerInstance($this->version, $payload, $this->solution['workspaceSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Taskrouter.V1.WorkerPage]'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceCumulativeStatisticsPage.php 0000644 00000001561 15002236443 0024247 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace; use Twilio\Page; class WorkspaceCumulativeStatisticsPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new WorkspaceCumulativeStatisticsInstance( $this->version, $payload, $this->solution['workspaceSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Taskrouter.V1.WorkspaceCumulativeStatisticsPage]'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskChannelInstance.php 0000644 00000011323 15002236443 0021257 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $friendlyName * @property string $sid * @property string $uniqueName * @property string $workspaceSid * @property bool $channelOptimizedRouting * @property string $url * @property array $links */ class TaskChannelInstance extends InstanceResource { /** * Initialize the TaskChannelInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $workspaceSid The SID of the Workspace that contains the * TaskChannel * @param string $sid The SID of the TaskChannel resource to fetch * @return \Twilio\Rest\Taskrouter\V1\Workspace\TaskChannelInstance */ public function __construct(Version $version, array $payload, $workspaceSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'accountSid' => Values::array_get($payload, 'account_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'sid' => Values::array_get($payload, 'sid'), 'uniqueName' => Values::array_get($payload, 'unique_name'), 'workspaceSid' => Values::array_get($payload, 'workspace_sid'), 'channelOptimizedRouting' => Values::array_get($payload, 'channel_optimized_routing'), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ); $this->solution = array('workspaceSid' => $workspaceSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Taskrouter\V1\Workspace\TaskChannelContext Context for * this * TaskChannelInstance */ protected function proxy() { if (!$this->context) { $this->context = new TaskChannelContext( $this->version, $this->solution['workspaceSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch a TaskChannelInstance * * @return TaskChannelInstance Fetched TaskChannelInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Update the TaskChannelInstance * * @param array|Options $options Optional Arguments * @return TaskChannelInstance Updated TaskChannelInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Deletes the TaskChannelInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Taskrouter.V1.TaskChannelInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceRealTimeStatisticsPage.php 0000644 00000001553 15002236443 0023634 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace; use Twilio\Page; class WorkspaceRealTimeStatisticsPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new WorkspaceRealTimeStatisticsInstance( $this->version, $payload, $this->solution['workspaceSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Taskrouter.V1.WorkspaceRealTimeStatisticsPage]'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceStatisticsContext.php 0000644 00000004366 15002236443 0022766 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class WorkspaceStatisticsContext extends InstanceContext { /** * Initialize the WorkspaceStatisticsContext * * @param \Twilio\Version $version Version that contains the resource * @param string $workspaceSid The SID of the Workspace to fetch * @return \Twilio\Rest\Taskrouter\V1\Workspace\WorkspaceStatisticsContext */ public function __construct(Version $version, $workspaceSid) { parent::__construct($version); // Path Solution $this->solution = array('workspaceSid' => $workspaceSid, ); $this->uri = '/Workspaces/' . \rawurlencode($workspaceSid) . '/Statistics'; } /** * Fetch a WorkspaceStatisticsInstance * * @param array|Options $options Optional Arguments * @return WorkspaceStatisticsInstance Fetched WorkspaceStatisticsInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch($options = array()) { $options = new Values($options); $params = Values::of(array( 'Minutes' => $options['minutes'], 'StartDate' => Serialize::iso8601DateTime($options['startDate']), 'EndDate' => Serialize::iso8601DateTime($options['endDate']), 'TaskChannel' => $options['taskChannel'], 'SplitByWaitTime' => $options['splitByWaitTime'], )); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new WorkspaceStatisticsInstance($this->version, $payload, $this->solution['workspaceSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Taskrouter.V1.WorkspaceStatisticsContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskInstance.php 0000644 00000013430 15002236443 0017767 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property int $age * @property string $assignmentStatus * @property string $attributes * @property string $addons * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property int $priority * @property string $reason * @property string $sid * @property string $taskQueueSid * @property string $taskQueueFriendlyName * @property string $taskChannelSid * @property string $taskChannelUniqueName * @property int $timeout * @property string $workflowSid * @property string $workflowFriendlyName * @property string $workspaceSid * @property string $url * @property array $links */ class TaskInstance extends InstanceResource { protected $_reservations = null; /** * Initialize the TaskInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $workspaceSid The SID of the Workspace that contains the Task * @param string $sid The SID of the resource to fetch * @return \Twilio\Rest\Taskrouter\V1\Workspace\TaskInstance */ public function __construct(Version $version, array $payload, $workspaceSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'accountSid' => Values::array_get($payload, 'account_sid'), 'age' => Values::array_get($payload, 'age'), 'assignmentStatus' => Values::array_get($payload, 'assignment_status'), 'attributes' => Values::array_get($payload, 'attributes'), 'addons' => Values::array_get($payload, 'addons'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'priority' => Values::array_get($payload, 'priority'), 'reason' => Values::array_get($payload, 'reason'), 'sid' => Values::array_get($payload, 'sid'), 'taskQueueSid' => Values::array_get($payload, 'task_queue_sid'), 'taskQueueFriendlyName' => Values::array_get($payload, 'task_queue_friendly_name'), 'taskChannelSid' => Values::array_get($payload, 'task_channel_sid'), 'taskChannelUniqueName' => Values::array_get($payload, 'task_channel_unique_name'), 'timeout' => Values::array_get($payload, 'timeout'), 'workflowSid' => Values::array_get($payload, 'workflow_sid'), 'workflowFriendlyName' => Values::array_get($payload, 'workflow_friendly_name'), 'workspaceSid' => Values::array_get($payload, 'workspace_sid'), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ); $this->solution = array('workspaceSid' => $workspaceSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Taskrouter\V1\Workspace\TaskContext Context for this * TaskInstance */ protected function proxy() { if (!$this->context) { $this->context = new TaskContext( $this->version, $this->solution['workspaceSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch a TaskInstance * * @return TaskInstance Fetched TaskInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Update the TaskInstance * * @param array|Options $options Optional Arguments * @return TaskInstance Updated TaskInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Deletes the TaskInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Access the reservations * * @return \Twilio\Rest\Taskrouter\V1\Workspace\Task\ReservationList */ protected function getReservations() { return $this->proxy()->reservations; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Taskrouter.V1.TaskInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueueContext.php 0000644 00000015511 15002236443 0020656 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Rest\Taskrouter\V1\Workspace\TaskQueue\TaskQueueCumulativeStatisticsList; use Twilio\Rest\Taskrouter\V1\Workspace\TaskQueue\TaskQueueRealTimeStatisticsList; use Twilio\Rest\Taskrouter\V1\Workspace\TaskQueue\TaskQueueStatisticsList; use Twilio\Values; use Twilio\Version; /** * @property \Twilio\Rest\Taskrouter\V1\Workspace\TaskQueue\TaskQueueStatisticsList $statistics * @property \Twilio\Rest\Taskrouter\V1\Workspace\TaskQueue\TaskQueueRealTimeStatisticsList $realTimeStatistics * @property \Twilio\Rest\Taskrouter\V1\Workspace\TaskQueue\TaskQueueCumulativeStatisticsList $cumulativeStatistics * @method \Twilio\Rest\Taskrouter\V1\Workspace\TaskQueue\TaskQueueStatisticsContext statistics() * @method \Twilio\Rest\Taskrouter\V1\Workspace\TaskQueue\TaskQueueRealTimeStatisticsContext realTimeStatistics() * @method \Twilio\Rest\Taskrouter\V1\Workspace\TaskQueue\TaskQueueCumulativeStatisticsContext cumulativeStatistics() */ class TaskQueueContext extends InstanceContext { protected $_statistics = null; protected $_realTimeStatistics = null; protected $_cumulativeStatistics = null; /** * Initialize the TaskQueueContext * * @param \Twilio\Version $version Version that contains the resource * @param string $workspaceSid The SID of the Workspace with the TaskQueue to * fetch * @param string $sid The SID of the resource to * @return \Twilio\Rest\Taskrouter\V1\Workspace\TaskQueueContext */ public function __construct(Version $version, $workspaceSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array('workspaceSid' => $workspaceSid, 'sid' => $sid, ); $this->uri = '/Workspaces/' . \rawurlencode($workspaceSid) . '/TaskQueues/' . \rawurlencode($sid) . ''; } /** * Fetch a TaskQueueInstance * * @return TaskQueueInstance Fetched TaskQueueInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new TaskQueueInstance( $this->version, $payload, $this->solution['workspaceSid'], $this->solution['sid'] ); } /** * Update the TaskQueueInstance * * @param array|Options $options Optional Arguments * @return TaskQueueInstance Updated TaskQueueInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { $options = new Values($options); $data = Values::of(array( 'FriendlyName' => $options['friendlyName'], 'TargetWorkers' => $options['targetWorkers'], 'ReservationActivitySid' => $options['reservationActivitySid'], 'AssignmentActivitySid' => $options['assignmentActivitySid'], 'MaxReservedWorkers' => $options['maxReservedWorkers'], 'TaskOrder' => $options['taskOrder'], )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new TaskQueueInstance( $this->version, $payload, $this->solution['workspaceSid'], $this->solution['sid'] ); } /** * Deletes the TaskQueueInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Access the statistics * * @return \Twilio\Rest\Taskrouter\V1\Workspace\TaskQueue\TaskQueueStatisticsList */ protected function getStatistics() { if (!$this->_statistics) { $this->_statistics = new TaskQueueStatisticsList( $this->version, $this->solution['workspaceSid'], $this->solution['sid'] ); } return $this->_statistics; } /** * Access the realTimeStatistics * * @return \Twilio\Rest\Taskrouter\V1\Workspace\TaskQueue\TaskQueueRealTimeStatisticsList */ protected function getRealTimeStatistics() { if (!$this->_realTimeStatistics) { $this->_realTimeStatistics = new TaskQueueRealTimeStatisticsList( $this->version, $this->solution['workspaceSid'], $this->solution['sid'] ); } return $this->_realTimeStatistics; } /** * Access the cumulativeStatistics * * @return \Twilio\Rest\Taskrouter\V1\Workspace\TaskQueue\TaskQueueCumulativeStatisticsList */ protected function getCumulativeStatistics() { if (!$this->_cumulativeStatistics) { $this->_cumulativeStatistics = new TaskQueueCumulativeStatisticsList( $this->version, $this->solution['workspaceSid'], $this->solution['sid'] ); } return $this->_cumulativeStatistics; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get($name) { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Taskrouter.V1.TaskQueueContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/EventInstance.php 0000644 00000011074 15002236443 0020150 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property string $actorSid * @property string $actorType * @property string $actorUrl * @property string $description * @property array $eventData * @property \DateTime $eventDate * @property string $eventDateMs * @property string $eventType * @property string $resourceSid * @property string $resourceType * @property string $resourceUrl * @property string $sid * @property string $source * @property string $sourceIpAddress * @property string $url * @property string $workspaceSid */ class EventInstance extends InstanceResource { /** * Initialize the EventInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $workspaceSid The SID of the Workspace that contains the Event * @param string $sid The SID of the resource to fetch * @return \Twilio\Rest\Taskrouter\V1\Workspace\EventInstance */ public function __construct(Version $version, array $payload, $workspaceSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'accountSid' => Values::array_get($payload, 'account_sid'), 'actorSid' => Values::array_get($payload, 'actor_sid'), 'actorType' => Values::array_get($payload, 'actor_type'), 'actorUrl' => Values::array_get($payload, 'actor_url'), 'description' => Values::array_get($payload, 'description'), 'eventData' => Values::array_get($payload, 'event_data'), 'eventDate' => Deserialize::dateTime(Values::array_get($payload, 'event_date')), 'eventDateMs' => Values::array_get($payload, 'event_date_ms'), 'eventType' => Values::array_get($payload, 'event_type'), 'resourceSid' => Values::array_get($payload, 'resource_sid'), 'resourceType' => Values::array_get($payload, 'resource_type'), 'resourceUrl' => Values::array_get($payload, 'resource_url'), 'sid' => Values::array_get($payload, 'sid'), 'source' => Values::array_get($payload, 'source'), 'sourceIpAddress' => Values::array_get($payload, 'source_ip_address'), 'url' => Values::array_get($payload, 'url'), 'workspaceSid' => Values::array_get($payload, 'workspace_sid'), ); $this->solution = array('workspaceSid' => $workspaceSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Taskrouter\V1\Workspace\EventContext Context for this * EventInstance */ protected function proxy() { if (!$this->context) { $this->context = new EventContext( $this->version, $this->solution['workspaceSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch a EventInstance * * @return EventInstance Fetched EventInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Taskrouter.V1.EventInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueuesStatisticsOptions.php 0000644 00000013625 15002236443 0025036 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\TaskQueue; use Twilio\Options; use Twilio\Values; abstract class TaskQueuesStatisticsOptions { /** * @param \DateTime $endDate Only calculate statistics from on or before this * date * @param string $friendlyName The friendly_name of the TaskQueue statistics to * read * @param int $minutes Only calculate statistics since this many minutes in the * past * @param \DateTime $startDate Only calculate statistics from on or after this * date * @param string $taskChannel Only calculate statistics on this TaskChannel. * @param string $splitByWaitTime A comma separated list of values that * describes the thresholds to calculate * statistics on * @return ReadTaskQueuesStatisticsOptions Options builder */ public static function read($endDate = Values::NONE, $friendlyName = Values::NONE, $minutes = Values::NONE, $startDate = Values::NONE, $taskChannel = Values::NONE, $splitByWaitTime = Values::NONE) { return new ReadTaskQueuesStatisticsOptions($endDate, $friendlyName, $minutes, $startDate, $taskChannel, $splitByWaitTime); } } class ReadTaskQueuesStatisticsOptions extends Options { /** * @param \DateTime $endDate Only calculate statistics from on or before this * date * @param string $friendlyName The friendly_name of the TaskQueue statistics to * read * @param int $minutes Only calculate statistics since this many minutes in the * past * @param \DateTime $startDate Only calculate statistics from on or after this * date * @param string $taskChannel Only calculate statistics on this TaskChannel. * @param string $splitByWaitTime A comma separated list of values that * describes the thresholds to calculate * statistics on */ public function __construct($endDate = Values::NONE, $friendlyName = Values::NONE, $minutes = Values::NONE, $startDate = Values::NONE, $taskChannel = Values::NONE, $splitByWaitTime = Values::NONE) { $this->options['endDate'] = $endDate; $this->options['friendlyName'] = $friendlyName; $this->options['minutes'] = $minutes; $this->options['startDate'] = $startDate; $this->options['taskChannel'] = $taskChannel; $this->options['splitByWaitTime'] = $splitByWaitTime; } /** * Only calculate statistics from this date and time and earlier, specified in GMT as an [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time. * * @param \DateTime $endDate Only calculate statistics from on or before this * date * @return $this Fluent Builder */ public function setEndDate($endDate) { $this->options['endDate'] = $endDate; return $this; } /** * The `friendly_name` of the TaskQueue statistics to read. * * @param string $friendlyName The friendly_name of the TaskQueue statistics to * read * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * Only calculate statistics since this many minutes in the past. The default is 15 minutes. * * @param int $minutes Only calculate statistics since this many minutes in the * past * @return $this Fluent Builder */ public function setMinutes($minutes) { $this->options['minutes'] = $minutes; return $this; } /** * Only calculate statistics from this date and time and later, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. * * @param \DateTime $startDate Only calculate statistics from on or after this * date * @return $this Fluent Builder */ public function setStartDate($startDate) { $this->options['startDate'] = $startDate; return $this; } /** * Only calculate statistics on this TaskChannel. Can be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`. * * @param string $taskChannel Only calculate statistics on this TaskChannel. * @return $this Fluent Builder */ public function setTaskChannel($taskChannel) { $this->options['taskChannel'] = $taskChannel; return $this; } /** * A comma separated list of values that describes the thresholds, in seconds, to calculate statistics on. For each threshold specified, the number of Tasks canceled and reservations accepted above and below the specified thresholds in seconds are computed. * * @param string $splitByWaitTime A comma separated list of values that * describes the thresholds to calculate * statistics on * @return $this Fluent Builder */ public function setSplitByWaitTime($splitByWaitTime) { $this->options['splitByWaitTime'] = $splitByWaitTime; 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.Taskrouter.V1.ReadTaskQueuesStatisticsOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueRealTimeStatisticsContext.php 0000644 00000004704 15002236443 0026265 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\TaskQueue; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Values; use Twilio\Version; class TaskQueueRealTimeStatisticsContext extends InstanceContext { /** * Initialize the TaskQueueRealTimeStatisticsContext * * @param \Twilio\Version $version Version that contains the resource * @param string $workspaceSid The SID of the Workspace with the TaskQueue to * fetch * @param string $taskQueueSid The SID of the TaskQueue for which to fetch * statistics * @return \Twilio\Rest\Taskrouter\V1\Workspace\TaskQueue\TaskQueueRealTimeStatisticsContext */ public function __construct(Version $version, $workspaceSid, $taskQueueSid) { parent::__construct($version); // Path Solution $this->solution = array('workspaceSid' => $workspaceSid, 'taskQueueSid' => $taskQueueSid, ); $this->uri = '/Workspaces/' . \rawurlencode($workspaceSid) . '/TaskQueues/' . \rawurlencode($taskQueueSid) . '/RealTimeStatistics'; } /** * Fetch a TaskQueueRealTimeStatisticsInstance * * @param array|Options $options Optional Arguments * @return TaskQueueRealTimeStatisticsInstance Fetched * TaskQueueRealTimeStatisticsInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch($options = array()) { $options = new Values($options); $params = Values::of(array('TaskChannel' => $options['taskChannel'], )); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new TaskQueueRealTimeStatisticsInstance( $this->version, $payload, $this->solution['workspaceSid'], $this->solution['taskQueueSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Taskrouter.V1.TaskQueueRealTimeStatisticsContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueRealTimeStatisticsOptions.php 0000644 00000003321 15002236443 0026266 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\TaskQueue; use Twilio\Options; use Twilio\Values; abstract class TaskQueueRealTimeStatisticsOptions { /** * @param string $taskChannel The TaskChannel for which to fetch statistics * @return FetchTaskQueueRealTimeStatisticsOptions Options builder */ public static function fetch($taskChannel = Values::NONE) { return new FetchTaskQueueRealTimeStatisticsOptions($taskChannel); } } class FetchTaskQueueRealTimeStatisticsOptions extends Options { /** * @param string $taskChannel The TaskChannel for which to fetch statistics */ public function __construct($taskChannel = Values::NONE) { $this->options['taskChannel'] = $taskChannel; } /** * The TaskChannel for which to fetch statistics. Can be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`. * * @param string $taskChannel The TaskChannel for which to fetch statistics * @return $this Fluent Builder */ public function setTaskChannel($taskChannel) { $this->options['taskChannel'] = $taskChannel; 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.Taskrouter.V1.FetchTaskQueueRealTimeStatisticsOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueCumulativeStatisticsInstance.php 0000644 00000013617 15002236443 0027024 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\TaskQueue; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property int $avgTaskAcceptanceTime * @property \DateTime $startTime * @property \DateTime $endTime * @property int $reservationsCreated * @property int $reservationsAccepted * @property int $reservationsRejected * @property int $reservationsTimedOut * @property int $reservationsCanceled * @property int $reservationsRescinded * @property array $splitByWaitTime * @property string $taskQueueSid * @property array $waitDurationUntilAccepted * @property array $waitDurationUntilCanceled * @property int $tasksCanceled * @property int $tasksCompleted * @property int $tasksDeleted * @property int $tasksEntered * @property int $tasksMoved * @property string $workspaceSid * @property string $url */ class TaskQueueCumulativeStatisticsInstance extends InstanceResource { /** * Initialize the TaskQueueCumulativeStatisticsInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $workspaceSid The SID of the Workspace that contains the * TaskQueue * @param string $taskQueueSid The SID of the TaskQueue from which these * statistics were calculated * @return \Twilio\Rest\Taskrouter\V1\Workspace\TaskQueue\TaskQueueCumulativeStatisticsInstance */ public function __construct(Version $version, array $payload, $workspaceSid, $taskQueueSid) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'accountSid' => Values::array_get($payload, 'account_sid'), 'avgTaskAcceptanceTime' => Values::array_get($payload, 'avg_task_acceptance_time'), 'startTime' => Deserialize::dateTime(Values::array_get($payload, 'start_time')), 'endTime' => Deserialize::dateTime(Values::array_get($payload, 'end_time')), 'reservationsCreated' => Values::array_get($payload, 'reservations_created'), 'reservationsAccepted' => Values::array_get($payload, 'reservations_accepted'), 'reservationsRejected' => Values::array_get($payload, 'reservations_rejected'), 'reservationsTimedOut' => Values::array_get($payload, 'reservations_timed_out'), 'reservationsCanceled' => Values::array_get($payload, 'reservations_canceled'), 'reservationsRescinded' => Values::array_get($payload, 'reservations_rescinded'), 'splitByWaitTime' => Values::array_get($payload, 'split_by_wait_time'), 'taskQueueSid' => Values::array_get($payload, 'task_queue_sid'), 'waitDurationUntilAccepted' => Values::array_get($payload, 'wait_duration_until_accepted'), 'waitDurationUntilCanceled' => Values::array_get($payload, 'wait_duration_until_canceled'), 'tasksCanceled' => Values::array_get($payload, 'tasks_canceled'), 'tasksCompleted' => Values::array_get($payload, 'tasks_completed'), 'tasksDeleted' => Values::array_get($payload, 'tasks_deleted'), 'tasksEntered' => Values::array_get($payload, 'tasks_entered'), 'tasksMoved' => Values::array_get($payload, 'tasks_moved'), 'workspaceSid' => Values::array_get($payload, 'workspace_sid'), 'url' => Values::array_get($payload, 'url'), ); $this->solution = array('workspaceSid' => $workspaceSid, 'taskQueueSid' => $taskQueueSid, ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Taskrouter\V1\Workspace\TaskQueue\TaskQueueCumulativeStatisticsContext Context for this * TaskQueueCumulativeStatisticsInstance */ protected function proxy() { if (!$this->context) { $this->context = new TaskQueueCumulativeStatisticsContext( $this->version, $this->solution['workspaceSid'], $this->solution['taskQueueSid'] ); } return $this->context; } /** * Fetch a TaskQueueCumulativeStatisticsInstance * * @param array|Options $options Optional Arguments * @return TaskQueueCumulativeStatisticsInstance Fetched * TaskQueueCumulativeStatisticsInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch($options = array()) { return $this->proxy()->fetch($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Taskrouter.V1.TaskQueueCumulativeStatisticsInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueCumulativeStatisticsOptions.php 0000644 00000012532 15002236443 0026706 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\TaskQueue; use Twilio\Options; use Twilio\Values; abstract class TaskQueueCumulativeStatisticsOptions { /** * @param \DateTime $endDate Only calculate statistics from on or before this * date * @param int $minutes Only calculate statistics since this many minutes in the * past * @param \DateTime $startDate Only calculate statistics from on or after this * date * @param string $taskChannel Only calculate cumulative statistics on this * TaskChannel * @param string $splitByWaitTime A comma separated list of values that * describes the thresholds to calculate * statistics on * @return FetchTaskQueueCumulativeStatisticsOptions Options builder */ public static function fetch($endDate = Values::NONE, $minutes = Values::NONE, $startDate = Values::NONE, $taskChannel = Values::NONE, $splitByWaitTime = Values::NONE) { return new FetchTaskQueueCumulativeStatisticsOptions($endDate, $minutes, $startDate, $taskChannel, $splitByWaitTime); } } class FetchTaskQueueCumulativeStatisticsOptions extends Options { /** * @param \DateTime $endDate Only calculate statistics from on or before this * date * @param int $minutes Only calculate statistics since this many minutes in the * past * @param \DateTime $startDate Only calculate statistics from on or after this * date * @param string $taskChannel Only calculate cumulative statistics on this * TaskChannel * @param string $splitByWaitTime A comma separated list of values that * describes the thresholds to calculate * statistics on */ public function __construct($endDate = Values::NONE, $minutes = Values::NONE, $startDate = Values::NONE, $taskChannel = Values::NONE, $splitByWaitTime = Values::NONE) { $this->options['endDate'] = $endDate; $this->options['minutes'] = $minutes; $this->options['startDate'] = $startDate; $this->options['taskChannel'] = $taskChannel; $this->options['splitByWaitTime'] = $splitByWaitTime; } /** * Only calculate statistics from this date and time and earlier, specified in GMT as an [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time. * * @param \DateTime $endDate Only calculate statistics from on or before this * date * @return $this Fluent Builder */ public function setEndDate($endDate) { $this->options['endDate'] = $endDate; return $this; } /** * Only calculate statistics since this many minutes in the past. The default is 15 minutes. * * @param int $minutes Only calculate statistics since this many minutes in the * past * @return $this Fluent Builder */ public function setMinutes($minutes) { $this->options['minutes'] = $minutes; return $this; } /** * Only calculate statistics from this date and time and later, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. * * @param \DateTime $startDate Only calculate statistics from on or after this * date * @return $this Fluent Builder */ public function setStartDate($startDate) { $this->options['startDate'] = $startDate; return $this; } /** * Only calculate cumulative statistics on this TaskChannel. Can be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`. * * @param string $taskChannel Only calculate cumulative statistics on this * TaskChannel * @return $this Fluent Builder */ public function setTaskChannel($taskChannel) { $this->options['taskChannel'] = $taskChannel; return $this; } /** * A comma separated list of values that describes the thresholds, in seconds, to calculate statistics on. For each threshold specified, the number of Tasks canceled and reservations accepted above and below the specified thresholds in seconds are computed. * * @param string $splitByWaitTime A comma separated list of values that * describes the thresholds to calculate * statistics on * @return $this Fluent Builder */ public function setSplitByWaitTime($splitByWaitTime) { $this->options['splitByWaitTime'] = $splitByWaitTime; 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.Taskrouter.V1.FetchTaskQueueCumulativeStatisticsOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueCumulativeStatisticsPage.php 0000644 00000001650 15002236443 0026126 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\TaskQueue; use Twilio\Page; class TaskQueueCumulativeStatisticsPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new TaskQueueCumulativeStatisticsInstance( $this->version, $payload, $this->solution['workspaceSid'], $this->solution['taskQueueSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Taskrouter.V1.TaskQueueCumulativeStatisticsPage]'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueStatisticsPage.php 0000644 00000001612 15002236443 0024065 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\TaskQueue; use Twilio\Page; class TaskQueueStatisticsPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new TaskQueueStatisticsInstance( $this->version, $payload, $this->solution['workspaceSid'], $this->solution['taskQueueSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Taskrouter.V1.TaskQueueStatisticsPage]'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueStatisticsList.php 0000644 00000003114 15002236443 0024123 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\TaskQueue; use Twilio\ListResource; use Twilio\Version; class TaskQueueStatisticsList extends ListResource { /** * Construct the TaskQueueStatisticsList * * @param Version $version Version that contains the resource * @param string $workspaceSid The SID of the Workspace that contains the * TaskQueue * @param string $taskQueueSid The SID of the TaskQueue from which these * statistics were calculated * @return \Twilio\Rest\Taskrouter\V1\Workspace\TaskQueue\TaskQueueStatisticsList */ public function __construct(Version $version, $workspaceSid, $taskQueueSid) { parent::__construct($version); // Path Solution $this->solution = array('workspaceSid' => $workspaceSid, 'taskQueueSid' => $taskQueueSid, ); } /** * Constructs a TaskQueueStatisticsContext * * @return \Twilio\Rest\Taskrouter\V1\Workspace\TaskQueue\TaskQueueStatisticsContext */ public function getContext() { return new TaskQueueStatisticsContext( $this->version, $this->solution['workspaceSid'], $this->solution['taskQueueSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Taskrouter.V1.TaskQueueStatisticsList]'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueuesStatisticsInstance.php 0000644 00000004506 15002236443 0025145 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\TaskQueue; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property array $cumulative * @property array $realtime * @property string $taskQueueSid * @property string $workspaceSid */ class TaskQueuesStatisticsInstance extends InstanceResource { /** * Initialize the TaskQueuesStatisticsInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $workspaceSid The SID of the Workspace that contains the * TaskQueue * @return \Twilio\Rest\Taskrouter\V1\Workspace\TaskQueue\TaskQueuesStatisticsInstance */ public function __construct(Version $version, array $payload, $workspaceSid) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'accountSid' => Values::array_get($payload, 'account_sid'), 'cumulative' => Values::array_get($payload, 'cumulative'), 'realtime' => Values::array_get($payload, 'realtime'), 'taskQueueSid' => Values::array_get($payload, 'task_queue_sid'), 'workspaceSid' => Values::array_get($payload, 'workspace_sid'), ); $this->solution = array('workspaceSid' => $workspaceSid, ); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Taskrouter.V1.TaskQueuesStatisticsInstance]'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueuesStatisticsList.php 0000644 00000012722 15002236443 0024313 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\TaskQueue; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class TaskQueuesStatisticsList extends ListResource { /** * Construct the TaskQueuesStatisticsList * * @param Version $version Version that contains the resource * @param string $workspaceSid The SID of the Workspace that contains the * TaskQueue * @return \Twilio\Rest\Taskrouter\V1\Workspace\TaskQueue\TaskQueuesStatisticsList */ public function __construct(Version $version, $workspaceSid) { parent::__construct($version); // Path Solution $this->solution = array('workspaceSid' => $workspaceSid, ); $this->uri = '/Workspaces/' . \rawurlencode($workspaceSid) . '/TaskQueues/Statistics'; } /** * Streams TaskQueuesStatisticsInstance records from the API as a generator * stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($options = array(), $limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads TaskQueuesStatisticsInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return TaskQueuesStatisticsInstance[] Array of results */ public function read($options = array(), $limit = null, $pageSize = null) { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Retrieve a single page of TaskQueuesStatisticsInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of TaskQueuesStatisticsInstance */ public function page($options = array(), $pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $options = new Values($options); $params = Values::of(array( 'EndDate' => Serialize::iso8601DateTime($options['endDate']), 'FriendlyName' => $options['friendlyName'], 'Minutes' => $options['minutes'], 'StartDate' => Serialize::iso8601DateTime($options['startDate']), 'TaskChannel' => $options['taskChannel'], 'SplitByWaitTime' => $options['splitByWaitTime'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new TaskQueuesStatisticsPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of TaskQueuesStatisticsInstance records from the * API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of TaskQueuesStatisticsInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new TaskQueuesStatisticsPage($this->version, $response, $this->solution); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Taskrouter.V1.TaskQueuesStatisticsList]'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueStatisticsOptions.php 0000644 00000012610 15002236443 0024644 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\TaskQueue; use Twilio\Options; use Twilio\Values; abstract class TaskQueueStatisticsOptions { /** * @param \DateTime $endDate Only calculate statistics from on or before this * date * @param int $minutes Only calculate statistics since this many minutes in the * past * @param \DateTime $startDate Only calculate statistics from on or after this * date * @param string $taskChannel Only calculate real-time and cumulative * statistics for the specified TaskChannel * @param string $splitByWaitTime A comma separated list of values that * describes the thresholds to calculate * statistics on * @return FetchTaskQueueStatisticsOptions Options builder */ public static function fetch($endDate = Values::NONE, $minutes = Values::NONE, $startDate = Values::NONE, $taskChannel = Values::NONE, $splitByWaitTime = Values::NONE) { return new FetchTaskQueueStatisticsOptions($endDate, $minutes, $startDate, $taskChannel, $splitByWaitTime); } } class FetchTaskQueueStatisticsOptions extends Options { /** * @param \DateTime $endDate Only calculate statistics from on or before this * date * @param int $minutes Only calculate statistics since this many minutes in the * past * @param \DateTime $startDate Only calculate statistics from on or after this * date * @param string $taskChannel Only calculate real-time and cumulative * statistics for the specified TaskChannel * @param string $splitByWaitTime A comma separated list of values that * describes the thresholds to calculate * statistics on */ public function __construct($endDate = Values::NONE, $minutes = Values::NONE, $startDate = Values::NONE, $taskChannel = Values::NONE, $splitByWaitTime = Values::NONE) { $this->options['endDate'] = $endDate; $this->options['minutes'] = $minutes; $this->options['startDate'] = $startDate; $this->options['taskChannel'] = $taskChannel; $this->options['splitByWaitTime'] = $splitByWaitTime; } /** * Only calculate statistics from this date and time and earlier, specified in GMT as an [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time. * * @param \DateTime $endDate Only calculate statistics from on or before this * date * @return $this Fluent Builder */ public function setEndDate($endDate) { $this->options['endDate'] = $endDate; return $this; } /** * Only calculate statistics since this many minutes in the past. The default is 15 minutes. * * @param int $minutes Only calculate statistics since this many minutes in the * past * @return $this Fluent Builder */ public function setMinutes($minutes) { $this->options['minutes'] = $minutes; return $this; } /** * Only calculate statistics from this date and time and later, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. * * @param \DateTime $startDate Only calculate statistics from on or after this * date * @return $this Fluent Builder */ public function setStartDate($startDate) { $this->options['startDate'] = $startDate; return $this; } /** * Only calculate real-time and cumulative statistics for the specified TaskChannel. Can be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`. * * @param string $taskChannel Only calculate real-time and cumulative * statistics for the specified TaskChannel * @return $this Fluent Builder */ public function setTaskChannel($taskChannel) { $this->options['taskChannel'] = $taskChannel; return $this; } /** * A comma separated list of values that describes the thresholds, in seconds, to calculate statistics on. For each threshold specified, the number of Tasks canceled and reservations accepted above and below the specified thresholds in seconds are computed. * * @param string $splitByWaitTime A comma separated list of values that * describes the thresholds to calculate * statistics on * @return $this Fluent Builder */ public function setSplitByWaitTime($splitByWaitTime) { $this->options['splitByWaitTime'] = $splitByWaitTime; 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.Taskrouter.V1.FetchTaskQueueStatisticsOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueRealTimeStatisticsList.php 0000644 00000003204 15002236443 0025546 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\TaskQueue; use Twilio\ListResource; use Twilio\Version; class TaskQueueRealTimeStatisticsList extends ListResource { /** * Construct the TaskQueueRealTimeStatisticsList * * @param Version $version Version that contains the resource * @param string $workspaceSid The SID of the Workspace that contains the * TaskQueue * @param string $taskQueueSid The SID of the TaskQueue from which these * statistics were calculated * @return \Twilio\Rest\Taskrouter\V1\Workspace\TaskQueue\TaskQueueRealTimeStatisticsList */ public function __construct(Version $version, $workspaceSid, $taskQueueSid) { parent::__construct($version); // Path Solution $this->solution = array('workspaceSid' => $workspaceSid, 'taskQueueSid' => $taskQueueSid, ); } /** * Constructs a TaskQueueRealTimeStatisticsContext * * @return \Twilio\Rest\Taskrouter\V1\Workspace\TaskQueue\TaskQueueRealTimeStatisticsContext */ public function getContext() { return new TaskQueueRealTimeStatisticsContext( $this->version, $this->solution['workspaceSid'], $this->solution['taskQueueSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Taskrouter.V1.TaskQueueRealTimeStatisticsList]'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueCumulativeStatisticsContext.php 0000644 00000005407 15002236443 0026702 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\TaskQueue; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class TaskQueueCumulativeStatisticsContext extends InstanceContext { /** * Initialize the TaskQueueCumulativeStatisticsContext * * @param \Twilio\Version $version Version that contains the resource * @param string $workspaceSid The SID of the Workspace with the TaskQueue to * fetch * @param string $taskQueueSid The SID of the TaskQueue for which to fetch * statistics * @return \Twilio\Rest\Taskrouter\V1\Workspace\TaskQueue\TaskQueueCumulativeStatisticsContext */ public function __construct(Version $version, $workspaceSid, $taskQueueSid) { parent::__construct($version); // Path Solution $this->solution = array('workspaceSid' => $workspaceSid, 'taskQueueSid' => $taskQueueSid, ); $this->uri = '/Workspaces/' . \rawurlencode($workspaceSid) . '/TaskQueues/' . \rawurlencode($taskQueueSid) . '/CumulativeStatistics'; } /** * Fetch a TaskQueueCumulativeStatisticsInstance * * @param array|Options $options Optional Arguments * @return TaskQueueCumulativeStatisticsInstance Fetched * TaskQueueCumulativeStatisticsInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch($options = array()) { $options = new Values($options); $params = Values::of(array( 'EndDate' => Serialize::iso8601DateTime($options['endDate']), 'Minutes' => $options['minutes'], 'StartDate' => Serialize::iso8601DateTime($options['startDate']), 'TaskChannel' => $options['taskChannel'], 'SplitByWaitTime' => $options['splitByWaitTime'], )); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new TaskQueueCumulativeStatisticsInstance( $this->version, $payload, $this->solution['workspaceSid'], $this->solution['taskQueueSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Taskrouter.V1.TaskQueueCumulativeStatisticsContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueRealTimeStatisticsPage.php 0000644 00000001642 15002236443 0025513 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\TaskQueue; use Twilio\Page; class TaskQueueRealTimeStatisticsPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new TaskQueueRealTimeStatisticsInstance( $this->version, $payload, $this->solution['workspaceSid'], $this->solution['taskQueueSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Taskrouter.V1.TaskQueueRealTimeStatisticsPage]'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueRealTimeStatisticsInstance.php 0000644 00000011370 15002236443 0026402 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\TaskQueue; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property array $activityStatistics * @property int $longestTaskWaitingAge * @property string $longestTaskWaitingSid * @property string $taskQueueSid * @property array $tasksByPriority * @property array $tasksByStatus * @property int $totalAvailableWorkers * @property int $totalEligibleWorkers * @property int $totalTasks * @property string $workspaceSid * @property string $url */ class TaskQueueRealTimeStatisticsInstance extends InstanceResource { /** * Initialize the TaskQueueRealTimeStatisticsInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $workspaceSid The SID of the Workspace that contains the * TaskQueue * @param string $taskQueueSid The SID of the TaskQueue from which these * statistics were calculated * @return \Twilio\Rest\Taskrouter\V1\Workspace\TaskQueue\TaskQueueRealTimeStatisticsInstance */ public function __construct(Version $version, array $payload, $workspaceSid, $taskQueueSid) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'accountSid' => Values::array_get($payload, 'account_sid'), 'activityStatistics' => Values::array_get($payload, 'activity_statistics'), 'longestTaskWaitingAge' => Values::array_get($payload, 'longest_task_waiting_age'), 'longestTaskWaitingSid' => Values::array_get($payload, 'longest_task_waiting_sid'), 'taskQueueSid' => Values::array_get($payload, 'task_queue_sid'), 'tasksByPriority' => Values::array_get($payload, 'tasks_by_priority'), 'tasksByStatus' => Values::array_get($payload, 'tasks_by_status'), 'totalAvailableWorkers' => Values::array_get($payload, 'total_available_workers'), 'totalEligibleWorkers' => Values::array_get($payload, 'total_eligible_workers'), 'totalTasks' => Values::array_get($payload, 'total_tasks'), 'workspaceSid' => Values::array_get($payload, 'workspace_sid'), 'url' => Values::array_get($payload, 'url'), ); $this->solution = array('workspaceSid' => $workspaceSid, 'taskQueueSid' => $taskQueueSid, ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Taskrouter\V1\Workspace\TaskQueue\TaskQueueRealTimeStatisticsContext Context for this * TaskQueueRealTimeStatisticsInstance */ protected function proxy() { if (!$this->context) { $this->context = new TaskQueueRealTimeStatisticsContext( $this->version, $this->solution['workspaceSid'], $this->solution['taskQueueSid'] ); } return $this->context; } /** * Fetch a TaskQueueRealTimeStatisticsInstance * * @param array|Options $options Optional Arguments * @return TaskQueueRealTimeStatisticsInstance Fetched * TaskQueueRealTimeStatisticsInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch($options = array()) { return $this->proxy()->fetch($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Taskrouter.V1.TaskQueueRealTimeStatisticsInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueStatisticsInstance.php 0000644 00000007511 15002236443 0024761 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\TaskQueue; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property array $cumulative * @property array $realtime * @property string $taskQueueSid * @property string $workspaceSid * @property string $url */ class TaskQueueStatisticsInstance extends InstanceResource { /** * Initialize the TaskQueueStatisticsInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $workspaceSid The SID of the Workspace that contains the * TaskQueue * @param string $taskQueueSid The SID of the TaskQueue from which these * statistics were calculated * @return \Twilio\Rest\Taskrouter\V1\Workspace\TaskQueue\TaskQueueStatisticsInstance */ public function __construct(Version $version, array $payload, $workspaceSid, $taskQueueSid) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'accountSid' => Values::array_get($payload, 'account_sid'), 'cumulative' => Values::array_get($payload, 'cumulative'), 'realtime' => Values::array_get($payload, 'realtime'), 'taskQueueSid' => Values::array_get($payload, 'task_queue_sid'), 'workspaceSid' => Values::array_get($payload, 'workspace_sid'), 'url' => Values::array_get($payload, 'url'), ); $this->solution = array('workspaceSid' => $workspaceSid, 'taskQueueSid' => $taskQueueSid, ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Taskrouter\V1\Workspace\TaskQueue\TaskQueueStatisticsContext Context for this * TaskQueueStatisticsInstance */ protected function proxy() { if (!$this->context) { $this->context = new TaskQueueStatisticsContext( $this->version, $this->solution['workspaceSid'], $this->solution['taskQueueSid'] ); } return $this->context; } /** * Fetch a TaskQueueStatisticsInstance * * @param array|Options $options Optional Arguments * @return TaskQueueStatisticsInstance Fetched TaskQueueStatisticsInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch($options = array()) { return $this->proxy()->fetch($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Taskrouter.V1.TaskQueueStatisticsInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueStatisticsContext.php 0000644 00000005170 15002236443 0024640 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\TaskQueue; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class TaskQueueStatisticsContext extends InstanceContext { /** * Initialize the TaskQueueStatisticsContext * * @param \Twilio\Version $version Version that contains the resource * @param string $workspaceSid The SID of the Workspace with the TaskQueue to * fetch * @param string $taskQueueSid The SID of the TaskQueue for which to fetch * statistics * @return \Twilio\Rest\Taskrouter\V1\Workspace\TaskQueue\TaskQueueStatisticsContext */ public function __construct(Version $version, $workspaceSid, $taskQueueSid) { parent::__construct($version); // Path Solution $this->solution = array('workspaceSid' => $workspaceSid, 'taskQueueSid' => $taskQueueSid, ); $this->uri = '/Workspaces/' . \rawurlencode($workspaceSid) . '/TaskQueues/' . \rawurlencode($taskQueueSid) . '/Statistics'; } /** * Fetch a TaskQueueStatisticsInstance * * @param array|Options $options Optional Arguments * @return TaskQueueStatisticsInstance Fetched TaskQueueStatisticsInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch($options = array()) { $options = new Values($options); $params = Values::of(array( 'EndDate' => Serialize::iso8601DateTime($options['endDate']), 'Minutes' => $options['minutes'], 'StartDate' => Serialize::iso8601DateTime($options['startDate']), 'TaskChannel' => $options['taskChannel'], 'SplitByWaitTime' => $options['splitByWaitTime'], )); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new TaskQueueStatisticsInstance( $this->version, $payload, $this->solution['workspaceSid'], $this->solution['taskQueueSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Taskrouter.V1.TaskQueueStatisticsContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueCumulativeStatisticsList.php 0000644 00000003222 15002236443 0026162 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\TaskQueue; use Twilio\ListResource; use Twilio\Version; class TaskQueueCumulativeStatisticsList extends ListResource { /** * Construct the TaskQueueCumulativeStatisticsList * * @param Version $version Version that contains the resource * @param string $workspaceSid The SID of the Workspace that contains the * TaskQueue * @param string $taskQueueSid The SID of the TaskQueue from which these * statistics were calculated * @return \Twilio\Rest\Taskrouter\V1\Workspace\TaskQueue\TaskQueueCumulativeStatisticsList */ public function __construct(Version $version, $workspaceSid, $taskQueueSid) { parent::__construct($version); // Path Solution $this->solution = array('workspaceSid' => $workspaceSid, 'taskQueueSid' => $taskQueueSid, ); } /** * Constructs a TaskQueueCumulativeStatisticsContext * * @return \Twilio\Rest\Taskrouter\V1\Workspace\TaskQueue\TaskQueueCumulativeStatisticsContext */ public function getContext() { return new TaskQueueCumulativeStatisticsContext( $this->version, $this->solution['workspaceSid'], $this->solution['taskQueueSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Taskrouter.V1.TaskQueueCumulativeStatisticsList]'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueuesStatisticsPage.php 0000644 00000001462 15002236443 0024253 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\TaskQueue; use Twilio\Page; class TaskQueuesStatisticsPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new TaskQueuesStatisticsInstance($this->version, $payload, $this->solution['workspaceSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Taskrouter.V1.TaskQueuesStatisticsPage]'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceStatisticsInstance.php 0000644 00000006412 15002236443 0023100 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property array $realtime * @property array $cumulative * @property string $accountSid * @property string $workspaceSid * @property string $url */ class WorkspaceStatisticsInstance extends InstanceResource { /** * Initialize the WorkspaceStatisticsInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $workspaceSid The SID of the Workspace * @return \Twilio\Rest\Taskrouter\V1\Workspace\WorkspaceStatisticsInstance */ public function __construct(Version $version, array $payload, $workspaceSid) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'realtime' => Values::array_get($payload, 'realtime'), 'cumulative' => Values::array_get($payload, 'cumulative'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'workspaceSid' => Values::array_get($payload, 'workspace_sid'), 'url' => Values::array_get($payload, 'url'), ); $this->solution = array('workspaceSid' => $workspaceSid, ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Taskrouter\V1\Workspace\WorkspaceStatisticsContext Context for this WorkspaceStatisticsInstance */ protected function proxy() { if (!$this->context) { $this->context = new WorkspaceStatisticsContext($this->version, $this->solution['workspaceSid']); } return $this->context; } /** * Fetch a WorkspaceStatisticsInstance * * @param array|Options $options Optional Arguments * @return WorkspaceStatisticsInstance Fetched WorkspaceStatisticsInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch($options = array()) { return $this->proxy()->fetch($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Taskrouter.V1.WorkspaceStatisticsInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceCumulativeStatisticsContext.php 0000644 00000004663 15002236443 0025025 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class WorkspaceCumulativeStatisticsContext extends InstanceContext { /** * Initialize the WorkspaceCumulativeStatisticsContext * * @param \Twilio\Version $version Version that contains the resource * @param string $workspaceSid The SID of the Workspace to fetch * @return \Twilio\Rest\Taskrouter\V1\Workspace\WorkspaceCumulativeStatisticsContext */ public function __construct(Version $version, $workspaceSid) { parent::__construct($version); // Path Solution $this->solution = array('workspaceSid' => $workspaceSid, ); $this->uri = '/Workspaces/' . \rawurlencode($workspaceSid) . '/CumulativeStatistics'; } /** * Fetch a WorkspaceCumulativeStatisticsInstance * * @param array|Options $options Optional Arguments * @return WorkspaceCumulativeStatisticsInstance Fetched * WorkspaceCumulativeStatisticsInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch($options = array()) { $options = new Values($options); $params = Values::of(array( 'EndDate' => Serialize::iso8601DateTime($options['endDate']), 'Minutes' => $options['minutes'], 'StartDate' => Serialize::iso8601DateTime($options['startDate']), 'TaskChannel' => $options['taskChannel'], 'SplitByWaitTime' => $options['splitByWaitTime'], )); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new WorkspaceCumulativeStatisticsInstance( $this->version, $payload, $this->solution['workspaceSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Taskrouter.V1.WorkspaceCumulativeStatisticsContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskList.php 0000644 00000015061 15002236443 0017140 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class TaskList extends ListResource { /** * Construct the TaskList * * @param Version $version Version that contains the resource * @param string $workspaceSid The SID of the Workspace that contains the Task * @return \Twilio\Rest\Taskrouter\V1\Workspace\TaskList */ public function __construct(Version $version, $workspaceSid) { parent::__construct($version); // Path Solution $this->solution = array('workspaceSid' => $workspaceSid, ); $this->uri = '/Workspaces/' . \rawurlencode($workspaceSid) . '/Tasks'; } /** * Streams TaskInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($options = array(), $limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads TaskInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return TaskInstance[] Array of results */ public function read($options = array(), $limit = null, $pageSize = null) { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Retrieve a single page of TaskInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of TaskInstance */ public function page($options = array(), $pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $options = new Values($options); $params = Values::of(array( 'Priority' => $options['priority'], 'AssignmentStatus' => Serialize::map($options['assignmentStatus'], function($e) { return $e; }), 'WorkflowSid' => $options['workflowSid'], 'WorkflowName' => $options['workflowName'], 'TaskQueueSid' => $options['taskQueueSid'], 'TaskQueueName' => $options['taskQueueName'], 'EvaluateTaskAttributes' => $options['evaluateTaskAttributes'], 'Ordering' => $options['ordering'], 'HasAddons' => Serialize::booleanToString($options['hasAddons']), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new TaskPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of TaskInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of TaskInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new TaskPage($this->version, $response, $this->solution); } /** * Create a new TaskInstance * * @param array|Options $options Optional Arguments * @return TaskInstance Newly created TaskInstance * @throws TwilioException When an HTTP error occurs. */ public function create($options = array()) { $options = new Values($options); $data = Values::of(array( 'Timeout' => $options['timeout'], 'Priority' => $options['priority'], 'TaskChannel' => $options['taskChannel'], 'WorkflowSid' => $options['workflowSid'], 'Attributes' => $options['attributes'], )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new TaskInstance($this->version, $payload, $this->solution['workspaceSid']); } /** * Constructs a TaskContext * * @param string $sid The SID of the resource to fetch * @return \Twilio\Rest\Taskrouter\V1\Workspace\TaskContext */ public function getContext($sid) { return new TaskContext($this->version, $this->solution['workspaceSid'], $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Taskrouter.V1.TaskList]'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceRealTimeStatisticsContext.php 0000644 00000004160 15002236443 0024401 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Values; use Twilio\Version; class WorkspaceRealTimeStatisticsContext extends InstanceContext { /** * Initialize the WorkspaceRealTimeStatisticsContext * * @param \Twilio\Version $version Version that contains the resource * @param string $workspaceSid The SID of the Workspace to fetch * @return \Twilio\Rest\Taskrouter\V1\Workspace\WorkspaceRealTimeStatisticsContext */ public function __construct(Version $version, $workspaceSid) { parent::__construct($version); // Path Solution $this->solution = array('workspaceSid' => $workspaceSid, ); $this->uri = '/Workspaces/' . \rawurlencode($workspaceSid) . '/RealTimeStatistics'; } /** * Fetch a WorkspaceRealTimeStatisticsInstance * * @param array|Options $options Optional Arguments * @return WorkspaceRealTimeStatisticsInstance Fetched * WorkspaceRealTimeStatisticsInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch($options = array()) { $options = new Values($options); $params = Values::of(array('TaskChannel' => $options['taskChannel'], )); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new WorkspaceRealTimeStatisticsInstance( $this->version, $payload, $this->solution['workspaceSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Taskrouter.V1.WorkspaceRealTimeStatisticsContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/ActivityOptions.php 0000644 00000013336 15002236443 0020555 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace; use Twilio\Options; use Twilio\Values; abstract class ActivityOptions { /** * @param string $friendlyName A string to describe the Activity resource * @return UpdateActivityOptions Options builder */ public static function update($friendlyName = Values::NONE) { return new UpdateActivityOptions($friendlyName); } /** * @param string $friendlyName The friendly_name of the Activity resources to * read * @param string $available Whether to return activities that are available or * unavailable * @return ReadActivityOptions Options builder */ public static function read($friendlyName = Values::NONE, $available = Values::NONE) { return new ReadActivityOptions($friendlyName, $available); } /** * @param bool $available Whether the Worker should be eligible to receive a * Task when it occupies the Activity * @return CreateActivityOptions Options builder */ public static function create($available = Values::NONE) { return new CreateActivityOptions($available); } } class UpdateActivityOptions extends Options { /** * @param string $friendlyName A string to describe the Activity resource */ public function __construct($friendlyName = Values::NONE) { $this->options['friendlyName'] = $friendlyName; } /** * A descriptive string that you create to describe the Activity resource. It can be up to 64 characters long. These names are used to calculate and expose statistics about Workers, and provide visibility into the state of each Worker. Examples of friendly names include: `on-call`, `break`, and `email`. * * @param string $friendlyName A string to describe the Activity resource * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; 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.Taskrouter.V1.UpdateActivityOptions ' . \implode(' ', $options) . ']'; } } class ReadActivityOptions extends Options { /** * @param string $friendlyName The friendly_name of the Activity resources to * read * @param string $available Whether to return activities that are available or * unavailable */ public function __construct($friendlyName = Values::NONE, $available = Values::NONE) { $this->options['friendlyName'] = $friendlyName; $this->options['available'] = $available; } /** * The `friendly_name` of the Activity resources to read. * * @param string $friendlyName The friendly_name of the Activity resources to * read * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * Whether return only Activity resources that are available or unavailable. A value of `true` returns only available activities. Values of '1' or `yes` also indicate `true`. All other values represent `false` and return activities that are unavailable. * * @param string $available Whether to return activities that are available or * unavailable * @return $this Fluent Builder */ public function setAvailable($available) { $this->options['available'] = $available; 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.Taskrouter.V1.ReadActivityOptions ' . \implode(' ', $options) . ']'; } } class CreateActivityOptions extends Options { /** * @param bool $available Whether the Worker should be eligible to receive a * Task when it occupies the Activity */ public function __construct($available = Values::NONE) { $this->options['available'] = $available; } /** * Whether the Worker should be eligible to receive a Task when it occupies the Activity. A value of `true`, `1`, or `yes` specifies the Activity is available. All other values specify that it is not. * * @param bool $available Whether the Worker should be eligible to receive a * Task when it occupies the Activity * @return $this Fluent Builder */ public function setAvailable($available) { $this->options['available'] = $available; 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.Taskrouter.V1.CreateActivityOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskChannelContext.php 0000644 00000006176 15002236443 0021151 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class TaskChannelContext extends InstanceContext { /** * Initialize the TaskChannelContext * * @param \Twilio\Version $version Version that contains the resource * @param string $workspaceSid The SID of the Workspace with the TaskChannel to * fetch * @param string $sid The SID of the TaskChannel resource to fetch * @return \Twilio\Rest\Taskrouter\V1\Workspace\TaskChannelContext */ public function __construct(Version $version, $workspaceSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array('workspaceSid' => $workspaceSid, 'sid' => $sid, ); $this->uri = '/Workspaces/' . \rawurlencode($workspaceSid) . '/TaskChannels/' . \rawurlencode($sid) . ''; } /** * Fetch a TaskChannelInstance * * @return TaskChannelInstance Fetched TaskChannelInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new TaskChannelInstance( $this->version, $payload, $this->solution['workspaceSid'], $this->solution['sid'] ); } /** * Update the TaskChannelInstance * * @param array|Options $options Optional Arguments * @return TaskChannelInstance Updated TaskChannelInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { $options = new Values($options); $data = Values::of(array( 'FriendlyName' => $options['friendlyName'], 'ChannelOptimizedRouting' => Serialize::booleanToString($options['channelOptimizedRouting']), )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new TaskChannelInstance( $this->version, $payload, $this->solution['workspaceSid'], $this->solution['sid'] ); } /** * Deletes the TaskChannelInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Taskrouter.V1.TaskChannelContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/EventContext.php 0000644 00000003556 15002236443 0020036 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; class EventContext extends InstanceContext { /** * Initialize the EventContext * * @param \Twilio\Version $version Version that contains the resource * @param string $workspaceSid The SID of the Workspace with the Event to fetch * @param string $sid The SID of the resource to fetch * @return \Twilio\Rest\Taskrouter\V1\Workspace\EventContext */ public function __construct(Version $version, $workspaceSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array('workspaceSid' => $workspaceSid, 'sid' => $sid, ); $this->uri = '/Workspaces/' . \rawurlencode($workspaceSid) . '/Events/' . \rawurlencode($sid) . ''; } /** * Fetch a EventInstance * * @return EventInstance Fetched EventInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new EventInstance( $this->version, $payload, $this->solution['workspaceSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Taskrouter.V1.EventContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskPage.php 0000644 00000001370 15002236443 0017077 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace; use Twilio\Page; class TaskPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new TaskInstance($this->version, $payload, $this->solution['workspaceSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Taskrouter.V1.TaskPage]'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkerList.php 0000644 00000020014 15002236443 0017501 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Rest\Taskrouter\V1\Workspace\Worker\WorkersStatisticsList; use Twilio\Values; use Twilio\Version; /** * @property \Twilio\Rest\Taskrouter\V1\Workspace\Worker\WorkersStatisticsList $statistics * @method \Twilio\Rest\Taskrouter\V1\Workspace\Worker\WorkersStatisticsContext statistics() */ class WorkerList extends ListResource { protected $_statistics = null; /** * Construct the WorkerList * * @param Version $version Version that contains the resource * @param string $workspaceSid The SID of the Workspace that contains the Worker * @return \Twilio\Rest\Taskrouter\V1\Workspace\WorkerList */ public function __construct(Version $version, $workspaceSid) { parent::__construct($version); // Path Solution $this->solution = array('workspaceSid' => $workspaceSid, ); $this->uri = '/Workspaces/' . \rawurlencode($workspaceSid) . '/Workers'; } /** * Streams WorkerInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($options = array(), $limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads WorkerInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return WorkerInstance[] Array of results */ public function read($options = array(), $limit = null, $pageSize = null) { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Retrieve a single page of WorkerInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of WorkerInstance */ public function page($options = array(), $pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $options = new Values($options); $params = Values::of(array( 'ActivityName' => $options['activityName'], 'ActivitySid' => $options['activitySid'], 'Available' => $options['available'], 'FriendlyName' => $options['friendlyName'], 'TargetWorkersExpression' => $options['targetWorkersExpression'], 'TaskQueueName' => $options['taskQueueName'], 'TaskQueueSid' => $options['taskQueueSid'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new WorkerPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of WorkerInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of WorkerInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new WorkerPage($this->version, $response, $this->solution); } /** * Create a new WorkerInstance * * @param string $friendlyName A string to describe the resource * @param array|Options $options Optional Arguments * @return WorkerInstance Newly created WorkerInstance * @throws TwilioException When an HTTP error occurs. */ public function create($friendlyName, $options = array()) { $options = new Values($options); $data = Values::of(array( 'FriendlyName' => $friendlyName, 'ActivitySid' => $options['activitySid'], 'Attributes' => $options['attributes'], )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new WorkerInstance($this->version, $payload, $this->solution['workspaceSid']); } /** * Access the statistics */ protected function getStatistics() { if (!$this->_statistics) { $this->_statistics = new WorkersStatisticsList($this->version, $this->solution['workspaceSid']); } return $this->_statistics; } /** * Constructs a WorkerContext * * @param string $sid The SID of the resource to fetch * @return \Twilio\Rest\Taskrouter\V1\Workspace\WorkerContext */ public function getContext($sid) { return new WorkerContext($this->version, $this->solution['workspaceSid'], $sid); } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get($name) { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Taskrouter.V1.WorkerList]'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskChannelList.php 0000644 00000014112 15002236443 0020425 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class TaskChannelList extends ListResource { /** * Construct the TaskChannelList * * @param Version $version Version that contains the resource * @param string $workspaceSid The SID of the Workspace that contains the * TaskChannel * @return \Twilio\Rest\Taskrouter\V1\Workspace\TaskChannelList */ public function __construct(Version $version, $workspaceSid) { parent::__construct($version); // Path Solution $this->solution = array('workspaceSid' => $workspaceSid, ); $this->uri = '/Workspaces/' . \rawurlencode($workspaceSid) . '/TaskChannels'; } /** * Streams TaskChannelInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads TaskChannelInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return TaskChannelInstance[] Array of results */ public function read($limit = null, $pageSize = null) { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of TaskChannelInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of TaskChannelInstance */ public function page($pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $params = Values::of(array( 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new TaskChannelPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of TaskChannelInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of TaskChannelInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new TaskChannelPage($this->version, $response, $this->solution); } /** * Create a new TaskChannelInstance * * @param string $friendlyName A string to describe the TaskChannel resource * @param string $uniqueName An application-defined string that uniquely * identifies the TaskChannel * @param array|Options $options Optional Arguments * @return TaskChannelInstance Newly created TaskChannelInstance * @throws TwilioException When an HTTP error occurs. */ public function create($friendlyName, $uniqueName, $options = array()) { $options = new Values($options); $data = Values::of(array( 'FriendlyName' => $friendlyName, 'UniqueName' => $uniqueName, 'ChannelOptimizedRouting' => Serialize::booleanToString($options['channelOptimizedRouting']), )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new TaskChannelInstance($this->version, $payload, $this->solution['workspaceSid']); } /** * Constructs a TaskChannelContext * * @param string $sid The SID of the TaskChannel resource to fetch * @return \Twilio\Rest\Taskrouter\V1\Workspace\TaskChannelContext */ public function getContext($sid) { return new TaskChannelContext($this->version, $this->solution['workspaceSid'], $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Taskrouter.V1.TaskChannelList]'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceStatisticsOptions.php 0000644 00000013005 15002236443 0022763 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace; use Twilio\Options; use Twilio\Values; abstract class WorkspaceStatisticsOptions { /** * @param int $minutes Only calculate statistics since this many minutes in the * past * @param \DateTime $startDate Only calculate statistics from on or after this * date * @param \DateTime $endDate Only calculate statistics from this date and time * and earlier * @param string $taskChannel Only calculate statistics on this TaskChannel. * @param string $splitByWaitTime A comma separated list of values that * describes the thresholds to calculate * statistics on * @return FetchWorkspaceStatisticsOptions Options builder */ public static function fetch($minutes = Values::NONE, $startDate = Values::NONE, $endDate = Values::NONE, $taskChannel = Values::NONE, $splitByWaitTime = Values::NONE) { return new FetchWorkspaceStatisticsOptions($minutes, $startDate, $endDate, $taskChannel, $splitByWaitTime); } } class FetchWorkspaceStatisticsOptions extends Options { /** * @param int $minutes Only calculate statistics since this many minutes in the * past * @param \DateTime $startDate Only calculate statistics from on or after this * date * @param \DateTime $endDate Only calculate statistics from this date and time * and earlier * @param string $taskChannel Only calculate statistics on this TaskChannel. * @param string $splitByWaitTime A comma separated list of values that * describes the thresholds to calculate * statistics on */ public function __construct($minutes = Values::NONE, $startDate = Values::NONE, $endDate = Values::NONE, $taskChannel = Values::NONE, $splitByWaitTime = Values::NONE) { $this->options['minutes'] = $minutes; $this->options['startDate'] = $startDate; $this->options['endDate'] = $endDate; $this->options['taskChannel'] = $taskChannel; $this->options['splitByWaitTime'] = $splitByWaitTime; } /** * Only calculate statistics since this many minutes in the past. The default 15 minutes. This is helpful for displaying statistics for the last 15 minutes, 240 minutes (4 hours), and 480 minutes (8 hours) to see trends. * * @param int $minutes Only calculate statistics since this many minutes in the * past * @return $this Fluent Builder */ public function setMinutes($minutes) { $this->options['minutes'] = $minutes; return $this; } /** * Only calculate statistics from this date and time and later, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. * * @param \DateTime $startDate Only calculate statistics from on or after this * date * @return $this Fluent Builder */ public function setStartDate($startDate) { $this->options['startDate'] = $startDate; return $this; } /** * Only calculate statistics from this date and time and earlier, specified in GMT as an [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time. * * @param \DateTime $endDate Only calculate statistics from this date and time * and earlier * @return $this Fluent Builder */ public function setEndDate($endDate) { $this->options['endDate'] = $endDate; return $this; } /** * Only calculate statistics on this TaskChannel. Can be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`. * * @param string $taskChannel Only calculate statistics on this TaskChannel. * @return $this Fluent Builder */ public function setTaskChannel($taskChannel) { $this->options['taskChannel'] = $taskChannel; return $this; } /** * A comma separated list of values that describes the thresholds, in seconds, to calculate statistics on. For each threshold specified, the number of Tasks canceled and reservations accepted above and below the specified thresholds in seconds are computed. For example, `5,30` would show splits of Tasks that were canceled or accepted before and after 5 seconds and before and after 30 seconds. This can be used to show short abandoned Tasks or Tasks that failed to meet an SLA. * * @param string $splitByWaitTime A comma separated list of values that * describes the thresholds to calculate * statistics on * @return $this Fluent Builder */ public function setSplitByWaitTime($splitByWaitTime) { $this->options['splitByWaitTime'] = $splitByWaitTime; 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.Taskrouter.V1.FetchWorkspaceStatisticsOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkflowInstance.php 0000644 00000013655 15002236443 0020710 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property string $assignmentCallbackUrl * @property string $configuration * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $documentContentType * @property string $fallbackAssignmentCallbackUrl * @property string $friendlyName * @property string $sid * @property int $taskReservationTimeout * @property string $workspaceSid * @property string $url * @property array $links */ class WorkflowInstance extends InstanceResource { protected $_statistics = null; protected $_realTimeStatistics = null; protected $_cumulativeStatistics = null; /** * Initialize the WorkflowInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $workspaceSid The SID of the Workspace that contains the * Workflow * @param string $sid The SID of the resource * @return \Twilio\Rest\Taskrouter\V1\Workspace\WorkflowInstance */ public function __construct(Version $version, array $payload, $workspaceSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'accountSid' => Values::array_get($payload, 'account_sid'), 'assignmentCallbackUrl' => Values::array_get($payload, 'assignment_callback_url'), 'configuration' => Values::array_get($payload, 'configuration'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'documentContentType' => Values::array_get($payload, 'document_content_type'), 'fallbackAssignmentCallbackUrl' => Values::array_get($payload, 'fallback_assignment_callback_url'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'sid' => Values::array_get($payload, 'sid'), 'taskReservationTimeout' => Values::array_get($payload, 'task_reservation_timeout'), 'workspaceSid' => Values::array_get($payload, 'workspace_sid'), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ); $this->solution = array('workspaceSid' => $workspaceSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Taskrouter\V1\Workspace\WorkflowContext Context for * this * WorkflowInstance */ protected function proxy() { if (!$this->context) { $this->context = new WorkflowContext( $this->version, $this->solution['workspaceSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch a WorkflowInstance * * @return WorkflowInstance Fetched WorkflowInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Update the WorkflowInstance * * @param array|Options $options Optional Arguments * @return WorkflowInstance Updated WorkflowInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Deletes the WorkflowInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Access the statistics * * @return \Twilio\Rest\Taskrouter\V1\Workspace\Workflow\WorkflowStatisticsList */ protected function getStatistics() { return $this->proxy()->statistics; } /** * Access the realTimeStatistics * * @return \Twilio\Rest\Taskrouter\V1\Workspace\Workflow\WorkflowRealTimeStatisticsList */ protected function getRealTimeStatistics() { return $this->proxy()->realTimeStatistics; } /** * Access the cumulativeStatistics * * @return \Twilio\Rest\Taskrouter\V1\Workspace\Workflow\WorkflowCumulativeStatisticsList */ protected function getCumulativeStatistics() { return $this->proxy()->cumulativeStatistics; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Taskrouter.V1.WorkflowInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkerContext.php 0000644 00000017770 15002236443 0020231 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Rest\Taskrouter\V1\Workspace\Worker\ReservationList; use Twilio\Rest\Taskrouter\V1\Workspace\Worker\WorkerChannelList; use Twilio\Rest\Taskrouter\V1\Workspace\Worker\WorkerStatisticsList; use Twilio\Rest\Taskrouter\V1\Workspace\Worker\WorkersCumulativeStatisticsList; use Twilio\Rest\Taskrouter\V1\Workspace\Worker\WorkersRealTimeStatisticsList; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * @property \Twilio\Rest\Taskrouter\V1\Workspace\Worker\WorkersRealTimeStatisticsList $realTimeStatistics * @property \Twilio\Rest\Taskrouter\V1\Workspace\Worker\WorkersCumulativeStatisticsList $cumulativeStatistics * @property \Twilio\Rest\Taskrouter\V1\Workspace\Worker\WorkerStatisticsList $statistics * @property \Twilio\Rest\Taskrouter\V1\Workspace\Worker\ReservationList $reservations * @property \Twilio\Rest\Taskrouter\V1\Workspace\Worker\WorkerChannelList $workerChannels * @method \Twilio\Rest\Taskrouter\V1\Workspace\Worker\WorkersRealTimeStatisticsContext realTimeStatistics() * @method \Twilio\Rest\Taskrouter\V1\Workspace\Worker\WorkersCumulativeStatisticsContext cumulativeStatistics() * @method \Twilio\Rest\Taskrouter\V1\Workspace\Worker\WorkerStatisticsContext statistics() * @method \Twilio\Rest\Taskrouter\V1\Workspace\Worker\ReservationContext reservations(string $sid) * @method \Twilio\Rest\Taskrouter\V1\Workspace\Worker\WorkerChannelContext workerChannels(string $sid) */ class WorkerContext extends InstanceContext { protected $_realTimeStatistics = null; protected $_cumulativeStatistics = null; protected $_statistics = null; protected $_reservations = null; protected $_workerChannels = null; /** * Initialize the WorkerContext * * @param \Twilio\Version $version Version that contains the resource * @param string $workspaceSid The SID of the Workspace with the Worker to fetch * @param string $sid The SID of the resource to fetch * @return \Twilio\Rest\Taskrouter\V1\Workspace\WorkerContext */ public function __construct(Version $version, $workspaceSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array('workspaceSid' => $workspaceSid, 'sid' => $sid, ); $this->uri = '/Workspaces/' . \rawurlencode($workspaceSid) . '/Workers/' . \rawurlencode($sid) . ''; } /** * Fetch a WorkerInstance * * @return WorkerInstance Fetched WorkerInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new WorkerInstance( $this->version, $payload, $this->solution['workspaceSid'], $this->solution['sid'] ); } /** * Update the WorkerInstance * * @param array|Options $options Optional Arguments * @return WorkerInstance Updated WorkerInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { $options = new Values($options); $data = Values::of(array( 'ActivitySid' => $options['activitySid'], 'Attributes' => $options['attributes'], 'FriendlyName' => $options['friendlyName'], 'RejectPendingReservations' => Serialize::booleanToString($options['rejectPendingReservations']), )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new WorkerInstance( $this->version, $payload, $this->solution['workspaceSid'], $this->solution['sid'] ); } /** * Deletes the WorkerInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Access the realTimeStatistics * * @return \Twilio\Rest\Taskrouter\V1\Workspace\Worker\WorkersRealTimeStatisticsList */ protected function getRealTimeStatistics() { if (!$this->_realTimeStatistics) { $this->_realTimeStatistics = new WorkersRealTimeStatisticsList( $this->version, $this->solution['workspaceSid'] ); } return $this->_realTimeStatistics; } /** * Access the cumulativeStatistics * * @return \Twilio\Rest\Taskrouter\V1\Workspace\Worker\WorkersCumulativeStatisticsList */ protected function getCumulativeStatistics() { if (!$this->_cumulativeStatistics) { $this->_cumulativeStatistics = new WorkersCumulativeStatisticsList( $this->version, $this->solution['workspaceSid'] ); } return $this->_cumulativeStatistics; } /** * Access the statistics * * @return \Twilio\Rest\Taskrouter\V1\Workspace\Worker\WorkerStatisticsList */ protected function getStatistics() { if (!$this->_statistics) { $this->_statistics = new WorkerStatisticsList( $this->version, $this->solution['workspaceSid'], $this->solution['sid'] ); } return $this->_statistics; } /** * Access the reservations * * @return \Twilio\Rest\Taskrouter\V1\Workspace\Worker\ReservationList */ protected function getReservations() { if (!$this->_reservations) { $this->_reservations = new ReservationList( $this->version, $this->solution['workspaceSid'], $this->solution['sid'] ); } return $this->_reservations; } /** * Access the workerChannels * * @return \Twilio\Rest\Taskrouter\V1\Workspace\Worker\WorkerChannelList */ protected function getWorkerChannels() { if (!$this->_workerChannels) { $this->_workerChannels = new WorkerChannelList( $this->version, $this->solution['workspaceSid'], $this->solution['sid'] ); } return $this->_workerChannels; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get($name) { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Taskrouter.V1.WorkerContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersStatisticsPage.php 0000644 00000001446 15002236443 0023161 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\Worker; use Twilio\Page; class WorkersStatisticsPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new WorkersStatisticsInstance($this->version, $payload, $this->solution['workspaceSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Taskrouter.V1.WorkersStatisticsPage]'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/ReservationContext.php 0000644 00000015107 15002236443 0022522 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\Worker; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class ReservationContext extends InstanceContext { /** * Initialize the ReservationContext * * @param \Twilio\Version $version Version that contains the resource * @param string $workspaceSid The SID of the Workspace with the * WorkerReservation resource to fetch * @param string $workerSid The SID of the reserved Worker resource with the * WorkerReservation resource to fetch * @param string $sid The SID of the WorkerReservation resource to fetch * @return \Twilio\Rest\Taskrouter\V1\Workspace\Worker\ReservationContext */ public function __construct(Version $version, $workspaceSid, $workerSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array('workspaceSid' => $workspaceSid, 'workerSid' => $workerSid, 'sid' => $sid, ); $this->uri = '/Workspaces/' . \rawurlencode($workspaceSid) . '/Workers/' . \rawurlencode($workerSid) . '/Reservations/' . \rawurlencode($sid) . ''; } /** * Fetch a ReservationInstance * * @return ReservationInstance Fetched ReservationInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new ReservationInstance( $this->version, $payload, $this->solution['workspaceSid'], $this->solution['workerSid'], $this->solution['sid'] ); } /** * Update the ReservationInstance * * @param array|Options $options Optional Arguments * @return ReservationInstance Updated ReservationInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { $options = new Values($options); $data = Values::of(array( 'ReservationStatus' => $options['reservationStatus'], 'WorkerActivitySid' => $options['workerActivitySid'], 'Instruction' => $options['instruction'], 'DequeuePostWorkActivitySid' => $options['dequeuePostWorkActivitySid'], 'DequeueFrom' => $options['dequeueFrom'], 'DequeueRecord' => $options['dequeueRecord'], 'DequeueTimeout' => $options['dequeueTimeout'], 'DequeueTo' => $options['dequeueTo'], 'DequeueStatusCallbackUrl' => $options['dequeueStatusCallbackUrl'], 'CallFrom' => $options['callFrom'], 'CallRecord' => $options['callRecord'], 'CallTimeout' => $options['callTimeout'], 'CallTo' => $options['callTo'], 'CallUrl' => $options['callUrl'], 'CallStatusCallbackUrl' => $options['callStatusCallbackUrl'], 'CallAccept' => Serialize::booleanToString($options['callAccept']), 'RedirectCallSid' => $options['redirectCallSid'], 'RedirectAccept' => Serialize::booleanToString($options['redirectAccept']), 'RedirectUrl' => $options['redirectUrl'], 'To' => $options['to'], 'From' => $options['from'], 'StatusCallback' => $options['statusCallback'], 'StatusCallbackMethod' => $options['statusCallbackMethod'], 'StatusCallbackEvent' => Serialize::map($options['statusCallbackEvent'], function($e) { return $e; }), 'Timeout' => $options['timeout'], 'Record' => Serialize::booleanToString($options['record']), 'Muted' => Serialize::booleanToString($options['muted']), 'Beep' => $options['beep'], 'StartConferenceOnEnter' => Serialize::booleanToString($options['startConferenceOnEnter']), 'EndConferenceOnExit' => Serialize::booleanToString($options['endConferenceOnExit']), 'WaitUrl' => $options['waitUrl'], 'WaitMethod' => $options['waitMethod'], 'EarlyMedia' => Serialize::booleanToString($options['earlyMedia']), 'MaxParticipants' => $options['maxParticipants'], 'ConferenceStatusCallback' => $options['conferenceStatusCallback'], 'ConferenceStatusCallbackMethod' => $options['conferenceStatusCallbackMethod'], 'ConferenceStatusCallbackEvent' => Serialize::map($options['conferenceStatusCallbackEvent'], function($e) { return $e; }), 'ConferenceRecord' => $options['conferenceRecord'], 'ConferenceTrim' => $options['conferenceTrim'], 'RecordingChannels' => $options['recordingChannels'], 'RecordingStatusCallback' => $options['recordingStatusCallback'], 'RecordingStatusCallbackMethod' => $options['recordingStatusCallbackMethod'], 'ConferenceRecordingStatusCallback' => $options['conferenceRecordingStatusCallback'], 'ConferenceRecordingStatusCallbackMethod' => $options['conferenceRecordingStatusCallbackMethod'], 'Region' => $options['region'], 'SipAuthUsername' => $options['sipAuthUsername'], 'SipAuthPassword' => $options['sipAuthPassword'], 'DequeueStatusCallbackEvent' => Serialize::map($options['dequeueStatusCallbackEvent'], function($e) { return $e; }), 'PostWorkActivitySid' => $options['postWorkActivitySid'], 'EndConferenceOnCustomerExit' => Serialize::booleanToString($options['endConferenceOnCustomerExit']), 'BeepOnCustomerEntrance' => Serialize::booleanToString($options['beepOnCustomerEntrance']), )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new ReservationInstance( $this->version, $payload, $this->solution['workspaceSid'], $this->solution['workerSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Taskrouter.V1.ReservationContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkerStatisticsPage.php 0000644 00000001573 15002236443 0022777 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\Worker; use Twilio\Page; class WorkerStatisticsPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new WorkerStatisticsInstance( $this->version, $payload, $this->solution['workspaceSid'], $this->solution['workerSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Taskrouter.V1.WorkerStatisticsPage]'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/ReservationPage.php 0000644 00000001554 15002236443 0021753 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\Worker; use Twilio\Page; class ReservationPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new ReservationInstance( $this->version, $payload, $this->solution['workspaceSid'], $this->solution['workerSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Taskrouter.V1.ReservationPage]'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkerStatisticsInstance.php 0000644 00000007102 15002236443 0023661 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\Worker; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property array $cumulative * @property string $workerSid * @property string $workspaceSid * @property string $url */ class WorkerStatisticsInstance extends InstanceResource { /** * Initialize the WorkerStatisticsInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $workspaceSid The SID of the Workspace that contains the * WorkerChannel * @param string $workerSid The SID of the Worker that contains the * WorkerChannel * @return \Twilio\Rest\Taskrouter\V1\Workspace\Worker\WorkerStatisticsInstance */ public function __construct(Version $version, array $payload, $workspaceSid, $workerSid) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'accountSid' => Values::array_get($payload, 'account_sid'), 'cumulative' => Values::array_get($payload, 'cumulative'), 'workerSid' => Values::array_get($payload, 'worker_sid'), 'workspaceSid' => Values::array_get($payload, 'workspace_sid'), 'url' => Values::array_get($payload, 'url'), ); $this->solution = array('workspaceSid' => $workspaceSid, 'workerSid' => $workerSid, ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Taskrouter\V1\Workspace\Worker\WorkerStatisticsContext Context for this WorkerStatisticsInstance */ protected function proxy() { if (!$this->context) { $this->context = new WorkerStatisticsContext( $this->version, $this->solution['workspaceSid'], $this->solution['workerSid'] ); } return $this->context; } /** * Fetch a WorkerStatisticsInstance * * @param array|Options $options Optional Arguments * @return WorkerStatisticsInstance Fetched WorkerStatisticsInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch($options = array()) { return $this->proxy()->fetch($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Taskrouter.V1.WorkerStatisticsInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/ReservationInstance.php 0000644 00000011160 15002236443 0022635 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\Worker; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $reservationStatus * @property string $sid * @property string $taskSid * @property string $workerName * @property string $workerSid * @property string $workspaceSid * @property string $url * @property array $links */ class ReservationInstance extends InstanceResource { /** * Initialize the ReservationInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $workspaceSid The SID of the Workspace that this worker is * contained within. * @param string $workerSid The SID of the reserved Worker resource * @param string $sid The SID of the WorkerReservation resource to fetch * @return \Twilio\Rest\Taskrouter\V1\Workspace\Worker\ReservationInstance */ public function __construct(Version $version, array $payload, $workspaceSid, $workerSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'accountSid' => Values::array_get($payload, 'account_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'reservationStatus' => Values::array_get($payload, 'reservation_status'), 'sid' => Values::array_get($payload, 'sid'), 'taskSid' => Values::array_get($payload, 'task_sid'), 'workerName' => Values::array_get($payload, 'worker_name'), 'workerSid' => Values::array_get($payload, 'worker_sid'), 'workspaceSid' => Values::array_get($payload, 'workspace_sid'), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ); $this->solution = array( 'workspaceSid' => $workspaceSid, 'workerSid' => $workerSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Taskrouter\V1\Workspace\Worker\ReservationContext Context for this ReservationInstance */ protected function proxy() { if (!$this->context) { $this->context = new ReservationContext( $this->version, $this->solution['workspaceSid'], $this->solution['workerSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch a ReservationInstance * * @return ReservationInstance Fetched ReservationInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Update the ReservationInstance * * @param array|Options $options Optional Arguments * @return ReservationInstance Updated ReservationInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Taskrouter.V1.ReservationInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkerStatisticsContext.php 0000644 00000005007 15002236443 0023543 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\Worker; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class WorkerStatisticsContext extends InstanceContext { /** * Initialize the WorkerStatisticsContext * * @param \Twilio\Version $version Version that contains the resource * @param string $workspaceSid The SID of the Workspace with the WorkerChannel * to fetch * @param string $workerSid The SID of the Worker with the WorkerChannel to * fetch * @return \Twilio\Rest\Taskrouter\V1\Workspace\Worker\WorkerStatisticsContext */ public function __construct(Version $version, $workspaceSid, $workerSid) { parent::__construct($version); // Path Solution $this->solution = array('workspaceSid' => $workspaceSid, 'workerSid' => $workerSid, ); $this->uri = '/Workspaces/' . \rawurlencode($workspaceSid) . '/Workers/' . \rawurlencode($workerSid) . '/Statistics'; } /** * Fetch a WorkerStatisticsInstance * * @param array|Options $options Optional Arguments * @return WorkerStatisticsInstance Fetched WorkerStatisticsInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch($options = array()) { $options = new Values($options); $params = Values::of(array( 'Minutes' => $options['minutes'], 'StartDate' => Serialize::iso8601DateTime($options['startDate']), 'EndDate' => Serialize::iso8601DateTime($options['endDate']), 'TaskChannel' => $options['taskChannel'], )); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new WorkerStatisticsInstance( $this->version, $payload, $this->solution['workspaceSid'], $this->solution['workerSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Taskrouter.V1.WorkerStatisticsContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersRealTimeStatisticsInstance.php 0000644 00000007167 15002236443 0025502 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\Worker; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property array $activityStatistics * @property int $totalWorkers * @property string $workspaceSid * @property string $url */ class WorkersRealTimeStatisticsInstance extends InstanceResource { /** * Initialize the WorkersRealTimeStatisticsInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $workspaceSid The SID of the Workspace that contains the * Workers * @return \Twilio\Rest\Taskrouter\V1\Workspace\Worker\WorkersRealTimeStatisticsInstance */ public function __construct(Version $version, array $payload, $workspaceSid) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'accountSid' => Values::array_get($payload, 'account_sid'), 'activityStatistics' => Values::array_get($payload, 'activity_statistics'), 'totalWorkers' => Values::array_get($payload, 'total_workers'), 'workspaceSid' => Values::array_get($payload, 'workspace_sid'), 'url' => Values::array_get($payload, 'url'), ); $this->solution = array('workspaceSid' => $workspaceSid, ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Taskrouter\V1\Workspace\Worker\WorkersRealTimeStatisticsContext Context for this * WorkersRealTimeStatisticsInstance */ protected function proxy() { if (!$this->context) { $this->context = new WorkersRealTimeStatisticsContext( $this->version, $this->solution['workspaceSid'] ); } return $this->context; } /** * Fetch a WorkersRealTimeStatisticsInstance * * @param array|Options $options Optional Arguments * @return WorkersRealTimeStatisticsInstance Fetched * WorkersRealTimeStatisticsInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch($options = array()) { return $this->proxy()->fetch($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Taskrouter.V1.WorkersRealTimeStatisticsInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersCumulativeStatisticsOptions.php 0000644 00000010363 15002236443 0025775 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\Worker; use Twilio\Options; use Twilio\Values; abstract class WorkersCumulativeStatisticsOptions { /** * @param \DateTime $endDate Only calculate statistics from on or before this * date * @param int $minutes Only calculate statistics since this many minutes in the * past * @param \DateTime $startDate Only calculate statistics from on or after this * date * @param string $taskChannel Only calculate cumulative statistics on this * TaskChannel * @return FetchWorkersCumulativeStatisticsOptions Options builder */ public static function fetch($endDate = Values::NONE, $minutes = Values::NONE, $startDate = Values::NONE, $taskChannel = Values::NONE) { return new FetchWorkersCumulativeStatisticsOptions($endDate, $minutes, $startDate, $taskChannel); } } class FetchWorkersCumulativeStatisticsOptions extends Options { /** * @param \DateTime $endDate Only calculate statistics from on or before this * date * @param int $minutes Only calculate statistics since this many minutes in the * past * @param \DateTime $startDate Only calculate statistics from on or after this * date * @param string $taskChannel Only calculate cumulative statistics on this * TaskChannel */ public function __construct($endDate = Values::NONE, $minutes = Values::NONE, $startDate = Values::NONE, $taskChannel = Values::NONE) { $this->options['endDate'] = $endDate; $this->options['minutes'] = $minutes; $this->options['startDate'] = $startDate; $this->options['taskChannel'] = $taskChannel; } /** * Only calculate statistics from this date and time and earlier, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. * * @param \DateTime $endDate Only calculate statistics from on or before this * date * @return $this Fluent Builder */ public function setEndDate($endDate) { $this->options['endDate'] = $endDate; return $this; } /** * Only calculate statistics since this many minutes in the past. The default 15 minutes. This is helpful for displaying statistics for the last 15 minutes, 240 minutes (4 hours), and 480 minutes (8 hours) to see trends. * * @param int $minutes Only calculate statistics since this many minutes in the * past * @return $this Fluent Builder */ public function setMinutes($minutes) { $this->options['minutes'] = $minutes; return $this; } /** * Only calculate statistics from this date and time and later, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. * * @param \DateTime $startDate Only calculate statistics from on or after this * date * @return $this Fluent Builder */ public function setStartDate($startDate) { $this->options['startDate'] = $startDate; return $this; } /** * Only calculate cumulative statistics on this TaskChannel. Can be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`. * * @param string $taskChannel Only calculate cumulative statistics on this * TaskChannel * @return $this Fluent Builder */ public function setTaskChannel($taskChannel) { $this->options['taskChannel'] = $taskChannel; 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.Taskrouter.V1.FetchWorkersCumulativeStatisticsOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersRealTimeStatisticsPage.php 0000644 00000001554 15002236443 0024604 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\Worker; use Twilio\Page; class WorkersRealTimeStatisticsPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new WorkersRealTimeStatisticsInstance( $this->version, $payload, $this->solution['workspaceSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Taskrouter.V1.WorkersRealTimeStatisticsPage]'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersCumulativeStatisticsPage.php 0000644 00000001562 15002236443 0025217 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\Worker; use Twilio\Page; class WorkersCumulativeStatisticsPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new WorkersCumulativeStatisticsInstance( $this->version, $payload, $this->solution['workspaceSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Taskrouter.V1.WorkersCumulativeStatisticsPage]'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersCumulativeStatisticsList.php 0000644 00000002557 15002236443 0025263 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\Worker; use Twilio\ListResource; use Twilio\Version; class WorkersCumulativeStatisticsList extends ListResource { /** * Construct the WorkersCumulativeStatisticsList * * @param Version $version Version that contains the resource * @param string $workspaceSid The SID of the Workspace that contains the * Workers * @return \Twilio\Rest\Taskrouter\V1\Workspace\Worker\WorkersCumulativeStatisticsList */ public function __construct(Version $version, $workspaceSid) { parent::__construct($version); // Path Solution $this->solution = array('workspaceSid' => $workspaceSid, ); } /** * Constructs a WorkersCumulativeStatisticsContext * * @return \Twilio\Rest\Taskrouter\V1\Workspace\Worker\WorkersCumulativeStatisticsContext */ public function getContext() { return new WorkersCumulativeStatisticsContext($this->version, $this->solution['workspaceSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Taskrouter.V1.WorkersCumulativeStatisticsList]'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersStatisticsList.php 0000644 00000002405 15002236443 0023214 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\Worker; use Twilio\ListResource; use Twilio\Version; class WorkersStatisticsList extends ListResource { /** * Construct the WorkersStatisticsList * * @param Version $version Version that contains the resource * @param string $workspaceSid The SID of the Workspace that contains the Worker * @return \Twilio\Rest\Taskrouter\V1\Workspace\Worker\WorkersStatisticsList */ public function __construct(Version $version, $workspaceSid) { parent::__construct($version); // Path Solution $this->solution = array('workspaceSid' => $workspaceSid, ); } /** * Constructs a WorkersStatisticsContext * * @return \Twilio\Rest\Taskrouter\V1\Workspace\Worker\WorkersStatisticsContext */ public function getContext() { return new WorkersStatisticsContext($this->version, $this->solution['workspaceSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Taskrouter.V1.WorkersStatisticsList]'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersRealTimeStatisticsList.php 0000644 00000002541 15002236443 0024640 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\Worker; use Twilio\ListResource; use Twilio\Version; class WorkersRealTimeStatisticsList extends ListResource { /** * Construct the WorkersRealTimeStatisticsList * * @param Version $version Version that contains the resource * @param string $workspaceSid The SID of the Workspace that contains the * Workers * @return \Twilio\Rest\Taskrouter\V1\Workspace\Worker\WorkersRealTimeStatisticsList */ public function __construct(Version $version, $workspaceSid) { parent::__construct($version); // Path Solution $this->solution = array('workspaceSid' => $workspaceSid, ); } /** * Constructs a WorkersRealTimeStatisticsContext * * @return \Twilio\Rest\Taskrouter\V1\Workspace\Worker\WorkersRealTimeStatisticsContext */ public function getContext() { return new WorkersRealTimeStatisticsContext($this->version, $this->solution['workspaceSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Taskrouter.V1.WorkersRealTimeStatisticsList]'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersStatisticsInstance.php 0000644 00000006444 15002236443 0024054 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\Worker; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property array $realtime * @property array $cumulative * @property string $accountSid * @property string $workspaceSid * @property string $url */ class WorkersStatisticsInstance extends InstanceResource { /** * Initialize the WorkersStatisticsInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $workspaceSid The SID of the Workspace that contains the Worker * @return \Twilio\Rest\Taskrouter\V1\Workspace\Worker\WorkersStatisticsInstance */ public function __construct(Version $version, array $payload, $workspaceSid) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'realtime' => Values::array_get($payload, 'realtime'), 'cumulative' => Values::array_get($payload, 'cumulative'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'workspaceSid' => Values::array_get($payload, 'workspace_sid'), 'url' => Values::array_get($payload, 'url'), ); $this->solution = array('workspaceSid' => $workspaceSid, ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Taskrouter\V1\Workspace\Worker\WorkersStatisticsContext Context for this WorkersStatisticsInstance */ protected function proxy() { if (!$this->context) { $this->context = new WorkersStatisticsContext($this->version, $this->solution['workspaceSid']); } return $this->context; } /** * Fetch a WorkersStatisticsInstance * * @param array|Options $options Optional Arguments * @return WorkersStatisticsInstance Fetched WorkersStatisticsInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch($options = array()) { return $this->proxy()->fetch($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Taskrouter.V1.WorkersStatisticsInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkerChannelInstance.php 0000644 00000011742 15002236443 0023104 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\Worker; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property int $assignedTasks * @property bool $available * @property int $availableCapacityPercentage * @property int $configuredCapacity * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $sid * @property string $taskChannelSid * @property string $taskChannelUniqueName * @property string $workerSid * @property string $workspaceSid * @property string $url */ class WorkerChannelInstance extends InstanceResource { /** * Initialize the WorkerChannelInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $workspaceSid The SID of the Workspace that contains the * WorkerChannel * @param string $workerSid The SID of the Worker that contains the * WorkerChannel * @param string $sid The SID of the to fetch * @return \Twilio\Rest\Taskrouter\V1\Workspace\Worker\WorkerChannelInstance */ public function __construct(Version $version, array $payload, $workspaceSid, $workerSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'accountSid' => Values::array_get($payload, 'account_sid'), 'assignedTasks' => Values::array_get($payload, 'assigned_tasks'), 'available' => Values::array_get($payload, 'available'), 'availableCapacityPercentage' => Values::array_get($payload, 'available_capacity_percentage'), 'configuredCapacity' => Values::array_get($payload, 'configured_capacity'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'sid' => Values::array_get($payload, 'sid'), 'taskChannelSid' => Values::array_get($payload, 'task_channel_sid'), 'taskChannelUniqueName' => Values::array_get($payload, 'task_channel_unique_name'), 'workerSid' => Values::array_get($payload, 'worker_sid'), 'workspaceSid' => Values::array_get($payload, 'workspace_sid'), 'url' => Values::array_get($payload, 'url'), ); $this->solution = array( 'workspaceSid' => $workspaceSid, 'workerSid' => $workerSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Taskrouter\V1\Workspace\Worker\WorkerChannelContext Context for this WorkerChannelInstance */ protected function proxy() { if (!$this->context) { $this->context = new WorkerChannelContext( $this->version, $this->solution['workspaceSid'], $this->solution['workerSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch a WorkerChannelInstance * * @return WorkerChannelInstance Fetched WorkerChannelInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Update the WorkerChannelInstance * * @param array|Options $options Optional Arguments * @return WorkerChannelInstance Updated WorkerChannelInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Taskrouter.V1.WorkerChannelInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersStatisticsOptions.php 0000644 00000015017 15002236443 0023737 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\Worker; use Twilio\Options; use Twilio\Values; abstract class WorkersStatisticsOptions { /** * @param int $minutes Only calculate statistics since this many minutes in the * past * @param \DateTime $startDate Only calculate statistics from on or after this * date * @param \DateTime $endDate Only calculate statistics from this date and time * and earlier * @param string $taskQueueSid The SID of the TaskQueue for which to fetch * Worker statistics * @param string $taskQueueName The friendly_name of the TaskQueue for which to * fetch Worker statistics * @param string $friendlyName Only include Workers with `friendly_name` values * that match this parameter * @param string $taskChannel Only calculate statistics on this TaskChannel * @return FetchWorkersStatisticsOptions Options builder */ public static function fetch($minutes = Values::NONE, $startDate = Values::NONE, $endDate = Values::NONE, $taskQueueSid = Values::NONE, $taskQueueName = Values::NONE, $friendlyName = Values::NONE, $taskChannel = Values::NONE) { return new FetchWorkersStatisticsOptions($minutes, $startDate, $endDate, $taskQueueSid, $taskQueueName, $friendlyName, $taskChannel); } } class FetchWorkersStatisticsOptions extends Options { /** * @param int $minutes Only calculate statistics since this many minutes in the * past * @param \DateTime $startDate Only calculate statistics from on or after this * date * @param \DateTime $endDate Only calculate statistics from this date and time * and earlier * @param string $taskQueueSid The SID of the TaskQueue for which to fetch * Worker statistics * @param string $taskQueueName The friendly_name of the TaskQueue for which to * fetch Worker statistics * @param string $friendlyName Only include Workers with `friendly_name` values * that match this parameter * @param string $taskChannel Only calculate statistics on this TaskChannel */ public function __construct($minutes = Values::NONE, $startDate = Values::NONE, $endDate = Values::NONE, $taskQueueSid = Values::NONE, $taskQueueName = Values::NONE, $friendlyName = Values::NONE, $taskChannel = Values::NONE) { $this->options['minutes'] = $minutes; $this->options['startDate'] = $startDate; $this->options['endDate'] = $endDate; $this->options['taskQueueSid'] = $taskQueueSid; $this->options['taskQueueName'] = $taskQueueName; $this->options['friendlyName'] = $friendlyName; $this->options['taskChannel'] = $taskChannel; } /** * Only calculate statistics since this many minutes in the past. The default 15 minutes. This is helpful for displaying statistics for the last 15 minutes, 240 minutes (4 hours), and 480 minutes (8 hours) to see trends. * * @param int $minutes Only calculate statistics since this many minutes in the * past * @return $this Fluent Builder */ public function setMinutes($minutes) { $this->options['minutes'] = $minutes; return $this; } /** * Only calculate statistics from this date and time and later, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. * * @param \DateTime $startDate Only calculate statistics from on or after this * date * @return $this Fluent Builder */ public function setStartDate($startDate) { $this->options['startDate'] = $startDate; return $this; } /** * Only calculate statistics from this date and time and earlier, specified in GMT as an [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time. * * @param \DateTime $endDate Only calculate statistics from this date and time * and earlier * @return $this Fluent Builder */ public function setEndDate($endDate) { $this->options['endDate'] = $endDate; return $this; } /** * The SID of the TaskQueue for which to fetch Worker statistics. * * @param string $taskQueueSid The SID of the TaskQueue for which to fetch * Worker statistics * @return $this Fluent Builder */ public function setTaskQueueSid($taskQueueSid) { $this->options['taskQueueSid'] = $taskQueueSid; return $this; } /** * The `friendly_name` of the TaskQueue for which to fetch Worker statistics. * * @param string $taskQueueName The friendly_name of the TaskQueue for which to * fetch Worker statistics * @return $this Fluent Builder */ public function setTaskQueueName($taskQueueName) { $this->options['taskQueueName'] = $taskQueueName; return $this; } /** * Only include Workers with `friendly_name` values that match this parameter. * * @param string $friendlyName Only include Workers with `friendly_name` values * that match this parameter * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * Only calculate statistics on this TaskChannel. Can be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`. * * @param string $taskChannel Only calculate statistics on this TaskChannel * @return $this Fluent Builder */ public function setTaskChannel($taskChannel) { $this->options['taskChannel'] = $taskChannel; 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.Taskrouter.V1.FetchWorkersStatisticsOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersCumulativeStatisticsInstance.php 0000644 00000011104 15002236443 0026100 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\Worker; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property \DateTime $startTime * @property \DateTime $endTime * @property array $activityDurations * @property int $reservationsCreated * @property int $reservationsAccepted * @property int $reservationsRejected * @property int $reservationsTimedOut * @property int $reservationsCanceled * @property int $reservationsRescinded * @property string $workspaceSid * @property string $url */ class WorkersCumulativeStatisticsInstance extends InstanceResource { /** * Initialize the WorkersCumulativeStatisticsInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $workspaceSid The SID of the Workspace that contains the * Workers * @return \Twilio\Rest\Taskrouter\V1\Workspace\Worker\WorkersCumulativeStatisticsInstance */ public function __construct(Version $version, array $payload, $workspaceSid) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'accountSid' => Values::array_get($payload, 'account_sid'), 'startTime' => Deserialize::dateTime(Values::array_get($payload, 'start_time')), 'endTime' => Deserialize::dateTime(Values::array_get($payload, 'end_time')), 'activityDurations' => Values::array_get($payload, 'activity_durations'), 'reservationsCreated' => Values::array_get($payload, 'reservations_created'), 'reservationsAccepted' => Values::array_get($payload, 'reservations_accepted'), 'reservationsRejected' => Values::array_get($payload, 'reservations_rejected'), 'reservationsTimedOut' => Values::array_get($payload, 'reservations_timed_out'), 'reservationsCanceled' => Values::array_get($payload, 'reservations_canceled'), 'reservationsRescinded' => Values::array_get($payload, 'reservations_rescinded'), 'workspaceSid' => Values::array_get($payload, 'workspace_sid'), 'url' => Values::array_get($payload, 'url'), ); $this->solution = array('workspaceSid' => $workspaceSid, ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Taskrouter\V1\Workspace\Worker\WorkersCumulativeStatisticsContext Context for this * WorkersCumulativeStatisticsInstance */ protected function proxy() { if (!$this->context) { $this->context = new WorkersCumulativeStatisticsContext( $this->version, $this->solution['workspaceSid'] ); } return $this->context; } /** * Fetch a WorkersCumulativeStatisticsInstance * * @param array|Options $options Optional Arguments * @return WorkersCumulativeStatisticsInstance Fetched * WorkersCumulativeStatisticsInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch($options = array()) { return $this->proxy()->fetch($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Taskrouter.V1.WorkersCumulativeStatisticsInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersRealTimeStatisticsContext.php 0000644 00000004251 15002236443 0025351 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\Worker; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Values; use Twilio\Version; class WorkersRealTimeStatisticsContext extends InstanceContext { /** * Initialize the WorkersRealTimeStatisticsContext * * @param \Twilio\Version $version Version that contains the resource * @param string $workspaceSid The SID of the Workspace with the resource to * fetch * @return \Twilio\Rest\Taskrouter\V1\Workspace\Worker\WorkersRealTimeStatisticsContext */ public function __construct(Version $version, $workspaceSid) { parent::__construct($version); // Path Solution $this->solution = array('workspaceSid' => $workspaceSid, ); $this->uri = '/Workspaces/' . \rawurlencode($workspaceSid) . '/Workers/RealTimeStatistics'; } /** * Fetch a WorkersRealTimeStatisticsInstance * * @param array|Options $options Optional Arguments * @return WorkersRealTimeStatisticsInstance Fetched * WorkersRealTimeStatisticsInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch($options = array()) { $options = new Values($options); $params = Values::of(array('TaskChannel' => $options['taskChannel'], )); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new WorkersRealTimeStatisticsInstance( $this->version, $payload, $this->solution['workspaceSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Taskrouter.V1.WorkersRealTimeStatisticsContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersRealTimeStatisticsOptions.php 0000644 00000003522 15002236443 0025360 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\Worker; use Twilio\Options; use Twilio\Values; abstract class WorkersRealTimeStatisticsOptions { /** * @param string $taskChannel Only calculate real-time statistics on this * TaskChannel * @return FetchWorkersRealTimeStatisticsOptions Options builder */ public static function fetch($taskChannel = Values::NONE) { return new FetchWorkersRealTimeStatisticsOptions($taskChannel); } } class FetchWorkersRealTimeStatisticsOptions extends Options { /** * @param string $taskChannel Only calculate real-time statistics on this * TaskChannel */ public function __construct($taskChannel = Values::NONE) { $this->options['taskChannel'] = $taskChannel; } /** * Only calculate real-time statistics on this TaskChannel. Can be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`. * * @param string $taskChannel Only calculate real-time statistics on this * TaskChannel * @return $this Fluent Builder */ public function setTaskChannel($taskChannel) { $this->options['taskChannel'] = $taskChannel; 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.Taskrouter.V1.FetchWorkersRealTimeStatisticsOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersCumulativeStatisticsContext.php 0000644 00000004656 15002236443 0025776 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\Worker; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class WorkersCumulativeStatisticsContext extends InstanceContext { /** * Initialize the WorkersCumulativeStatisticsContext * * @param \Twilio\Version $version Version that contains the resource * @param string $workspaceSid The SID of the Workspace with the resource to * fetch * @return \Twilio\Rest\Taskrouter\V1\Workspace\Worker\WorkersCumulativeStatisticsContext */ public function __construct(Version $version, $workspaceSid) { parent::__construct($version); // Path Solution $this->solution = array('workspaceSid' => $workspaceSid, ); $this->uri = '/Workspaces/' . \rawurlencode($workspaceSid) . '/Workers/CumulativeStatistics'; } /** * Fetch a WorkersCumulativeStatisticsInstance * * @param array|Options $options Optional Arguments * @return WorkersCumulativeStatisticsInstance Fetched * WorkersCumulativeStatisticsInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch($options = array()) { $options = new Values($options); $params = Values::of(array( 'EndDate' => Serialize::iso8601DateTime($options['endDate']), 'Minutes' => $options['minutes'], 'StartDate' => Serialize::iso8601DateTime($options['startDate']), 'TaskChannel' => $options['taskChannel'], )); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new WorkersCumulativeStatisticsInstance( $this->version, $payload, $this->solution['workspaceSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Taskrouter.V1.WorkersCumulativeStatisticsContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkerChannelOptions.php 0000644 00000005012 15002236443 0022764 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\Worker; use Twilio\Options; use Twilio\Values; abstract class WorkerChannelOptions { /** * @param int $capacity The total number of Tasks that the Worker should handle * for the TaskChannel type * @param bool $available Whether the WorkerChannel is available * @return UpdateWorkerChannelOptions Options builder */ public static function update($capacity = Values::NONE, $available = Values::NONE) { return new UpdateWorkerChannelOptions($capacity, $available); } } class UpdateWorkerChannelOptions extends Options { /** * @param int $capacity The total number of Tasks that the Worker should handle * for the TaskChannel type * @param bool $available Whether the WorkerChannel is available */ public function __construct($capacity = Values::NONE, $available = Values::NONE) { $this->options['capacity'] = $capacity; $this->options['available'] = $available; } /** * The total number of Tasks that the Worker should handle for the TaskChannel type. TaskRouter creates reservations for Tasks of this TaskChannel type up to the specified capacity. If the capacity is 0, no new reservations will be created. * * @param int $capacity The total number of Tasks that the Worker should handle * for the TaskChannel type * @return $this Fluent Builder */ public function setCapacity($capacity) { $this->options['capacity'] = $capacity; return $this; } /** * Whether the WorkerChannel is available. Set to `false` to prevent the Worker from receiving any new Tasks of this TaskChannel type. * * @param bool $available Whether the WorkerChannel is available * @return $this Fluent Builder */ public function setAvailable($available) { $this->options['available'] = $available; 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.Taskrouter.V1.UpdateWorkerChannelOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/ReservationList.php 0000644 00000013132 15002236443 0022005 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\Worker; use Twilio\ListResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; class ReservationList extends ListResource { /** * Construct the ReservationList * * @param Version $version Version that contains the resource * @param string $workspaceSid The SID of the Workspace that this worker is * contained within. * @param string $workerSid The SID of the reserved Worker resource * @return \Twilio\Rest\Taskrouter\V1\Workspace\Worker\ReservationList */ public function __construct(Version $version, $workspaceSid, $workerSid) { parent::__construct($version); // Path Solution $this->solution = array('workspaceSid' => $workspaceSid, 'workerSid' => $workerSid, ); $this->uri = '/Workspaces/' . \rawurlencode($workspaceSid) . '/Workers/' . \rawurlencode($workerSid) . '/Reservations'; } /** * Streams ReservationInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($options = array(), $limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads ReservationInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return ReservationInstance[] Array of results */ public function read($options = array(), $limit = null, $pageSize = null) { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Retrieve a single page of ReservationInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of ReservationInstance */ public function page($options = array(), $pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $options = new Values($options); $params = Values::of(array( 'ReservationStatus' => $options['reservationStatus'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new ReservationPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of ReservationInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of ReservationInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new ReservationPage($this->version, $response, $this->solution); } /** * Constructs a ReservationContext * * @param string $sid The SID of the WorkerReservation resource to fetch * @return \Twilio\Rest\Taskrouter\V1\Workspace\Worker\ReservationContext */ public function getContext($sid) { return new ReservationContext( $this->version, $this->solution['workspaceSid'], $this->solution['workerSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Taskrouter.V1.ReservationList]'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkerChannelContext.php 0000644 00000006151 15002236443 0022762 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\Worker; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class WorkerChannelContext extends InstanceContext { /** * Initialize the WorkerChannelContext * * @param \Twilio\Version $version Version that contains the resource * @param string $workspaceSid The SID of the Workspace with the WorkerChannel * to fetch * @param string $workerSid The SID of the Worker with the WorkerChannel to * fetch * @param string $sid The SID of the to fetch * @return \Twilio\Rest\Taskrouter\V1\Workspace\Worker\WorkerChannelContext */ public function __construct(Version $version, $workspaceSid, $workerSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array('workspaceSid' => $workspaceSid, 'workerSid' => $workerSid, 'sid' => $sid, ); $this->uri = '/Workspaces/' . \rawurlencode($workspaceSid) . '/Workers/' . \rawurlencode($workerSid) . '/Channels/' . \rawurlencode($sid) . ''; } /** * Fetch a WorkerChannelInstance * * @return WorkerChannelInstance Fetched WorkerChannelInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new WorkerChannelInstance( $this->version, $payload, $this->solution['workspaceSid'], $this->solution['workerSid'], $this->solution['sid'] ); } /** * Update the WorkerChannelInstance * * @param array|Options $options Optional Arguments * @return WorkerChannelInstance Updated WorkerChannelInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { $options = new Values($options); $data = Values::of(array( 'Capacity' => $options['capacity'], 'Available' => Serialize::booleanToString($options['available']), )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new WorkerChannelInstance( $this->version, $payload, $this->solution['workspaceSid'], $this->solution['workerSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Taskrouter.V1.WorkerChannelContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkerStatisticsOptions.php 0000644 00000010067 15002236443 0023554 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\Worker; use Twilio\Options; use Twilio\Values; abstract class WorkerStatisticsOptions { /** * @param int $minutes Only calculate statistics since this many minutes in the * past * @param \DateTime $startDate Only calculate statistics from on or after this * date * @param \DateTime $endDate Only include usage that occurred on or before this * date * @param string $taskChannel Only calculate statistics on this TaskChannel * @return FetchWorkerStatisticsOptions Options builder */ public static function fetch($minutes = Values::NONE, $startDate = Values::NONE, $endDate = Values::NONE, $taskChannel = Values::NONE) { return new FetchWorkerStatisticsOptions($minutes, $startDate, $endDate, $taskChannel); } } class FetchWorkerStatisticsOptions extends Options { /** * @param int $minutes Only calculate statistics since this many minutes in the * past * @param \DateTime $startDate Only calculate statistics from on or after this * date * @param \DateTime $endDate Only include usage that occurred on or before this * date * @param string $taskChannel Only calculate statistics on this TaskChannel */ public function __construct($minutes = Values::NONE, $startDate = Values::NONE, $endDate = Values::NONE, $taskChannel = Values::NONE) { $this->options['minutes'] = $minutes; $this->options['startDate'] = $startDate; $this->options['endDate'] = $endDate; $this->options['taskChannel'] = $taskChannel; } /** * Only calculate statistics since this many minutes in the past. The default 15 minutes. This is helpful for displaying statistics for the last 15 minutes, 240 minutes (4 hours), and 480 minutes (8 hours) to see trends. * * @param int $minutes Only calculate statistics since this many minutes in the * past * @return $this Fluent Builder */ public function setMinutes($minutes) { $this->options['minutes'] = $minutes; return $this; } /** * Only calculate statistics from this date and time and later, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. * * @param \DateTime $startDate Only calculate statistics from on or after this * date * @return $this Fluent Builder */ public function setStartDate($startDate) { $this->options['startDate'] = $startDate; return $this; } /** * Only include usage that occurred on or before this date, specified in GMT as an [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time. * * @param \DateTime $endDate Only include usage that occurred on or before this * date * @return $this Fluent Builder */ public function setEndDate($endDate) { $this->options['endDate'] = $endDate; return $this; } /** * Only calculate statistics on this TaskChannel. Can be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`. * * @param string $taskChannel Only calculate statistics on this TaskChannel * @return $this Fluent Builder */ public function setTaskChannel($taskChannel) { $this->options['taskChannel'] = $taskChannel; 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.Taskrouter.V1.FetchWorkerStatisticsOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/ReservationOptions.php 0000644 00000140611 15002236443 0022530 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\Worker; use Twilio\Options; use Twilio\Values; abstract class ReservationOptions { /** * @param string $reservationStatus Returns the list of reservations for a * worker with a specified ReservationStatus * @return ReadReservationOptions Options builder */ public static function read($reservationStatus = Values::NONE) { return new ReadReservationOptions($reservationStatus); } /** * @param string $reservationStatus The new status of the reservation * @param string $workerActivitySid The new worker activity SID if rejecting a * reservation * @param string $instruction The assignment instruction for the reservation * @param string $dequeuePostWorkActivitySid The SID of the Activity resource * to start after executing a Dequeue * instruction * @param string $dequeueFrom The caller ID of the call to the worker when * executing a Dequeue instruction * @param string $dequeueRecord Whether to record both legs of a call when * executing a Dequeue instruction * @param int $dequeueTimeout The timeout for call when executing a Dequeue * instruction * @param string $dequeueTo The contact URI of the worker when executing a * Dequeue instruction * @param string $dequeueStatusCallbackUrl The callback URL for completed call * event when executing a Dequeue * instruction * @param string $callFrom The Caller ID of the outbound call when executing a * Call instruction * @param string $callRecord Whether to record both legs of a call when * executing a Call instruction * @param int $callTimeout The timeout for a call when executing a Call * instruction * @param string $callTo The contact URI of the worker when executing a Call * instruction * @param string $callUrl TwiML URI executed on answering the worker's leg as a * result of the Call instruction * @param string $callStatusCallbackUrl The URL to call for the completed call * event when executing a Call instruction * @param bool $callAccept Whether to accept a reservation when executing a * Call instruction * @param string $redirectCallSid The Call SID of the call parked in the queue * when executing a Redirect instruction * @param bool $redirectAccept Whether the reservation should be accepted when * executing a Redirect instruction * @param string $redirectUrl TwiML URI to redirect the call to when executing * the Redirect instruction * @param string $to The Contact URI of the worker when executing a Conference * instruction * @param string $from The caller ID of the call to the worker when executing a * Conference instruction * @param string $statusCallback The URL we should call to send status * information to your application * @param string $statusCallbackMethod The HTTP method we should use to call * status_callback * @param string $statusCallbackEvent The call progress events that we will * send to status_callback * @param int $timeout The timeout for a call when executing a Conference * instruction * @param bool $record Whether to record the participant and their conferences * @param bool $muted Whether to mute the agent * @param string $beep Whether to play a notification beep when the participant * joins * @param bool $startConferenceOnEnter Whether the conference starts when the * participant joins the conference * @param bool $endConferenceOnExit Whether to end the conference when the * agent leaves * @param string $waitUrl URL that hosts pre-conference hold music * @param string $waitMethod The HTTP method we should use to call `wait_url` * @param bool $earlyMedia Whether agents can hear the state of the outbound * call * @param int $maxParticipants The maximum number of agent conference * participants * @param string $conferenceStatusCallback The callback URL for conference * events * @param string $conferenceStatusCallbackMethod HTTP method for requesting * `conference_status_callback` * URL * @param string $conferenceStatusCallbackEvent The conference status events * that we will send to * conference_status_callback * @param string $conferenceRecord Whether to record the conference the * participant is joining * @param string $conferenceTrim Whether to trim leading and trailing silence * from your recorded conference audio files * @param string $recordingChannels Specify `mono` or `dual` recording channels * @param string $recordingStatusCallback The URL that we should call using the * `recording_status_callback_method` * when the recording status changes * @param string $recordingStatusCallbackMethod The HTTP method we should use * when we call * `recording_status_callback` * @param string $conferenceRecordingStatusCallback The URL we should call * using the * `conference_recording_status_callback_method` when the conference recording is available * @param string $conferenceRecordingStatusCallbackMethod The HTTP method we * should use to call * `conference_recording_status_callback` * @param string $region The region where we should mix the conference audio * @param string $sipAuthUsername The SIP username used for authentication * @param string $sipAuthPassword The SIP password for authentication * @param string $dequeueStatusCallbackEvent The call progress events sent via * webhooks as a result of a Dequeue * instruction * @param string $postWorkActivitySid The new worker activity SID after * executing a Conference instruction * @param bool $endConferenceOnCustomerExit Whether to end the conference when * the customer leaves * @param bool $beepOnCustomerEntrance Whether to play a notification beep when * the customer joins * @return UpdateReservationOptions Options builder */ public static function update($reservationStatus = Values::NONE, $workerActivitySid = Values::NONE, $instruction = Values::NONE, $dequeuePostWorkActivitySid = Values::NONE, $dequeueFrom = Values::NONE, $dequeueRecord = Values::NONE, $dequeueTimeout = Values::NONE, $dequeueTo = Values::NONE, $dequeueStatusCallbackUrl = Values::NONE, $callFrom = Values::NONE, $callRecord = Values::NONE, $callTimeout = Values::NONE, $callTo = Values::NONE, $callUrl = Values::NONE, $callStatusCallbackUrl = Values::NONE, $callAccept = Values::NONE, $redirectCallSid = Values::NONE, $redirectAccept = Values::NONE, $redirectUrl = Values::NONE, $to = Values::NONE, $from = Values::NONE, $statusCallback = Values::NONE, $statusCallbackMethod = Values::NONE, $statusCallbackEvent = Values::NONE, $timeout = Values::NONE, $record = Values::NONE, $muted = Values::NONE, $beep = Values::NONE, $startConferenceOnEnter = Values::NONE, $endConferenceOnExit = Values::NONE, $waitUrl = Values::NONE, $waitMethod = Values::NONE, $earlyMedia = Values::NONE, $maxParticipants = Values::NONE, $conferenceStatusCallback = Values::NONE, $conferenceStatusCallbackMethod = Values::NONE, $conferenceStatusCallbackEvent = Values::NONE, $conferenceRecord = Values::NONE, $conferenceTrim = Values::NONE, $recordingChannels = Values::NONE, $recordingStatusCallback = Values::NONE, $recordingStatusCallbackMethod = Values::NONE, $conferenceRecordingStatusCallback = Values::NONE, $conferenceRecordingStatusCallbackMethod = Values::NONE, $region = Values::NONE, $sipAuthUsername = Values::NONE, $sipAuthPassword = Values::NONE, $dequeueStatusCallbackEvent = Values::NONE, $postWorkActivitySid = Values::NONE, $endConferenceOnCustomerExit = Values::NONE, $beepOnCustomerEntrance = Values::NONE) { return new UpdateReservationOptions($reservationStatus, $workerActivitySid, $instruction, $dequeuePostWorkActivitySid, $dequeueFrom, $dequeueRecord, $dequeueTimeout, $dequeueTo, $dequeueStatusCallbackUrl, $callFrom, $callRecord, $callTimeout, $callTo, $callUrl, $callStatusCallbackUrl, $callAccept, $redirectCallSid, $redirectAccept, $redirectUrl, $to, $from, $statusCallback, $statusCallbackMethod, $statusCallbackEvent, $timeout, $record, $muted, $beep, $startConferenceOnEnter, $endConferenceOnExit, $waitUrl, $waitMethod, $earlyMedia, $maxParticipants, $conferenceStatusCallback, $conferenceStatusCallbackMethod, $conferenceStatusCallbackEvent, $conferenceRecord, $conferenceTrim, $recordingChannels, $recordingStatusCallback, $recordingStatusCallbackMethod, $conferenceRecordingStatusCallback, $conferenceRecordingStatusCallbackMethod, $region, $sipAuthUsername, $sipAuthPassword, $dequeueStatusCallbackEvent, $postWorkActivitySid, $endConferenceOnCustomerExit, $beepOnCustomerEntrance); } } class ReadReservationOptions extends Options { /** * @param string $reservationStatus Returns the list of reservations for a * worker with a specified ReservationStatus */ public function __construct($reservationStatus = Values::NONE) { $this->options['reservationStatus'] = $reservationStatus; } /** * Returns the list of reservations for a worker with a specified ReservationStatus. Can be: `pending`, `accepted`, `rejected`, `timeout`, `canceled`, or `rescinded`. * * @param string $reservationStatus Returns the list of reservations for a * worker with a specified ReservationStatus * @return $this Fluent Builder */ public function setReservationStatus($reservationStatus) { $this->options['reservationStatus'] = $reservationStatus; 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.Taskrouter.V1.ReadReservationOptions ' . \implode(' ', $options) . ']'; } } class UpdateReservationOptions extends Options { /** * @param string $reservationStatus The new status of the reservation * @param string $workerActivitySid The new worker activity SID if rejecting a * reservation * @param string $instruction The assignment instruction for the reservation * @param string $dequeuePostWorkActivitySid The SID of the Activity resource * to start after executing a Dequeue * instruction * @param string $dequeueFrom The caller ID of the call to the worker when * executing a Dequeue instruction * @param string $dequeueRecord Whether to record both legs of a call when * executing a Dequeue instruction * @param int $dequeueTimeout The timeout for call when executing a Dequeue * instruction * @param string $dequeueTo The contact URI of the worker when executing a * Dequeue instruction * @param string $dequeueStatusCallbackUrl The callback URL for completed call * event when executing a Dequeue * instruction * @param string $callFrom The Caller ID of the outbound call when executing a * Call instruction * @param string $callRecord Whether to record both legs of a call when * executing a Call instruction * @param int $callTimeout The timeout for a call when executing a Call * instruction * @param string $callTo The contact URI of the worker when executing a Call * instruction * @param string $callUrl TwiML URI executed on answering the worker's leg as a * result of the Call instruction * @param string $callStatusCallbackUrl The URL to call for the completed call * event when executing a Call instruction * @param bool $callAccept Whether to accept a reservation when executing a * Call instruction * @param string $redirectCallSid The Call SID of the call parked in the queue * when executing a Redirect instruction * @param bool $redirectAccept Whether the reservation should be accepted when * executing a Redirect instruction * @param string $redirectUrl TwiML URI to redirect the call to when executing * the Redirect instruction * @param string $to The Contact URI of the worker when executing a Conference * instruction * @param string $from The caller ID of the call to the worker when executing a * Conference instruction * @param string $statusCallback The URL we should call to send status * information to your application * @param string $statusCallbackMethod The HTTP method we should use to call * status_callback * @param string $statusCallbackEvent The call progress events that we will * send to status_callback * @param int $timeout The timeout for a call when executing a Conference * instruction * @param bool $record Whether to record the participant and their conferences * @param bool $muted Whether to mute the agent * @param string $beep Whether to play a notification beep when the participant * joins * @param bool $startConferenceOnEnter Whether the conference starts when the * participant joins the conference * @param bool $endConferenceOnExit Whether to end the conference when the * agent leaves * @param string $waitUrl URL that hosts pre-conference hold music * @param string $waitMethod The HTTP method we should use to call `wait_url` * @param bool $earlyMedia Whether agents can hear the state of the outbound * call * @param int $maxParticipants The maximum number of agent conference * participants * @param string $conferenceStatusCallback The callback URL for conference * events * @param string $conferenceStatusCallbackMethod HTTP method for requesting * `conference_status_callback` * URL * @param string $conferenceStatusCallbackEvent The conference status events * that we will send to * conference_status_callback * @param string $conferenceRecord Whether to record the conference the * participant is joining * @param string $conferenceTrim Whether to trim leading and trailing silence * from your recorded conference audio files * @param string $recordingChannels Specify `mono` or `dual` recording channels * @param string $recordingStatusCallback The URL that we should call using the * `recording_status_callback_method` * when the recording status changes * @param string $recordingStatusCallbackMethod The HTTP method we should use * when we call * `recording_status_callback` * @param string $conferenceRecordingStatusCallback The URL we should call * using the * `conference_recording_status_callback_method` when the conference recording is available * @param string $conferenceRecordingStatusCallbackMethod The HTTP method we * should use to call * `conference_recording_status_callback` * @param string $region The region where we should mix the conference audio * @param string $sipAuthUsername The SIP username used for authentication * @param string $sipAuthPassword The SIP password for authentication * @param string $dequeueStatusCallbackEvent The call progress events sent via * webhooks as a result of a Dequeue * instruction * @param string $postWorkActivitySid The new worker activity SID after * executing a Conference instruction * @param bool $endConferenceOnCustomerExit Whether to end the conference when * the customer leaves * @param bool $beepOnCustomerEntrance Whether to play a notification beep when * the customer joins */ public function __construct($reservationStatus = Values::NONE, $workerActivitySid = Values::NONE, $instruction = Values::NONE, $dequeuePostWorkActivitySid = Values::NONE, $dequeueFrom = Values::NONE, $dequeueRecord = Values::NONE, $dequeueTimeout = Values::NONE, $dequeueTo = Values::NONE, $dequeueStatusCallbackUrl = Values::NONE, $callFrom = Values::NONE, $callRecord = Values::NONE, $callTimeout = Values::NONE, $callTo = Values::NONE, $callUrl = Values::NONE, $callStatusCallbackUrl = Values::NONE, $callAccept = Values::NONE, $redirectCallSid = Values::NONE, $redirectAccept = Values::NONE, $redirectUrl = Values::NONE, $to = Values::NONE, $from = Values::NONE, $statusCallback = Values::NONE, $statusCallbackMethod = Values::NONE, $statusCallbackEvent = Values::NONE, $timeout = Values::NONE, $record = Values::NONE, $muted = Values::NONE, $beep = Values::NONE, $startConferenceOnEnter = Values::NONE, $endConferenceOnExit = Values::NONE, $waitUrl = Values::NONE, $waitMethod = Values::NONE, $earlyMedia = Values::NONE, $maxParticipants = Values::NONE, $conferenceStatusCallback = Values::NONE, $conferenceStatusCallbackMethod = Values::NONE, $conferenceStatusCallbackEvent = Values::NONE, $conferenceRecord = Values::NONE, $conferenceTrim = Values::NONE, $recordingChannels = Values::NONE, $recordingStatusCallback = Values::NONE, $recordingStatusCallbackMethod = Values::NONE, $conferenceRecordingStatusCallback = Values::NONE, $conferenceRecordingStatusCallbackMethod = Values::NONE, $region = Values::NONE, $sipAuthUsername = Values::NONE, $sipAuthPassword = Values::NONE, $dequeueStatusCallbackEvent = Values::NONE, $postWorkActivitySid = Values::NONE, $endConferenceOnCustomerExit = Values::NONE, $beepOnCustomerEntrance = Values::NONE) { $this->options['reservationStatus'] = $reservationStatus; $this->options['workerActivitySid'] = $workerActivitySid; $this->options['instruction'] = $instruction; $this->options['dequeuePostWorkActivitySid'] = $dequeuePostWorkActivitySid; $this->options['dequeueFrom'] = $dequeueFrom; $this->options['dequeueRecord'] = $dequeueRecord; $this->options['dequeueTimeout'] = $dequeueTimeout; $this->options['dequeueTo'] = $dequeueTo; $this->options['dequeueStatusCallbackUrl'] = $dequeueStatusCallbackUrl; $this->options['callFrom'] = $callFrom; $this->options['callRecord'] = $callRecord; $this->options['callTimeout'] = $callTimeout; $this->options['callTo'] = $callTo; $this->options['callUrl'] = $callUrl; $this->options['callStatusCallbackUrl'] = $callStatusCallbackUrl; $this->options['callAccept'] = $callAccept; $this->options['redirectCallSid'] = $redirectCallSid; $this->options['redirectAccept'] = $redirectAccept; $this->options['redirectUrl'] = $redirectUrl; $this->options['to'] = $to; $this->options['from'] = $from; $this->options['statusCallback'] = $statusCallback; $this->options['statusCallbackMethod'] = $statusCallbackMethod; $this->options['statusCallbackEvent'] = $statusCallbackEvent; $this->options['timeout'] = $timeout; $this->options['record'] = $record; $this->options['muted'] = $muted; $this->options['beep'] = $beep; $this->options['startConferenceOnEnter'] = $startConferenceOnEnter; $this->options['endConferenceOnExit'] = $endConferenceOnExit; $this->options['waitUrl'] = $waitUrl; $this->options['waitMethod'] = $waitMethod; $this->options['earlyMedia'] = $earlyMedia; $this->options['maxParticipants'] = $maxParticipants; $this->options['conferenceStatusCallback'] = $conferenceStatusCallback; $this->options['conferenceStatusCallbackMethod'] = $conferenceStatusCallbackMethod; $this->options['conferenceStatusCallbackEvent'] = $conferenceStatusCallbackEvent; $this->options['conferenceRecord'] = $conferenceRecord; $this->options['conferenceTrim'] = $conferenceTrim; $this->options['recordingChannels'] = $recordingChannels; $this->options['recordingStatusCallback'] = $recordingStatusCallback; $this->options['recordingStatusCallbackMethod'] = $recordingStatusCallbackMethod; $this->options['conferenceRecordingStatusCallback'] = $conferenceRecordingStatusCallback; $this->options['conferenceRecordingStatusCallbackMethod'] = $conferenceRecordingStatusCallbackMethod; $this->options['region'] = $region; $this->options['sipAuthUsername'] = $sipAuthUsername; $this->options['sipAuthPassword'] = $sipAuthPassword; $this->options['dequeueStatusCallbackEvent'] = $dequeueStatusCallbackEvent; $this->options['postWorkActivitySid'] = $postWorkActivitySid; $this->options['endConferenceOnCustomerExit'] = $endConferenceOnCustomerExit; $this->options['beepOnCustomerEntrance'] = $beepOnCustomerEntrance; } /** * The new status of the reservation. Can be: `pending`, `accepted`, `rejected`, `timeout`, `canceled`, or `rescinded`. * * @param string $reservationStatus The new status of the reservation * @return $this Fluent Builder */ public function setReservationStatus($reservationStatus) { $this->options['reservationStatus'] = $reservationStatus; return $this; } /** * The new worker activity SID if rejecting a reservation. * * @param string $workerActivitySid The new worker activity SID if rejecting a * reservation * @return $this Fluent Builder */ public function setWorkerActivitySid($workerActivitySid) { $this->options['workerActivitySid'] = $workerActivitySid; return $this; } /** * The assignment instruction for the reservation. * * @param string $instruction The assignment instruction for the reservation * @return $this Fluent Builder */ public function setInstruction($instruction) { $this->options['instruction'] = $instruction; return $this; } /** * The SID of the Activity resource to start after executing a Dequeue instruction. * * @param string $dequeuePostWorkActivitySid The SID of the Activity resource * to start after executing a Dequeue * instruction * @return $this Fluent Builder */ public function setDequeuePostWorkActivitySid($dequeuePostWorkActivitySid) { $this->options['dequeuePostWorkActivitySid'] = $dequeuePostWorkActivitySid; return $this; } /** * The caller ID of the call to the worker when executing a Dequeue instruction. * * @param string $dequeueFrom The caller ID of the call to the worker when * executing a Dequeue instruction * @return $this Fluent Builder */ public function setDequeueFrom($dequeueFrom) { $this->options['dequeueFrom'] = $dequeueFrom; return $this; } /** * Whether to record both legs of a call when executing a Dequeue instruction or which leg to record. * * @param string $dequeueRecord Whether to record both legs of a call when * executing a Dequeue instruction * @return $this Fluent Builder */ public function setDequeueRecord($dequeueRecord) { $this->options['dequeueRecord'] = $dequeueRecord; return $this; } /** * The timeout for call when executing a Dequeue instruction. * * @param int $dequeueTimeout The timeout for call when executing a Dequeue * instruction * @return $this Fluent Builder */ public function setDequeueTimeout($dequeueTimeout) { $this->options['dequeueTimeout'] = $dequeueTimeout; return $this; } /** * The contact URI of the worker when executing a Dequeue instruction. Can be the URI of the Twilio Client, the SIP URI for Programmable SIP, or the [E.164](https://www.twilio.com/docs/glossary/what-e164) formatted phone number, depending on the destination. * * @param string $dequeueTo The contact URI of the worker when executing a * Dequeue instruction * @return $this Fluent Builder */ public function setDequeueTo($dequeueTo) { $this->options['dequeueTo'] = $dequeueTo; return $this; } /** * The callback URL for completed call event when executing a Dequeue instruction. * * @param string $dequeueStatusCallbackUrl The callback URL for completed call * event when executing a Dequeue * instruction * @return $this Fluent Builder */ public function setDequeueStatusCallbackUrl($dequeueStatusCallbackUrl) { $this->options['dequeueStatusCallbackUrl'] = $dequeueStatusCallbackUrl; return $this; } /** * The Caller ID of the outbound call when executing a Call instruction. * * @param string $callFrom The Caller ID of the outbound call when executing a * Call instruction * @return $this Fluent Builder */ public function setCallFrom($callFrom) { $this->options['callFrom'] = $callFrom; return $this; } /** * Whether to record both legs of a call when executing a Call instruction. * * @param string $callRecord Whether to record both legs of a call when * executing a Call instruction * @return $this Fluent Builder */ public function setCallRecord($callRecord) { $this->options['callRecord'] = $callRecord; return $this; } /** * The timeout for a call when executing a Call instruction. * * @param int $callTimeout The timeout for a call when executing a Call * instruction * @return $this Fluent Builder */ public function setCallTimeout($callTimeout) { $this->options['callTimeout'] = $callTimeout; return $this; } /** * The contact URI of the worker when executing a Call instruction. Can be the URI of the Twilio Client, the SIP URI for Programmable SIP, or the [E.164](https://www.twilio.com/docs/glossary/what-e164) formatted phone number, depending on the destination. * * @param string $callTo The contact URI of the worker when executing a Call * instruction * @return $this Fluent Builder */ public function setCallTo($callTo) { $this->options['callTo'] = $callTo; return $this; } /** * TwiML URI executed on answering the worker's leg as a result of the Call instruction. * * @param string $callUrl TwiML URI executed on answering the worker's leg as a * result of the Call instruction * @return $this Fluent Builder */ public function setCallUrl($callUrl) { $this->options['callUrl'] = $callUrl; return $this; } /** * The URL to call for the completed call event when executing a Call instruction. * * @param string $callStatusCallbackUrl The URL to call for the completed call * event when executing a Call instruction * @return $this Fluent Builder */ public function setCallStatusCallbackUrl($callStatusCallbackUrl) { $this->options['callStatusCallbackUrl'] = $callStatusCallbackUrl; return $this; } /** * Whether to accept a reservation when executing a Call instruction. * * @param bool $callAccept Whether to accept a reservation when executing a * Call instruction * @return $this Fluent Builder */ public function setCallAccept($callAccept) { $this->options['callAccept'] = $callAccept; return $this; } /** * The Call SID of the call parked in the queue when executing a Redirect instruction. * * @param string $redirectCallSid The Call SID of the call parked in the queue * when executing a Redirect instruction * @return $this Fluent Builder */ public function setRedirectCallSid($redirectCallSid) { $this->options['redirectCallSid'] = $redirectCallSid; return $this; } /** * Whether the reservation should be accepted when executing a Redirect instruction. * * @param bool $redirectAccept Whether the reservation should be accepted when * executing a Redirect instruction * @return $this Fluent Builder */ public function setRedirectAccept($redirectAccept) { $this->options['redirectAccept'] = $redirectAccept; return $this; } /** * TwiML URI to redirect the call to when executing the Redirect instruction. * * @param string $redirectUrl TwiML URI to redirect the call to when executing * the Redirect instruction * @return $this Fluent Builder */ public function setRedirectUrl($redirectUrl) { $this->options['redirectUrl'] = $redirectUrl; return $this; } /** * The Contact URI of the worker when executing a Conference instruction. Can be the URI of the Twilio Client, the SIP URI for Programmable SIP, or the [E.164](https://www.twilio.com/docs/glossary/what-e164) formatted phone number, depending on the destination. * * @param string $to The Contact URI of the worker when executing a Conference * instruction * @return $this Fluent Builder */ public function setTo($to) { $this->options['to'] = $to; return $this; } /** * The caller ID of the call to the worker when executing a Conference instruction. * * @param string $from The caller ID of the call to the worker when executing a * Conference instruction * @return $this Fluent Builder */ public function setFrom($from) { $this->options['from'] = $from; return $this; } /** * The URL we should call using the `status_callback_method` to send status information to your application. * * @param string $statusCallback The URL we should call to send status * information to your application * @return $this Fluent Builder */ public function setStatusCallback($statusCallback) { $this->options['statusCallback'] = $statusCallback; return $this; } /** * The HTTP method we should use to call `status_callback`. Can be: `POST` or `GET` and the default is `POST`. * * @param string $statusCallbackMethod The HTTP method we should use to call * status_callback * @return $this Fluent Builder */ public function setStatusCallbackMethod($statusCallbackMethod) { $this->options['statusCallbackMethod'] = $statusCallbackMethod; return $this; } /** * The call progress events that we will send to `status_callback`. Can be: `initiated`, `ringing`, `answered`, or `completed`. * * @param string $statusCallbackEvent The call progress events that we will * send to status_callback * @return $this Fluent Builder */ public function setStatusCallbackEvent($statusCallbackEvent) { $this->options['statusCallbackEvent'] = $statusCallbackEvent; return $this; } /** * The timeout for a call when executing a Conference instruction. * * @param int $timeout The timeout for a call when executing a Conference * instruction * @return $this Fluent Builder */ public function setTimeout($timeout) { $this->options['timeout'] = $timeout; return $this; } /** * Whether to record the participant and their conferences, including the time between conferences. Can be `true` or `false` and the default is `false`. * * @param bool $record Whether to record the participant and their conferences * @return $this Fluent Builder */ public function setRecord($record) { $this->options['record'] = $record; return $this; } /** * Whether the agent is muted in the conference. Defaults to `false`. * * @param bool $muted Whether to mute the agent * @return $this Fluent Builder */ public function setMuted($muted) { $this->options['muted'] = $muted; return $this; } /** * Whether to play a notification beep when the participant joins or when to play a beep. Can be: `true`, `false`, `onEnter`, or `onExit`. The default value is `true`. * * @param string $beep Whether to play a notification beep when the participant * joins * @return $this Fluent Builder */ public function setBeep($beep) { $this->options['beep'] = $beep; return $this; } /** * Whether to start the conference when the participant joins, if it has not already started. Can be: `true` or `false` and the default is `true`. If `false` and the conference has not started, the participant is muted and hears background music until another participant starts the conference. * * @param bool $startConferenceOnEnter Whether the conference starts when the * participant joins the conference * @return $this Fluent Builder */ public function setStartConferenceOnEnter($startConferenceOnEnter) { $this->options['startConferenceOnEnter'] = $startConferenceOnEnter; return $this; } /** * Whether to end the conference when the agent leaves. * * @param bool $endConferenceOnExit Whether to end the conference when the * agent leaves * @return $this Fluent Builder */ public function setEndConferenceOnExit($endConferenceOnExit) { $this->options['endConferenceOnExit'] = $endConferenceOnExit; return $this; } /** * The URL we should call using the `wait_method` for the music to play while participants are waiting for the conference to start. The default value is the URL of our standard hold music. [Learn more about hold music](https://www.twilio.com/labs/twimlets/holdmusic). * * @param string $waitUrl URL that hosts pre-conference hold music * @return $this Fluent Builder */ public function setWaitUrl($waitUrl) { $this->options['waitUrl'] = $waitUrl; return $this; } /** * The HTTP method we should use to call `wait_url`. Can be `GET` or `POST` and the default is `POST`. When using a static audio file, this should be `GET` so that we can cache the file. * * @param string $waitMethod The HTTP method we should use to call `wait_url` * @return $this Fluent Builder */ public function setWaitMethod($waitMethod) { $this->options['waitMethod'] = $waitMethod; return $this; } /** * Whether to allow an agent to hear the state of the outbound call, including ringing or disconnect messages. The default is `true`. * * @param bool $earlyMedia Whether agents can hear the state of the outbound * call * @return $this Fluent Builder */ public function setEarlyMedia($earlyMedia) { $this->options['earlyMedia'] = $earlyMedia; return $this; } /** * The maximum number of participants allowed in the conference. Can be a positive integer from `2` to `250`. The default value is `250`. * * @param int $maxParticipants The maximum number of agent conference * participants * @return $this Fluent Builder */ public function setMaxParticipants($maxParticipants) { $this->options['maxParticipants'] = $maxParticipants; return $this; } /** * The URL we should call using the `conference_status_callback_method` when the conference events in `conference_status_callback_event` occur. Only the value set by the first participant to join the conference is used. Subsequent `conference_status_callback` values are ignored. * * @param string $conferenceStatusCallback The callback URL for conference * events * @return $this Fluent Builder */ public function setConferenceStatusCallback($conferenceStatusCallback) { $this->options['conferenceStatusCallback'] = $conferenceStatusCallback; return $this; } /** * The HTTP method we should use to call `conference_status_callback`. Can be: `GET` or `POST` and defaults to `POST`. * * @param string $conferenceStatusCallbackMethod HTTP method for requesting * `conference_status_callback` * URL * @return $this Fluent Builder */ public function setConferenceStatusCallbackMethod($conferenceStatusCallbackMethod) { $this->options['conferenceStatusCallbackMethod'] = $conferenceStatusCallbackMethod; return $this; } /** * The conference status events that we will send to `conference_status_callback`. Can be: `start`, `end`, `join`, `leave`, `mute`, `hold`, `speaker`. * * @param string $conferenceStatusCallbackEvent The conference status events * that we will send to * conference_status_callback * @return $this Fluent Builder */ public function setConferenceStatusCallbackEvent($conferenceStatusCallbackEvent) { $this->options['conferenceStatusCallbackEvent'] = $conferenceStatusCallbackEvent; return $this; } /** * Whether to record the conference the participant is joining or when to record the conference. Can be: `true`, `false`, `record-from-start`, and `do-not-record`. The default value is `false`. * * @param string $conferenceRecord Whether to record the conference the * participant is joining * @return $this Fluent Builder */ public function setConferenceRecord($conferenceRecord) { $this->options['conferenceRecord'] = $conferenceRecord; return $this; } /** * Whether to trim leading and trailing silence from your recorded conference audio files. Can be: `trim-silence` or `do-not-trim` and defaults to `trim-silence`. * * @param string $conferenceTrim Whether to trim leading and trailing silence * from your recorded conference audio files * @return $this Fluent Builder */ public function setConferenceTrim($conferenceTrim) { $this->options['conferenceTrim'] = $conferenceTrim; return $this; } /** * The recording channels for the final recording. Can be: `mono` or `dual` and the default is `mono`. * * @param string $recordingChannels Specify `mono` or `dual` recording channels * @return $this Fluent Builder */ public function setRecordingChannels($recordingChannels) { $this->options['recordingChannels'] = $recordingChannels; return $this; } /** * The URL that we should call using the `recording_status_callback_method` when the recording status changes. * * @param string $recordingStatusCallback The URL that we should call using the * `recording_status_callback_method` * when the recording status changes * @return $this Fluent Builder */ public function setRecordingStatusCallback($recordingStatusCallback) { $this->options['recordingStatusCallback'] = $recordingStatusCallback; return $this; } /** * The HTTP method we should use when we call `recording_status_callback`. Can be: `GET` or `POST` and defaults to `POST`. * * @param string $recordingStatusCallbackMethod The HTTP method we should use * when we call * `recording_status_callback` * @return $this Fluent Builder */ public function setRecordingStatusCallbackMethod($recordingStatusCallbackMethod) { $this->options['recordingStatusCallbackMethod'] = $recordingStatusCallbackMethod; return $this; } /** * The URL we should call using the `conference_recording_status_callback_method` when the conference recording is available. * * @param string $conferenceRecordingStatusCallback The URL we should call * using the * `conference_recording_status_callback_method` when the conference recording is available * @return $this Fluent Builder */ public function setConferenceRecordingStatusCallback($conferenceRecordingStatusCallback) { $this->options['conferenceRecordingStatusCallback'] = $conferenceRecordingStatusCallback; return $this; } /** * The HTTP method we should use to call `conference_recording_status_callback`. Can be: `GET` or `POST` and defaults to `POST`. * * @param string $conferenceRecordingStatusCallbackMethod The HTTP method we * should use to call * `conference_recording_status_callback` * @return $this Fluent Builder */ public function setConferenceRecordingStatusCallbackMethod($conferenceRecordingStatusCallbackMethod) { $this->options['conferenceRecordingStatusCallbackMethod'] = $conferenceRecordingStatusCallbackMethod; return $this; } /** * The [region](https://support.twilio.com/hc/en-us/articles/223132167-How-global-low-latency-routing-and-region-selection-work-for-conferences-and-Client-calls) where we should mix the recorded audio. Can be:`us1`, `ie1`, `de1`, `sg1`, `br1`, `au1`, or `jp1`. * * @param string $region The region where we should mix the conference audio * @return $this Fluent Builder */ public function setRegion($region) { $this->options['region'] = $region; return $this; } /** * The SIP username used for authentication. * * @param string $sipAuthUsername The SIP username used for authentication * @return $this Fluent Builder */ public function setSipAuthUsername($sipAuthUsername) { $this->options['sipAuthUsername'] = $sipAuthUsername; return $this; } /** * The SIP password for authentication. * * @param string $sipAuthPassword The SIP password for authentication * @return $this Fluent Builder */ public function setSipAuthPassword($sipAuthPassword) { $this->options['sipAuthPassword'] = $sipAuthPassword; return $this; } /** * The call progress events sent via webhooks as a result of a Dequeue instruction. * * @param string $dequeueStatusCallbackEvent The call progress events sent via * webhooks as a result of a Dequeue * instruction * @return $this Fluent Builder */ public function setDequeueStatusCallbackEvent($dequeueStatusCallbackEvent) { $this->options['dequeueStatusCallbackEvent'] = $dequeueStatusCallbackEvent; return $this; } /** * The new worker activity SID after executing a Conference instruction. * * @param string $postWorkActivitySid The new worker activity SID after * executing a Conference instruction * @return $this Fluent Builder */ public function setPostWorkActivitySid($postWorkActivitySid) { $this->options['postWorkActivitySid'] = $postWorkActivitySid; return $this; } /** * Whether to end the conference when the customer leaves. * * @param bool $endConferenceOnCustomerExit Whether to end the conference when * the customer leaves * @return $this Fluent Builder */ public function setEndConferenceOnCustomerExit($endConferenceOnCustomerExit) { $this->options['endConferenceOnCustomerExit'] = $endConferenceOnCustomerExit; return $this; } /** * Whether to play a notification beep when the customer joins. * * @param bool $beepOnCustomerEntrance Whether to play a notification beep when * the customer joins * @return $this Fluent Builder */ public function setBeepOnCustomerEntrance($beepOnCustomerEntrance) { $this->options['beepOnCustomerEntrance'] = $beepOnCustomerEntrance; 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.Taskrouter.V1.UpdateReservationOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersStatisticsContext.php 0000644 00000004570 15002236443 0023732 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\Worker; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class WorkersStatisticsContext extends InstanceContext { /** * Initialize the WorkersStatisticsContext * * @param \Twilio\Version $version Version that contains the resource * @param string $workspaceSid The SID of the Workspace with the Worker to fetch * @return \Twilio\Rest\Taskrouter\V1\Workspace\Worker\WorkersStatisticsContext */ public function __construct(Version $version, $workspaceSid) { parent::__construct($version); // Path Solution $this->solution = array('workspaceSid' => $workspaceSid, ); $this->uri = '/Workspaces/' . \rawurlencode($workspaceSid) . '/Workers/Statistics'; } /** * Fetch a WorkersStatisticsInstance * * @param array|Options $options Optional Arguments * @return WorkersStatisticsInstance Fetched WorkersStatisticsInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch($options = array()) { $options = new Values($options); $params = Values::of(array( 'Minutes' => $options['minutes'], 'StartDate' => Serialize::iso8601DateTime($options['startDate']), 'EndDate' => Serialize::iso8601DateTime($options['endDate']), 'TaskQueueSid' => $options['taskQueueSid'], 'TaskQueueName' => $options['taskQueueName'], 'FriendlyName' => $options['friendlyName'], 'TaskChannel' => $options['taskChannel'], )); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new WorkersStatisticsInstance($this->version, $payload, $this->solution['workspaceSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Taskrouter.V1.WorkersStatisticsContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkerStatisticsList.php 0000644 00000003021 15002236443 0023024 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\Worker; use Twilio\ListResource; use Twilio\Version; class WorkerStatisticsList extends ListResource { /** * Construct the WorkerStatisticsList * * @param Version $version Version that contains the resource * @param string $workspaceSid The SID of the Workspace that contains the * WorkerChannel * @param string $workerSid The SID of the Worker that contains the * WorkerChannel * @return \Twilio\Rest\Taskrouter\V1\Workspace\Worker\WorkerStatisticsList */ public function __construct(Version $version, $workspaceSid, $workerSid) { parent::__construct($version); // Path Solution $this->solution = array('workspaceSid' => $workspaceSid, 'workerSid' => $workerSid, ); } /** * Constructs a WorkerStatisticsContext * * @return \Twilio\Rest\Taskrouter\V1\Workspace\Worker\WorkerStatisticsContext */ public function getContext() { return new WorkerStatisticsContext( $this->version, $this->solution['workspaceSid'], $this->solution['workerSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Taskrouter.V1.WorkerStatisticsList]'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkerChannelPage.php 0000644 00000001562 15002236443 0022213 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\Worker; use Twilio\Page; class WorkerChannelPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new WorkerChannelInstance( $this->version, $payload, $this->solution['workspaceSid'], $this->solution['workerSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Taskrouter.V1.WorkerChannelPage]'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkerChannelList.php 0000644 00000012414 15002236443 0022250 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\Worker; use Twilio\ListResource; use Twilio\Values; use Twilio\Version; class WorkerChannelList extends ListResource { /** * Construct the WorkerChannelList * * @param Version $version Version that contains the resource * @param string $workspaceSid The SID of the Workspace that contains the * WorkerChannel * @param string $workerSid The SID of the Worker that contains the * WorkerChannel * @return \Twilio\Rest\Taskrouter\V1\Workspace\Worker\WorkerChannelList */ public function __construct(Version $version, $workspaceSid, $workerSid) { parent::__construct($version); // Path Solution $this->solution = array('workspaceSid' => $workspaceSid, 'workerSid' => $workerSid, ); $this->uri = '/Workspaces/' . \rawurlencode($workspaceSid) . '/Workers/' . \rawurlencode($workerSid) . '/Channels'; } /** * Streams WorkerChannelInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads WorkerChannelInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return WorkerChannelInstance[] Array of results */ public function read($limit = null, $pageSize = null) { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of WorkerChannelInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of WorkerChannelInstance */ public function page($pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $params = Values::of(array( 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new WorkerChannelPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of WorkerChannelInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of WorkerChannelInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new WorkerChannelPage($this->version, $response, $this->solution); } /** * Constructs a WorkerChannelContext * * @param string $sid The SID of the to fetch * @return \Twilio\Rest\Taskrouter\V1\Workspace\Worker\WorkerChannelContext */ public function getContext($sid) { return new WorkerChannelContext( $this->version, $this->solution['workspaceSid'], $this->solution['workerSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Taskrouter.V1.WorkerChannelList]'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/EventPage.php 0000644 00000001373 15002236443 0017261 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace; use Twilio\Page; class EventPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new EventInstance($this->version, $payload, $this->solution['workspaceSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Taskrouter.V1.EventPage]'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkflowContext.php 0000644 00000015476 15002236443 0020573 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Rest\Taskrouter\V1\Workspace\Workflow\WorkflowCumulativeStatisticsList; use Twilio\Rest\Taskrouter\V1\Workspace\Workflow\WorkflowRealTimeStatisticsList; use Twilio\Rest\Taskrouter\V1\Workspace\Workflow\WorkflowStatisticsList; use Twilio\Values; use Twilio\Version; /** * @property \Twilio\Rest\Taskrouter\V1\Workspace\Workflow\WorkflowStatisticsList $statistics * @property \Twilio\Rest\Taskrouter\V1\Workspace\Workflow\WorkflowRealTimeStatisticsList $realTimeStatistics * @property \Twilio\Rest\Taskrouter\V1\Workspace\Workflow\WorkflowCumulativeStatisticsList $cumulativeStatistics * @method \Twilio\Rest\Taskrouter\V1\Workspace\Workflow\WorkflowStatisticsContext statistics() * @method \Twilio\Rest\Taskrouter\V1\Workspace\Workflow\WorkflowRealTimeStatisticsContext realTimeStatistics() * @method \Twilio\Rest\Taskrouter\V1\Workspace\Workflow\WorkflowCumulativeStatisticsContext cumulativeStatistics() */ class WorkflowContext extends InstanceContext { protected $_statistics = null; protected $_realTimeStatistics = null; protected $_cumulativeStatistics = null; /** * Initialize the WorkflowContext * * @param \Twilio\Version $version Version that contains the resource * @param string $workspaceSid The SID of the Workspace with the Workflow to * fetch * @param string $sid The SID of the resource * @return \Twilio\Rest\Taskrouter\V1\Workspace\WorkflowContext */ public function __construct(Version $version, $workspaceSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array('workspaceSid' => $workspaceSid, 'sid' => $sid, ); $this->uri = '/Workspaces/' . \rawurlencode($workspaceSid) . '/Workflows/' . \rawurlencode($sid) . ''; } /** * Fetch a WorkflowInstance * * @return WorkflowInstance Fetched WorkflowInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new WorkflowInstance( $this->version, $payload, $this->solution['workspaceSid'], $this->solution['sid'] ); } /** * Update the WorkflowInstance * * @param array|Options $options Optional Arguments * @return WorkflowInstance Updated WorkflowInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { $options = new Values($options); $data = Values::of(array( 'FriendlyName' => $options['friendlyName'], 'AssignmentCallbackUrl' => $options['assignmentCallbackUrl'], 'FallbackAssignmentCallbackUrl' => $options['fallbackAssignmentCallbackUrl'], 'Configuration' => $options['configuration'], 'TaskReservationTimeout' => $options['taskReservationTimeout'], 'ReEvaluateTasks' => $options['reEvaluateTasks'], )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new WorkflowInstance( $this->version, $payload, $this->solution['workspaceSid'], $this->solution['sid'] ); } /** * Deletes the WorkflowInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Access the statistics * * @return \Twilio\Rest\Taskrouter\V1\Workspace\Workflow\WorkflowStatisticsList */ protected function getStatistics() { if (!$this->_statistics) { $this->_statistics = new WorkflowStatisticsList( $this->version, $this->solution['workspaceSid'], $this->solution['sid'] ); } return $this->_statistics; } /** * Access the realTimeStatistics * * @return \Twilio\Rest\Taskrouter\V1\Workspace\Workflow\WorkflowRealTimeStatisticsList */ protected function getRealTimeStatistics() { if (!$this->_realTimeStatistics) { $this->_realTimeStatistics = new WorkflowRealTimeStatisticsList( $this->version, $this->solution['workspaceSid'], $this->solution['sid'] ); } return $this->_realTimeStatistics; } /** * Access the cumulativeStatistics * * @return \Twilio\Rest\Taskrouter\V1\Workspace\Workflow\WorkflowCumulativeStatisticsList */ protected function getCumulativeStatistics() { if (!$this->_cumulativeStatistics) { $this->_cumulativeStatistics = new WorkflowCumulativeStatisticsList( $this->version, $this->solution['workspaceSid'], $this->solution['sid'] ); } return $this->_cumulativeStatistics; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get($name) { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Taskrouter.V1.WorkflowContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceCumulativeStatisticsOptions.php 0000644 00000013256 15002236443 0025032 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace; use Twilio\Options; use Twilio\Values; abstract class WorkspaceCumulativeStatisticsOptions { /** * @param \DateTime $endDate Only include usage that occurred on or before this * date * @param int $minutes Only calculate statistics since this many minutes in the * past * @param \DateTime $startDate Only calculate statistics from on or after this * date * @param string $taskChannel Only calculate cumulative statistics on this * TaskChannel * @param string $splitByWaitTime A comma separated list of values that * describes the thresholds to calculate * statistics on * @return FetchWorkspaceCumulativeStatisticsOptions Options builder */ public static function fetch($endDate = Values::NONE, $minutes = Values::NONE, $startDate = Values::NONE, $taskChannel = Values::NONE, $splitByWaitTime = Values::NONE) { return new FetchWorkspaceCumulativeStatisticsOptions($endDate, $minutes, $startDate, $taskChannel, $splitByWaitTime); } } class FetchWorkspaceCumulativeStatisticsOptions extends Options { /** * @param \DateTime $endDate Only include usage that occurred on or before this * date * @param int $minutes Only calculate statistics since this many minutes in the * past * @param \DateTime $startDate Only calculate statistics from on or after this * date * @param string $taskChannel Only calculate cumulative statistics on this * TaskChannel * @param string $splitByWaitTime A comma separated list of values that * describes the thresholds to calculate * statistics on */ public function __construct($endDate = Values::NONE, $minutes = Values::NONE, $startDate = Values::NONE, $taskChannel = Values::NONE, $splitByWaitTime = Values::NONE) { $this->options['endDate'] = $endDate; $this->options['minutes'] = $minutes; $this->options['startDate'] = $startDate; $this->options['taskChannel'] = $taskChannel; $this->options['splitByWaitTime'] = $splitByWaitTime; } /** * Only include usage that occurred on or before this date, specified in GMT as an [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time. * * @param \DateTime $endDate Only include usage that occurred on or before this * date * @return $this Fluent Builder */ public function setEndDate($endDate) { $this->options['endDate'] = $endDate; return $this; } /** * Only calculate statistics since this many minutes in the past. The default 15 minutes. This is helpful for displaying statistics for the last 15 minutes, 240 minutes (4 hours), and 480 minutes (8 hours) to see trends. * * @param int $minutes Only calculate statistics since this many minutes in the * past * @return $this Fluent Builder */ public function setMinutes($minutes) { $this->options['minutes'] = $minutes; return $this; } /** * Only calculate statistics from this date and time and later, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. * * @param \DateTime $startDate Only calculate statistics from on or after this * date * @return $this Fluent Builder */ public function setStartDate($startDate) { $this->options['startDate'] = $startDate; return $this; } /** * Only calculate cumulative statistics on this TaskChannel. Can be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`. * * @param string $taskChannel Only calculate cumulative statistics on this * TaskChannel * @return $this Fluent Builder */ public function setTaskChannel($taskChannel) { $this->options['taskChannel'] = $taskChannel; return $this; } /** * A comma separated list of values that describes the thresholds, in seconds, to calculate statistics on. For each threshold specified, the number of Tasks canceled and reservations accepted above and below the specified thresholds in seconds are computed. For example, `5,30` would show splits of Tasks that were canceled or accepted before and after 5 seconds and before and after 30 seconds. This can be used to show short abandoned Tasks or Tasks that failed to meet an SLA. * * @param string $splitByWaitTime A comma separated list of values that * describes the thresholds to calculate * statistics on * @return $this Fluent Builder */ public function setSplitByWaitTime($splitByWaitTime) { $this->options['splitByWaitTime'] = $splitByWaitTime; 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.Taskrouter.V1.FetchWorkspaceCumulativeStatisticsOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkflowList.php 0000644 00000014775 15002236443 0020063 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; class WorkflowList extends ListResource { /** * Construct the WorkflowList * * @param Version $version Version that contains the resource * @param string $workspaceSid The SID of the Workspace that contains the * Workflow * @return \Twilio\Rest\Taskrouter\V1\Workspace\WorkflowList */ public function __construct(Version $version, $workspaceSid) { parent::__construct($version); // Path Solution $this->solution = array('workspaceSid' => $workspaceSid, ); $this->uri = '/Workspaces/' . \rawurlencode($workspaceSid) . '/Workflows'; } /** * Streams WorkflowInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($options = array(), $limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads WorkflowInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return WorkflowInstance[] Array of results */ public function read($options = array(), $limit = null, $pageSize = null) { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Retrieve a single page of WorkflowInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of WorkflowInstance */ public function page($options = array(), $pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $options = new Values($options); $params = Values::of(array( 'FriendlyName' => $options['friendlyName'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new WorkflowPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of WorkflowInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of WorkflowInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new WorkflowPage($this->version, $response, $this->solution); } /** * Create a new WorkflowInstance * * @param string $friendlyName descriptive string that you create to describe * the Workflow resource * @param string $configuration A JSON string that contains the rules to apply * to the Workflow * @param array|Options $options Optional Arguments * @return WorkflowInstance Newly created WorkflowInstance * @throws TwilioException When an HTTP error occurs. */ public function create($friendlyName, $configuration, $options = array()) { $options = new Values($options); $data = Values::of(array( 'FriendlyName' => $friendlyName, 'Configuration' => $configuration, 'AssignmentCallbackUrl' => $options['assignmentCallbackUrl'], 'FallbackAssignmentCallbackUrl' => $options['fallbackAssignmentCallbackUrl'], 'TaskReservationTimeout' => $options['taskReservationTimeout'], )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new WorkflowInstance($this->version, $payload, $this->solution['workspaceSid']); } /** * Constructs a WorkflowContext * * @param string $sid The SID of the resource * @return \Twilio\Rest\Taskrouter\V1\Workspace\WorkflowContext */ public function getContext($sid) { return new WorkflowContext($this->version, $this->solution['workspaceSid'], $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Taskrouter.V1.WorkflowList]'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceCumulativeStatisticsInstance.php 0000644 00000013134 15002236443 0025136 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property int $avgTaskAcceptanceTime * @property \DateTime $startTime * @property \DateTime $endTime * @property int $reservationsCreated * @property int $reservationsAccepted * @property int $reservationsRejected * @property int $reservationsTimedOut * @property int $reservationsCanceled * @property int $reservationsRescinded * @property array $splitByWaitTime * @property array $waitDurationUntilAccepted * @property array $waitDurationUntilCanceled * @property int $tasksCanceled * @property int $tasksCompleted * @property int $tasksCreated * @property int $tasksDeleted * @property int $tasksMoved * @property int $tasksTimedOutInWorkflow * @property string $workspaceSid * @property string $url */ class WorkspaceCumulativeStatisticsInstance extends InstanceResource { /** * Initialize the WorkspaceCumulativeStatisticsInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $workspaceSid The SID of the Workspace * @return \Twilio\Rest\Taskrouter\V1\Workspace\WorkspaceCumulativeStatisticsInstance */ public function __construct(Version $version, array $payload, $workspaceSid) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'accountSid' => Values::array_get($payload, 'account_sid'), 'avgTaskAcceptanceTime' => Values::array_get($payload, 'avg_task_acceptance_time'), 'startTime' => Deserialize::dateTime(Values::array_get($payload, 'start_time')), 'endTime' => Deserialize::dateTime(Values::array_get($payload, 'end_time')), 'reservationsCreated' => Values::array_get($payload, 'reservations_created'), 'reservationsAccepted' => Values::array_get($payload, 'reservations_accepted'), 'reservationsRejected' => Values::array_get($payload, 'reservations_rejected'), 'reservationsTimedOut' => Values::array_get($payload, 'reservations_timed_out'), 'reservationsCanceled' => Values::array_get($payload, 'reservations_canceled'), 'reservationsRescinded' => Values::array_get($payload, 'reservations_rescinded'), 'splitByWaitTime' => Values::array_get($payload, 'split_by_wait_time'), 'waitDurationUntilAccepted' => Values::array_get($payload, 'wait_duration_until_accepted'), 'waitDurationUntilCanceled' => Values::array_get($payload, 'wait_duration_until_canceled'), 'tasksCanceled' => Values::array_get($payload, 'tasks_canceled'), 'tasksCompleted' => Values::array_get($payload, 'tasks_completed'), 'tasksCreated' => Values::array_get($payload, 'tasks_created'), 'tasksDeleted' => Values::array_get($payload, 'tasks_deleted'), 'tasksMoved' => Values::array_get($payload, 'tasks_moved'), 'tasksTimedOutInWorkflow' => Values::array_get($payload, 'tasks_timed_out_in_workflow'), 'workspaceSid' => Values::array_get($payload, 'workspace_sid'), 'url' => Values::array_get($payload, 'url'), ); $this->solution = array('workspaceSid' => $workspaceSid, ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Taskrouter\V1\Workspace\WorkspaceCumulativeStatisticsContext Context for this * WorkspaceCumulativeStatisticsInstance */ protected function proxy() { if (!$this->context) { $this->context = new WorkspaceCumulativeStatisticsContext( $this->version, $this->solution['workspaceSid'] ); } return $this->context; } /** * Fetch a WorkspaceCumulativeStatisticsInstance * * @param array|Options $options Optional Arguments * @return WorkspaceCumulativeStatisticsInstance Fetched * WorkspaceCumulativeStatisticsInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch($options = array()) { return $this->proxy()->fetch($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Taskrouter.V1.WorkspaceCumulativeStatisticsInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceRealTimeStatisticsOptions.php 0000644 00000003525 15002236443 0024414 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace; use Twilio\Options; use Twilio\Values; abstract class WorkspaceRealTimeStatisticsOptions { /** * @param string $taskChannel Only calculate real-time statistics on this * TaskChannel * @return FetchWorkspaceRealTimeStatisticsOptions Options builder */ public static function fetch($taskChannel = Values::NONE) { return new FetchWorkspaceRealTimeStatisticsOptions($taskChannel); } } class FetchWorkspaceRealTimeStatisticsOptions extends Options { /** * @param string $taskChannel Only calculate real-time statistics on this * TaskChannel */ public function __construct($taskChannel = Values::NONE) { $this->options['taskChannel'] = $taskChannel; } /** * Only calculate real-time statistics on this TaskChannel. Can be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`. * * @param string $taskChannel Only calculate real-time statistics on this * TaskChannel * @return $this Fluent Builder */ public function setTaskChannel($taskChannel) { $this->options['taskChannel'] = $taskChannel; 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.Taskrouter.V1.FetchWorkspaceRealTimeStatisticsOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueueList.php 0000644 00000020033 15002236443 0020140 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Rest\Taskrouter\V1\Workspace\TaskQueue\TaskQueuesStatisticsList; use Twilio\Values; use Twilio\Version; /** * @property \Twilio\Rest\Taskrouter\V1\Workspace\TaskQueue\TaskQueuesStatisticsList $statistics */ class TaskQueueList extends ListResource { protected $_statistics = null; /** * Construct the TaskQueueList * * @param Version $version Version that contains the resource * @param string $workspaceSid The SID of the Workspace that contains the * TaskQueue * @return \Twilio\Rest\Taskrouter\V1\Workspace\TaskQueueList */ public function __construct(Version $version, $workspaceSid) { parent::__construct($version); // Path Solution $this->solution = array('workspaceSid' => $workspaceSid, ); $this->uri = '/Workspaces/' . \rawurlencode($workspaceSid) . '/TaskQueues'; } /** * Streams TaskQueueInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($options = array(), $limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads TaskQueueInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return TaskQueueInstance[] Array of results */ public function read($options = array(), $limit = null, $pageSize = null) { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Retrieve a single page of TaskQueueInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of TaskQueueInstance */ public function page($options = array(), $pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $options = new Values($options); $params = Values::of(array( 'FriendlyName' => $options['friendlyName'], 'EvaluateWorkerAttributes' => $options['evaluateWorkerAttributes'], 'WorkerSid' => $options['workerSid'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new TaskQueuePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of TaskQueueInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of TaskQueueInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new TaskQueuePage($this->version, $response, $this->solution); } /** * Create a new TaskQueueInstance * * @param string $friendlyName A string to describe the resource * @param array|Options $options Optional Arguments * @return TaskQueueInstance Newly created TaskQueueInstance * @throws TwilioException When an HTTP error occurs. */ public function create($friendlyName, $options = array()) { $options = new Values($options); $data = Values::of(array( 'FriendlyName' => $friendlyName, 'TargetWorkers' => $options['targetWorkers'], 'MaxReservedWorkers' => $options['maxReservedWorkers'], 'TaskOrder' => $options['taskOrder'], 'ReservationActivitySid' => $options['reservationActivitySid'], 'AssignmentActivitySid' => $options['assignmentActivitySid'], )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new TaskQueueInstance($this->version, $payload, $this->solution['workspaceSid']); } /** * Access the statistics */ protected function getStatistics() { if (!$this->_statistics) { $this->_statistics = new TaskQueuesStatisticsList($this->version, $this->solution['workspaceSid']); } return $this->_statistics; } /** * Constructs a TaskQueueContext * * @param string $sid The SID of the resource to * @return \Twilio\Rest\Taskrouter\V1\Workspace\TaskQueueContext */ public function getContext($sid) { return new TaskQueueContext($this->version, $this->solution['workspaceSid'], $sid); } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get($name) { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Taskrouter.V1.TaskQueueList]'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceRealTimeStatisticsInstance.php 0000644 00000010226 15002236443 0024521 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property array $activityStatistics * @property int $longestTaskWaitingAge * @property string $longestTaskWaitingSid * @property array $tasksByPriority * @property array $tasksByStatus * @property int $totalTasks * @property int $totalWorkers * @property string $workspaceSid * @property string $url */ class WorkspaceRealTimeStatisticsInstance extends InstanceResource { /** * Initialize the WorkspaceRealTimeStatisticsInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $workspaceSid The SID of the Workspace * @return \Twilio\Rest\Taskrouter\V1\Workspace\WorkspaceRealTimeStatisticsInstance */ public function __construct(Version $version, array $payload, $workspaceSid) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'accountSid' => Values::array_get($payload, 'account_sid'), 'activityStatistics' => Values::array_get($payload, 'activity_statistics'), 'longestTaskWaitingAge' => Values::array_get($payload, 'longest_task_waiting_age'), 'longestTaskWaitingSid' => Values::array_get($payload, 'longest_task_waiting_sid'), 'tasksByPriority' => Values::array_get($payload, 'tasks_by_priority'), 'tasksByStatus' => Values::array_get($payload, 'tasks_by_status'), 'totalTasks' => Values::array_get($payload, 'total_tasks'), 'totalWorkers' => Values::array_get($payload, 'total_workers'), 'workspaceSid' => Values::array_get($payload, 'workspace_sid'), 'url' => Values::array_get($payload, 'url'), ); $this->solution = array('workspaceSid' => $workspaceSid, ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Taskrouter\V1\Workspace\WorkspaceRealTimeStatisticsContext Context for this * WorkspaceRealTimeStatisticsInstance */ protected function proxy() { if (!$this->context) { $this->context = new WorkspaceRealTimeStatisticsContext( $this->version, $this->solution['workspaceSid'] ); } return $this->context; } /** * Fetch a WorkspaceRealTimeStatisticsInstance * * @param array|Options $options Optional Arguments * @return WorkspaceRealTimeStatisticsInstance Fetched * WorkspaceRealTimeStatisticsInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch($options = array()) { return $this->proxy()->fetch($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Taskrouter.V1.WorkspaceRealTimeStatisticsInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskChannelOptions.php 0000644 00000010541 15002236443 0021147 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace; use Twilio\Options; use Twilio\Values; abstract class TaskChannelOptions { /** * @param string $friendlyName A string to describe the TaskChannel resource * @param bool $channelOptimizedRouting Whether the TaskChannel should * prioritize Workers that have been idle * @return UpdateTaskChannelOptions Options builder */ public static function update($friendlyName = Values::NONE, $channelOptimizedRouting = Values::NONE) { return new UpdateTaskChannelOptions($friendlyName, $channelOptimizedRouting); } /** * @param bool $channelOptimizedRouting Whether the TaskChannel should * prioritize Workers that have been idle * @return CreateTaskChannelOptions Options builder */ public static function create($channelOptimizedRouting = Values::NONE) { return new CreateTaskChannelOptions($channelOptimizedRouting); } } class UpdateTaskChannelOptions extends Options { /** * @param string $friendlyName A string to describe the TaskChannel resource * @param bool $channelOptimizedRouting Whether the TaskChannel should * prioritize Workers that have been idle */ public function __construct($friendlyName = Values::NONE, $channelOptimizedRouting = Values::NONE) { $this->options['friendlyName'] = $friendlyName; $this->options['channelOptimizedRouting'] = $channelOptimizedRouting; } /** * A descriptive string that you create to describe the TaskChannel. It can be up to 64 characters long. * * @param string $friendlyName A string to describe the TaskChannel resource * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * Whether the TaskChannel should prioritize Workers that have been idle. If `true`, Workers that have been idle the longest are prioritized. * * @param bool $channelOptimizedRouting Whether the TaskChannel should * prioritize Workers that have been idle * @return $this Fluent Builder */ public function setChannelOptimizedRouting($channelOptimizedRouting) { $this->options['channelOptimizedRouting'] = $channelOptimizedRouting; 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.Taskrouter.V1.UpdateTaskChannelOptions ' . \implode(' ', $options) . ']'; } } class CreateTaskChannelOptions extends Options { /** * @param bool $channelOptimizedRouting Whether the TaskChannel should * prioritize Workers that have been idle */ public function __construct($channelOptimizedRouting = Values::NONE) { $this->options['channelOptimizedRouting'] = $channelOptimizedRouting; } /** * Whether the TaskChannel should prioritize Workers that have been idle. If `true`, Workers that have been idle the longest are prioritized. * * @param bool $channelOptimizedRouting Whether the TaskChannel should * prioritize Workers that have been idle * @return $this Fluent Builder */ public function setChannelOptimizedRouting($channelOptimizedRouting) { $this->options['channelOptimizedRouting'] = $channelOptimizedRouting; 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.Taskrouter.V1.CreateTaskChannelOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceStatisticsPage.php 0000644 00000001445 15002236443 0022211 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace; use Twilio\Page; class WorkspaceStatisticsPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new WorkspaceStatisticsInstance($this->version, $payload, $this->solution['workspaceSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Taskrouter.V1.WorkspaceStatisticsPage]'; } } sdk/src/Twilio/Rest/Taskrouter/V1/Workspace/TaskContext.php 0000644 00000011536 15002236443 0017654 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Rest\Taskrouter\V1\Workspace\Task\ReservationList; use Twilio\Values; use Twilio\Version; /** * @property \Twilio\Rest\Taskrouter\V1\Workspace\Task\ReservationList $reservations * @method \Twilio\Rest\Taskrouter\V1\Workspace\Task\ReservationContext reservations(string $sid) */ class TaskContext extends InstanceContext { protected $_reservations = null; /** * Initialize the TaskContext * * @param \Twilio\Version $version Version that contains the resource * @param string $workspaceSid The SID of the Workspace with the Task to fetch * @param string $sid The SID of the resource to fetch * @return \Twilio\Rest\Taskrouter\V1\Workspace\TaskContext */ public function __construct(Version $version, $workspaceSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array('workspaceSid' => $workspaceSid, 'sid' => $sid, ); $this->uri = '/Workspaces/' . \rawurlencode($workspaceSid) . '/Tasks/' . \rawurlencode($sid) . ''; } /** * Fetch a TaskInstance * * @return TaskInstance Fetched TaskInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new TaskInstance( $this->version, $payload, $this->solution['workspaceSid'], $this->solution['sid'] ); } /** * Update the TaskInstance * * @param array|Options $options Optional Arguments * @return TaskInstance Updated TaskInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { $options = new Values($options); $data = Values::of(array( 'Attributes' => $options['attributes'], 'AssignmentStatus' => $options['assignmentStatus'], 'Reason' => $options['reason'], 'Priority' => $options['priority'], 'TaskChannel' => $options['taskChannel'], )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new TaskInstance( $this->version, $payload, $this->solution['workspaceSid'], $this->solution['sid'] ); } /** * Deletes the TaskInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Access the reservations * * @return \Twilio\Rest\Taskrouter\V1\Workspace\Task\ReservationList */ protected function getReservations() { if (!$this->_reservations) { $this->_reservations = new ReservationList( $this->version, $this->solution['workspaceSid'], $this->solution['sid'] ); } return $this->_reservations; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get($name) { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Taskrouter.V1.TaskContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/Sync.php 0000644 00000004422 15002236443 0013347 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\Rest\Preview\Sync\ServiceList; use Twilio\Version; /** * @property \Twilio\Rest\Preview\Sync\ServiceList $services * @method \Twilio\Rest\Preview\Sync\ServiceContext services(string $sid) */ class Sync extends Version { protected $_services = null; /** * Construct the Sync version of Preview * * @param \Twilio\Domain $domain Domain that contains the version * @return \Twilio\Rest\Preview\Sync Sync version of Preview */ public function __construct(Domain $domain) { parent::__construct($domain); $this->version = 'Sync'; } /** * @return \Twilio\Rest\Preview\Sync\ServiceList */ protected function getServices() { if (!$this->_services) { $this->_services = new ServiceList($this); } return $this->_services; } /** * Magic getter to lazy load root resources * * @param string $name Resource to return * @return \Twilio\ListResource The requested resource * @throws TwilioException For unknown resource */ public function __get($name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown resource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Preview.Sync]'; } } sdk/src/Twilio/Rest/Preview/BulkExports.php 0000644 00000005713 15002236443 0014721 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\Rest\Preview\BulkExports\ExportConfigurationList; use Twilio\Rest\Preview\BulkExports\ExportList; use Twilio\Version; /** * @property \Twilio\Rest\Preview\BulkExports\ExportList $exports * @property \Twilio\Rest\Preview\BulkExports\ExportConfigurationList $exportConfiguration * @method \Twilio\Rest\Preview\BulkExports\ExportContext exports(string $resourceType) * @method \Twilio\Rest\Preview\BulkExports\ExportConfigurationContext exportConfiguration(string $resourceType) */ class BulkExports extends Version { protected $_exports = null; protected $_exportConfiguration = null; /** * Construct the BulkExports version of Preview * * @param \Twilio\Domain $domain Domain that contains the version * @return \Twilio\Rest\Preview\BulkExports BulkExports version of Preview */ public function __construct(Domain $domain) { parent::__construct($domain); $this->version = 'BulkExports'; } /** * @return \Twilio\Rest\Preview\BulkExports\ExportList */ protected function getExports() { if (!$this->_exports) { $this->_exports = new ExportList($this); } return $this->_exports; } /** * @return \Twilio\Rest\Preview\BulkExports\ExportConfigurationList */ protected function getExportConfiguration() { if (!$this->_exportConfiguration) { $this->_exportConfiguration = new ExportConfigurationList($this); } return $this->_exportConfiguration; } /** * Magic getter to lazy load root resources * * @param string $name Resource to return * @return \Twilio\ListResource The requested resource * @throws TwilioException For unknown resource */ public function __get($name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown resource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Preview.BulkExports]'; } } sdk/src/Twilio/Rest/Preview/BulkExports/ExportConfigurationContext.php 0000644 00000005474 15002236443 0022303 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\BulkExports; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class ExportConfigurationContext extends InstanceContext { /** * Initialize the ExportConfigurationContext * * @param \Twilio\Version $version Version that contains the resource * @param string $resourceType The resource_type * @return \Twilio\Rest\Preview\BulkExports\ExportConfigurationContext */ public function __construct(Version $version, $resourceType) { parent::__construct($version); // Path Solution $this->solution = array('resourceType' => $resourceType, ); $this->uri = '/Exports/' . \rawurlencode($resourceType) . '/Configuration'; } /** * Fetch a ExportConfigurationInstance * * @return ExportConfigurationInstance Fetched ExportConfigurationInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new ExportConfigurationInstance($this->version, $payload, $this->solution['resourceType']); } /** * Update the ExportConfigurationInstance * * @param array|Options $options Optional Arguments * @return ExportConfigurationInstance Updated ExportConfigurationInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { $options = new Values($options); $data = Values::of(array( 'Enabled' => Serialize::booleanToString($options['enabled']), 'WebhookUrl' => $options['webhookUrl'], 'WebhookMethod' => $options['webhookMethod'], )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new ExportConfigurationInstance($this->version, $payload, $this->solution['resourceType']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.BulkExports.ExportConfigurationContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/BulkExports/ExportPage.php 0000644 00000001652 15002236443 0016775 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\BulkExports; use Twilio\Page; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class ExportPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new ExportInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Preview.BulkExports.ExportPage]'; } } sdk/src/Twilio/Rest/Preview/BulkExports/ExportConfigurationInstance.php 0000644 00000007651 15002236443 0022422 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\BulkExports; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property bool $enabled * @property string $webhookUrl * @property string $webhookMethod * @property string $resourceType * @property string $url */ class ExportConfigurationInstance extends InstanceResource { /** * Initialize the ExportConfigurationInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $resourceType The resource_type * @return \Twilio\Rest\Preview\BulkExports\ExportConfigurationInstance */ public function __construct(Version $version, array $payload, $resourceType = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'enabled' => Values::array_get($payload, 'enabled'), 'webhookUrl' => Values::array_get($payload, 'webhook_url'), 'webhookMethod' => Values::array_get($payload, 'webhook_method'), 'resourceType' => Values::array_get($payload, 'resource_type'), 'url' => Values::array_get($payload, 'url'), ); $this->solution = array('resourceType' => $resourceType ?: $this->properties['resourceType'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Preview\BulkExports\ExportConfigurationContext Context * for this * ExportConfigurationInstance */ protected function proxy() { if (!$this->context) { $this->context = new ExportConfigurationContext($this->version, $this->solution['resourceType']); } return $this->context; } /** * Fetch a ExportConfigurationInstance * * @return ExportConfigurationInstance Fetched ExportConfigurationInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Update the ExportConfigurationInstance * * @param array|Options $options Optional Arguments * @return ExportConfigurationInstance Updated ExportConfigurationInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.BulkExports.ExportConfigurationInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/BulkExports/ExportConfigurationOptions.php 0000644 00000005111 15002236443 0022276 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\BulkExports; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ abstract class ExportConfigurationOptions { /** * @param bool $enabled The enabled * @param string $webhookUrl The webhook_url * @param string $webhookMethod The webhook_method * @return UpdateExportConfigurationOptions Options builder */ public static function update($enabled = Values::NONE, $webhookUrl = Values::NONE, $webhookMethod = Values::NONE) { return new UpdateExportConfigurationOptions($enabled, $webhookUrl, $webhookMethod); } } class UpdateExportConfigurationOptions extends Options { /** * @param bool $enabled The enabled * @param string $webhookUrl The webhook_url * @param string $webhookMethod The webhook_method */ public function __construct($enabled = Values::NONE, $webhookUrl = Values::NONE, $webhookMethod = Values::NONE) { $this->options['enabled'] = $enabled; $this->options['webhookUrl'] = $webhookUrl; $this->options['webhookMethod'] = $webhookMethod; } /** * The enabled * * @param bool $enabled The enabled * @return $this Fluent Builder */ public function setEnabled($enabled) { $this->options['enabled'] = $enabled; return $this; } /** * The webhook_url * * @param string $webhookUrl The webhook_url * @return $this Fluent Builder */ public function setWebhookUrl($webhookUrl) { $this->options['webhookUrl'] = $webhookUrl; return $this; } /** * The webhook_method * * @param string $webhookMethod The webhook_method * @return $this Fluent Builder */ public function setWebhookMethod($webhookMethod) { $this->options['webhookMethod'] = $webhookMethod; 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.Preview.BulkExports.UpdateExportConfigurationOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Preview/BulkExports/Export/DayList.php 0000644 00000011223 15002236443 0017544 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\BulkExports\Export; use Twilio\ListResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class DayList extends ListResource { /** * Construct the DayList * * @param Version $version Version that contains the resource * @param string $resourceType The resource_type * @return \Twilio\Rest\Preview\BulkExports\Export\DayList */ public function __construct(Version $version, $resourceType) { parent::__construct($version); // Path Solution $this->solution = array('resourceType' => $resourceType, ); $this->uri = '/Exports/' . \rawurlencode($resourceType) . '/Days'; } /** * Streams DayInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads DayInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return DayInstance[] Array of results */ public function read($limit = null, $pageSize = null) { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of DayInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of DayInstance */ public function page($pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $params = Values::of(array( 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new DayPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of DayInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of DayInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new DayPage($this->version, $response, $this->solution); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Preview.BulkExports.DayList]'; } } sdk/src/Twilio/Rest/Preview/BulkExports/Export/JobList.php 0000644 00000002373 15002236443 0017547 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\BulkExports\Export; use Twilio\ListResource; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class JobList extends ListResource { /** * Construct the JobList * * @param Version $version Version that contains the resource * @return \Twilio\Rest\Preview\BulkExports\Export\JobList */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = array(); } /** * Constructs a JobContext * * @param string $jobSid The job_sid * @return \Twilio\Rest\Preview\BulkExports\Export\JobContext */ public function getContext($jobSid) { return new JobContext($this->version, $jobSid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Preview.BulkExports.JobList]'; } } sdk/src/Twilio/Rest/Preview/BulkExports/Export/DayInstance.php 0000644 00000004351 15002236443 0020401 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\BulkExports\Export; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $redirectTo * @property string $day * @property int $size * @property string $resourceType */ class DayInstance extends InstanceResource { /** * Initialize the DayInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $resourceType The resource_type * @return \Twilio\Rest\Preview\BulkExports\Export\DayInstance */ public function __construct(Version $version, array $payload, $resourceType) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'redirectTo' => Values::array_get($payload, 'redirect_to'), 'day' => Values::array_get($payload, 'day'), 'size' => Values::array_get($payload, 'size'), 'resourceType' => Values::array_get($payload, 'resource_type'), ); $this->solution = array('resourceType' => $resourceType, ); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Preview.BulkExports.DayInstance]'; } } sdk/src/Twilio/Rest/Preview/BulkExports/Export/DayPage.php 0000644 00000001711 15002236443 0017506 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\BulkExports\Export; use Twilio\Page; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class DayPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new DayInstance($this->version, $payload, $this->solution['resourceType']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Preview.BulkExports.DayPage]'; } } sdk/src/Twilio/Rest/Preview/BulkExports/Export/ExportCustomJobInstance.php 0000644 00000005477 15002236443 0023005 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\BulkExports\Export; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $friendlyName * @property string $resourceType * @property string $startDay * @property string $endDay * @property string $webhookUrl * @property string $webhookMethod * @property string $email * @property string $jobSid * @property array $details */ class ExportCustomJobInstance extends InstanceResource { /** * Initialize the ExportCustomJobInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $resourceType The type of communication – Messages, Calls * @return \Twilio\Rest\Preview\BulkExports\Export\ExportCustomJobInstance */ public function __construct(Version $version, array $payload, $resourceType) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'resourceType' => Values::array_get($payload, 'resource_type'), 'startDay' => Values::array_get($payload, 'start_day'), 'endDay' => Values::array_get($payload, 'end_day'), 'webhookUrl' => Values::array_get($payload, 'webhook_url'), 'webhookMethod' => Values::array_get($payload, 'webhook_method'), 'email' => Values::array_get($payload, 'email'), 'jobSid' => Values::array_get($payload, 'job_sid'), 'details' => Values::array_get($payload, 'details'), ); $this->solution = array('resourceType' => $resourceType, ); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Preview.BulkExports.ExportCustomJobInstance]'; } } sdk/src/Twilio/Rest/Preview/BulkExports/Export/JobPage.php 0000644 00000001650 15002236443 0017505 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\BulkExports\Export; use Twilio\Page; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class JobPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new JobInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Preview.BulkExports.JobPage]'; } } sdk/src/Twilio/Rest/Preview/BulkExports/Export/ExportCustomJobOptions.php 0000644 00000013537 15002236443 0022670 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\BulkExports\Export; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ abstract class ExportCustomJobOptions { /** * @param string $nextToken The token for the next page of job results * @param string $previousToken The token for the previous page of result * @return ReadExportCustomJobOptions Options builder */ public static function read($nextToken = Values::NONE, $previousToken = Values::NONE) { return new ReadExportCustomJobOptions($nextToken, $previousToken); } /** * @param string $friendlyName The friendly_name * @param string $startDay The start_day * @param string $endDay The end_day * @param string $webhookUrl The webhook_url * @param string $webhookMethod The webhook_method * @param string $email The email * @return CreateExportCustomJobOptions Options builder */ public static function create($friendlyName = Values::NONE, $startDay = Values::NONE, $endDay = Values::NONE, $webhookUrl = Values::NONE, $webhookMethod = Values::NONE, $email = Values::NONE) { return new CreateExportCustomJobOptions($friendlyName, $startDay, $endDay, $webhookUrl, $webhookMethod, $email); } } class ReadExportCustomJobOptions extends Options { /** * @param string $nextToken The token for the next page of job results * @param string $previousToken The token for the previous page of result */ public function __construct($nextToken = Values::NONE, $previousToken = Values::NONE) { $this->options['nextToken'] = $nextToken; $this->options['previousToken'] = $previousToken; } /** * The token for the next page of job results, and may be null if there are no more pages * * @param string $nextToken The token for the next page of job results * @return $this Fluent Builder */ public function setNextToken($nextToken) { $this->options['nextToken'] = $nextToken; return $this; } /** * The token for the previous page of results, and may be null if this is the first page * * @param string $previousToken The token for the previous page of result * @return $this Fluent Builder */ public function setPreviousToken($previousToken) { $this->options['previousToken'] = $previousToken; 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.Preview.BulkExports.ReadExportCustomJobOptions ' . \implode(' ', $options) . ']'; } } class CreateExportCustomJobOptions extends Options { /** * @param string $friendlyName The friendly_name * @param string $startDay The start_day * @param string $endDay The end_day * @param string $webhookUrl The webhook_url * @param string $webhookMethod The webhook_method * @param string $email The email */ public function __construct($friendlyName = Values::NONE, $startDay = Values::NONE, $endDay = Values::NONE, $webhookUrl = Values::NONE, $webhookMethod = Values::NONE, $email = Values::NONE) { $this->options['friendlyName'] = $friendlyName; $this->options['startDay'] = $startDay; $this->options['endDay'] = $endDay; $this->options['webhookUrl'] = $webhookUrl; $this->options['webhookMethod'] = $webhookMethod; $this->options['email'] = $email; } /** * The friendly_name * * @param string $friendlyName The friendly_name * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The start_day * * @param string $startDay The start_day * @return $this Fluent Builder */ public function setStartDay($startDay) { $this->options['startDay'] = $startDay; return $this; } /** * The end_day * * @param string $endDay The end_day * @return $this Fluent Builder */ public function setEndDay($endDay) { $this->options['endDay'] = $endDay; return $this; } /** * The webhook_url * * @param string $webhookUrl The webhook_url * @return $this Fluent Builder */ public function setWebhookUrl($webhookUrl) { $this->options['webhookUrl'] = $webhookUrl; return $this; } /** * The webhook_method * * @param string $webhookMethod The webhook_method * @return $this Fluent Builder */ public function setWebhookMethod($webhookMethod) { $this->options['webhookMethod'] = $webhookMethod; return $this; } /** * The email * * @param string $email The email * @return $this Fluent Builder */ public function setEmail($email) { $this->options['email'] = $email; 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.Preview.BulkExports.CreateExportCustomJobOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Preview/BulkExports/Export/ExportCustomJobPage.php 0000644 00000001755 15002236443 0022110 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\BulkExports\Export; use Twilio\Page; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class ExportCustomJobPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new ExportCustomJobInstance($this->version, $payload, $this->solution['resourceType']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Preview.BulkExports.ExportCustomJobPage]'; } } sdk/src/Twilio/Rest/Preview/BulkExports/Export/ExportCustomJobList.php 0000644 00000014303 15002236443 0022140 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\BulkExports\Export; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class ExportCustomJobList extends ListResource { /** * Construct the ExportCustomJobList * * @param Version $version Version that contains the resource * @param string $resourceType The type of communication – Messages, Calls * @return \Twilio\Rest\Preview\BulkExports\Export\ExportCustomJobList */ public function __construct(Version $version, $resourceType) { parent::__construct($version); // Path Solution $this->solution = array('resourceType' => $resourceType, ); $this->uri = '/Exports/' . \rawurlencode($resourceType) . '/Jobs'; } /** * Streams ExportCustomJobInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($options = array(), $limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads ExportCustomJobInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return ExportCustomJobInstance[] Array of results */ public function read($options = array(), $limit = null, $pageSize = null) { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Retrieve a single page of ExportCustomJobInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of ExportCustomJobInstance */ public function page($options = array(), $pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $options = new Values($options); $params = Values::of(array( 'NextToken' => $options['nextToken'], 'PreviousToken' => $options['previousToken'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new ExportCustomJobPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of ExportCustomJobInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of ExportCustomJobInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new ExportCustomJobPage($this->version, $response, $this->solution); } /** * Create a new ExportCustomJobInstance * * @param array|Options $options Optional Arguments * @return ExportCustomJobInstance Newly created ExportCustomJobInstance * @throws TwilioException When an HTTP error occurs. */ public function create($options = array()) { $options = new Values($options); $data = Values::of(array( 'FriendlyName' => $options['friendlyName'], 'StartDay' => $options['startDay'], 'EndDay' => $options['endDay'], 'WebhookUrl' => $options['webhookUrl'], 'WebhookMethod' => $options['webhookMethod'], 'Email' => $options['email'], )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new ExportCustomJobInstance($this->version, $payload, $this->solution['resourceType']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Preview.BulkExports.ExportCustomJobList]'; } } sdk/src/Twilio/Rest/Preview/BulkExports/Export/JobContext.php 0000644 00000004074 15002236443 0020260 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\BulkExports\Export; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class JobContext extends InstanceContext { /** * Initialize the JobContext * * @param \Twilio\Version $version Version that contains the resource * @param string $jobSid The job_sid * @return \Twilio\Rest\Preview\BulkExports\Export\JobContext */ public function __construct(Version $version, $jobSid) { parent::__construct($version); // Path Solution $this->solution = array('jobSid' => $jobSid, ); $this->uri = '/Exports/Jobs/' . \rawurlencode($jobSid) . ''; } /** * Fetch a JobInstance * * @return JobInstance Fetched JobInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new JobInstance($this->version, $payload, $this->solution['jobSid']); } /** * Deletes the JobInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.BulkExports.JobContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/BulkExports/Export/JobInstance.php 0000644 00000007314 15002236443 0020400 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\BulkExports\Export; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $resourceType * @property string $friendlyName * @property array $details * @property string $startDay * @property string $endDay * @property string $jobSid * @property string $url */ class JobInstance extends InstanceResource { /** * Initialize the JobInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $jobSid The job_sid * @return \Twilio\Rest\Preview\BulkExports\Export\JobInstance */ public function __construct(Version $version, array $payload, $jobSid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'resourceType' => Values::array_get($payload, 'resource_type'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'details' => Values::array_get($payload, 'details'), 'startDay' => Values::array_get($payload, 'start_day'), 'endDay' => Values::array_get($payload, 'end_day'), 'jobSid' => Values::array_get($payload, 'job_sid'), 'url' => Values::array_get($payload, 'url'), ); $this->solution = array('jobSid' => $jobSid ?: $this->properties['jobSid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Preview\BulkExports\Export\JobContext Context for this * JobInstance */ protected function proxy() { if (!$this->context) { $this->context = new JobContext($this->version, $this->solution['jobSid']); } return $this->context; } /** * Fetch a JobInstance * * @return JobInstance Fetched JobInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the JobInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.BulkExports.JobInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/BulkExports/ExportInstance.php 0000644 00000007135 15002236443 0017667 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\BulkExports; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $resourceType * @property string $url * @property array $links */ class ExportInstance extends InstanceResource { protected $_days = null; protected $_exportCustomJobs = null; /** * Initialize the ExportInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $resourceType The resource_type * @return \Twilio\Rest\Preview\BulkExports\ExportInstance */ public function __construct(Version $version, array $payload, $resourceType = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'resourceType' => Values::array_get($payload, 'resource_type'), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ); $this->solution = array('resourceType' => $resourceType ?: $this->properties['resourceType'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Preview\BulkExports\ExportContext Context for this * ExportInstance */ protected function proxy() { if (!$this->context) { $this->context = new ExportContext($this->version, $this->solution['resourceType']); } return $this->context; } /** * Fetch a ExportInstance * * @return ExportInstance Fetched ExportInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Access the days * * @return \Twilio\Rest\Preview\BulkExports\Export\DayList */ protected function getDays() { return $this->proxy()->days; } /** * Access the exportCustomJobs * * @return \Twilio\Rest\Preview\BulkExports\Export\ExportCustomJobList */ protected function getExportCustomJobs() { return $this->proxy()->exportCustomJobs; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.BulkExports.ExportInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/BulkExports/ExportList.php 0000644 00000005465 15002236443 0017042 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\BulkExports; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Rest\Preview\BulkExports\Export\JobList; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property \Twilio\Rest\Preview\BulkExports\Export\JobList $jobs * @method \Twilio\Rest\Preview\BulkExports\Export\JobContext jobs(string $jobSid) */ class ExportList extends ListResource { protected $_jobs = null; /** * Construct the ExportList * * @param Version $version Version that contains the resource * @return \Twilio\Rest\Preview\BulkExports\ExportList */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = array(); } /** * Access the jobs */ protected function getJobs() { if (!$this->_jobs) { $this->_jobs = new JobList($this->version); } return $this->_jobs; } /** * Constructs a ExportContext * * @param string $resourceType The resource_type * @return \Twilio\Rest\Preview\BulkExports\ExportContext */ public function getContext($resourceType) { return new ExportContext($this->version, $resourceType); } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get($name) { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Preview.BulkExports.ExportList]'; } } sdk/src/Twilio/Rest/Preview/BulkExports/ExportConfigurationList.php 0000644 00000002556 15002236443 0021570 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\BulkExports; use Twilio\ListResource; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class ExportConfigurationList extends ListResource { /** * Construct the ExportConfigurationList * * @param Version $version Version that contains the resource * @return \Twilio\Rest\Preview\BulkExports\ExportConfigurationList */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = array(); } /** * Constructs a ExportConfigurationContext * * @param string $resourceType The resource_type * @return \Twilio\Rest\Preview\BulkExports\ExportConfigurationContext */ public function getContext($resourceType) { return new ExportConfigurationContext($this->version, $resourceType); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Preview.BulkExports.ExportConfigurationList]'; } } sdk/src/Twilio/Rest/Preview/BulkExports/ExportContext.php 0000644 00000007664 15002236443 0017556 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\BulkExports; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Rest\Preview\BulkExports\Export\DayList; use Twilio\Rest\Preview\BulkExports\Export\ExportCustomJobList; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property \Twilio\Rest\Preview\BulkExports\Export\DayList $days * @property \Twilio\Rest\Preview\BulkExports\Export\ExportCustomJobList $exportCustomJobs */ class ExportContext extends InstanceContext { protected $_days = null; protected $_exportCustomJobs = null; /** * Initialize the ExportContext * * @param \Twilio\Version $version Version that contains the resource * @param string $resourceType The resource_type * @return \Twilio\Rest\Preview\BulkExports\ExportContext */ public function __construct(Version $version, $resourceType) { parent::__construct($version); // Path Solution $this->solution = array('resourceType' => $resourceType, ); $this->uri = '/Exports/' . \rawurlencode($resourceType) . ''; } /** * Fetch a ExportInstance * * @return ExportInstance Fetched ExportInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new ExportInstance($this->version, $payload, $this->solution['resourceType']); } /** * Access the days * * @return \Twilio\Rest\Preview\BulkExports\Export\DayList */ protected function getDays() { if (!$this->_days) { $this->_days = new DayList($this->version, $this->solution['resourceType']); } return $this->_days; } /** * Access the exportCustomJobs * * @return \Twilio\Rest\Preview\BulkExports\Export\ExportCustomJobList */ protected function getExportCustomJobs() { if (!$this->_exportCustomJobs) { $this->_exportCustomJobs = new ExportCustomJobList($this->version, $this->solution['resourceType']); } return $this->_exportCustomJobs; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get($name) { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.BulkExports.ExportContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/BulkExports/ExportConfigurationPage.php 0000644 00000001721 15002236443 0021522 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\BulkExports; use Twilio\Page; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class ExportConfigurationPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new ExportConfigurationInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Preview.BulkExports.ExportConfigurationPage]'; } } sdk/src/Twilio/Rest/Preview/Understand/AssistantOptions.php 0000644 00000043447 15002236443 0020101 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ abstract class AssistantOptions { /** * @param string $friendlyName A text description for the Assistant. It is * non-unique and can up to 255 characters long. * @param bool $logQueries A boolean that specifies whether queries should be * logged for 30 days further training. If false, no * queries will be stored, if true, queries will be * stored for 30 days and deleted thereafter. Defaults * to true if no value is provided. * @param string $uniqueName A user-provided string that uniquely identifies * this resource as an alternative to the sid. Unique * up to 64 characters long. * @param string $callbackUrl A user-provided URL to send event callbacks to. * @param string $callbackEvents Space-separated list of callback events that * will trigger callbacks. * @param array $fallbackActions The JSON actions to be executed when the * user's input is not recognized as matching any * Task. * @param array $initiationActions The JSON actions to be executed on inbound * phone calls when the Assistant has to say * something first. * @param array $styleSheet The JSON object that holds the style sheet for the * assistant * @return CreateAssistantOptions Options builder */ public static function create($friendlyName = Values::NONE, $logQueries = Values::NONE, $uniqueName = Values::NONE, $callbackUrl = Values::NONE, $callbackEvents = Values::NONE, $fallbackActions = Values::NONE, $initiationActions = Values::NONE, $styleSheet = Values::NONE) { return new CreateAssistantOptions($friendlyName, $logQueries, $uniqueName, $callbackUrl, $callbackEvents, $fallbackActions, $initiationActions, $styleSheet); } /** * @param string $friendlyName A text description for the Assistant. It is * non-unique and can up to 255 characters long. * @param bool $logQueries A boolean that specifies whether queries should be * logged for 30 days further training. If false, no * queries will be stored, if true, queries will be * stored for 30 days and deleted thereafter. Defaults * to true if no value is provided. * @param string $uniqueName A user-provided string that uniquely identifies * this resource as an alternative to the sid. Unique * up to 64 characters long. * @param string $callbackUrl A user-provided URL to send event callbacks to. * @param string $callbackEvents Space-separated list of callback events that * will trigger callbacks. * @param array $fallbackActions The JSON actions to be executed when the * user's input is not recognized as matching any * Task. * @param array $initiationActions The JSON actions to be executed on inbound * phone calls when the Assistant has to say * something first. * @param array $styleSheet The JSON object that holds the style sheet for the * assistant * @return UpdateAssistantOptions Options builder */ public static function update($friendlyName = Values::NONE, $logQueries = Values::NONE, $uniqueName = Values::NONE, $callbackUrl = Values::NONE, $callbackEvents = Values::NONE, $fallbackActions = Values::NONE, $initiationActions = Values::NONE, $styleSheet = Values::NONE) { return new UpdateAssistantOptions($friendlyName, $logQueries, $uniqueName, $callbackUrl, $callbackEvents, $fallbackActions, $initiationActions, $styleSheet); } } class CreateAssistantOptions extends Options { /** * @param string $friendlyName A text description for the Assistant. It is * non-unique and can up to 255 characters long. * @param bool $logQueries A boolean that specifies whether queries should be * logged for 30 days further training. If false, no * queries will be stored, if true, queries will be * stored for 30 days and deleted thereafter. Defaults * to true if no value is provided. * @param string $uniqueName A user-provided string that uniquely identifies * this resource as an alternative to the sid. Unique * up to 64 characters long. * @param string $callbackUrl A user-provided URL to send event callbacks to. * @param string $callbackEvents Space-separated list of callback events that * will trigger callbacks. * @param array $fallbackActions The JSON actions to be executed when the * user's input is not recognized as matching any * Task. * @param array $initiationActions The JSON actions to be executed on inbound * phone calls when the Assistant has to say * something first. * @param array $styleSheet The JSON object that holds the style sheet for the * assistant */ public function __construct($friendlyName = Values::NONE, $logQueries = Values::NONE, $uniqueName = Values::NONE, $callbackUrl = Values::NONE, $callbackEvents = Values::NONE, $fallbackActions = Values::NONE, $initiationActions = Values::NONE, $styleSheet = Values::NONE) { $this->options['friendlyName'] = $friendlyName; $this->options['logQueries'] = $logQueries; $this->options['uniqueName'] = $uniqueName; $this->options['callbackUrl'] = $callbackUrl; $this->options['callbackEvents'] = $callbackEvents; $this->options['fallbackActions'] = $fallbackActions; $this->options['initiationActions'] = $initiationActions; $this->options['styleSheet'] = $styleSheet; } /** * A text description for the Assistant. It is non-unique and can up to 255 characters long. * * @param string $friendlyName A text description for the Assistant. It is * non-unique and can up to 255 characters long. * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * A boolean that specifies whether queries should be logged for 30 days further training. If false, no queries will be stored, if true, queries will be stored for 30 days and deleted thereafter. Defaults to true if no value is provided. * * @param bool $logQueries A boolean that specifies whether queries should be * logged for 30 days further training. If false, no * queries will be stored, if true, queries will be * stored for 30 days and deleted thereafter. Defaults * to true if no value is provided. * @return $this Fluent Builder */ public function setLogQueries($logQueries) { $this->options['logQueries'] = $logQueries; return $this; } /** * A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. * * @param string $uniqueName A user-provided string that uniquely identifies * this resource as an alternative to the sid. Unique * up to 64 characters long. * @return $this Fluent Builder */ public function setUniqueName($uniqueName) { $this->options['uniqueName'] = $uniqueName; return $this; } /** * A user-provided URL to send event callbacks to. * * @param string $callbackUrl A user-provided URL to send event callbacks to. * @return $this Fluent Builder */ public function setCallbackUrl($callbackUrl) { $this->options['callbackUrl'] = $callbackUrl; return $this; } /** * Space-separated list of callback events that will trigger callbacks. * * @param string $callbackEvents Space-separated list of callback events that * will trigger callbacks. * @return $this Fluent Builder */ public function setCallbackEvents($callbackEvents) { $this->options['callbackEvents'] = $callbackEvents; return $this; } /** * The JSON actions to be executed when the user's input is not recognized as matching any Task. * * @param array $fallbackActions The JSON actions to be executed when the * user's input is not recognized as matching any * Task. * @return $this Fluent Builder */ public function setFallbackActions($fallbackActions) { $this->options['fallbackActions'] = $fallbackActions; return $this; } /** * The JSON actions to be executed on inbound phone calls when the Assistant has to say something first. * * @param array $initiationActions The JSON actions to be executed on inbound * phone calls when the Assistant has to say * something first. * @return $this Fluent Builder */ public function setInitiationActions($initiationActions) { $this->options['initiationActions'] = $initiationActions; return $this; } /** * The JSON object that holds the style sheet for the assistant * * @param array $styleSheet The JSON object that holds the style sheet for the * assistant * @return $this Fluent Builder */ public function setStyleSheet($styleSheet) { $this->options['styleSheet'] = $styleSheet; 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.Preview.Understand.CreateAssistantOptions ' . \implode(' ', $options) . ']'; } } class UpdateAssistantOptions extends Options { /** * @param string $friendlyName A text description for the Assistant. It is * non-unique and can up to 255 characters long. * @param bool $logQueries A boolean that specifies whether queries should be * logged for 30 days further training. If false, no * queries will be stored, if true, queries will be * stored for 30 days and deleted thereafter. Defaults * to true if no value is provided. * @param string $uniqueName A user-provided string that uniquely identifies * this resource as an alternative to the sid. Unique * up to 64 characters long. * @param string $callbackUrl A user-provided URL to send event callbacks to. * @param string $callbackEvents Space-separated list of callback events that * will trigger callbacks. * @param array $fallbackActions The JSON actions to be executed when the * user's input is not recognized as matching any * Task. * @param array $initiationActions The JSON actions to be executed on inbound * phone calls when the Assistant has to say * something first. * @param array $styleSheet The JSON object that holds the style sheet for the * assistant */ public function __construct($friendlyName = Values::NONE, $logQueries = Values::NONE, $uniqueName = Values::NONE, $callbackUrl = Values::NONE, $callbackEvents = Values::NONE, $fallbackActions = Values::NONE, $initiationActions = Values::NONE, $styleSheet = Values::NONE) { $this->options['friendlyName'] = $friendlyName; $this->options['logQueries'] = $logQueries; $this->options['uniqueName'] = $uniqueName; $this->options['callbackUrl'] = $callbackUrl; $this->options['callbackEvents'] = $callbackEvents; $this->options['fallbackActions'] = $fallbackActions; $this->options['initiationActions'] = $initiationActions; $this->options['styleSheet'] = $styleSheet; } /** * A text description for the Assistant. It is non-unique and can up to 255 characters long. * * @param string $friendlyName A text description for the Assistant. It is * non-unique and can up to 255 characters long. * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * A boolean that specifies whether queries should be logged for 30 days further training. If false, no queries will be stored, if true, queries will be stored for 30 days and deleted thereafter. Defaults to true if no value is provided. * * @param bool $logQueries A boolean that specifies whether queries should be * logged for 30 days further training. If false, no * queries will be stored, if true, queries will be * stored for 30 days and deleted thereafter. Defaults * to true if no value is provided. * @return $this Fluent Builder */ public function setLogQueries($logQueries) { $this->options['logQueries'] = $logQueries; return $this; } /** * A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. * * @param string $uniqueName A user-provided string that uniquely identifies * this resource as an alternative to the sid. Unique * up to 64 characters long. * @return $this Fluent Builder */ public function setUniqueName($uniqueName) { $this->options['uniqueName'] = $uniqueName; return $this; } /** * A user-provided URL to send event callbacks to. * * @param string $callbackUrl A user-provided URL to send event callbacks to. * @return $this Fluent Builder */ public function setCallbackUrl($callbackUrl) { $this->options['callbackUrl'] = $callbackUrl; return $this; } /** * Space-separated list of callback events that will trigger callbacks. * * @param string $callbackEvents Space-separated list of callback events that * will trigger callbacks. * @return $this Fluent Builder */ public function setCallbackEvents($callbackEvents) { $this->options['callbackEvents'] = $callbackEvents; return $this; } /** * The JSON actions to be executed when the user's input is not recognized as matching any Task. * * @param array $fallbackActions The JSON actions to be executed when the * user's input is not recognized as matching any * Task. * @return $this Fluent Builder */ public function setFallbackActions($fallbackActions) { $this->options['fallbackActions'] = $fallbackActions; return $this; } /** * The JSON actions to be executed on inbound phone calls when the Assistant has to say something first. * * @param array $initiationActions The JSON actions to be executed on inbound * phone calls when the Assistant has to say * something first. * @return $this Fluent Builder */ public function setInitiationActions($initiationActions) { $this->options['initiationActions'] = $initiationActions; return $this; } /** * The JSON object that holds the style sheet for the assistant * * @param array $styleSheet The JSON object that holds the style sheet for the * assistant * @return $this Fluent Builder */ public function setStyleSheet($styleSheet) { $this->options['styleSheet'] = $styleSheet; 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.Preview.Understand.UpdateAssistantOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Preview/Understand/AssistantContext.php 0000644 00000023036 15002236443 0020062 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Rest\Preview\Understand\Assistant\AssistantFallbackActionsList; use Twilio\Rest\Preview\Understand\Assistant\AssistantInitiationActionsList; use Twilio\Rest\Preview\Understand\Assistant\DialogueList; use Twilio\Rest\Preview\Understand\Assistant\FieldTypeList; use Twilio\Rest\Preview\Understand\Assistant\ModelBuildList; use Twilio\Rest\Preview\Understand\Assistant\QueryList; use Twilio\Rest\Preview\Understand\Assistant\StyleSheetList; use Twilio\Rest\Preview\Understand\Assistant\TaskList; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property \Twilio\Rest\Preview\Understand\Assistant\FieldTypeList $fieldTypes * @property \Twilio\Rest\Preview\Understand\Assistant\TaskList $tasks * @property \Twilio\Rest\Preview\Understand\Assistant\ModelBuildList $modelBuilds * @property \Twilio\Rest\Preview\Understand\Assistant\QueryList $queries * @property \Twilio\Rest\Preview\Understand\Assistant\AssistantFallbackActionsList $assistantFallbackActions * @property \Twilio\Rest\Preview\Understand\Assistant\AssistantInitiationActionsList $assistantInitiationActions * @property \Twilio\Rest\Preview\Understand\Assistant\DialogueList $dialogues * @property \Twilio\Rest\Preview\Understand\Assistant\StyleSheetList $styleSheet * @method \Twilio\Rest\Preview\Understand\Assistant\FieldTypeContext fieldTypes(string $sid) * @method \Twilio\Rest\Preview\Understand\Assistant\TaskContext tasks(string $sid) * @method \Twilio\Rest\Preview\Understand\Assistant\ModelBuildContext modelBuilds(string $sid) * @method \Twilio\Rest\Preview\Understand\Assistant\QueryContext queries(string $sid) * @method \Twilio\Rest\Preview\Understand\Assistant\AssistantFallbackActionsContext assistantFallbackActions() * @method \Twilio\Rest\Preview\Understand\Assistant\AssistantInitiationActionsContext assistantInitiationActions() * @method \Twilio\Rest\Preview\Understand\Assistant\DialogueContext dialogues(string $sid) * @method \Twilio\Rest\Preview\Understand\Assistant\StyleSheetContext styleSheet() */ class AssistantContext extends InstanceContext { protected $_fieldTypes = null; protected $_tasks = null; protected $_modelBuilds = null; protected $_queries = null; protected $_assistantFallbackActions = null; protected $_assistantInitiationActions = null; protected $_dialogues = null; protected $_styleSheet = null; /** * Initialize the AssistantContext * * @param \Twilio\Version $version Version that contains the resource * @param string $sid A 34 character string that uniquely identifies this * resource. * @return \Twilio\Rest\Preview\Understand\AssistantContext */ public function __construct(Version $version, $sid) { parent::__construct($version); // Path Solution $this->solution = array('sid' => $sid, ); $this->uri = '/Assistants/' . \rawurlencode($sid) . ''; } /** * Fetch a AssistantInstance * * @return AssistantInstance Fetched AssistantInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new AssistantInstance($this->version, $payload, $this->solution['sid']); } /** * Update the AssistantInstance * * @param array|Options $options Optional Arguments * @return AssistantInstance Updated AssistantInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { $options = new Values($options); $data = Values::of(array( 'FriendlyName' => $options['friendlyName'], 'LogQueries' => Serialize::booleanToString($options['logQueries']), 'UniqueName' => $options['uniqueName'], 'CallbackUrl' => $options['callbackUrl'], 'CallbackEvents' => $options['callbackEvents'], 'FallbackActions' => Serialize::jsonObject($options['fallbackActions']), 'InitiationActions' => Serialize::jsonObject($options['initiationActions']), 'StyleSheet' => Serialize::jsonObject($options['styleSheet']), )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new AssistantInstance($this->version, $payload, $this->solution['sid']); } /** * Deletes the AssistantInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Access the fieldTypes * * @return \Twilio\Rest\Preview\Understand\Assistant\FieldTypeList */ protected function getFieldTypes() { if (!$this->_fieldTypes) { $this->_fieldTypes = new FieldTypeList($this->version, $this->solution['sid']); } return $this->_fieldTypes; } /** * Access the tasks * * @return \Twilio\Rest\Preview\Understand\Assistant\TaskList */ protected function getTasks() { if (!$this->_tasks) { $this->_tasks = new TaskList($this->version, $this->solution['sid']); } return $this->_tasks; } /** * Access the modelBuilds * * @return \Twilio\Rest\Preview\Understand\Assistant\ModelBuildList */ protected function getModelBuilds() { if (!$this->_modelBuilds) { $this->_modelBuilds = new ModelBuildList($this->version, $this->solution['sid']); } return $this->_modelBuilds; } /** * Access the queries * * @return \Twilio\Rest\Preview\Understand\Assistant\QueryList */ protected function getQueries() { if (!$this->_queries) { $this->_queries = new QueryList($this->version, $this->solution['sid']); } return $this->_queries; } /** * Access the assistantFallbackActions * * @return \Twilio\Rest\Preview\Understand\Assistant\AssistantFallbackActionsList */ protected function getAssistantFallbackActions() { if (!$this->_assistantFallbackActions) { $this->_assistantFallbackActions = new AssistantFallbackActionsList( $this->version, $this->solution['sid'] ); } return $this->_assistantFallbackActions; } /** * Access the assistantInitiationActions * * @return \Twilio\Rest\Preview\Understand\Assistant\AssistantInitiationActionsList */ protected function getAssistantInitiationActions() { if (!$this->_assistantInitiationActions) { $this->_assistantInitiationActions = new AssistantInitiationActionsList( $this->version, $this->solution['sid'] ); } return $this->_assistantInitiationActions; } /** * Access the dialogues * * @return \Twilio\Rest\Preview\Understand\Assistant\DialogueList */ protected function getDialogues() { if (!$this->_dialogues) { $this->_dialogues = new DialogueList($this->version, $this->solution['sid']); } return $this->_dialogues; } /** * Access the styleSheet * * @return \Twilio\Rest\Preview\Understand\Assistant\StyleSheetList */ protected function getStyleSheet() { if (!$this->_styleSheet) { $this->_styleSheet = new StyleSheetList($this->version, $this->solution['sid']); } return $this->_styleSheet; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get($name) { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.Understand.AssistantContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/Understand/AssistantList.php 0000644 00000014136 15002236443 0017352 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class AssistantList extends ListResource { /** * Construct the AssistantList * * @param Version $version Version that contains the resource * @return \Twilio\Rest\Preview\Understand\AssistantList */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = array(); $this->uri = '/Assistants'; } /** * Streams AssistantInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads AssistantInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return AssistantInstance[] Array of results */ public function read($limit = null, $pageSize = null) { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of AssistantInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of AssistantInstance */ public function page($pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $params = Values::of(array( 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new AssistantPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of AssistantInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of AssistantInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new AssistantPage($this->version, $response, $this->solution); } /** * Create a new AssistantInstance * * @param array|Options $options Optional Arguments * @return AssistantInstance Newly created AssistantInstance * @throws TwilioException When an HTTP error occurs. */ public function create($options = array()) { $options = new Values($options); $data = Values::of(array( 'FriendlyName' => $options['friendlyName'], 'LogQueries' => Serialize::booleanToString($options['logQueries']), 'UniqueName' => $options['uniqueName'], 'CallbackUrl' => $options['callbackUrl'], 'CallbackEvents' => $options['callbackEvents'], 'FallbackActions' => Serialize::jsonObject($options['fallbackActions']), 'InitiationActions' => Serialize::jsonObject($options['initiationActions']), 'StyleSheet' => Serialize::jsonObject($options['styleSheet']), )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new AssistantInstance($this->version, $payload); } /** * Constructs a AssistantContext * * @param string $sid A 34 character string that uniquely identifies this * resource. * @return \Twilio\Rest\Preview\Understand\AssistantContext */ public function getContext($sid) { return new AssistantContext($this->version, $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Preview.Understand.AssistantList]'; } } sdk/src/Twilio/Rest/Preview/Understand/Assistant/QueryContext.php 0000644 00000006173 15002236443 0021172 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\Assistant; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class QueryContext extends InstanceContext { /** * Initialize the QueryContext * * @param \Twilio\Version $version Version that contains the resource * @param string $assistantSid The unique ID of the Assistant. * @param string $sid A 34 character string that uniquely identifies this * resource. * @return \Twilio\Rest\Preview\Understand\Assistant\QueryContext */ public function __construct(Version $version, $assistantSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array('assistantSid' => $assistantSid, 'sid' => $sid, ); $this->uri = '/Assistants/' . \rawurlencode($assistantSid) . '/Queries/' . \rawurlencode($sid) . ''; } /** * Fetch a QueryInstance * * @return QueryInstance Fetched QueryInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new QueryInstance( $this->version, $payload, $this->solution['assistantSid'], $this->solution['sid'] ); } /** * Update the QueryInstance * * @param array|Options $options Optional Arguments * @return QueryInstance Updated QueryInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { $options = new Values($options); $data = Values::of(array('SampleSid' => $options['sampleSid'], 'Status' => $options['status'], )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new QueryInstance( $this->version, $payload, $this->solution['assistantSid'], $this->solution['sid'] ); } /** * Deletes the QueryInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.Understand.QueryContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/Understand/Assistant/AssistantInitiationActionsContext.php 0000644 00000006011 15002236443 0025376 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\Assistant; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class AssistantInitiationActionsContext extends InstanceContext { /** * Initialize the AssistantInitiationActionsContext * * @param \Twilio\Version $version Version that contains the resource * @param string $assistantSid The assistant_sid * @return \Twilio\Rest\Preview\Understand\Assistant\AssistantInitiationActionsContext */ public function __construct(Version $version, $assistantSid) { parent::__construct($version); // Path Solution $this->solution = array('assistantSid' => $assistantSid, ); $this->uri = '/Assistants/' . \rawurlencode($assistantSid) . '/InitiationActions'; } /** * Fetch a AssistantInitiationActionsInstance * * @return AssistantInitiationActionsInstance Fetched * AssistantInitiationActionsInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new AssistantInitiationActionsInstance( $this->version, $payload, $this->solution['assistantSid'] ); } /** * Update the AssistantInitiationActionsInstance * * @param array|Options $options Optional Arguments * @return AssistantInitiationActionsInstance Updated * AssistantInitiationActionsInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { $options = new Values($options); $data = Values::of(array( 'InitiationActions' => Serialize::jsonObject($options['initiationActions']), )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new AssistantInitiationActionsInstance( $this->version, $payload, $this->solution['assistantSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.Understand.AssistantInitiationActionsContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/Understand/Assistant/AssistantFallbackActionsContext.php 0000644 00000005722 15002236443 0024776 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\Assistant; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class AssistantFallbackActionsContext extends InstanceContext { /** * Initialize the AssistantFallbackActionsContext * * @param \Twilio\Version $version Version that contains the resource * @param string $assistantSid The assistant_sid * @return \Twilio\Rest\Preview\Understand\Assistant\AssistantFallbackActionsContext */ public function __construct(Version $version, $assistantSid) { parent::__construct($version); // Path Solution $this->solution = array('assistantSid' => $assistantSid, ); $this->uri = '/Assistants/' . \rawurlencode($assistantSid) . '/FallbackActions'; } /** * Fetch a AssistantFallbackActionsInstance * * @return AssistantFallbackActionsInstance Fetched * AssistantFallbackActionsInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new AssistantFallbackActionsInstance( $this->version, $payload, $this->solution['assistantSid'] ); } /** * Update the AssistantFallbackActionsInstance * * @param array|Options $options Optional Arguments * @return AssistantFallbackActionsInstance Updated * AssistantFallbackActionsInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { $options = new Values($options); $data = Values::of(array('FallbackActions' => Serialize::jsonObject($options['fallbackActions']), )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new AssistantFallbackActionsInstance( $this->version, $payload, $this->solution['assistantSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.Understand.AssistantFallbackActionsContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/Understand/Assistant/StyleSheetPage.php 0000644 00000001737 15002236443 0021407 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\Assistant; use Twilio\Page; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class StyleSheetPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new StyleSheetInstance($this->version, $payload, $this->solution['assistantSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Preview.Understand.StyleSheetPage]'; } } sdk/src/Twilio/Rest/Preview/Understand/Assistant/AssistantFallbackActionsOptions.php 0000644 00000003401 15002236443 0024775 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\Assistant; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ abstract class AssistantFallbackActionsOptions { /** * @param array $fallbackActions The fallback_actions * @return UpdateAssistantFallbackActionsOptions Options builder */ public static function update($fallbackActions = Values::NONE) { return new UpdateAssistantFallbackActionsOptions($fallbackActions); } } class UpdateAssistantFallbackActionsOptions extends Options { /** * @param array $fallbackActions The fallback_actions */ public function __construct($fallbackActions = Values::NONE) { $this->options['fallbackActions'] = $fallbackActions; } /** * The fallback_actions * * @param array $fallbackActions The fallback_actions * @return $this Fluent Builder */ public function setFallbackActions($fallbackActions) { $this->options['fallbackActions'] = $fallbackActions; 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.Preview.Understand.UpdateAssistantFallbackActionsOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Preview/Understand/Assistant/ModelBuildInstance.php 0000644 00000011447 15002236443 0022225 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\Assistant; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $accountSid * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $assistantSid * @property string $sid * @property string $status * @property string $uniqueName * @property string $url * @property int $buildDuration * @property int $errorCode */ class ModelBuildInstance extends InstanceResource { /** * Initialize the ModelBuildInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $assistantSid The unique ID of the parent Assistant. * @param string $sid The sid * @return \Twilio\Rest\Preview\Understand\Assistant\ModelBuildInstance */ public function __construct(Version $version, array $payload, $assistantSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'accountSid' => Values::array_get($payload, 'account_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'assistantSid' => Values::array_get($payload, 'assistant_sid'), 'sid' => Values::array_get($payload, 'sid'), 'status' => Values::array_get($payload, 'status'), 'uniqueName' => Values::array_get($payload, 'unique_name'), 'url' => Values::array_get($payload, 'url'), 'buildDuration' => Values::array_get($payload, 'build_duration'), 'errorCode' => Values::array_get($payload, 'error_code'), ); $this->solution = array('assistantSid' => $assistantSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Preview\Understand\Assistant\ModelBuildContext Context * for this * ModelBuildInstance */ protected function proxy() { if (!$this->context) { $this->context = new ModelBuildContext( $this->version, $this->solution['assistantSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch a ModelBuildInstance * * @return ModelBuildInstance Fetched ModelBuildInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Update the ModelBuildInstance * * @param array|Options $options Optional Arguments * @return ModelBuildInstance Updated ModelBuildInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Deletes the ModelBuildInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.Understand.ModelBuildInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/Understand/Assistant/StyleSheetOptions.php 0000644 00000003233 15002236443 0022157 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\Assistant; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ abstract class StyleSheetOptions { /** * @param array $styleSheet The JSON Style sheet string * @return UpdateStyleSheetOptions Options builder */ public static function update($styleSheet = Values::NONE) { return new UpdateStyleSheetOptions($styleSheet); } } class UpdateStyleSheetOptions extends Options { /** * @param array $styleSheet The JSON Style sheet string */ public function __construct($styleSheet = Values::NONE) { $this->options['styleSheet'] = $styleSheet; } /** * The JSON Style sheet string * * @param array $styleSheet The JSON Style sheet string * @return $this Fluent Builder */ public function setStyleSheet($styleSheet) { $this->options['styleSheet'] = $styleSheet; 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.Preview.Understand.UpdateStyleSheetOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Preview/Understand/Assistant/TaskOptions.php 0000644 00000021010 15002236443 0020761 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\Assistant; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ abstract class TaskOptions { /** * @param string $friendlyName A user-provided string that identifies this * resource. It is non-unique and can up to 255 * characters long. * @param array $actions A user-provided JSON object encoded as a string to * specify the actions for this task. It is optional and * non-unique. * @param string $actionsUrl User-provided HTTP endpoint where from the * assistant fetches actions * @return CreateTaskOptions Options builder */ public static function create($friendlyName = Values::NONE, $actions = Values::NONE, $actionsUrl = Values::NONE) { return new CreateTaskOptions($friendlyName, $actions, $actionsUrl); } /** * @param string $friendlyName A user-provided string that identifies this * resource. It is non-unique and can up to 255 * characters long. * @param string $uniqueName A user-provided string that uniquely identifies * this resource as an alternative to the sid. Unique * up to 64 characters long. * @param array $actions A user-provided JSON object encoded as a string to * specify the actions for this task. It is optional and * non-unique. * @param string $actionsUrl User-provided HTTP endpoint where from the * assistant fetches actions * @return UpdateTaskOptions Options builder */ public static function update($friendlyName = Values::NONE, $uniqueName = Values::NONE, $actions = Values::NONE, $actionsUrl = Values::NONE) { return new UpdateTaskOptions($friendlyName, $uniqueName, $actions, $actionsUrl); } } class CreateTaskOptions extends Options { /** * @param string $friendlyName A user-provided string that identifies this * resource. It is non-unique and can up to 255 * characters long. * @param array $actions A user-provided JSON object encoded as a string to * specify the actions for this task. It is optional and * non-unique. * @param string $actionsUrl User-provided HTTP endpoint where from the * assistant fetches actions */ public function __construct($friendlyName = Values::NONE, $actions = Values::NONE, $actionsUrl = Values::NONE) { $this->options['friendlyName'] = $friendlyName; $this->options['actions'] = $actions; $this->options['actionsUrl'] = $actionsUrl; } /** * A user-provided string that identifies this resource. It is non-unique and can up to 255 characters long. * * @param string $friendlyName A user-provided string that identifies this * resource. It is non-unique and can up to 255 * characters long. * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * A user-provided JSON object encoded as a string to specify the actions for this task. It is optional and non-unique. * * @param array $actions A user-provided JSON object encoded as a string to * specify the actions for this task. It is optional and * non-unique. * @return $this Fluent Builder */ public function setActions($actions) { $this->options['actions'] = $actions; return $this; } /** * User-provided HTTP endpoint where from the assistant fetches actions * * @param string $actionsUrl User-provided HTTP endpoint where from the * assistant fetches actions * @return $this Fluent Builder */ public function setActionsUrl($actionsUrl) { $this->options['actionsUrl'] = $actionsUrl; 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.Preview.Understand.CreateTaskOptions ' . \implode(' ', $options) . ']'; } } class UpdateTaskOptions extends Options { /** * @param string $friendlyName A user-provided string that identifies this * resource. It is non-unique and can up to 255 * characters long. * @param string $uniqueName A user-provided string that uniquely identifies * this resource as an alternative to the sid. Unique * up to 64 characters long. * @param array $actions A user-provided JSON object encoded as a string to * specify the actions for this task. It is optional and * non-unique. * @param string $actionsUrl User-provided HTTP endpoint where from the * assistant fetches actions */ public function __construct($friendlyName = Values::NONE, $uniqueName = Values::NONE, $actions = Values::NONE, $actionsUrl = Values::NONE) { $this->options['friendlyName'] = $friendlyName; $this->options['uniqueName'] = $uniqueName; $this->options['actions'] = $actions; $this->options['actionsUrl'] = $actionsUrl; } /** * A user-provided string that identifies this resource. It is non-unique and can up to 255 characters long. * * @param string $friendlyName A user-provided string that identifies this * resource. It is non-unique and can up to 255 * characters long. * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. * * @param string $uniqueName A user-provided string that uniquely identifies * this resource as an alternative to the sid. Unique * up to 64 characters long. * @return $this Fluent Builder */ public function setUniqueName($uniqueName) { $this->options['uniqueName'] = $uniqueName; return $this; } /** * A user-provided JSON object encoded as a string to specify the actions for this task. It is optional and non-unique. * * @param array $actions A user-provided JSON object encoded as a string to * specify the actions for this task. It is optional and * non-unique. * @return $this Fluent Builder */ public function setActions($actions) { $this->options['actions'] = $actions; return $this; } /** * User-provided HTTP endpoint where from the assistant fetches actions * * @param string $actionsUrl User-provided HTTP endpoint where from the * assistant fetches actions * @return $this Fluent Builder */ public function setActionsUrl($actionsUrl) { $this->options['actionsUrl'] = $actionsUrl; 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.Preview.Understand.UpdateTaskOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Preview/Understand/Assistant/Task/FieldInstance.php 0000644 00000011116 15002236443 0022123 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\Assistant\Task; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $accountSid * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $fieldType * @property string $taskSid * @property string $assistantSid * @property string $sid * @property string $uniqueName * @property string $url */ class FieldInstance extends InstanceResource { /** * Initialize the FieldInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $assistantSid The unique ID of the parent Assistant. * @param string $taskSid The unique ID of the Task associated with this Field. * @param string $sid A 34 character string that uniquely identifies this * resource. * @return \Twilio\Rest\Preview\Understand\Assistant\Task\FieldInstance */ public function __construct(Version $version, array $payload, $assistantSid, $taskSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'accountSid' => Values::array_get($payload, 'account_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'fieldType' => Values::array_get($payload, 'field_type'), 'taskSid' => Values::array_get($payload, 'task_sid'), 'assistantSid' => Values::array_get($payload, 'assistant_sid'), 'sid' => Values::array_get($payload, 'sid'), 'uniqueName' => Values::array_get($payload, 'unique_name'), 'url' => Values::array_get($payload, 'url'), ); $this->solution = array( 'assistantSid' => $assistantSid, 'taskSid' => $taskSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Preview\Understand\Assistant\Task\FieldContext Context * for this * FieldInstance */ protected function proxy() { if (!$this->context) { $this->context = new FieldContext( $this->version, $this->solution['assistantSid'], $this->solution['taskSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch a FieldInstance * * @return FieldInstance Fetched FieldInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the FieldInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.Understand.FieldInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/Understand/Assistant/Task/FieldList.php 0000644 00000014650 15002236443 0021300 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\Assistant\Task; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class FieldList extends ListResource { /** * Construct the FieldList * * @param Version $version Version that contains the resource * @param string $assistantSid The unique ID of the parent Assistant. * @param string $taskSid The unique ID of the Task associated with this Field. * @return \Twilio\Rest\Preview\Understand\Assistant\Task\FieldList */ public function __construct(Version $version, $assistantSid, $taskSid) { parent::__construct($version); // Path Solution $this->solution = array('assistantSid' => $assistantSid, 'taskSid' => $taskSid, ); $this->uri = '/Assistants/' . \rawurlencode($assistantSid) . '/Tasks/' . \rawurlencode($taskSid) . '/Fields'; } /** * Streams FieldInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads FieldInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return FieldInstance[] Array of results */ public function read($limit = null, $pageSize = null) { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of FieldInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of FieldInstance */ public function page($pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $params = Values::of(array( 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new FieldPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of FieldInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of FieldInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new FieldPage($this->version, $response, $this->solution); } /** * Create a new FieldInstance * * @param string $fieldType The unique name or sid of the FieldType. It can be * any Built-in Field Type or the unique_name or sid * of a custom Field Type. * @param string $uniqueName A user-provided string that uniquely identifies * this resource as an alternative to the sid. Unique * up to 64 characters long. * @return FieldInstance Newly created FieldInstance * @throws TwilioException When an HTTP error occurs. */ public function create($fieldType, $uniqueName) { $data = Values::of(array('FieldType' => $fieldType, 'UniqueName' => $uniqueName, )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new FieldInstance( $this->version, $payload, $this->solution['assistantSid'], $this->solution['taskSid'] ); } /** * Constructs a FieldContext * * @param string $sid A 34 character string that uniquely identifies this * resource. * @return \Twilio\Rest\Preview\Understand\Assistant\Task\FieldContext */ public function getContext($sid) { return new FieldContext( $this->version, $this->solution['assistantSid'], $this->solution['taskSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Preview.Understand.FieldList]'; } } sdk/src/Twilio/Rest/Preview/Understand/Assistant/Task/TaskActionsInstance.php 0000644 00000007527 15002236443 0023336 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\Assistant\Task; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $accountSid * @property string $assistantSid * @property string $taskSid * @property string $url * @property array $data */ class TaskActionsInstance extends InstanceResource { /** * Initialize the TaskActionsInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $assistantSid The unique ID of the parent Assistant. * @param string $taskSid The unique ID of the Task. * @return \Twilio\Rest\Preview\Understand\Assistant\Task\TaskActionsInstance */ public function __construct(Version $version, array $payload, $assistantSid, $taskSid) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'accountSid' => Values::array_get($payload, 'account_sid'), 'assistantSid' => Values::array_get($payload, 'assistant_sid'), 'taskSid' => Values::array_get($payload, 'task_sid'), 'url' => Values::array_get($payload, 'url'), 'data' => Values::array_get($payload, 'data'), ); $this->solution = array('assistantSid' => $assistantSid, 'taskSid' => $taskSid, ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Preview\Understand\Assistant\Task\TaskActionsContext Context for this TaskActionsInstance */ protected function proxy() { if (!$this->context) { $this->context = new TaskActionsContext( $this->version, $this->solution['assistantSid'], $this->solution['taskSid'] ); } return $this->context; } /** * Fetch a TaskActionsInstance * * @return TaskActionsInstance Fetched TaskActionsInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Update the TaskActionsInstance * * @param array|Options $options Optional Arguments * @return TaskActionsInstance Updated TaskActionsInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.Understand.TaskActionsInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/Understand/Assistant/Task/TaskStatisticsContext.php 0000644 00000004307 15002236443 0023741 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\Assistant\Task; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class TaskStatisticsContext extends InstanceContext { /** * Initialize the TaskStatisticsContext * * @param \Twilio\Version $version Version that contains the resource * @param string $assistantSid The unique ID of the parent Assistant. * @param string $taskSid The unique ID of the Task associated with this Field. * @return \Twilio\Rest\Preview\Understand\Assistant\Task\TaskStatisticsContext */ public function __construct(Version $version, $assistantSid, $taskSid) { parent::__construct($version); // Path Solution $this->solution = array('assistantSid' => $assistantSid, 'taskSid' => $taskSid, ); $this->uri = '/Assistants/' . \rawurlencode($assistantSid) . '/Tasks/' . \rawurlencode($taskSid) . '/Statistics'; } /** * Fetch a TaskStatisticsInstance * * @return TaskStatisticsInstance Fetched TaskStatisticsInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new TaskStatisticsInstance( $this->version, $payload, $this->solution['assistantSid'], $this->solution['taskSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.Understand.TaskStatisticsContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/Understand/Assistant/Task/TaskStatisticsList.php 0000644 00000003175 15002236443 0023232 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\Assistant\Task; use Twilio\ListResource; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class TaskStatisticsList extends ListResource { /** * Construct the TaskStatisticsList * * @param Version $version Version that contains the resource * @param string $assistantSid The unique ID of the parent Assistant. * @param string $taskSid The unique ID of the Task associated with this Field. * @return \Twilio\Rest\Preview\Understand\Assistant\Task\TaskStatisticsList */ public function __construct(Version $version, $assistantSid, $taskSid) { parent::__construct($version); // Path Solution $this->solution = array('assistantSid' => $assistantSid, 'taskSid' => $taskSid, ); } /** * Constructs a TaskStatisticsContext * * @return \Twilio\Rest\Preview\Understand\Assistant\Task\TaskStatisticsContext */ public function getContext() { return new TaskStatisticsContext( $this->version, $this->solution['assistantSid'], $this->solution['taskSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Preview.Understand.TaskStatisticsList]'; } } sdk/src/Twilio/Rest/Preview/Understand/Assistant/Task/FieldContext.php 0000644 00000005120 15002236443 0022001 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\Assistant\Task; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class FieldContext extends InstanceContext { /** * Initialize the FieldContext * * @param \Twilio\Version $version Version that contains the resource * @param string $assistantSid The unique ID of the Assistant. * @param string $taskSid The unique ID of the Task associated with this Field. * @param string $sid A 34 character string that uniquely identifies this * resource. * @return \Twilio\Rest\Preview\Understand\Assistant\Task\FieldContext */ public function __construct(Version $version, $assistantSid, $taskSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array('assistantSid' => $assistantSid, 'taskSid' => $taskSid, 'sid' => $sid, ); $this->uri = '/Assistants/' . \rawurlencode($assistantSid) . '/Tasks/' . \rawurlencode($taskSid) . '/Fields/' . \rawurlencode($sid) . ''; } /** * Fetch a FieldInstance * * @return FieldInstance Fetched FieldInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new FieldInstance( $this->version, $payload, $this->solution['assistantSid'], $this->solution['taskSid'], $this->solution['sid'] ); } /** * Deletes the FieldInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.Understand.FieldContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/Understand/Assistant/Task/SampleList.php 0000644 00000015436 15002236443 0021501 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\Assistant\Task; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class SampleList extends ListResource { /** * Construct the SampleList * * @param Version $version Version that contains the resource * @param string $assistantSid The unique ID of the Assistant. * @param string $taskSid The unique ID of the Task associated with this Sample. * @return \Twilio\Rest\Preview\Understand\Assistant\Task\SampleList */ public function __construct(Version $version, $assistantSid, $taskSid) { parent::__construct($version); // Path Solution $this->solution = array('assistantSid' => $assistantSid, 'taskSid' => $taskSid, ); $this->uri = '/Assistants/' . \rawurlencode($assistantSid) . '/Tasks/' . \rawurlencode($taskSid) . '/Samples'; } /** * Streams SampleInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($options = array(), $limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads SampleInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return SampleInstance[] Array of results */ public function read($options = array(), $limit = null, $pageSize = null) { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Retrieve a single page of SampleInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of SampleInstance */ public function page($options = array(), $pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $options = new Values($options); $params = Values::of(array( 'Language' => $options['language'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new SamplePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of SampleInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of SampleInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new SamplePage($this->version, $response, $this->solution); } /** * Create a new SampleInstance * * @param string $language An ISO language-country string of the sample. * @param string $taggedText The text example of how end-users may express this * task. The sample may contain Field tag blocks. * @param array|Options $options Optional Arguments * @return SampleInstance Newly created SampleInstance * @throws TwilioException When an HTTP error occurs. */ public function create($language, $taggedText, $options = array()) { $options = new Values($options); $data = Values::of(array( 'Language' => $language, 'TaggedText' => $taggedText, 'SourceChannel' => $options['sourceChannel'], )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new SampleInstance( $this->version, $payload, $this->solution['assistantSid'], $this->solution['taskSid'] ); } /** * Constructs a SampleContext * * @param string $sid A 34 character string that uniquely identifies this * resource. * @return \Twilio\Rest\Preview\Understand\Assistant\Task\SampleContext */ public function getContext($sid) { return new SampleContext( $this->version, $this->solution['assistantSid'], $this->solution['taskSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Preview.Understand.SampleList]'; } } sdk/src/Twilio/Rest/Preview/Understand/Assistant/Task/TaskStatisticsPage.php 0000644 00000002106 15002236443 0023164 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\Assistant\Task; use Twilio\Page; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class TaskStatisticsPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new TaskStatisticsInstance( $this->version, $payload, $this->solution['assistantSid'], $this->solution['taskSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Preview.Understand.TaskStatisticsPage]'; } } sdk/src/Twilio/Rest/Preview/Understand/Assistant/Task/TaskActionsOptions.php 0000644 00000003604 15002236443 0023215 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\Assistant\Task; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ abstract class TaskActionsOptions { /** * @param array $actions The JSON actions that instruct the Assistant how to * perform this task. * @return UpdateTaskActionsOptions Options builder */ public static function update($actions = Values::NONE) { return new UpdateTaskActionsOptions($actions); } } class UpdateTaskActionsOptions extends Options { /** * @param array $actions The JSON actions that instruct the Assistant how to * perform this task. */ public function __construct($actions = Values::NONE) { $this->options['actions'] = $actions; } /** * The JSON actions that instruct the Assistant how to perform this task. * * @param array $actions The JSON actions that instruct the Assistant how to * perform this task. * @return $this Fluent Builder */ public function setActions($actions) { $this->options['actions'] = $actions; 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.Preview.Understand.UpdateTaskActionsOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Preview/Understand/Assistant/Task/TaskActionsContext.php 0000644 00000005655 15002236443 0023216 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\Assistant\Task; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class TaskActionsContext extends InstanceContext { /** * Initialize the TaskActionsContext * * @param \Twilio\Version $version Version that contains the resource * @param string $assistantSid The unique ID of the parent Assistant. * @param string $taskSid The unique ID of the Task. * @return \Twilio\Rest\Preview\Understand\Assistant\Task\TaskActionsContext */ public function __construct(Version $version, $assistantSid, $taskSid) { parent::__construct($version); // Path Solution $this->solution = array('assistantSid' => $assistantSid, 'taskSid' => $taskSid, ); $this->uri = '/Assistants/' . \rawurlencode($assistantSid) . '/Tasks/' . \rawurlencode($taskSid) . '/Actions'; } /** * Fetch a TaskActionsInstance * * @return TaskActionsInstance Fetched TaskActionsInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new TaskActionsInstance( $this->version, $payload, $this->solution['assistantSid'], $this->solution['taskSid'] ); } /** * Update the TaskActionsInstance * * @param array|Options $options Optional Arguments * @return TaskActionsInstance Updated TaskActionsInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { $options = new Values($options); $data = Values::of(array('Actions' => Serialize::jsonObject($options['actions']), )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new TaskActionsInstance( $this->version, $payload, $this->solution['assistantSid'], $this->solution['taskSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.Understand.TaskActionsContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/Understand/Assistant/Task/TaskActionsList.php 0000644 00000003115 15002236443 0022472 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\Assistant\Task; use Twilio\ListResource; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class TaskActionsList extends ListResource { /** * Construct the TaskActionsList * * @param Version $version Version that contains the resource * @param string $assistantSid The unique ID of the parent Assistant. * @param string $taskSid The unique ID of the Task. * @return \Twilio\Rest\Preview\Understand\Assistant\Task\TaskActionsList */ public function __construct(Version $version, $assistantSid, $taskSid) { parent::__construct($version); // Path Solution $this->solution = array('assistantSid' => $assistantSid, 'taskSid' => $taskSid, ); } /** * Constructs a TaskActionsContext * * @return \Twilio\Rest\Preview\Understand\Assistant\Task\TaskActionsContext */ public function getContext() { return new TaskActionsContext( $this->version, $this->solution['assistantSid'], $this->solution['taskSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Preview.Understand.TaskActionsList]'; } } sdk/src/Twilio/Rest/Preview/Understand/Assistant/Task/SampleContext.php 0000644 00000006737 15002236443 0022216 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\Assistant\Task; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class SampleContext extends InstanceContext { /** * Initialize the SampleContext * * @param \Twilio\Version $version Version that contains the resource * @param string $assistantSid The unique ID of the Assistant. * @param string $taskSid The unique ID of the Task associated with this Sample. * @param string $sid A 34 character string that uniquely identifies this * resource. * @return \Twilio\Rest\Preview\Understand\Assistant\Task\SampleContext */ public function __construct(Version $version, $assistantSid, $taskSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array('assistantSid' => $assistantSid, 'taskSid' => $taskSid, 'sid' => $sid, ); $this->uri = '/Assistants/' . \rawurlencode($assistantSid) . '/Tasks/' . \rawurlencode($taskSid) . '/Samples/' . \rawurlencode($sid) . ''; } /** * Fetch a SampleInstance * * @return SampleInstance Fetched SampleInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new SampleInstance( $this->version, $payload, $this->solution['assistantSid'], $this->solution['taskSid'], $this->solution['sid'] ); } /** * Update the SampleInstance * * @param array|Options $options Optional Arguments * @return SampleInstance Updated SampleInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { $options = new Values($options); $data = Values::of(array( 'Language' => $options['language'], 'TaggedText' => $options['taggedText'], 'SourceChannel' => $options['sourceChannel'], )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new SampleInstance( $this->version, $payload, $this->solution['assistantSid'], $this->solution['taskSid'], $this->solution['sid'] ); } /** * Deletes the SampleInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.Understand.SampleContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/Understand/Assistant/Task/TaskStatisticsInstance.php 0000644 00000007244 15002236443 0024064 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\Assistant\Task; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $accountSid * @property string $assistantSid * @property string $taskSid * @property int $samplesCount * @property int $fieldsCount * @property string $url */ class TaskStatisticsInstance extends InstanceResource { /** * Initialize the TaskStatisticsInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $assistantSid The unique ID of the parent Assistant. * @param string $taskSid The unique ID of the Task associated with this Field. * @return \Twilio\Rest\Preview\Understand\Assistant\Task\TaskStatisticsInstance */ public function __construct(Version $version, array $payload, $assistantSid, $taskSid) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'accountSid' => Values::array_get($payload, 'account_sid'), 'assistantSid' => Values::array_get($payload, 'assistant_sid'), 'taskSid' => Values::array_get($payload, 'task_sid'), 'samplesCount' => Values::array_get($payload, 'samples_count'), 'fieldsCount' => Values::array_get($payload, 'fields_count'), 'url' => Values::array_get($payload, 'url'), ); $this->solution = array('assistantSid' => $assistantSid, 'taskSid' => $taskSid, ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Preview\Understand\Assistant\Task\TaskStatisticsContext Context for this TaskStatisticsInstance */ protected function proxy() { if (!$this->context) { $this->context = new TaskStatisticsContext( $this->version, $this->solution['assistantSid'], $this->solution['taskSid'] ); } return $this->context; } /** * Fetch a TaskStatisticsInstance * * @return TaskStatisticsInstance Fetched TaskStatisticsInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.Understand.TaskStatisticsInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/Understand/Assistant/Task/TaskActionsPage.php 0000644 00000002075 15002236443 0022437 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\Assistant\Task; use Twilio\Page; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class TaskActionsPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new TaskActionsInstance( $this->version, $payload, $this->solution['assistantSid'], $this->solution['taskSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Preview.Understand.TaskActionsPage]'; } } sdk/src/Twilio/Rest/Preview/Understand/Assistant/Task/FieldPage.php 0000644 00000002053 15002236443 0021233 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\Assistant\Task; use Twilio\Page; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class FieldPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new FieldInstance( $this->version, $payload, $this->solution['assistantSid'], $this->solution['taskSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Preview.Understand.FieldPage]'; } } sdk/src/Twilio/Rest/Preview/Understand/Assistant/Task/SampleInstance.php 0000644 00000012152 15002236443 0022322 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\Assistant\Task; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $accountSid * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $taskSid * @property string $language * @property string $assistantSid * @property string $sid * @property string $taggedText * @property string $url * @property string $sourceChannel */ class SampleInstance extends InstanceResource { /** * Initialize the SampleInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $assistantSid The unique ID of the Assistant. * @param string $taskSid The unique ID of the Task associated with this Sample. * @param string $sid A 34 character string that uniquely identifies this * resource. * @return \Twilio\Rest\Preview\Understand\Assistant\Task\SampleInstance */ public function __construct(Version $version, array $payload, $assistantSid, $taskSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'accountSid' => Values::array_get($payload, 'account_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'taskSid' => Values::array_get($payload, 'task_sid'), 'language' => Values::array_get($payload, 'language'), 'assistantSid' => Values::array_get($payload, 'assistant_sid'), 'sid' => Values::array_get($payload, 'sid'), 'taggedText' => Values::array_get($payload, 'tagged_text'), 'url' => Values::array_get($payload, 'url'), 'sourceChannel' => Values::array_get($payload, 'source_channel'), ); $this->solution = array( 'assistantSid' => $assistantSid, 'taskSid' => $taskSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Preview\Understand\Assistant\Task\SampleContext Context * for * this * SampleInstance */ protected function proxy() { if (!$this->context) { $this->context = new SampleContext( $this->version, $this->solution['assistantSid'], $this->solution['taskSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch a SampleInstance * * @return SampleInstance Fetched SampleInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Update the SampleInstance * * @param array|Options $options Optional Arguments * @return SampleInstance Updated SampleInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Deletes the SampleInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.Understand.SampleInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/Understand/Assistant/Task/SampleOptions.php 0000644 00000016364 15002236443 0022222 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\Assistant\Task; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ abstract class SampleOptions { /** * @param string $language An ISO language-country string of the sample. * @return ReadSampleOptions Options builder */ public static function read($language = Values::NONE) { return new ReadSampleOptions($language); } /** * @param string $sourceChannel The communication channel the sample was * captured. It can be: voice, sms, chat, alexa, * google-assistant, or slack. If not included the * value will be null * @return CreateSampleOptions Options builder */ public static function create($sourceChannel = Values::NONE) { return new CreateSampleOptions($sourceChannel); } /** * @param string $language An ISO language-country string of the sample. * @param string $taggedText The text example of how end-users may express this * task. The sample may contain Field tag blocks. * @param string $sourceChannel The communication channel the sample was * captured. It can be: voice, sms, chat, alexa, * google-assistant, or slack. If not included the * value will be null * @return UpdateSampleOptions Options builder */ public static function update($language = Values::NONE, $taggedText = Values::NONE, $sourceChannel = Values::NONE) { return new UpdateSampleOptions($language, $taggedText, $sourceChannel); } } class ReadSampleOptions extends Options { /** * @param string $language An ISO language-country string of the sample. */ public function __construct($language = Values::NONE) { $this->options['language'] = $language; } /** * An ISO language-country string of the sample. * * @param string $language An ISO language-country string of the sample. * @return $this Fluent Builder */ public function setLanguage($language) { $this->options['language'] = $language; 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.Preview.Understand.ReadSampleOptions ' . \implode(' ', $options) . ']'; } } class CreateSampleOptions extends Options { /** * @param string $sourceChannel The communication channel the sample was * captured. It can be: voice, sms, chat, alexa, * google-assistant, or slack. If not included the * value will be null */ public function __construct($sourceChannel = Values::NONE) { $this->options['sourceChannel'] = $sourceChannel; } /** * The communication channel the sample was captured. It can be: *voice*, *sms*, *chat*, *alexa*, *google-assistant*, or *slack*. If not included the value will be null * * @param string $sourceChannel The communication channel the sample was * captured. It can be: voice, sms, chat, alexa, * google-assistant, or slack. If not included the * value will be null * @return $this Fluent Builder */ public function setSourceChannel($sourceChannel) { $this->options['sourceChannel'] = $sourceChannel; 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.Preview.Understand.CreateSampleOptions ' . \implode(' ', $options) . ']'; } } class UpdateSampleOptions extends Options { /** * @param string $language An ISO language-country string of the sample. * @param string $taggedText The text example of how end-users may express this * task. The sample may contain Field tag blocks. * @param string $sourceChannel The communication channel the sample was * captured. It can be: voice, sms, chat, alexa, * google-assistant, or slack. If not included the * value will be null */ public function __construct($language = Values::NONE, $taggedText = Values::NONE, $sourceChannel = Values::NONE) { $this->options['language'] = $language; $this->options['taggedText'] = $taggedText; $this->options['sourceChannel'] = $sourceChannel; } /** * An ISO language-country string of the sample. * * @param string $language An ISO language-country string of the sample. * @return $this Fluent Builder */ public function setLanguage($language) { $this->options['language'] = $language; return $this; } /** * The text example of how end-users may express this task. The sample may contain Field tag blocks. * * @param string $taggedText The text example of how end-users may express this * task. The sample may contain Field tag blocks. * @return $this Fluent Builder */ public function setTaggedText($taggedText) { $this->options['taggedText'] = $taggedText; return $this; } /** * The communication channel the sample was captured. It can be: *voice*, *sms*, *chat*, *alexa*, *google-assistant*, or *slack*. If not included the value will be null * * @param string $sourceChannel The communication channel the sample was * captured. It can be: voice, sms, chat, alexa, * google-assistant, or slack. If not included the * value will be null * @return $this Fluent Builder */ public function setSourceChannel($sourceChannel) { $this->options['sourceChannel'] = $sourceChannel; 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.Preview.Understand.UpdateSampleOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Preview/Understand/Assistant/Task/SamplePage.php 0000644 00000002056 15002236443 0021434 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\Assistant\Task; use Twilio\Page; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class SamplePage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new SampleInstance( $this->version, $payload, $this->solution['assistantSid'], $this->solution['taskSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Preview.Understand.SamplePage]'; } } sdk/src/Twilio/Rest/Preview/Understand/Assistant/AssistantInitiationActionsList.php 0000644 00000002756 15002236443 0024701 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\Assistant; use Twilio\ListResource; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class AssistantInitiationActionsList extends ListResource { /** * Construct the AssistantInitiationActionsList * * @param Version $version Version that contains the resource * @param string $assistantSid The assistant_sid * @return \Twilio\Rest\Preview\Understand\Assistant\AssistantInitiationActionsList */ public function __construct(Version $version, $assistantSid) { parent::__construct($version); // Path Solution $this->solution = array('assistantSid' => $assistantSid, ); } /** * Constructs a AssistantInitiationActionsContext * * @return \Twilio\Rest\Preview\Understand\Assistant\AssistantInitiationActionsContext */ public function getContext() { return new AssistantInitiationActionsContext($this->version, $this->solution['assistantSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Preview.Understand.AssistantInitiationActionsList]'; } } sdk/src/Twilio/Rest/Preview/Understand/Assistant/DialogueList.php 0000644 00000002661 15002236443 0021103 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\Assistant; use Twilio\ListResource; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class DialogueList extends ListResource { /** * Construct the DialogueList * * @param Version $version Version that contains the resource * @param string $assistantSid The unique ID of the parent Assistant. * @return \Twilio\Rest\Preview\Understand\Assistant\DialogueList */ public function __construct(Version $version, $assistantSid) { parent::__construct($version); // Path Solution $this->solution = array('assistantSid' => $assistantSid, ); } /** * Constructs a DialogueContext * * @param string $sid The sid * @return \Twilio\Rest\Preview\Understand\Assistant\DialogueContext */ public function getContext($sid) { return new DialogueContext($this->version, $this->solution['assistantSid'], $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Preview.Understand.DialogueList]'; } } sdk/src/Twilio/Rest/Preview/Understand/Assistant/QueryOptions.php 0000644 00000023013 15002236443 0021171 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\Assistant; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ abstract class QueryOptions { /** * @param string $language An ISO language-country string of the sample. * @param string $modelBuild The Model Build Sid or unique name of the Model * Build to be queried. * @param string $status A string that described the query status. The values * can be: pending_review, reviewed, discarded * @return ReadQueryOptions Options builder */ public static function read($language = Values::NONE, $modelBuild = Values::NONE, $status = Values::NONE) { return new ReadQueryOptions($language, $modelBuild, $status); } /** * @param string $tasks Constraints the query to a set of tasks. Useful when * you need to constrain the paths the user can take. * Tasks should be comma separated task-unique-name-1, * task-unique-name-2 * @param string $modelBuild The Model Build Sid or unique name of the Model * Build to be queried. * @param string $field Constraints the query to a given Field with an task. * Useful when you know the Field you are expecting. It * accepts one field in the format * task-unique-name-1:field-unique-name * @return CreateQueryOptions Options builder */ public static function create($tasks = Values::NONE, $modelBuild = Values::NONE, $field = Values::NONE) { return new CreateQueryOptions($tasks, $modelBuild, $field); } /** * @param string $sampleSid An optional reference to the Sample created from * this query. * @param string $status A string that described the query status. The values * can be: pending_review, reviewed, discarded * @return UpdateQueryOptions Options builder */ public static function update($sampleSid = Values::NONE, $status = Values::NONE) { return new UpdateQueryOptions($sampleSid, $status); } } class ReadQueryOptions extends Options { /** * @param string $language An ISO language-country string of the sample. * @param string $modelBuild The Model Build Sid or unique name of the Model * Build to be queried. * @param string $status A string that described the query status. The values * can be: pending_review, reviewed, discarded */ public function __construct($language = Values::NONE, $modelBuild = Values::NONE, $status = Values::NONE) { $this->options['language'] = $language; $this->options['modelBuild'] = $modelBuild; $this->options['status'] = $status; } /** * An ISO language-country string of the sample. * * @param string $language An ISO language-country string of the sample. * @return $this Fluent Builder */ public function setLanguage($language) { $this->options['language'] = $language; return $this; } /** * The Model Build Sid or unique name of the Model Build to be queried. * * @param string $modelBuild The Model Build Sid or unique name of the Model * Build to be queried. * @return $this Fluent Builder */ public function setModelBuild($modelBuild) { $this->options['modelBuild'] = $modelBuild; return $this; } /** * A string that described the query status. The values can be: pending_review, reviewed, discarded * * @param string $status A string that described the query status. The values * can be: pending_review, reviewed, discarded * @return $this Fluent Builder */ public function setStatus($status) { $this->options['status'] = $status; 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.Preview.Understand.ReadQueryOptions ' . \implode(' ', $options) . ']'; } } class CreateQueryOptions extends Options { /** * @param string $tasks Constraints the query to a set of tasks. Useful when * you need to constrain the paths the user can take. * Tasks should be comma separated task-unique-name-1, * task-unique-name-2 * @param string $modelBuild The Model Build Sid or unique name of the Model * Build to be queried. * @param string $field Constraints the query to a given Field with an task. * Useful when you know the Field you are expecting. It * accepts one field in the format * task-unique-name-1:field-unique-name */ public function __construct($tasks = Values::NONE, $modelBuild = Values::NONE, $field = Values::NONE) { $this->options['tasks'] = $tasks; $this->options['modelBuild'] = $modelBuild; $this->options['field'] = $field; } /** * Constraints the query to a set of tasks. Useful when you need to constrain the paths the user can take. Tasks should be comma separated *task-unique-name-1*, *task-unique-name-2* * * @param string $tasks Constraints the query to a set of tasks. Useful when * you need to constrain the paths the user can take. * Tasks should be comma separated task-unique-name-1, * task-unique-name-2 * @return $this Fluent Builder */ public function setTasks($tasks) { $this->options['tasks'] = $tasks; return $this; } /** * The Model Build Sid or unique name of the Model Build to be queried. * * @param string $modelBuild The Model Build Sid or unique name of the Model * Build to be queried. * @return $this Fluent Builder */ public function setModelBuild($modelBuild) { $this->options['modelBuild'] = $modelBuild; return $this; } /** * Constraints the query to a given Field with an task. Useful when you know the Field you are expecting. It accepts one field in the format *task-unique-name-1*:*field-unique-name* * * @param string $field Constraints the query to a given Field with an task. * Useful when you know the Field you are expecting. It * accepts one field in the format * task-unique-name-1:field-unique-name * @return $this Fluent Builder */ public function setField($field) { $this->options['field'] = $field; 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.Preview.Understand.CreateQueryOptions ' . \implode(' ', $options) . ']'; } } class UpdateQueryOptions extends Options { /** * @param string $sampleSid An optional reference to the Sample created from * this query. * @param string $status A string that described the query status. The values * can be: pending_review, reviewed, discarded */ public function __construct($sampleSid = Values::NONE, $status = Values::NONE) { $this->options['sampleSid'] = $sampleSid; $this->options['status'] = $status; } /** * An optional reference to the Sample created from this query. * * @param string $sampleSid An optional reference to the Sample created from * this query. * @return $this Fluent Builder */ public function setSampleSid($sampleSid) { $this->options['sampleSid'] = $sampleSid; return $this; } /** * A string that described the query status. The values can be: pending_review, reviewed, discarded * * @param string $status A string that described the query status. The values * can be: pending_review, reviewed, discarded * @return $this Fluent Builder */ public function setStatus($status) { $this->options['status'] = $status; 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.Preview.Understand.UpdateQueryOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Preview/Understand/Assistant/FieldTypePage.php 0000644 00000001734 15002236443 0021200 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\Assistant; use Twilio\Page; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class FieldTypePage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new FieldTypeInstance($this->version, $payload, $this->solution['assistantSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Preview.Understand.FieldTypePage]'; } } sdk/src/Twilio/Rest/Preview/Understand/Assistant/FieldTypeOptions.php 0000644 00000012021 15002236443 0021746 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\Assistant; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ abstract class FieldTypeOptions { /** * @param string $friendlyName A user-provided string that identifies this * resource. It is non-unique and can up to 255 * characters long. * @return CreateFieldTypeOptions Options builder */ public static function create($friendlyName = Values::NONE) { return new CreateFieldTypeOptions($friendlyName); } /** * @param string $friendlyName A user-provided string that identifies this * resource. It is non-unique and can up to 255 * characters long. * @param string $uniqueName A user-provided string that uniquely identifies * this resource as an alternative to the sid. Unique * up to 64 characters long. * @return UpdateFieldTypeOptions Options builder */ public static function update($friendlyName = Values::NONE, $uniqueName = Values::NONE) { return new UpdateFieldTypeOptions($friendlyName, $uniqueName); } } class CreateFieldTypeOptions extends Options { /** * @param string $friendlyName A user-provided string that identifies this * resource. It is non-unique and can up to 255 * characters long. */ public function __construct($friendlyName = Values::NONE) { $this->options['friendlyName'] = $friendlyName; } /** * A user-provided string that identifies this resource. It is non-unique and can up to 255 characters long. * * @param string $friendlyName A user-provided string that identifies this * resource. It is non-unique and can up to 255 * characters long. * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; 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.Preview.Understand.CreateFieldTypeOptions ' . \implode(' ', $options) . ']'; } } class UpdateFieldTypeOptions extends Options { /** * @param string $friendlyName A user-provided string that identifies this * resource. It is non-unique and can up to 255 * characters long. * @param string $uniqueName A user-provided string that uniquely identifies * this resource as an alternative to the sid. Unique * up to 64 characters long. */ public function __construct($friendlyName = Values::NONE, $uniqueName = Values::NONE) { $this->options['friendlyName'] = $friendlyName; $this->options['uniqueName'] = $uniqueName; } /** * A user-provided string that identifies this resource. It is non-unique and can up to 255 characters long. * * @param string $friendlyName A user-provided string that identifies this * resource. It is non-unique and can up to 255 * characters long. * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. * * @param string $uniqueName A user-provided string that uniquely identifies * this resource as an alternative to the sid. Unique * up to 64 characters long. * @return $this Fluent Builder */ public function setUniqueName($uniqueName) { $this->options['uniqueName'] = $uniqueName; 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.Preview.Understand.UpdateFieldTypeOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Preview/Understand/Assistant/TaskInstance.php 0000644 00000013363 15002236443 0021106 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\Assistant; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $accountSid * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $friendlyName * @property array $links * @property string $assistantSid * @property string $sid * @property string $uniqueName * @property string $actionsUrl * @property string $url */ class TaskInstance extends InstanceResource { protected $_fields = null; protected $_samples = null; protected $_taskActions = null; protected $_statistics = null; /** * Initialize the TaskInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $assistantSid The unique ID of the Assistant. * @param string $sid A 34 character string that uniquely identifies this * resource. * @return \Twilio\Rest\Preview\Understand\Assistant\TaskInstance */ public function __construct(Version $version, array $payload, $assistantSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'accountSid' => Values::array_get($payload, 'account_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'links' => Values::array_get($payload, 'links'), 'assistantSid' => Values::array_get($payload, 'assistant_sid'), 'sid' => Values::array_get($payload, 'sid'), 'uniqueName' => Values::array_get($payload, 'unique_name'), 'actionsUrl' => Values::array_get($payload, 'actions_url'), 'url' => Values::array_get($payload, 'url'), ); $this->solution = array('assistantSid' => $assistantSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Preview\Understand\Assistant\TaskContext Context for * this * TaskInstance */ protected function proxy() { if (!$this->context) { $this->context = new TaskContext( $this->version, $this->solution['assistantSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch a TaskInstance * * @return TaskInstance Fetched TaskInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Update the TaskInstance * * @param array|Options $options Optional Arguments * @return TaskInstance Updated TaskInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Deletes the TaskInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Access the fields * * @return \Twilio\Rest\Preview\Understand\Assistant\Task\FieldList */ protected function getFields() { return $this->proxy()->fields; } /** * Access the samples * * @return \Twilio\Rest\Preview\Understand\Assistant\Task\SampleList */ protected function getSamples() { return $this->proxy()->samples; } /** * Access the taskActions * * @return \Twilio\Rest\Preview\Understand\Assistant\Task\TaskActionsList */ protected function getTaskActions() { return $this->proxy()->taskActions; } /** * Access the statistics * * @return \Twilio\Rest\Preview\Understand\Assistant\Task\TaskStatisticsList */ protected function getStatistics() { return $this->proxy()->statistics; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.Understand.TaskInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/Understand/Assistant/ModelBuildList.php 0000644 00000013540 15002236443 0021370 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\Assistant; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class ModelBuildList extends ListResource { /** * Construct the ModelBuildList * * @param Version $version Version that contains the resource * @param string $assistantSid The unique ID of the parent Assistant. * @return \Twilio\Rest\Preview\Understand\Assistant\ModelBuildList */ public function __construct(Version $version, $assistantSid) { parent::__construct($version); // Path Solution $this->solution = array('assistantSid' => $assistantSid, ); $this->uri = '/Assistants/' . \rawurlencode($assistantSid) . '/ModelBuilds'; } /** * Streams ModelBuildInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads ModelBuildInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return ModelBuildInstance[] Array of results */ public function read($limit = null, $pageSize = null) { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of ModelBuildInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of ModelBuildInstance */ public function page($pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $params = Values::of(array( 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new ModelBuildPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of ModelBuildInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of ModelBuildInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new ModelBuildPage($this->version, $response, $this->solution); } /** * Create a new ModelBuildInstance * * @param array|Options $options Optional Arguments * @return ModelBuildInstance Newly created ModelBuildInstance * @throws TwilioException When an HTTP error occurs. */ public function create($options = array()) { $options = new Values($options); $data = Values::of(array( 'StatusCallback' => $options['statusCallback'], 'UniqueName' => $options['uniqueName'], )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new ModelBuildInstance($this->version, $payload, $this->solution['assistantSid']); } /** * Constructs a ModelBuildContext * * @param string $sid The sid * @return \Twilio\Rest\Preview\Understand\Assistant\ModelBuildContext */ public function getContext($sid) { return new ModelBuildContext($this->version, $this->solution['assistantSid'], $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Preview.Understand.ModelBuildList]'; } } sdk/src/Twilio/Rest/Preview/Understand/Assistant/AssistantFallbackActionsPage.php 0000644 00000002067 15002236443 0024225 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\Assistant; use Twilio\Page; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class AssistantFallbackActionsPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new AssistantFallbackActionsInstance( $this->version, $payload, $this->solution['assistantSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Preview.Understand.AssistantFallbackActionsPage]'; } } sdk/src/Twilio/Rest/Preview/Understand/Assistant/ModelBuildPage.php 0000644 00000001737 15002236443 0021336 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\Assistant; use Twilio\Page; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class ModelBuildPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new ModelBuildInstance($this->version, $payload, $this->solution['assistantSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Preview.Understand.ModelBuildPage]'; } } sdk/src/Twilio/Rest/Preview/Understand/Assistant/TaskList.php 0000644 00000014230 15002236443 0020247 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\Assistant; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class TaskList extends ListResource { /** * Construct the TaskList * * @param Version $version Version that contains the resource * @param string $assistantSid The unique ID of the Assistant. * @return \Twilio\Rest\Preview\Understand\Assistant\TaskList */ public function __construct(Version $version, $assistantSid) { parent::__construct($version); // Path Solution $this->solution = array('assistantSid' => $assistantSid, ); $this->uri = '/Assistants/' . \rawurlencode($assistantSid) . '/Tasks'; } /** * Streams TaskInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads TaskInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return TaskInstance[] Array of results */ public function read($limit = null, $pageSize = null) { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of TaskInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of TaskInstance */ public function page($pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $params = Values::of(array( 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new TaskPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of TaskInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of TaskInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new TaskPage($this->version, $response, $this->solution); } /** * Create a new TaskInstance * * @param string $uniqueName A user-provided string that uniquely identifies * this resource as an alternative to the sid. Unique * up to 64 characters long. * @param array|Options $options Optional Arguments * @return TaskInstance Newly created TaskInstance * @throws TwilioException When an HTTP error occurs. */ public function create($uniqueName, $options = array()) { $options = new Values($options); $data = Values::of(array( 'UniqueName' => $uniqueName, 'FriendlyName' => $options['friendlyName'], 'Actions' => Serialize::jsonObject($options['actions']), 'ActionsUrl' => $options['actionsUrl'], )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new TaskInstance($this->version, $payload, $this->solution['assistantSid']); } /** * Constructs a TaskContext * * @param string $sid A 34 character string that uniquely identifies this * resource. * @return \Twilio\Rest\Preview\Understand\Assistant\TaskContext */ public function getContext($sid) { return new TaskContext($this->version, $this->solution['assistantSid'], $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Preview.Understand.TaskList]'; } } sdk/src/Twilio/Rest/Preview/Understand/Assistant/AssistantFallbackActionsList.php 0000644 00000002740 15002236443 0024262 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\Assistant; use Twilio\ListResource; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class AssistantFallbackActionsList extends ListResource { /** * Construct the AssistantFallbackActionsList * * @param Version $version Version that contains the resource * @param string $assistantSid The assistant_sid * @return \Twilio\Rest\Preview\Understand\Assistant\AssistantFallbackActionsList */ public function __construct(Version $version, $assistantSid) { parent::__construct($version); // Path Solution $this->solution = array('assistantSid' => $assistantSid, ); } /** * Constructs a AssistantFallbackActionsContext * * @return \Twilio\Rest\Preview\Understand\Assistant\AssistantFallbackActionsContext */ public function getContext() { return new AssistantFallbackActionsContext($this->version, $this->solution['assistantSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Preview.Understand.AssistantFallbackActionsList]'; } } sdk/src/Twilio/Rest/Preview/Understand/Assistant/QueryInstance.php 0000644 00000012115 15002236443 0021303 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\Assistant; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $accountSid * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property array $results * @property string $language * @property string $modelBuildSid * @property string $query * @property string $sampleSid * @property string $assistantSid * @property string $sid * @property string $status * @property string $url * @property string $sourceChannel */ class QueryInstance extends InstanceResource { /** * Initialize the QueryInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $assistantSid The unique ID of the parent Assistant. * @param string $sid A 34 character string that uniquely identifies this * resource. * @return \Twilio\Rest\Preview\Understand\Assistant\QueryInstance */ public function __construct(Version $version, array $payload, $assistantSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'accountSid' => Values::array_get($payload, 'account_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'results' => Values::array_get($payload, 'results'), 'language' => Values::array_get($payload, 'language'), 'modelBuildSid' => Values::array_get($payload, 'model_build_sid'), 'query' => Values::array_get($payload, 'query'), 'sampleSid' => Values::array_get($payload, 'sample_sid'), 'assistantSid' => Values::array_get($payload, 'assistant_sid'), 'sid' => Values::array_get($payload, 'sid'), 'status' => Values::array_get($payload, 'status'), 'url' => Values::array_get($payload, 'url'), 'sourceChannel' => Values::array_get($payload, 'source_channel'), ); $this->solution = array('assistantSid' => $assistantSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Preview\Understand\Assistant\QueryContext Context for * this * QueryInstance */ protected function proxy() { if (!$this->context) { $this->context = new QueryContext( $this->version, $this->solution['assistantSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch a QueryInstance * * @return QueryInstance Fetched QueryInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Update the QueryInstance * * @param array|Options $options Optional Arguments * @return QueryInstance Updated QueryInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Deletes the QueryInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.Understand.QueryInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/Understand/Assistant/AssistantInitiationActionsOptions.php 0000644 00000003453 15002236443 0025414 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\Assistant; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ abstract class AssistantInitiationActionsOptions { /** * @param array $initiationActions The initiation_actions * @return UpdateAssistantInitiationActionsOptions Options builder */ public static function update($initiationActions = Values::NONE) { return new UpdateAssistantInitiationActionsOptions($initiationActions); } } class UpdateAssistantInitiationActionsOptions extends Options { /** * @param array $initiationActions The initiation_actions */ public function __construct($initiationActions = Values::NONE) { $this->options['initiationActions'] = $initiationActions; } /** * The initiation_actions * * @param array $initiationActions The initiation_actions * @return $this Fluent Builder */ public function setInitiationActions($initiationActions) { $this->options['initiationActions'] = $initiationActions; 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.Preview.Understand.UpdateAssistantInitiationActionsOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Preview/Understand/Assistant/ModelBuildOptions.php 0000644 00000011300 15002236443 0022100 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\Assistant; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ abstract class ModelBuildOptions { /** * @param string $statusCallback The status_callback * @param string $uniqueName A user-provided string that uniquely identifies * this resource as an alternative to the sid. Unique * up to 64 characters long. For example: v0.1 * @return CreateModelBuildOptions Options builder */ public static function create($statusCallback = Values::NONE, $uniqueName = Values::NONE) { return new CreateModelBuildOptions($statusCallback, $uniqueName); } /** * @param string $uniqueName A user-provided string that uniquely identifies * this resource as an alternative to the sid. Unique * up to 64 characters long. For example: v0.1 * @return UpdateModelBuildOptions Options builder */ public static function update($uniqueName = Values::NONE) { return new UpdateModelBuildOptions($uniqueName); } } class CreateModelBuildOptions extends Options { /** * @param string $statusCallback The status_callback * @param string $uniqueName A user-provided string that uniquely identifies * this resource as an alternative to the sid. Unique * up to 64 characters long. For example: v0.1 */ public function __construct($statusCallback = Values::NONE, $uniqueName = Values::NONE) { $this->options['statusCallback'] = $statusCallback; $this->options['uniqueName'] = $uniqueName; } /** * The status_callback * * @param string $statusCallback The status_callback * @return $this Fluent Builder */ public function setStatusCallback($statusCallback) { $this->options['statusCallback'] = $statusCallback; return $this; } /** * A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. For example: v0.1 * * @param string $uniqueName A user-provided string that uniquely identifies * this resource as an alternative to the sid. Unique * up to 64 characters long. For example: v0.1 * @return $this Fluent Builder */ public function setUniqueName($uniqueName) { $this->options['uniqueName'] = $uniqueName; 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.Preview.Understand.CreateModelBuildOptions ' . \implode(' ', $options) . ']'; } } class UpdateModelBuildOptions extends Options { /** * @param string $uniqueName A user-provided string that uniquely identifies * this resource as an alternative to the sid. Unique * up to 64 characters long. For example: v0.1 */ public function __construct($uniqueName = Values::NONE) { $this->options['uniqueName'] = $uniqueName; } /** * A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. For example: v0.1 * * @param string $uniqueName A user-provided string that uniquely identifies * this resource as an alternative to the sid. Unique * up to 64 characters long. For example: v0.1 * @return $this Fluent Builder */ public function setUniqueName($uniqueName) { $this->options['uniqueName'] = $uniqueName; 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.Preview.Understand.UpdateModelBuildOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Preview/Understand/Assistant/StyleSheetList.php 0000644 00000002613 15002236443 0021440 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\Assistant; use Twilio\ListResource; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class StyleSheetList extends ListResource { /** * Construct the StyleSheetList * * @param Version $version Version that contains the resource * @param string $assistantSid The unique ID of the Assistant * @return \Twilio\Rest\Preview\Understand\Assistant\StyleSheetList */ public function __construct(Version $version, $assistantSid) { parent::__construct($version); // Path Solution $this->solution = array('assistantSid' => $assistantSid, ); } /** * Constructs a StyleSheetContext * * @return \Twilio\Rest\Preview\Understand\Assistant\StyleSheetContext */ public function getContext() { return new StyleSheetContext($this->version, $this->solution['assistantSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Preview.Understand.StyleSheetList]'; } } sdk/src/Twilio/Rest/Preview/Understand/Assistant/AssistantInitiationActionsInstance.php 0000644 00000007720 15002236443 0025526 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\Assistant; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $accountSid * @property string $assistantSid * @property string $url * @property array $data */ class AssistantInitiationActionsInstance extends InstanceResource { /** * Initialize the AssistantInitiationActionsInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $assistantSid The assistant_sid * @return \Twilio\Rest\Preview\Understand\Assistant\AssistantInitiationActionsInstance */ public function __construct(Version $version, array $payload, $assistantSid) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'accountSid' => Values::array_get($payload, 'account_sid'), 'assistantSid' => Values::array_get($payload, 'assistant_sid'), 'url' => Values::array_get($payload, 'url'), 'data' => Values::array_get($payload, 'data'), ); $this->solution = array('assistantSid' => $assistantSid, ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Preview\Understand\Assistant\AssistantInitiationActionsContext Context for this * AssistantInitiationActionsInstance */ protected function proxy() { if (!$this->context) { $this->context = new AssistantInitiationActionsContext( $this->version, $this->solution['assistantSid'] ); } return $this->context; } /** * Fetch a AssistantInitiationActionsInstance * * @return AssistantInitiationActionsInstance Fetched * AssistantInitiationActionsInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Update the AssistantInitiationActionsInstance * * @param array|Options $options Optional Arguments * @return AssistantInitiationActionsInstance Updated * AssistantInitiationActionsInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.Understand.AssistantInitiationActionsInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/Understand/Assistant/TaskPage.php 0000644 00000001715 15002236443 0020214 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\Assistant; use Twilio\Page; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class TaskPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new TaskInstance($this->version, $payload, $this->solution['assistantSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Preview.Understand.TaskPage]'; } } sdk/src/Twilio/Rest/Preview/Understand/Assistant/DialogueInstance.php 0000644 00000007100 15002236443 0021725 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\Assistant; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $accountSid * @property string $assistantSid * @property string $sid * @property array $data * @property string $url */ class DialogueInstance extends InstanceResource { /** * Initialize the DialogueInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $assistantSid The unique ID of the parent Assistant. * @param string $sid The sid * @return \Twilio\Rest\Preview\Understand\Assistant\DialogueInstance */ public function __construct(Version $version, array $payload, $assistantSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'accountSid' => Values::array_get($payload, 'account_sid'), 'assistantSid' => Values::array_get($payload, 'assistant_sid'), 'sid' => Values::array_get($payload, 'sid'), 'data' => Values::array_get($payload, 'data'), 'url' => Values::array_get($payload, 'url'), ); $this->solution = array('assistantSid' => $assistantSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Preview\Understand\Assistant\DialogueContext Context * for this * DialogueInstance */ protected function proxy() { if (!$this->context) { $this->context = new DialogueContext( $this->version, $this->solution['assistantSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch a DialogueInstance * * @return DialogueInstance Fetched DialogueInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.Understand.DialogueInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/Understand/Assistant/StyleSheetContext.php 0000644 00000005154 15002236443 0022154 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\Assistant; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class StyleSheetContext extends InstanceContext { /** * Initialize the StyleSheetContext * * @param \Twilio\Version $version Version that contains the resource * @param string $assistantSid The unique ID of the Assistant * @return \Twilio\Rest\Preview\Understand\Assistant\StyleSheetContext */ public function __construct(Version $version, $assistantSid) { parent::__construct($version); // Path Solution $this->solution = array('assistantSid' => $assistantSid, ); $this->uri = '/Assistants/' . \rawurlencode($assistantSid) . '/StyleSheet'; } /** * Fetch a StyleSheetInstance * * @return StyleSheetInstance Fetched StyleSheetInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new StyleSheetInstance($this->version, $payload, $this->solution['assistantSid']); } /** * Update the StyleSheetInstance * * @param array|Options $options Optional Arguments * @return StyleSheetInstance Updated StyleSheetInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { $options = new Values($options); $data = Values::of(array('StyleSheet' => Serialize::jsonObject($options['styleSheet']), )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new StyleSheetInstance($this->version, $payload, $this->solution['assistantSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.Understand.StyleSheetContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/Understand/Assistant/FieldTypeInstance.php 0000644 00000011663 15002236443 0022072 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\Assistant; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $accountSid * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $friendlyName * @property array $links * @property string $assistantSid * @property string $sid * @property string $uniqueName * @property string $url */ class FieldTypeInstance extends InstanceResource { protected $_fieldValues = null; /** * Initialize the FieldTypeInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $assistantSid The unique ID of the Assistant. * @param string $sid The sid * @return \Twilio\Rest\Preview\Understand\Assistant\FieldTypeInstance */ public function __construct(Version $version, array $payload, $assistantSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'accountSid' => Values::array_get($payload, 'account_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'links' => Values::array_get($payload, 'links'), 'assistantSid' => Values::array_get($payload, 'assistant_sid'), 'sid' => Values::array_get($payload, 'sid'), 'uniqueName' => Values::array_get($payload, 'unique_name'), 'url' => Values::array_get($payload, 'url'), ); $this->solution = array('assistantSid' => $assistantSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Preview\Understand\Assistant\FieldTypeContext Context * for this * FieldTypeInstance */ protected function proxy() { if (!$this->context) { $this->context = new FieldTypeContext( $this->version, $this->solution['assistantSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch a FieldTypeInstance * * @return FieldTypeInstance Fetched FieldTypeInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Update the FieldTypeInstance * * @param array|Options $options Optional Arguments * @return FieldTypeInstance Updated FieldTypeInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Deletes the FieldTypeInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Access the fieldValues * * @return \Twilio\Rest\Preview\Understand\Assistant\FieldType\FieldValueList */ protected function getFieldValues() { return $this->proxy()->fieldValues; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.Understand.FieldTypeInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/Understand/Assistant/FieldType/FieldValuePage.php 0000644 00000002104 15002236443 0023210 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\Assistant\FieldType; use Twilio\Page; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class FieldValuePage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new FieldValueInstance( $this->version, $payload, $this->solution['assistantSid'], $this->solution['fieldTypeSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Preview.Understand.FieldValuePage]'; } } sdk/src/Twilio/Rest/Preview/Understand/Assistant/FieldType/FieldValueList.php 0000644 00000015634 15002236443 0023263 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\Assistant\FieldType; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class FieldValueList extends ListResource { /** * Construct the FieldValueList * * @param Version $version Version that contains the resource * @param string $assistantSid The unique ID of the Assistant. * @param string $fieldTypeSid The unique ID of the Field Type associated with * this Field Value. * @return \Twilio\Rest\Preview\Understand\Assistant\FieldType\FieldValueList */ public function __construct(Version $version, $assistantSid, $fieldTypeSid) { parent::__construct($version); // Path Solution $this->solution = array('assistantSid' => $assistantSid, 'fieldTypeSid' => $fieldTypeSid, ); $this->uri = '/Assistants/' . \rawurlencode($assistantSid) . '/FieldTypes/' . \rawurlencode($fieldTypeSid) . '/FieldValues'; } /** * Streams FieldValueInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($options = array(), $limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads FieldValueInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return FieldValueInstance[] Array of results */ public function read($options = array(), $limit = null, $pageSize = null) { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Retrieve a single page of FieldValueInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of FieldValueInstance */ public function page($options = array(), $pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $options = new Values($options); $params = Values::of(array( 'Language' => $options['language'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new FieldValuePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of FieldValueInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of FieldValueInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new FieldValuePage($this->version, $response, $this->solution); } /** * Create a new FieldValueInstance * * @param string $language An ISO language-country string of the value. * @param string $value A user-provided string that uniquely identifies this * resource as an alternative to the sid. Unique up to 64 * characters long. * @param array|Options $options Optional Arguments * @return FieldValueInstance Newly created FieldValueInstance * @throws TwilioException When an HTTP error occurs. */ public function create($language, $value, $options = array()) { $options = new Values($options); $data = Values::of(array( 'Language' => $language, 'Value' => $value, 'SynonymOf' => $options['synonymOf'], )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new FieldValueInstance( $this->version, $payload, $this->solution['assistantSid'], $this->solution['fieldTypeSid'] ); } /** * Constructs a FieldValueContext * * @param string $sid The sid * @return \Twilio\Rest\Preview\Understand\Assistant\FieldType\FieldValueContext */ public function getContext($sid) { return new FieldValueContext( $this->version, $this->solution['assistantSid'], $this->solution['fieldTypeSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Preview.Understand.FieldValueList]'; } } sdk/src/Twilio/Rest/Preview/Understand/Assistant/FieldType/FieldValueOptions.php 0000644 00000006657 15002236443 0024010 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\Assistant\FieldType; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ abstract class FieldValueOptions { /** * @param string $language An ISO language-country string of the value. For * example: en-US * @return ReadFieldValueOptions Options builder */ public static function read($language = Values::NONE) { return new ReadFieldValueOptions($language); } /** * @param string $synonymOf A value that indicates this field value is a * synonym of. Empty if the value is not a synonym. * @return CreateFieldValueOptions Options builder */ public static function create($synonymOf = Values::NONE) { return new CreateFieldValueOptions($synonymOf); } } class ReadFieldValueOptions extends Options { /** * @param string $language An ISO language-country string of the value. For * example: en-US */ public function __construct($language = Values::NONE) { $this->options['language'] = $language; } /** * An ISO language-country string of the value. For example: *en-US* * * @param string $language An ISO language-country string of the value. For * example: en-US * @return $this Fluent Builder */ public function setLanguage($language) { $this->options['language'] = $language; 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.Preview.Understand.ReadFieldValueOptions ' . \implode(' ', $options) . ']'; } } class CreateFieldValueOptions extends Options { /** * @param string $synonymOf A value that indicates this field value is a * synonym of. Empty if the value is not a synonym. */ public function __construct($synonymOf = Values::NONE) { $this->options['synonymOf'] = $synonymOf; } /** * A value that indicates this field value is a synonym of. Empty if the value is not a synonym. * * @param string $synonymOf A value that indicates this field value is a * synonym of. Empty if the value is not a synonym. * @return $this Fluent Builder */ public function setSynonymOf($synonymOf) { $this->options['synonymOf'] = $synonymOf; 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.Preview.Understand.CreateFieldValueOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Preview/Understand/Assistant/FieldType/FieldValueInstance.php 0000644 00000011245 15002236443 0024106 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\Assistant\FieldType; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $accountSid * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $fieldTypeSid * @property string $language * @property string $assistantSid * @property string $sid * @property string $value * @property string $url * @property string $synonymOf */ class FieldValueInstance extends InstanceResource { /** * Initialize the FieldValueInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $assistantSid The unique ID of the Assistant. * @param string $fieldTypeSid The unique ID of the Field Type associated with * this Field Value. * @param string $sid The sid * @return \Twilio\Rest\Preview\Understand\Assistant\FieldType\FieldValueInstance */ public function __construct(Version $version, array $payload, $assistantSid, $fieldTypeSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'accountSid' => Values::array_get($payload, 'account_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'fieldTypeSid' => Values::array_get($payload, 'field_type_sid'), 'language' => Values::array_get($payload, 'language'), 'assistantSid' => Values::array_get($payload, 'assistant_sid'), 'sid' => Values::array_get($payload, 'sid'), 'value' => Values::array_get($payload, 'value'), 'url' => Values::array_get($payload, 'url'), 'synonymOf' => Values::array_get($payload, 'synonym_of'), ); $this->solution = array( 'assistantSid' => $assistantSid, 'fieldTypeSid' => $fieldTypeSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Preview\Understand\Assistant\FieldType\FieldValueContext Context for this * FieldValueInstance */ protected function proxy() { if (!$this->context) { $this->context = new FieldValueContext( $this->version, $this->solution['assistantSid'], $this->solution['fieldTypeSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch a FieldValueInstance * * @return FieldValueInstance Fetched FieldValueInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the FieldValueInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.Understand.FieldValueInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/Understand/Assistant/FieldType/FieldValueContext.php 0000644 00000005133 15002236443 0023765 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\Assistant\FieldType; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class FieldValueContext extends InstanceContext { /** * Initialize the FieldValueContext * * @param \Twilio\Version $version Version that contains the resource * @param string $assistantSid The assistant_sid * @param string $fieldTypeSid The field_type_sid * @param string $sid The sid * @return \Twilio\Rest\Preview\Understand\Assistant\FieldType\FieldValueContext */ public function __construct(Version $version, $assistantSid, $fieldTypeSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array( 'assistantSid' => $assistantSid, 'fieldTypeSid' => $fieldTypeSid, 'sid' => $sid, ); $this->uri = '/Assistants/' . \rawurlencode($assistantSid) . '/FieldTypes/' . \rawurlencode($fieldTypeSid) . '/FieldValues/' . \rawurlencode($sid) . ''; } /** * Fetch a FieldValueInstance * * @return FieldValueInstance Fetched FieldValueInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new FieldValueInstance( $this->version, $payload, $this->solution['assistantSid'], $this->solution['fieldTypeSid'], $this->solution['sid'] ); } /** * Deletes the FieldValueInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.Understand.FieldValueContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/Understand/Assistant/DialogueContext.php 0000644 00000004053 15002236443 0021611 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\Assistant; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class DialogueContext extends InstanceContext { /** * Initialize the DialogueContext * * @param \Twilio\Version $version Version that contains the resource * @param string $assistantSid The assistant_sid * @param string $sid The sid * @return \Twilio\Rest\Preview\Understand\Assistant\DialogueContext */ public function __construct(Version $version, $assistantSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array('assistantSid' => $assistantSid, 'sid' => $sid, ); $this->uri = '/Assistants/' . \rawurlencode($assistantSid) . '/Dialogues/' . \rawurlencode($sid) . ''; } /** * Fetch a DialogueInstance * * @return DialogueInstance Fetched DialogueInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new DialogueInstance( $this->version, $payload, $this->solution['assistantSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.Understand.DialogueContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/Understand/Assistant/QueryList.php 0000644 00000015213 15002236443 0020454 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\Assistant; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class QueryList extends ListResource { /** * Construct the QueryList * * @param Version $version Version that contains the resource * @param string $assistantSid The unique ID of the parent Assistant. * @return \Twilio\Rest\Preview\Understand\Assistant\QueryList */ public function __construct(Version $version, $assistantSid) { parent::__construct($version); // Path Solution $this->solution = array('assistantSid' => $assistantSid, ); $this->uri = '/Assistants/' . \rawurlencode($assistantSid) . '/Queries'; } /** * Streams QueryInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($options = array(), $limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads QueryInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return QueryInstance[] Array of results */ public function read($options = array(), $limit = null, $pageSize = null) { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Retrieve a single page of QueryInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of QueryInstance */ public function page($options = array(), $pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $options = new Values($options); $params = Values::of(array( 'Language' => $options['language'], 'ModelBuild' => $options['modelBuild'], 'Status' => $options['status'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new QueryPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of QueryInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of QueryInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new QueryPage($this->version, $response, $this->solution); } /** * Create a new QueryInstance * * @param string $language An ISO language-country string of the sample. * @param string $query A user-provided string that uniquely identifies this * resource as an alternative to the sid. It can be up to * 2048 characters long. * @param array|Options $options Optional Arguments * @return QueryInstance Newly created QueryInstance * @throws TwilioException When an HTTP error occurs. */ public function create($language, $query, $options = array()) { $options = new Values($options); $data = Values::of(array( 'Language' => $language, 'Query' => $query, 'Tasks' => $options['tasks'], 'ModelBuild' => $options['modelBuild'], 'Field' => $options['field'], )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new QueryInstance($this->version, $payload, $this->solution['assistantSid']); } /** * Constructs a QueryContext * * @param string $sid A 34 character string that uniquely identifies this * resource. * @return \Twilio\Rest\Preview\Understand\Assistant\QueryContext */ public function getContext($sid) { return new QueryContext($this->version, $this->solution['assistantSid'], $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Preview.Understand.QueryList]'; } } sdk/src/Twilio/Rest/Preview/Understand/Assistant/AssistantFallbackActionsInstance.php 0000644 00000007660 15002236443 0025121 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\Assistant; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $accountSid * @property string $assistantSid * @property string $url * @property array $data */ class AssistantFallbackActionsInstance extends InstanceResource { /** * Initialize the AssistantFallbackActionsInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $assistantSid The assistant_sid * @return \Twilio\Rest\Preview\Understand\Assistant\AssistantFallbackActionsInstance */ public function __construct(Version $version, array $payload, $assistantSid) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'accountSid' => Values::array_get($payload, 'account_sid'), 'assistantSid' => Values::array_get($payload, 'assistant_sid'), 'url' => Values::array_get($payload, 'url'), 'data' => Values::array_get($payload, 'data'), ); $this->solution = array('assistantSid' => $assistantSid, ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Preview\Understand\Assistant\AssistantFallbackActionsContext Context for this * AssistantFallbackActionsInstance */ protected function proxy() { if (!$this->context) { $this->context = new AssistantFallbackActionsContext( $this->version, $this->solution['assistantSid'] ); } return $this->context; } /** * Fetch a AssistantFallbackActionsInstance * * @return AssistantFallbackActionsInstance Fetched * AssistantFallbackActionsInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Update the AssistantFallbackActionsInstance * * @param array|Options $options Optional Arguments * @return AssistantFallbackActionsInstance Updated * AssistantFallbackActionsInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.Understand.AssistantFallbackActionsInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/Understand/Assistant/FieldTypeContext.php 0000644 00000011703 15002236443 0021745 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\Assistant; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Rest\Preview\Understand\Assistant\FieldType\FieldValueList; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property \Twilio\Rest\Preview\Understand\Assistant\FieldType\FieldValueList $fieldValues * @method \Twilio\Rest\Preview\Understand\Assistant\FieldType\FieldValueContext fieldValues(string $sid) */ class FieldTypeContext extends InstanceContext { protected $_fieldValues = null; /** * Initialize the FieldTypeContext * * @param \Twilio\Version $version Version that contains the resource * @param string $assistantSid The assistant_sid * @param string $sid The sid * @return \Twilio\Rest\Preview\Understand\Assistant\FieldTypeContext */ public function __construct(Version $version, $assistantSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array('assistantSid' => $assistantSid, 'sid' => $sid, ); $this->uri = '/Assistants/' . \rawurlencode($assistantSid) . '/FieldTypes/' . \rawurlencode($sid) . ''; } /** * Fetch a FieldTypeInstance * * @return FieldTypeInstance Fetched FieldTypeInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new FieldTypeInstance( $this->version, $payload, $this->solution['assistantSid'], $this->solution['sid'] ); } /** * Update the FieldTypeInstance * * @param array|Options $options Optional Arguments * @return FieldTypeInstance Updated FieldTypeInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { $options = new Values($options); $data = Values::of(array( 'FriendlyName' => $options['friendlyName'], 'UniqueName' => $options['uniqueName'], )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new FieldTypeInstance( $this->version, $payload, $this->solution['assistantSid'], $this->solution['sid'] ); } /** * Deletes the FieldTypeInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Access the fieldValues * * @return \Twilio\Rest\Preview\Understand\Assistant\FieldType\FieldValueList */ protected function getFieldValues() { if (!$this->_fieldValues) { $this->_fieldValues = new FieldValueList( $this->version, $this->solution['assistantSid'], $this->solution['sid'] ); } return $this->_fieldValues; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get($name) { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.Understand.FieldTypeContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/Understand/Assistant/AssistantInitiationActionsPage.php 0000644 00000002075 15002236443 0024634 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\Assistant; use Twilio\Page; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class AssistantInitiationActionsPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new AssistantInitiationActionsInstance( $this->version, $payload, $this->solution['assistantSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Preview.Understand.AssistantInitiationActionsPage]'; } } sdk/src/Twilio/Rest/Preview/Understand/Assistant/ModelBuildContext.php 0000644 00000006104 15002236443 0022077 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\Assistant; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class ModelBuildContext extends InstanceContext { /** * Initialize the ModelBuildContext * * @param \Twilio\Version $version Version that contains the resource * @param string $assistantSid The assistant_sid * @param string $sid The sid * @return \Twilio\Rest\Preview\Understand\Assistant\ModelBuildContext */ public function __construct(Version $version, $assistantSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array('assistantSid' => $assistantSid, 'sid' => $sid, ); $this->uri = '/Assistants/' . \rawurlencode($assistantSid) . '/ModelBuilds/' . \rawurlencode($sid) . ''; } /** * Fetch a ModelBuildInstance * * @return ModelBuildInstance Fetched ModelBuildInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new ModelBuildInstance( $this->version, $payload, $this->solution['assistantSid'], $this->solution['sid'] ); } /** * Update the ModelBuildInstance * * @param array|Options $options Optional Arguments * @return ModelBuildInstance Updated ModelBuildInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { $options = new Values($options); $data = Values::of(array('UniqueName' => $options['uniqueName'], )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new ModelBuildInstance( $this->version, $payload, $this->solution['assistantSid'], $this->solution['sid'] ); } /** * Deletes the ModelBuildInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.Understand.ModelBuildContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/Understand/Assistant/StyleSheetInstance.php 0000644 00000007266 15002236443 0022302 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\Assistant; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $accountSid * @property string $assistantSid * @property string $url * @property array $data */ class StyleSheetInstance extends InstanceResource { /** * Initialize the StyleSheetInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $assistantSid The unique ID of the Assistant * @return \Twilio\Rest\Preview\Understand\Assistant\StyleSheetInstance */ public function __construct(Version $version, array $payload, $assistantSid) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'accountSid' => Values::array_get($payload, 'account_sid'), 'assistantSid' => Values::array_get($payload, 'assistant_sid'), 'url' => Values::array_get($payload, 'url'), 'data' => Values::array_get($payload, 'data'), ); $this->solution = array('assistantSid' => $assistantSid, ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Preview\Understand\Assistant\StyleSheetContext Context * for this * StyleSheetInstance */ protected function proxy() { if (!$this->context) { $this->context = new StyleSheetContext($this->version, $this->solution['assistantSid']); } return $this->context; } /** * Fetch a StyleSheetInstance * * @return StyleSheetInstance Fetched StyleSheetInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Update the StyleSheetInstance * * @param array|Options $options Optional Arguments * @return StyleSheetInstance Updated StyleSheetInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.Understand.StyleSheetInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/Understand/Assistant/DialoguePage.php 0000644 00000001731 15002236443 0021041 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\Assistant; use Twilio\Page; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class DialoguePage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new DialogueInstance($this->version, $payload, $this->solution['assistantSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Preview.Understand.DialoguePage]'; } } sdk/src/Twilio/Rest/Preview/Understand/Assistant/FieldTypeList.php 0000644 00000014001 15002236443 0021226 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\Assistant; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class FieldTypeList extends ListResource { /** * Construct the FieldTypeList * * @param Version $version Version that contains the resource * @param string $assistantSid The unique ID of the Assistant. * @return \Twilio\Rest\Preview\Understand\Assistant\FieldTypeList */ public function __construct(Version $version, $assistantSid) { parent::__construct($version); // Path Solution $this->solution = array('assistantSid' => $assistantSid, ); $this->uri = '/Assistants/' . \rawurlencode($assistantSid) . '/FieldTypes'; } /** * Streams FieldTypeInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads FieldTypeInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return FieldTypeInstance[] Array of results */ public function read($limit = null, $pageSize = null) { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of FieldTypeInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of FieldTypeInstance */ public function page($pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $params = Values::of(array( 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new FieldTypePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of FieldTypeInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of FieldTypeInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new FieldTypePage($this->version, $response, $this->solution); } /** * Create a new FieldTypeInstance * * @param string $uniqueName A user-provided string that uniquely identifies * this resource as an alternative to the sid. Unique * up to 64 characters long. * @param array|Options $options Optional Arguments * @return FieldTypeInstance Newly created FieldTypeInstance * @throws TwilioException When an HTTP error occurs. */ public function create($uniqueName, $options = array()) { $options = new Values($options); $data = Values::of(array('UniqueName' => $uniqueName, 'FriendlyName' => $options['friendlyName'], )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new FieldTypeInstance($this->version, $payload, $this->solution['assistantSid']); } /** * Constructs a FieldTypeContext * * @param string $sid The sid * @return \Twilio\Rest\Preview\Understand\Assistant\FieldTypeContext */ public function getContext($sid) { return new FieldTypeContext($this->version, $this->solution['assistantSid'], $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Preview.Understand.FieldTypeList]'; } } sdk/src/Twilio/Rest/Preview/Understand/Assistant/QueryPage.php 0000644 00000001720 15002236443 0020413 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\Assistant; use Twilio\Page; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class QueryPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new QueryInstance($this->version, $payload, $this->solution['assistantSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Preview.Understand.QueryPage]'; } } sdk/src/Twilio/Rest/Preview/Understand/Assistant/TaskContext.php 0000644 00000016216 15002236443 0020766 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\Assistant; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Rest\Preview\Understand\Assistant\Task\FieldList; use Twilio\Rest\Preview\Understand\Assistant\Task\SampleList; use Twilio\Rest\Preview\Understand\Assistant\Task\TaskActionsList; use Twilio\Rest\Preview\Understand\Assistant\Task\TaskStatisticsList; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property \Twilio\Rest\Preview\Understand\Assistant\Task\FieldList $fields * @property \Twilio\Rest\Preview\Understand\Assistant\Task\SampleList $samples * @property \Twilio\Rest\Preview\Understand\Assistant\Task\TaskActionsList $taskActions * @property \Twilio\Rest\Preview\Understand\Assistant\Task\TaskStatisticsList $statistics * @method \Twilio\Rest\Preview\Understand\Assistant\Task\FieldContext fields(string $sid) * @method \Twilio\Rest\Preview\Understand\Assistant\Task\SampleContext samples(string $sid) * @method \Twilio\Rest\Preview\Understand\Assistant\Task\TaskActionsContext taskActions() * @method \Twilio\Rest\Preview\Understand\Assistant\Task\TaskStatisticsContext statistics() */ class TaskContext extends InstanceContext { protected $_fields = null; protected $_samples = null; protected $_taskActions = null; protected $_statistics = null; /** * Initialize the TaskContext * * @param \Twilio\Version $version Version that contains the resource * @param string $assistantSid The unique ID of the Assistant. * @param string $sid A 34 character string that uniquely identifies this * resource. * @return \Twilio\Rest\Preview\Understand\Assistant\TaskContext */ public function __construct(Version $version, $assistantSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array('assistantSid' => $assistantSid, 'sid' => $sid, ); $this->uri = '/Assistants/' . \rawurlencode($assistantSid) . '/Tasks/' . \rawurlencode($sid) . ''; } /** * Fetch a TaskInstance * * @return TaskInstance Fetched TaskInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new TaskInstance( $this->version, $payload, $this->solution['assistantSid'], $this->solution['sid'] ); } /** * Update the TaskInstance * * @param array|Options $options Optional Arguments * @return TaskInstance Updated TaskInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { $options = new Values($options); $data = Values::of(array( 'FriendlyName' => $options['friendlyName'], 'UniqueName' => $options['uniqueName'], 'Actions' => Serialize::jsonObject($options['actions']), 'ActionsUrl' => $options['actionsUrl'], )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new TaskInstance( $this->version, $payload, $this->solution['assistantSid'], $this->solution['sid'] ); } /** * Deletes the TaskInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Access the fields * * @return \Twilio\Rest\Preview\Understand\Assistant\Task\FieldList */ protected function getFields() { if (!$this->_fields) { $this->_fields = new FieldList( $this->version, $this->solution['assistantSid'], $this->solution['sid'] ); } return $this->_fields; } /** * Access the samples * * @return \Twilio\Rest\Preview\Understand\Assistant\Task\SampleList */ protected function getSamples() { if (!$this->_samples) { $this->_samples = new SampleList( $this->version, $this->solution['assistantSid'], $this->solution['sid'] ); } return $this->_samples; } /** * Access the taskActions * * @return \Twilio\Rest\Preview\Understand\Assistant\Task\TaskActionsList */ protected function getTaskActions() { if (!$this->_taskActions) { $this->_taskActions = new TaskActionsList( $this->version, $this->solution['assistantSid'], $this->solution['sid'] ); } return $this->_taskActions; } /** * Access the statistics * * @return \Twilio\Rest\Preview\Understand\Assistant\Task\TaskStatisticsList */ protected function getStatistics() { if (!$this->_statistics) { $this->_statistics = new TaskStatisticsList( $this->version, $this->solution['assistantSid'], $this->solution['sid'] ); } return $this->_statistics; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get($name) { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.Understand.TaskContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/Understand/AssistantInstance.php 0000644 00000015513 15002236443 0020203 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $accountSid * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $friendlyName * @property string $latestModelBuildSid * @property array $links * @property bool $logQueries * @property string $sid * @property string $uniqueName * @property string $url * @property string $callbackUrl * @property string $callbackEvents */ class AssistantInstance extends InstanceResource { protected $_fieldTypes = null; protected $_tasks = null; protected $_modelBuilds = null; protected $_queries = null; protected $_assistantFallbackActions = null; protected $_assistantInitiationActions = null; protected $_dialogues = null; protected $_styleSheet = null; /** * Initialize the AssistantInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid A 34 character string that uniquely identifies this * resource. * @return \Twilio\Rest\Preview\Understand\AssistantInstance */ public function __construct(Version $version, array $payload, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'accountSid' => Values::array_get($payload, 'account_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'latestModelBuildSid' => Values::array_get($payload, 'latest_model_build_sid'), 'links' => Values::array_get($payload, 'links'), 'logQueries' => Values::array_get($payload, 'log_queries'), 'sid' => Values::array_get($payload, 'sid'), 'uniqueName' => Values::array_get($payload, 'unique_name'), 'url' => Values::array_get($payload, 'url'), 'callbackUrl' => Values::array_get($payload, 'callback_url'), 'callbackEvents' => Values::array_get($payload, 'callback_events'), ); $this->solution = array('sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Preview\Understand\AssistantContext Context for this * AssistantInstance */ protected function proxy() { if (!$this->context) { $this->context = new AssistantContext($this->version, $this->solution['sid']); } return $this->context; } /** * Fetch a AssistantInstance * * @return AssistantInstance Fetched AssistantInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Update the AssistantInstance * * @param array|Options $options Optional Arguments * @return AssistantInstance Updated AssistantInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Deletes the AssistantInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Access the fieldTypes * * @return \Twilio\Rest\Preview\Understand\Assistant\FieldTypeList */ protected function getFieldTypes() { return $this->proxy()->fieldTypes; } /** * Access the tasks * * @return \Twilio\Rest\Preview\Understand\Assistant\TaskList */ protected function getTasks() { return $this->proxy()->tasks; } /** * Access the modelBuilds * * @return \Twilio\Rest\Preview\Understand\Assistant\ModelBuildList */ protected function getModelBuilds() { return $this->proxy()->modelBuilds; } /** * Access the queries * * @return \Twilio\Rest\Preview\Understand\Assistant\QueryList */ protected function getQueries() { return $this->proxy()->queries; } /** * Access the assistantFallbackActions * * @return \Twilio\Rest\Preview\Understand\Assistant\AssistantFallbackActionsList */ protected function getAssistantFallbackActions() { return $this->proxy()->assistantFallbackActions; } /** * Access the assistantInitiationActions * * @return \Twilio\Rest\Preview\Understand\Assistant\AssistantInitiationActionsList */ protected function getAssistantInitiationActions() { return $this->proxy()->assistantInitiationActions; } /** * Access the dialogues * * @return \Twilio\Rest\Preview\Understand\Assistant\DialogueList */ protected function getDialogues() { return $this->proxy()->dialogues; } /** * Access the styleSheet * * @return \Twilio\Rest\Preview\Understand\Assistant\StyleSheetList */ protected function getStyleSheet() { return $this->proxy()->styleSheet; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.Understand.AssistantInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/Understand/AssistantPage.php 0000644 00000001661 15002236443 0017312 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand; use Twilio\Page; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class AssistantPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new AssistantInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Preview.Understand.AssistantPage]'; } } sdk/src/Twilio/Rest/Preview/Wireless/SimPage.php 0000644 00000001633 15002236443 0015556 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Wireless; use Twilio\Page; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class SimPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new SimInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Preview.Wireless.SimPage]'; } } sdk/src/Twilio/Rest/Preview/Wireless/CommandContext.php 0000644 00000003430 15002236443 0017151 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Wireless; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class CommandContext extends InstanceContext { /** * Initialize the CommandContext * * @param \Twilio\Version $version Version that contains the resource * @param string $sid The sid * @return \Twilio\Rest\Preview\Wireless\CommandContext */ public function __construct(Version $version, $sid) { parent::__construct($version); // Path Solution $this->solution = array('sid' => $sid, ); $this->uri = '/Commands/' . \rawurlencode($sid) . ''; } /** * Fetch a CommandInstance * * @return CommandInstance Fetched CommandInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new CommandInstance($this->version, $payload, $this->solution['sid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.Wireless.CommandContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/Wireless/Sim/UsageInstance.php 0000644 00000007355 15002236443 0017521 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Wireless\Sim; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $simSid * @property string $simUniqueName * @property string $accountSid * @property array $period * @property array $commandsUsage * @property array $commandsCosts * @property array $dataUsage * @property array $dataCosts * @property string $url */ class UsageInstance extends InstanceResource { /** * Initialize the UsageInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $simSid The sim_sid * @return \Twilio\Rest\Preview\Wireless\Sim\UsageInstance */ public function __construct(Version $version, array $payload, $simSid) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'simSid' => Values::array_get($payload, 'sim_sid'), 'simUniqueName' => Values::array_get($payload, 'sim_unique_name'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'period' => Values::array_get($payload, 'period'), 'commandsUsage' => Values::array_get($payload, 'commands_usage'), 'commandsCosts' => Values::array_get($payload, 'commands_costs'), 'dataUsage' => Values::array_get($payload, 'data_usage'), 'dataCosts' => Values::array_get($payload, 'data_costs'), 'url' => Values::array_get($payload, 'url'), ); $this->solution = array('simSid' => $simSid, ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Preview\Wireless\Sim\UsageContext Context for this * UsageInstance */ protected function proxy() { if (!$this->context) { $this->context = new UsageContext($this->version, $this->solution['simSid']); } return $this->context; } /** * Fetch a UsageInstance * * @param array|Options $options Optional Arguments * @return UsageInstance Fetched UsageInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch($options = array()) { return $this->proxy()->fetch($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.Wireless.UsageInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/Wireless/Sim/UsagePage.php 0000644 00000001700 15002236443 0016615 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Wireless\Sim; use Twilio\Page; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class UsagePage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new UsageInstance($this->version, $payload, $this->solution['simSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Preview.Wireless.UsagePage]'; } } sdk/src/Twilio/Rest/Preview/Wireless/Sim/UsageOptions.php 0000644 00000003536 15002236443 0017405 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Wireless\Sim; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ abstract class UsageOptions { /** * @param string $end The end * @param string $start The start * @return FetchUsageOptions Options builder */ public static function fetch($end = Values::NONE, $start = Values::NONE) { return new FetchUsageOptions($end, $start); } } class FetchUsageOptions extends Options { /** * @param string $end The end * @param string $start The start */ public function __construct($end = Values::NONE, $start = Values::NONE) { $this->options['end'] = $end; $this->options['start'] = $start; } /** * The end * * @param string $end The end * @return $this Fluent Builder */ public function setEnd($end) { $this->options['end'] = $end; return $this; } /** * The start * * @param string $start The start * @return $this Fluent Builder */ public function setStart($start) { $this->options['start'] = $start; 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.Preview.Wireless.FetchUsageOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Preview/Wireless/Sim/UsageList.php 0000644 00000002435 15002236443 0016662 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Wireless\Sim; use Twilio\ListResource; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class UsageList extends ListResource { /** * Construct the UsageList * * @param Version $version Version that contains the resource * @param string $simSid The sim_sid * @return \Twilio\Rest\Preview\Wireless\Sim\UsageList */ public function __construct(Version $version, $simSid) { parent::__construct($version); // Path Solution $this->solution = array('simSid' => $simSid, ); } /** * Constructs a UsageContext * * @return \Twilio\Rest\Preview\Wireless\Sim\UsageContext */ public function getContext() { return new UsageContext($this->version, $this->solution['simSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Preview.Wireless.UsageList]'; } } sdk/src/Twilio/Rest/Preview/Wireless/Sim/UsageContext.php 0000644 00000003750 15002236443 0017374 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Wireless\Sim; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class UsageContext extends InstanceContext { /** * Initialize the UsageContext * * @param \Twilio\Version $version Version that contains the resource * @param string $simSid The sim_sid * @return \Twilio\Rest\Preview\Wireless\Sim\UsageContext */ public function __construct(Version $version, $simSid) { parent::__construct($version); // Path Solution $this->solution = array('simSid' => $simSid, ); $this->uri = '/Sims/' . \rawurlencode($simSid) . '/Usage'; } /** * Fetch a UsageInstance * * @param array|Options $options Optional Arguments * @return UsageInstance Fetched UsageInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch($options = array()) { $options = new Values($options); $params = Values::of(array('End' => $options['end'], 'Start' => $options['start'], )); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new UsageInstance($this->version, $payload, $this->solution['simSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.Wireless.UsageContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/Wireless/SimList.php 0000644 00000012404 15002236443 0015613 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Wireless; use Twilio\ListResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class SimList extends ListResource { /** * Construct the SimList * * @param Version $version Version that contains the resource * @return \Twilio\Rest\Preview\Wireless\SimList */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = array(); $this->uri = '/Sims'; } /** * Streams SimInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($options = array(), $limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads SimInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return SimInstance[] Array of results */ public function read($options = array(), $limit = null, $pageSize = null) { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Retrieve a single page of SimInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of SimInstance */ public function page($options = array(), $pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $options = new Values($options); $params = Values::of(array( 'Status' => $options['status'], 'Iccid' => $options['iccid'], 'RatePlan' => $options['ratePlan'], 'EId' => $options['eId'], 'SimRegistrationCode' => $options['simRegistrationCode'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new SimPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of SimInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of SimInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new SimPage($this->version, $response, $this->solution); } /** * Constructs a SimContext * * @param string $sid The sid * @return \Twilio\Rest\Preview\Wireless\SimContext */ public function getContext($sid) { return new SimContext($this->version, $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Preview.Wireless.SimList]'; } } sdk/src/Twilio/Rest/Preview/Wireless/SimContext.php 0000644 00000011444 15002236443 0016327 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Wireless; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Rest\Preview\Wireless\Sim\UsageList; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property \Twilio\Rest\Preview\Wireless\Sim\UsageList $usage * @method \Twilio\Rest\Preview\Wireless\Sim\UsageContext usage() */ class SimContext extends InstanceContext { protected $_usage = null; /** * Initialize the SimContext * * @param \Twilio\Version $version Version that contains the resource * @param string $sid The sid * @return \Twilio\Rest\Preview\Wireless\SimContext */ public function __construct(Version $version, $sid) { parent::__construct($version); // Path Solution $this->solution = array('sid' => $sid, ); $this->uri = '/Sims/' . \rawurlencode($sid) . ''; } /** * Fetch a SimInstance * * @return SimInstance Fetched SimInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new SimInstance($this->version, $payload, $this->solution['sid']); } /** * Update the SimInstance * * @param array|Options $options Optional Arguments * @return SimInstance Updated SimInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { $options = new Values($options); $data = Values::of(array( 'UniqueName' => $options['uniqueName'], 'CallbackMethod' => $options['callbackMethod'], 'CallbackUrl' => $options['callbackUrl'], 'FriendlyName' => $options['friendlyName'], 'RatePlan' => $options['ratePlan'], 'Status' => $options['status'], 'CommandsCallbackMethod' => $options['commandsCallbackMethod'], 'CommandsCallbackUrl' => $options['commandsCallbackUrl'], 'SmsFallbackMethod' => $options['smsFallbackMethod'], 'SmsFallbackUrl' => $options['smsFallbackUrl'], 'SmsMethod' => $options['smsMethod'], 'SmsUrl' => $options['smsUrl'], 'VoiceFallbackMethod' => $options['voiceFallbackMethod'], 'VoiceFallbackUrl' => $options['voiceFallbackUrl'], 'VoiceMethod' => $options['voiceMethod'], 'VoiceUrl' => $options['voiceUrl'], )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new SimInstance($this->version, $payload, $this->solution['sid']); } /** * Access the usage * * @return \Twilio\Rest\Preview\Wireless\Sim\UsageList */ protected function getUsage() { if (!$this->_usage) { $this->_usage = new UsageList($this->version, $this->solution['sid']); } return $this->_usage; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get($name) { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.Wireless.SimContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/Wireless/CommandInstance.php 0000644 00000007612 15002236443 0017277 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Wireless; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $sid * @property string $accountSid * @property string $deviceSid * @property string $simSid * @property string $command * @property string $commandMode * @property string $status * @property string $direction * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $url */ class CommandInstance extends InstanceResource { /** * Initialize the CommandInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The sid * @return \Twilio\Rest\Preview\Wireless\CommandInstance */ public function __construct(Version $version, array $payload, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'deviceSid' => Values::array_get($payload, 'device_sid'), 'simSid' => Values::array_get($payload, 'sim_sid'), 'command' => Values::array_get($payload, 'command'), 'commandMode' => Values::array_get($payload, 'command_mode'), 'status' => Values::array_get($payload, 'status'), 'direction' => Values::array_get($payload, 'direction'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), ); $this->solution = array('sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Preview\Wireless\CommandContext Context for this * CommandInstance */ protected function proxy() { if (!$this->context) { $this->context = new CommandContext($this->version, $this->solution['sid']); } return $this->context; } /** * Fetch a CommandInstance * * @return CommandInstance Fetched CommandInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.Wireless.CommandInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/Wireless/CommandPage.php 0000644 00000001647 15002236443 0016411 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Wireless; use Twilio\Page; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class CommandPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new CommandInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Preview.Wireless.CommandPage]'; } } sdk/src/Twilio/Rest/Preview/Wireless/RatePlanPage.php 0000644 00000001652 15002236443 0016535 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Wireless; use Twilio\Page; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class RatePlanPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new RatePlanInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Preview.Wireless.RatePlanPage]'; } } sdk/src/Twilio/Rest/Preview/Wireless/RatePlanOptions.php 0000644 00000020047 15002236443 0017313 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Wireless; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ abstract class RatePlanOptions { /** * @param string $uniqueName The unique_name * @param string $friendlyName The friendly_name * @param bool $dataEnabled The data_enabled * @param int $dataLimit The data_limit * @param string $dataMetering The data_metering * @param bool $messagingEnabled The messaging_enabled * @param bool $voiceEnabled The voice_enabled * @param bool $commandsEnabled The commands_enabled * @param bool $nationalRoamingEnabled The national_roaming_enabled * @param string $internationalRoaming The international_roaming * @return CreateRatePlanOptions Options builder */ public static function create($uniqueName = Values::NONE, $friendlyName = Values::NONE, $dataEnabled = Values::NONE, $dataLimit = Values::NONE, $dataMetering = Values::NONE, $messagingEnabled = Values::NONE, $voiceEnabled = Values::NONE, $commandsEnabled = Values::NONE, $nationalRoamingEnabled = Values::NONE, $internationalRoaming = Values::NONE) { return new CreateRatePlanOptions($uniqueName, $friendlyName, $dataEnabled, $dataLimit, $dataMetering, $messagingEnabled, $voiceEnabled, $commandsEnabled, $nationalRoamingEnabled, $internationalRoaming); } /** * @param string $uniqueName The unique_name * @param string $friendlyName The friendly_name * @return UpdateRatePlanOptions Options builder */ public static function update($uniqueName = Values::NONE, $friendlyName = Values::NONE) { return new UpdateRatePlanOptions($uniqueName, $friendlyName); } } class CreateRatePlanOptions extends Options { /** * @param string $uniqueName The unique_name * @param string $friendlyName The friendly_name * @param bool $dataEnabled The data_enabled * @param int $dataLimit The data_limit * @param string $dataMetering The data_metering * @param bool $messagingEnabled The messaging_enabled * @param bool $voiceEnabled The voice_enabled * @param bool $commandsEnabled The commands_enabled * @param bool $nationalRoamingEnabled The national_roaming_enabled * @param string $internationalRoaming The international_roaming */ public function __construct($uniqueName = Values::NONE, $friendlyName = Values::NONE, $dataEnabled = Values::NONE, $dataLimit = Values::NONE, $dataMetering = Values::NONE, $messagingEnabled = Values::NONE, $voiceEnabled = Values::NONE, $commandsEnabled = Values::NONE, $nationalRoamingEnabled = Values::NONE, $internationalRoaming = Values::NONE) { $this->options['uniqueName'] = $uniqueName; $this->options['friendlyName'] = $friendlyName; $this->options['dataEnabled'] = $dataEnabled; $this->options['dataLimit'] = $dataLimit; $this->options['dataMetering'] = $dataMetering; $this->options['messagingEnabled'] = $messagingEnabled; $this->options['voiceEnabled'] = $voiceEnabled; $this->options['commandsEnabled'] = $commandsEnabled; $this->options['nationalRoamingEnabled'] = $nationalRoamingEnabled; $this->options['internationalRoaming'] = $internationalRoaming; } /** * The unique_name * * @param string $uniqueName The unique_name * @return $this Fluent Builder */ public function setUniqueName($uniqueName) { $this->options['uniqueName'] = $uniqueName; return $this; } /** * The friendly_name * * @param string $friendlyName The friendly_name * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The data_enabled * * @param bool $dataEnabled The data_enabled * @return $this Fluent Builder */ public function setDataEnabled($dataEnabled) { $this->options['dataEnabled'] = $dataEnabled; return $this; } /** * The data_limit * * @param int $dataLimit The data_limit * @return $this Fluent Builder */ public function setDataLimit($dataLimit) { $this->options['dataLimit'] = $dataLimit; return $this; } /** * The data_metering * * @param string $dataMetering The data_metering * @return $this Fluent Builder */ public function setDataMetering($dataMetering) { $this->options['dataMetering'] = $dataMetering; return $this; } /** * The messaging_enabled * * @param bool $messagingEnabled The messaging_enabled * @return $this Fluent Builder */ public function setMessagingEnabled($messagingEnabled) { $this->options['messagingEnabled'] = $messagingEnabled; return $this; } /** * The voice_enabled * * @param bool $voiceEnabled The voice_enabled * @return $this Fluent Builder */ public function setVoiceEnabled($voiceEnabled) { $this->options['voiceEnabled'] = $voiceEnabled; return $this; } /** * The commands_enabled * * @param bool $commandsEnabled The commands_enabled * @return $this Fluent Builder */ public function setCommandsEnabled($commandsEnabled) { $this->options['commandsEnabled'] = $commandsEnabled; return $this; } /** * The national_roaming_enabled * * @param bool $nationalRoamingEnabled The national_roaming_enabled * @return $this Fluent Builder */ public function setNationalRoamingEnabled($nationalRoamingEnabled) { $this->options['nationalRoamingEnabled'] = $nationalRoamingEnabled; return $this; } /** * The international_roaming * * @param string $internationalRoaming The international_roaming * @return $this Fluent Builder */ public function setInternationalRoaming($internationalRoaming) { $this->options['internationalRoaming'] = $internationalRoaming; 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.Preview.Wireless.CreateRatePlanOptions ' . \implode(' ', $options) . ']'; } } class UpdateRatePlanOptions extends Options { /** * @param string $uniqueName The unique_name * @param string $friendlyName The friendly_name */ public function __construct($uniqueName = Values::NONE, $friendlyName = Values::NONE) { $this->options['uniqueName'] = $uniqueName; $this->options['friendlyName'] = $friendlyName; } /** * The unique_name * * @param string $uniqueName The unique_name * @return $this Fluent Builder */ public function setUniqueName($uniqueName) { $this->options['uniqueName'] = $uniqueName; return $this; } /** * The friendly_name * * @param string $friendlyName The friendly_name * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; 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.Preview.Wireless.UpdateRatePlanOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Preview/Wireless/RatePlanContext.php 0000644 00000005420 15002236443 0017302 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Wireless; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class RatePlanContext extends InstanceContext { /** * Initialize the RatePlanContext * * @param \Twilio\Version $version Version that contains the resource * @param string $sid The sid * @return \Twilio\Rest\Preview\Wireless\RatePlanContext */ public function __construct(Version $version, $sid) { parent::__construct($version); // Path Solution $this->solution = array('sid' => $sid, ); $this->uri = '/RatePlans/' . \rawurlencode($sid) . ''; } /** * Fetch a RatePlanInstance * * @return RatePlanInstance Fetched RatePlanInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new RatePlanInstance($this->version, $payload, $this->solution['sid']); } /** * Update the RatePlanInstance * * @param array|Options $options Optional Arguments * @return RatePlanInstance Updated RatePlanInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { $options = new Values($options); $data = Values::of(array( 'UniqueName' => $options['uniqueName'], 'FriendlyName' => $options['friendlyName'], )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new RatePlanInstance($this->version, $payload, $this->solution['sid']); } /** * Deletes the RatePlanInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.Wireless.RatePlanContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/Wireless/RatePlanList.php 0000644 00000014331 15002236443 0016572 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Wireless; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class RatePlanList extends ListResource { /** * Construct the RatePlanList * * @param Version $version Version that contains the resource * @return \Twilio\Rest\Preview\Wireless\RatePlanList */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = array(); $this->uri = '/RatePlans'; } /** * Streams RatePlanInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads RatePlanInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return RatePlanInstance[] Array of results */ public function read($limit = null, $pageSize = null) { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of RatePlanInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of RatePlanInstance */ public function page($pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $params = Values::of(array( 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new RatePlanPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of RatePlanInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of RatePlanInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new RatePlanPage($this->version, $response, $this->solution); } /** * Create a new RatePlanInstance * * @param array|Options $options Optional Arguments * @return RatePlanInstance Newly created RatePlanInstance * @throws TwilioException When an HTTP error occurs. */ public function create($options = array()) { $options = new Values($options); $data = Values::of(array( 'UniqueName' => $options['uniqueName'], 'FriendlyName' => $options['friendlyName'], 'DataEnabled' => Serialize::booleanToString($options['dataEnabled']), 'DataLimit' => $options['dataLimit'], 'DataMetering' => $options['dataMetering'], 'MessagingEnabled' => Serialize::booleanToString($options['messagingEnabled']), 'VoiceEnabled' => Serialize::booleanToString($options['voiceEnabled']), 'CommandsEnabled' => Serialize::booleanToString($options['commandsEnabled']), 'NationalRoamingEnabled' => Serialize::booleanToString($options['nationalRoamingEnabled']), 'InternationalRoaming' => Serialize::map($options['internationalRoaming'], function($e) { return $e; }), )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new RatePlanInstance($this->version, $payload); } /** * Constructs a RatePlanContext * * @param string $sid The sid * @return \Twilio\Rest\Preview\Wireless\RatePlanContext */ public function getContext($sid) { return new RatePlanContext($this->version, $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Preview.Wireless.RatePlanList]'; } } sdk/src/Twilio/Rest/Preview/Wireless/CommandList.php 0000644 00000014365 15002236443 0016451 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Wireless; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class CommandList extends ListResource { /** * Construct the CommandList * * @param Version $version Version that contains the resource * @return \Twilio\Rest\Preview\Wireless\CommandList */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = array(); $this->uri = '/Commands'; } /** * Streams CommandInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($options = array(), $limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads CommandInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return CommandInstance[] Array of results */ public function read($options = array(), $limit = null, $pageSize = null) { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Retrieve a single page of CommandInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of CommandInstance */ public function page($options = array(), $pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $options = new Values($options); $params = Values::of(array( 'Device' => $options['device'], 'Sim' => $options['sim'], 'Status' => $options['status'], 'Direction' => $options['direction'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new CommandPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of CommandInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of CommandInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new CommandPage($this->version, $response, $this->solution); } /** * Create a new CommandInstance * * @param string $command The command * @param array|Options $options Optional Arguments * @return CommandInstance Newly created CommandInstance * @throws TwilioException When an HTTP error occurs. */ public function create($command, $options = array()) { $options = new Values($options); $data = Values::of(array( 'Command' => $command, 'Device' => $options['device'], 'Sim' => $options['sim'], 'CallbackMethod' => $options['callbackMethod'], 'CallbackUrl' => $options['callbackUrl'], 'CommandMode' => $options['commandMode'], 'IncludeSid' => $options['includeSid'], )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new CommandInstance($this->version, $payload); } /** * Constructs a CommandContext * * @param string $sid The sid * @return \Twilio\Rest\Preview\Wireless\CommandContext */ public function getContext($sid) { return new CommandContext($this->version, $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Preview.Wireless.CommandList]'; } } sdk/src/Twilio/Rest/Preview/Wireless/SimInstance.php 0000644 00000013072 15002236443 0016446 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Wireless; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $sid * @property string $uniqueName * @property string $accountSid * @property string $ratePlanSid * @property string $friendlyName * @property string $iccid * @property string $eId * @property string $status * @property string $commandsCallbackUrl * @property string $commandsCallbackMethod * @property string $smsFallbackMethod * @property string $smsFallbackUrl * @property string $smsMethod * @property string $smsUrl * @property string $voiceFallbackMethod * @property string $voiceFallbackUrl * @property string $voiceMethod * @property string $voiceUrl * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $url * @property array $links */ class SimInstance extends InstanceResource { protected $_usage = null; /** * Initialize the SimInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The sid * @return \Twilio\Rest\Preview\Wireless\SimInstance */ public function __construct(Version $version, array $payload, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'sid' => Values::array_get($payload, 'sid'), 'uniqueName' => Values::array_get($payload, 'unique_name'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'ratePlanSid' => Values::array_get($payload, 'rate_plan_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'iccid' => Values::array_get($payload, 'iccid'), 'eId' => Values::array_get($payload, 'e_id'), 'status' => Values::array_get($payload, 'status'), 'commandsCallbackUrl' => Values::array_get($payload, 'commands_callback_url'), 'commandsCallbackMethod' => Values::array_get($payload, 'commands_callback_method'), 'smsFallbackMethod' => Values::array_get($payload, 'sms_fallback_method'), 'smsFallbackUrl' => Values::array_get($payload, 'sms_fallback_url'), 'smsMethod' => Values::array_get($payload, 'sms_method'), 'smsUrl' => Values::array_get($payload, 'sms_url'), 'voiceFallbackMethod' => Values::array_get($payload, 'voice_fallback_method'), 'voiceFallbackUrl' => Values::array_get($payload, 'voice_fallback_url'), 'voiceMethod' => Values::array_get($payload, 'voice_method'), 'voiceUrl' => Values::array_get($payload, 'voice_url'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ); $this->solution = array('sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Preview\Wireless\SimContext Context for this SimInstance */ protected function proxy() { if (!$this->context) { $this->context = new SimContext($this->version, $this->solution['sid']); } return $this->context; } /** * Fetch a SimInstance * * @return SimInstance Fetched SimInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Update the SimInstance * * @param array|Options $options Optional Arguments * @return SimInstance Updated SimInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Access the usage * * @return \Twilio\Rest\Preview\Wireless\Sim\UsageList */ protected function getUsage() { return $this->proxy()->usage; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.Wireless.SimInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/Wireless/SimOptions.php 0000644 00000030203 15002236443 0016330 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Wireless; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ abstract class SimOptions { /** * @param string $status The status * @param string $iccid The iccid * @param string $ratePlan The rate_plan * @param string $eId The e_id * @param string $simRegistrationCode The sim_registration_code * @return ReadSimOptions Options builder */ public static function read($status = Values::NONE, $iccid = Values::NONE, $ratePlan = Values::NONE, $eId = Values::NONE, $simRegistrationCode = Values::NONE) { return new ReadSimOptions($status, $iccid, $ratePlan, $eId, $simRegistrationCode); } /** * @param string $uniqueName The unique_name * @param string $callbackMethod The callback_method * @param string $callbackUrl The callback_url * @param string $friendlyName The friendly_name * @param string $ratePlan The rate_plan * @param string $status The status * @param string $commandsCallbackMethod The commands_callback_method * @param string $commandsCallbackUrl The commands_callback_url * @param string $smsFallbackMethod The sms_fallback_method * @param string $smsFallbackUrl The sms_fallback_url * @param string $smsMethod The sms_method * @param string $smsUrl The sms_url * @param string $voiceFallbackMethod The voice_fallback_method * @param string $voiceFallbackUrl The voice_fallback_url * @param string $voiceMethod The voice_method * @param string $voiceUrl The voice_url * @return UpdateSimOptions Options builder */ public static function update($uniqueName = Values::NONE, $callbackMethod = Values::NONE, $callbackUrl = Values::NONE, $friendlyName = Values::NONE, $ratePlan = Values::NONE, $status = Values::NONE, $commandsCallbackMethod = Values::NONE, $commandsCallbackUrl = Values::NONE, $smsFallbackMethod = Values::NONE, $smsFallbackUrl = Values::NONE, $smsMethod = Values::NONE, $smsUrl = Values::NONE, $voiceFallbackMethod = Values::NONE, $voiceFallbackUrl = Values::NONE, $voiceMethod = Values::NONE, $voiceUrl = Values::NONE) { return new UpdateSimOptions($uniqueName, $callbackMethod, $callbackUrl, $friendlyName, $ratePlan, $status, $commandsCallbackMethod, $commandsCallbackUrl, $smsFallbackMethod, $smsFallbackUrl, $smsMethod, $smsUrl, $voiceFallbackMethod, $voiceFallbackUrl, $voiceMethod, $voiceUrl); } } class ReadSimOptions extends Options { /** * @param string $status The status * @param string $iccid The iccid * @param string $ratePlan The rate_plan * @param string $eId The e_id * @param string $simRegistrationCode The sim_registration_code */ public function __construct($status = Values::NONE, $iccid = Values::NONE, $ratePlan = Values::NONE, $eId = Values::NONE, $simRegistrationCode = Values::NONE) { $this->options['status'] = $status; $this->options['iccid'] = $iccid; $this->options['ratePlan'] = $ratePlan; $this->options['eId'] = $eId; $this->options['simRegistrationCode'] = $simRegistrationCode; } /** * The status * * @param string $status The status * @return $this Fluent Builder */ public function setStatus($status) { $this->options['status'] = $status; return $this; } /** * The iccid * * @param string $iccid The iccid * @return $this Fluent Builder */ public function setIccid($iccid) { $this->options['iccid'] = $iccid; return $this; } /** * The rate_plan * * @param string $ratePlan The rate_plan * @return $this Fluent Builder */ public function setRatePlan($ratePlan) { $this->options['ratePlan'] = $ratePlan; return $this; } /** * The e_id * * @param string $eId The e_id * @return $this Fluent Builder */ public function setEId($eId) { $this->options['eId'] = $eId; return $this; } /** * The sim_registration_code * * @param string $simRegistrationCode The sim_registration_code * @return $this Fluent Builder */ public function setSimRegistrationCode($simRegistrationCode) { $this->options['simRegistrationCode'] = $simRegistrationCode; 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.Preview.Wireless.ReadSimOptions ' . \implode(' ', $options) . ']'; } } class UpdateSimOptions extends Options { /** * @param string $uniqueName The unique_name * @param string $callbackMethod The callback_method * @param string $callbackUrl The callback_url * @param string $friendlyName The friendly_name * @param string $ratePlan The rate_plan * @param string $status The status * @param string $commandsCallbackMethod The commands_callback_method * @param string $commandsCallbackUrl The commands_callback_url * @param string $smsFallbackMethod The sms_fallback_method * @param string $smsFallbackUrl The sms_fallback_url * @param string $smsMethod The sms_method * @param string $smsUrl The sms_url * @param string $voiceFallbackMethod The voice_fallback_method * @param string $voiceFallbackUrl The voice_fallback_url * @param string $voiceMethod The voice_method * @param string $voiceUrl The voice_url */ public function __construct($uniqueName = Values::NONE, $callbackMethod = Values::NONE, $callbackUrl = Values::NONE, $friendlyName = Values::NONE, $ratePlan = Values::NONE, $status = Values::NONE, $commandsCallbackMethod = Values::NONE, $commandsCallbackUrl = Values::NONE, $smsFallbackMethod = Values::NONE, $smsFallbackUrl = Values::NONE, $smsMethod = Values::NONE, $smsUrl = Values::NONE, $voiceFallbackMethod = Values::NONE, $voiceFallbackUrl = Values::NONE, $voiceMethod = Values::NONE, $voiceUrl = Values::NONE) { $this->options['uniqueName'] = $uniqueName; $this->options['callbackMethod'] = $callbackMethod; $this->options['callbackUrl'] = $callbackUrl; $this->options['friendlyName'] = $friendlyName; $this->options['ratePlan'] = $ratePlan; $this->options['status'] = $status; $this->options['commandsCallbackMethod'] = $commandsCallbackMethod; $this->options['commandsCallbackUrl'] = $commandsCallbackUrl; $this->options['smsFallbackMethod'] = $smsFallbackMethod; $this->options['smsFallbackUrl'] = $smsFallbackUrl; $this->options['smsMethod'] = $smsMethod; $this->options['smsUrl'] = $smsUrl; $this->options['voiceFallbackMethod'] = $voiceFallbackMethod; $this->options['voiceFallbackUrl'] = $voiceFallbackUrl; $this->options['voiceMethod'] = $voiceMethod; $this->options['voiceUrl'] = $voiceUrl; } /** * The unique_name * * @param string $uniqueName The unique_name * @return $this Fluent Builder */ public function setUniqueName($uniqueName) { $this->options['uniqueName'] = $uniqueName; return $this; } /** * The callback_method * * @param string $callbackMethod The callback_method * @return $this Fluent Builder */ public function setCallbackMethod($callbackMethod) { $this->options['callbackMethod'] = $callbackMethod; return $this; } /** * The callback_url * * @param string $callbackUrl The callback_url * @return $this Fluent Builder */ public function setCallbackUrl($callbackUrl) { $this->options['callbackUrl'] = $callbackUrl; return $this; } /** * The friendly_name * * @param string $friendlyName The friendly_name * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The rate_plan * * @param string $ratePlan The rate_plan * @return $this Fluent Builder */ public function setRatePlan($ratePlan) { $this->options['ratePlan'] = $ratePlan; return $this; } /** * The status * * @param string $status The status * @return $this Fluent Builder */ public function setStatus($status) { $this->options['status'] = $status; return $this; } /** * The commands_callback_method * * @param string $commandsCallbackMethod The commands_callback_method * @return $this Fluent Builder */ public function setCommandsCallbackMethod($commandsCallbackMethod) { $this->options['commandsCallbackMethod'] = $commandsCallbackMethod; return $this; } /** * The commands_callback_url * * @param string $commandsCallbackUrl The commands_callback_url * @return $this Fluent Builder */ public function setCommandsCallbackUrl($commandsCallbackUrl) { $this->options['commandsCallbackUrl'] = $commandsCallbackUrl; return $this; } /** * The sms_fallback_method * * @param string $smsFallbackMethod The sms_fallback_method * @return $this Fluent Builder */ public function setSmsFallbackMethod($smsFallbackMethod) { $this->options['smsFallbackMethod'] = $smsFallbackMethod; return $this; } /** * The sms_fallback_url * * @param string $smsFallbackUrl The sms_fallback_url * @return $this Fluent Builder */ public function setSmsFallbackUrl($smsFallbackUrl) { $this->options['smsFallbackUrl'] = $smsFallbackUrl; return $this; } /** * The sms_method * * @param string $smsMethod The sms_method * @return $this Fluent Builder */ public function setSmsMethod($smsMethod) { $this->options['smsMethod'] = $smsMethod; return $this; } /** * The sms_url * * @param string $smsUrl The sms_url * @return $this Fluent Builder */ public function setSmsUrl($smsUrl) { $this->options['smsUrl'] = $smsUrl; return $this; } /** * The voice_fallback_method * * @param string $voiceFallbackMethod The voice_fallback_method * @return $this Fluent Builder */ public function setVoiceFallbackMethod($voiceFallbackMethod) { $this->options['voiceFallbackMethod'] = $voiceFallbackMethod; return $this; } /** * The voice_fallback_url * * @param string $voiceFallbackUrl The voice_fallback_url * @return $this Fluent Builder */ public function setVoiceFallbackUrl($voiceFallbackUrl) { $this->options['voiceFallbackUrl'] = $voiceFallbackUrl; return $this; } /** * The voice_method * * @param string $voiceMethod The voice_method * @return $this Fluent Builder */ public function setVoiceMethod($voiceMethod) { $this->options['voiceMethod'] = $voiceMethod; return $this; } /** * The voice_url * * @param string $voiceUrl The voice_url * @return $this Fluent Builder */ public function setVoiceUrl($voiceUrl) { $this->options['voiceUrl'] = $voiceUrl; 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.Preview.Wireless.UpdateSimOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Preview/Wireless/RatePlanInstance.php 0000644 00000011666 15002236443 0017433 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Wireless; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $sid * @property string $uniqueName * @property string $accountSid * @property string $friendlyName * @property bool $dataEnabled * @property string $dataMetering * @property int $dataLimit * @property bool $messagingEnabled * @property bool $voiceEnabled * @property bool $nationalRoamingEnabled * @property string $internationalRoaming * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $url */ class RatePlanInstance extends InstanceResource { /** * Initialize the RatePlanInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The sid * @return \Twilio\Rest\Preview\Wireless\RatePlanInstance */ public function __construct(Version $version, array $payload, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'sid' => Values::array_get($payload, 'sid'), 'uniqueName' => Values::array_get($payload, 'unique_name'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'dataEnabled' => Values::array_get($payload, 'data_enabled'), 'dataMetering' => Values::array_get($payload, 'data_metering'), 'dataLimit' => Values::array_get($payload, 'data_limit'), 'messagingEnabled' => Values::array_get($payload, 'messaging_enabled'), 'voiceEnabled' => Values::array_get($payload, 'voice_enabled'), 'nationalRoamingEnabled' => Values::array_get($payload, 'national_roaming_enabled'), 'internationalRoaming' => Values::array_get($payload, 'international_roaming'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), ); $this->solution = array('sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Preview\Wireless\RatePlanContext Context for this * RatePlanInstance */ protected function proxy() { if (!$this->context) { $this->context = new RatePlanContext($this->version, $this->solution['sid']); } return $this->context; } /** * Fetch a RatePlanInstance * * @return RatePlanInstance Fetched RatePlanInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Update the RatePlanInstance * * @param array|Options $options Optional Arguments * @return RatePlanInstance Updated RatePlanInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Deletes the RatePlanInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.Wireless.RatePlanInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/Wireless/CommandOptions.php 0000644 00000014177 15002236443 0017172 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Wireless; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ abstract class CommandOptions { /** * @param string $device The device * @param string $sim The sim * @param string $status The status * @param string $direction The direction * @return ReadCommandOptions Options builder */ public static function read($device = Values::NONE, $sim = Values::NONE, $status = Values::NONE, $direction = Values::NONE) { return new ReadCommandOptions($device, $sim, $status, $direction); } /** * @param string $device The device * @param string $sim The sim * @param string $callbackMethod The callback_method * @param string $callbackUrl The callback_url * @param string $commandMode The command_mode * @param string $includeSid The include_sid * @return CreateCommandOptions Options builder */ public static function create($device = Values::NONE, $sim = Values::NONE, $callbackMethod = Values::NONE, $callbackUrl = Values::NONE, $commandMode = Values::NONE, $includeSid = Values::NONE) { return new CreateCommandOptions($device, $sim, $callbackMethod, $callbackUrl, $commandMode, $includeSid); } } class ReadCommandOptions extends Options { /** * @param string $device The device * @param string $sim The sim * @param string $status The status * @param string $direction The direction */ public function __construct($device = Values::NONE, $sim = Values::NONE, $status = Values::NONE, $direction = Values::NONE) { $this->options['device'] = $device; $this->options['sim'] = $sim; $this->options['status'] = $status; $this->options['direction'] = $direction; } /** * The device * * @param string $device The device * @return $this Fluent Builder */ public function setDevice($device) { $this->options['device'] = $device; return $this; } /** * The sim * * @param string $sim The sim * @return $this Fluent Builder */ public function setSim($sim) { $this->options['sim'] = $sim; return $this; } /** * The status * * @param string $status The status * @return $this Fluent Builder */ public function setStatus($status) { $this->options['status'] = $status; return $this; } /** * The direction * * @param string $direction The direction * @return $this Fluent Builder */ public function setDirection($direction) { $this->options['direction'] = $direction; 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.Preview.Wireless.ReadCommandOptions ' . \implode(' ', $options) . ']'; } } class CreateCommandOptions extends Options { /** * @param string $device The device * @param string $sim The sim * @param string $callbackMethod The callback_method * @param string $callbackUrl The callback_url * @param string $commandMode The command_mode * @param string $includeSid The include_sid */ public function __construct($device = Values::NONE, $sim = Values::NONE, $callbackMethod = Values::NONE, $callbackUrl = Values::NONE, $commandMode = Values::NONE, $includeSid = Values::NONE) { $this->options['device'] = $device; $this->options['sim'] = $sim; $this->options['callbackMethod'] = $callbackMethod; $this->options['callbackUrl'] = $callbackUrl; $this->options['commandMode'] = $commandMode; $this->options['includeSid'] = $includeSid; } /** * The device * * @param string $device The device * @return $this Fluent Builder */ public function setDevice($device) { $this->options['device'] = $device; return $this; } /** * The sim * * @param string $sim The sim * @return $this Fluent Builder */ public function setSim($sim) { $this->options['sim'] = $sim; return $this; } /** * The callback_method * * @param string $callbackMethod The callback_method * @return $this Fluent Builder */ public function setCallbackMethod($callbackMethod) { $this->options['callbackMethod'] = $callbackMethod; return $this; } /** * The callback_url * * @param string $callbackUrl The callback_url * @return $this Fluent Builder */ public function setCallbackUrl($callbackUrl) { $this->options['callbackUrl'] = $callbackUrl; return $this; } /** * The command_mode * * @param string $commandMode The command_mode * @return $this Fluent Builder */ public function setCommandMode($commandMode) { $this->options['commandMode'] = $commandMode; return $this; } /** * The include_sid * * @param string $includeSid The include_sid * @return $this Fluent Builder */ public function setIncludeSid($includeSid) { $this->options['includeSid'] = $includeSid; 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.Preview.Wireless.CreateCommandOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Preview/DeployedDevices.php 0000644 00000004634 15002236443 0015510 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\Rest\Preview\DeployedDevices\FleetList; use Twilio\Version; /** * @property \Twilio\Rest\Preview\DeployedDevices\FleetList $fleets * @method \Twilio\Rest\Preview\DeployedDevices\FleetContext fleets(string $sid) */ class DeployedDevices extends Version { protected $_fleets = null; /** * Construct the DeployedDevices version of Preview * * @param \Twilio\Domain $domain Domain that contains the version * @return \Twilio\Rest\Preview\DeployedDevices DeployedDevices version of * Preview */ public function __construct(Domain $domain) { parent::__construct($domain); $this->version = 'DeployedDevices'; } /** * @return \Twilio\Rest\Preview\DeployedDevices\FleetList */ protected function getFleets() { if (!$this->_fleets) { $this->_fleets = new FleetList($this); } return $this->_fleets; } /** * Magic getter to lazy load root resources * * @param string $name Resource to return * @return \Twilio\ListResource The requested resource * @throws TwilioException For unknown resource */ public function __get($name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown resource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Preview.DeployedDevices]'; } } sdk/src/Twilio/Rest/Preview/Understand.php 0000644 00000004546 15002236443 0014551 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\Rest\Preview\Understand\AssistantList; use Twilio\Version; /** * @property \Twilio\Rest\Preview\Understand\AssistantList $assistants * @method \Twilio\Rest\Preview\Understand\AssistantContext assistants(string $sid) */ class Understand extends Version { protected $_assistants = null; /** * Construct the Understand version of Preview * * @param \Twilio\Domain $domain Domain that contains the version * @return \Twilio\Rest\Preview\Understand Understand version of Preview */ public function __construct(Domain $domain) { parent::__construct($domain); $this->version = 'understand'; } /** * @return \Twilio\Rest\Preview\Understand\AssistantList */ protected function getAssistants() { if (!$this->_assistants) { $this->_assistants = new AssistantList($this); } return $this->_assistants; } /** * Magic getter to lazy load root resources * * @param string $name Resource to return * @return \Twilio\ListResource The requested resource * @throws TwilioException For unknown resource */ public function __get($name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown resource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Preview.Understand]'; } } sdk/src/Twilio/Rest/Preview/TrustedComms/PhoneCallPage.php 0000644 00000001665 15002236443 0017534 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\TrustedComms; use Twilio\Page; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class PhoneCallPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new PhoneCallInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Preview.TrustedComms.PhoneCallPage]'; } } sdk/src/Twilio/Rest/Preview/TrustedComms/BusinessInstance.php 0000644 00000006660 15002236443 0020352 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\TrustedComms; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $accountSid * @property string $sid * @property string $url * @property array $links */ class BusinessInstance extends InstanceResource { protected $_insights = null; /** * Initialize the BusinessInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid A string that uniquely identifies this Business. * @return \Twilio\Rest\Preview\TrustedComms\BusinessInstance */ public function __construct(Version $version, array $payload, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'accountSid' => Values::array_get($payload, 'account_sid'), 'sid' => Values::array_get($payload, 'sid'), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ); $this->solution = array('sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Preview\TrustedComms\BusinessContext Context for this * BusinessInstance */ protected function proxy() { if (!$this->context) { $this->context = new BusinessContext($this->version, $this->solution['sid']); } return $this->context; } /** * Fetch a BusinessInstance * * @return BusinessInstance Fetched BusinessInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Access the insights * * @return \Twilio\Rest\Preview\TrustedComms\Business\InsightsList */ protected function getInsights() { return $this->proxy()->insights; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.TrustedComms.BusinessInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/TrustedComms/BrandedCallOptions.php 0000644 00000003302 15002236443 0020567 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\TrustedComms; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ abstract class BrandedCallOptions { /** * @param string $callSid The Call sid this Branded Call should link to * @return CreateBrandedCallOptions Options builder */ public static function create($callSid = Values::NONE) { return new CreateBrandedCallOptions($callSid); } } class CreateBrandedCallOptions extends Options { /** * @param string $callSid The Call sid this Branded Call should link to */ public function __construct($callSid = Values::NONE) { $this->options['callSid'] = $callSid; } /** * The Call sid this Branded Call should link to. * * @param string $callSid The Call sid this Branded Call should link to * @return $this Fluent Builder */ public function setCallSid($callSid) { $this->options['callSid'] = $callSid; 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.Preview.TrustedComms.CreateBrandedCallOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Preview/TrustedComms/PhoneCallInstance.php 0000644 00000007006 15002236443 0020417 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\TrustedComms; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $accountSid * @property string $bgColor * @property string $brandSid * @property string $brandedChannelSid * @property string $businessSid * @property string $callSid * @property string $caller * @property \DateTime $createdAt * @property string $fontColor * @property string $from * @property string $logo * @property string $phoneNumberSid * @property string $reason * @property string $sid * @property string $status * @property string $to * @property string $url * @property string $useCase */ class PhoneCallInstance extends InstanceResource { /** * Initialize the PhoneCallInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @return \Twilio\Rest\Preview\TrustedComms\PhoneCallInstance */ public function __construct(Version $version, array $payload) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'accountSid' => Values::array_get($payload, 'account_sid'), 'bgColor' => Values::array_get($payload, 'bg_color'), 'brandSid' => Values::array_get($payload, 'brand_sid'), 'brandedChannelSid' => Values::array_get($payload, 'branded_channel_sid'), 'businessSid' => Values::array_get($payload, 'business_sid'), 'callSid' => Values::array_get($payload, 'call_sid'), 'caller' => Values::array_get($payload, 'caller'), 'createdAt' => Deserialize::dateTime(Values::array_get($payload, 'created_at')), 'fontColor' => Values::array_get($payload, 'font_color'), 'from' => Values::array_get($payload, 'from'), 'logo' => Values::array_get($payload, 'logo'), 'phoneNumberSid' => Values::array_get($payload, 'phone_number_sid'), 'reason' => Values::array_get($payload, 'reason'), 'sid' => Values::array_get($payload, 'sid'), 'status' => Values::array_get($payload, 'status'), 'to' => Values::array_get($payload, 'to'), 'url' => Values::array_get($payload, 'url'), 'useCase' => Values::array_get($payload, 'use_case'), ); $this->solution = array(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Preview.TrustedComms.PhoneCallInstance]'; } } sdk/src/Twilio/Rest/Preview/TrustedComms/CurrentCallPage.php 0000644 00000001673 15002236443 0020104 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\TrustedComms; use Twilio\Page; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class CurrentCallPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new CurrentCallInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Preview.TrustedComms.CurrentCallPage]'; } } sdk/src/Twilio/Rest/Preview/TrustedComms/DeviceInstance.php 0000644 00000004202 15002236443 0017744 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\TrustedComms; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $bindingSid * @property string $phoneNumber * @property string $sid * @property string $url */ class DeviceInstance extends InstanceResource { /** * Initialize the DeviceInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @return \Twilio\Rest\Preview\TrustedComms\DeviceInstance */ public function __construct(Version $version, array $payload) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'bindingSid' => Values::array_get($payload, 'binding_sid'), 'phoneNumber' => Values::array_get($payload, 'phone_number'), 'sid' => Values::array_get($payload, 'sid'), 'url' => Values::array_get($payload, 'url'), ); $this->solution = array(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Preview.TrustedComms.DeviceInstance]'; } } sdk/src/Twilio/Rest/Preview/TrustedComms/BrandedCallInstance.php 0000644 00000007016 15002236443 0020706 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\TrustedComms; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $accountSid * @property string $bgColor * @property string $brandSid * @property string $brandedChannelSid * @property string $businessSid * @property string $callSid * @property string $caller * @property \DateTime $createdAt * @property string $fontColor * @property string $from * @property string $logo * @property string $phoneNumberSid * @property string $reason * @property string $sid * @property string $status * @property string $to * @property string $url * @property string $useCase */ class BrandedCallInstance extends InstanceResource { /** * Initialize the BrandedCallInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @return \Twilio\Rest\Preview\TrustedComms\BrandedCallInstance */ public function __construct(Version $version, array $payload) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'accountSid' => Values::array_get($payload, 'account_sid'), 'bgColor' => Values::array_get($payload, 'bg_color'), 'brandSid' => Values::array_get($payload, 'brand_sid'), 'brandedChannelSid' => Values::array_get($payload, 'branded_channel_sid'), 'businessSid' => Values::array_get($payload, 'business_sid'), 'callSid' => Values::array_get($payload, 'call_sid'), 'caller' => Values::array_get($payload, 'caller'), 'createdAt' => Deserialize::dateTime(Values::array_get($payload, 'created_at')), 'fontColor' => Values::array_get($payload, 'font_color'), 'from' => Values::array_get($payload, 'from'), 'logo' => Values::array_get($payload, 'logo'), 'phoneNumberSid' => Values::array_get($payload, 'phone_number_sid'), 'reason' => Values::array_get($payload, 'reason'), 'sid' => Values::array_get($payload, 'sid'), 'status' => Values::array_get($payload, 'status'), 'to' => Values::array_get($payload, 'to'), 'url' => Values::array_get($payload, 'url'), 'useCase' => Values::array_get($payload, 'use_case'), ); $this->solution = array(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Preview.TrustedComms.BrandedCallInstance]'; } } sdk/src/Twilio/Rest/Preview/TrustedComms/CpsList.php 0000644 00000002261 15002236443 0016444 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\TrustedComms; use Twilio\ListResource; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class CpsList extends ListResource { /** * Construct the CpsList * * @param Version $version Version that contains the resource * @return \Twilio\Rest\Preview\TrustedComms\CpsList */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = array(); } /** * Constructs a CpsContext * * @return \Twilio\Rest\Preview\TrustedComms\CpsContext */ public function getContext() { return new CpsContext($this->version); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Preview.TrustedComms.CpsList]'; } } sdk/src/Twilio/Rest/Preview/TrustedComms/CurrentCallInstance.php 0000644 00000010120 15002236443 0020757 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\TrustedComms; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $bgColor * @property string $caller * @property \DateTime $createdAt * @property string $fontColor * @property string $from * @property string $logo * @property string $manager * @property string $reason * @property string $shieldImg * @property string $sid * @property string $status * @property string $to * @property string $url * @property string $useCase */ class CurrentCallInstance extends InstanceResource { /** * Initialize the CurrentCallInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @return \Twilio\Rest\Preview\TrustedComms\CurrentCallInstance */ public function __construct(Version $version, array $payload) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'bgColor' => Values::array_get($payload, 'bg_color'), 'caller' => Values::array_get($payload, 'caller'), 'createdAt' => Deserialize::dateTime(Values::array_get($payload, 'created_at')), 'fontColor' => Values::array_get($payload, 'font_color'), 'from' => Values::array_get($payload, 'from'), 'logo' => Values::array_get($payload, 'logo'), 'manager' => Values::array_get($payload, 'manager'), 'reason' => Values::array_get($payload, 'reason'), 'shieldImg' => Values::array_get($payload, 'shield_img'), 'sid' => Values::array_get($payload, 'sid'), 'status' => Values::array_get($payload, 'status'), 'to' => Values::array_get($payload, 'to'), 'url' => Values::array_get($payload, 'url'), 'useCase' => Values::array_get($payload, 'use_case'), ); $this->solution = array(); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Preview\TrustedComms\CurrentCallContext Context for * this * CurrentCallInstance */ protected function proxy() { if (!$this->context) { $this->context = new CurrentCallContext($this->version); } return $this->context; } /** * Fetch a CurrentCallInstance * * @return CurrentCallInstance Fetched CurrentCallInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.TrustedComms.CurrentCallInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/TrustedComms/BusinessList.php 0000644 00000002451 15002236443 0017513 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\TrustedComms; use Twilio\ListResource; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class BusinessList extends ListResource { /** * Construct the BusinessList * * @param Version $version Version that contains the resource * @return \Twilio\Rest\Preview\TrustedComms\BusinessList */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = array(); } /** * Constructs a BusinessContext * * @param string $sid A string that uniquely identifies this Business. * @return \Twilio\Rest\Preview\TrustedComms\BusinessContext */ public function getContext($sid) { return new BusinessContext($this->version, $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Preview.TrustedComms.BusinessList]'; } } sdk/src/Twilio/Rest/Preview/TrustedComms/DevicePage.php 0000644 00000001654 15002236443 0017064 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\TrustedComms; use Twilio\Page; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class DevicePage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new DeviceInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Preview.TrustedComms.DevicePage]'; } } sdk/src/Twilio/Rest/Preview/TrustedComms/CpsPage.php 0000644 00000001643 15002236443 0016410 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\TrustedComms; use Twilio\Page; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class CpsPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new CpsInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Preview.TrustedComms.CpsPage]'; } } sdk/src/Twilio/Rest/Preview/TrustedComms/CpsContext.php 0000644 00000003224 15002236443 0017155 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\TrustedComms; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class CpsContext extends InstanceContext { /** * Initialize the CpsContext * * @param \Twilio\Version $version Version that contains the resource * @return \Twilio\Rest\Preview\TrustedComms\CpsContext */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = array(); $this->uri = '/CPS'; } /** * Fetch a CpsInstance * * @return CpsInstance Fetched CpsInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new CpsInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.TrustedComms.CpsContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/TrustedComms/CpsInstance.php 0000644 00000005642 15002236443 0017303 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\TrustedComms; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $cpsUrl * @property string $phoneNumber * @property string $url */ class CpsInstance extends InstanceResource { /** * Initialize the CpsInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @return \Twilio\Rest\Preview\TrustedComms\CpsInstance */ public function __construct(Version $version, array $payload) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'cpsUrl' => Values::array_get($payload, 'cps_url'), 'phoneNumber' => Values::array_get($payload, 'phone_number'), 'url' => Values::array_get($payload, 'url'), ); $this->solution = array(); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Preview\TrustedComms\CpsContext Context for this * CpsInstance */ protected function proxy() { if (!$this->context) { $this->context = new CpsContext($this->version); } return $this->context; } /** * Fetch a CpsInstance * * @return CpsInstance Fetched CpsInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.TrustedComms.CpsInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/TrustedComms/BusinessPage.php 0000644 00000001662 15002236443 0017457 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\TrustedComms; use Twilio\Page; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class BusinessPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new BusinessInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Preview.TrustedComms.BusinessPage]'; } } sdk/src/Twilio/Rest/Preview/TrustedComms/CurrentCallContext.php 0000644 00000003334 15002236443 0020650 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\TrustedComms; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class CurrentCallContext extends InstanceContext { /** * Initialize the CurrentCallContext * * @param \Twilio\Version $version Version that contains the resource * @return \Twilio\Rest\Preview\TrustedComms\CurrentCallContext */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = array(); $this->uri = '/CurrentCall'; } /** * Fetch a CurrentCallInstance * * @return CurrentCallInstance Fetched CurrentCallInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new CurrentCallInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.TrustedComms.CurrentCallContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/TrustedComms/CurrentCallList.php 0000644 00000002351 15002236443 0020135 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\TrustedComms; use Twilio\ListResource; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class CurrentCallList extends ListResource { /** * Construct the CurrentCallList * * @param Version $version Version that contains the resource * @return \Twilio\Rest\Preview\TrustedComms\CurrentCallList */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = array(); } /** * Constructs a CurrentCallContext * * @return \Twilio\Rest\Preview\TrustedComms\CurrentCallContext */ public function getContext() { return new CurrentCallContext($this->version); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Preview.TrustedComms.CurrentCallList]'; } } sdk/src/Twilio/Rest/Preview/TrustedComms/DeviceList.php 0000644 00000003343 15002236443 0017120 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\TrustedComms; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class DeviceList extends ListResource { /** * Construct the DeviceList * * @param Version $version Version that contains the resource * @return \Twilio\Rest\Preview\TrustedComms\DeviceList */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = array(); $this->uri = '/Devices'; } /** * Create a new DeviceInstance * * @param string $phoneNumber The end user Phone Number * @param string $pushToken The Push Token for this Phone Number * @return DeviceInstance Newly created DeviceInstance * @throws TwilioException When an HTTP error occurs. */ public function create($phoneNumber, $pushToken) { $data = Values::of(array('PhoneNumber' => $phoneNumber, 'PushToken' => $pushToken, )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new DeviceInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Preview.TrustedComms.DeviceList]'; } } sdk/src/Twilio/Rest/Preview/TrustedComms/PhoneCallList.php 0000644 00000007131 15002236443 0017565 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\TrustedComms; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class PhoneCallList extends ListResource { /** * Construct the PhoneCallList * * @param Version $version Version that contains the resource * @return \Twilio\Rest\Preview\TrustedComms\PhoneCallList */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = array(); $this->uri = '/Business/PhoneCalls'; } /** * Create a new PhoneCallInstance * * @param string $from Twilio number from which to originate the call * @param string $to The terminating Phone Number * @param array|Options $options Optional Arguments * @return PhoneCallInstance Newly created PhoneCallInstance * @throws TwilioException When an HTTP error occurs. */ public function create($from, $to, $options = array()) { $options = new Values($options); $data = Values::of(array( 'From' => $from, 'To' => $to, 'Reason' => $options['reason'], 'ApplicationSid' => $options['applicationSid'], 'CallerId' => $options['callerId'], 'FallbackMethod' => $options['fallbackMethod'], 'FallbackUrl' => $options['fallbackUrl'], 'MachineDetection' => $options['machineDetection'], 'MachineDetectionSilenceTimeout' => $options['machineDetectionSilenceTimeout'], 'MachineDetectionSpeechEndThreshold' => $options['machineDetectionSpeechEndThreshold'], 'MachineDetectionSpeechThreshold' => $options['machineDetectionSpeechThreshold'], 'MachineDetectionTimeout' => $options['machineDetectionTimeout'], 'Method' => $options['method'], 'Record' => Serialize::booleanToString($options['record']), 'RecordingChannels' => $options['recordingChannels'], 'RecordingStatusCallback' => $options['recordingStatusCallback'], 'RecordingStatusCallbackEvent' => Serialize::map($options['recordingStatusCallbackEvent'], function($e) { return $e; }), 'RecordingStatusCallbackMethod' => $options['recordingStatusCallbackMethod'], 'SendDigits' => $options['sendDigits'], 'SipAuthPassword' => $options['sipAuthPassword'], 'SipAuthUsername' => $options['sipAuthUsername'], 'StatusCallback' => $options['statusCallback'], 'StatusCallbackEvent' => Serialize::map($options['statusCallbackEvent'], function($e) { return $e; }), 'StatusCallbackMethod' => $options['statusCallbackMethod'], 'Timeout' => $options['timeout'], 'Trim' => $options['trim'], 'Url' => $options['url'], )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new PhoneCallInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Preview.TrustedComms.PhoneCallList]'; } } sdk/src/Twilio/Rest/Preview/TrustedComms/BusinessContext.php 0000644 00000006626 15002236443 0020234 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\TrustedComms; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Rest\Preview\TrustedComms\Business\InsightsList; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property \Twilio\Rest\Preview\TrustedComms\Business\InsightsList $insights */ class BusinessContext extends InstanceContext { protected $_insights = null; /** * Initialize the BusinessContext * * @param \Twilio\Version $version Version that contains the resource * @param string $sid A string that uniquely identifies this Business. * @return \Twilio\Rest\Preview\TrustedComms\BusinessContext */ public function __construct(Version $version, $sid) { parent::__construct($version); // Path Solution $this->solution = array('sid' => $sid, ); $this->uri = '/Businesses/' . \rawurlencode($sid) . ''; } /** * Fetch a BusinessInstance * * @return BusinessInstance Fetched BusinessInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new BusinessInstance($this->version, $payload, $this->solution['sid']); } /** * Access the insights * * @return \Twilio\Rest\Preview\TrustedComms\Business\InsightsList */ protected function getInsights() { if (!$this->_insights) { $this->_insights = new InsightsList($this->version, $this->solution['sid']); } return $this->_insights; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get($name) { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.TrustedComms.BusinessContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/TrustedComms/BrandedCallPage.php 0000644 00000001673 15002236443 0020021 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\TrustedComms; use Twilio\Page; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class BrandedCallPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new BrandedCallInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Preview.TrustedComms.BrandedCallPage]'; } } sdk/src/Twilio/Rest/Preview/TrustedComms/BrandedCallList.php 0000644 00000004062 15002236443 0020053 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\TrustedComms; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class BrandedCallList extends ListResource { /** * Construct the BrandedCallList * * @param Version $version Version that contains the resource * @return \Twilio\Rest\Preview\TrustedComms\BrandedCallList */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = array(); $this->uri = '/Business/BrandedCalls'; } /** * Create a new BrandedCallInstance * * @param string $from Twilio number from which to brand the call * @param string $to The terminating Phone Number * @param string $reason The business reason for this phone call * @param array|Options $options Optional Arguments * @return BrandedCallInstance Newly created BrandedCallInstance * @throws TwilioException When an HTTP error occurs. */ public function create($from, $to, $reason, $options = array()) { $options = new Values($options); $data = Values::of(array( 'From' => $from, 'To' => $to, 'Reason' => $reason, 'CallSid' => $options['callSid'], )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new BrandedCallInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Preview.TrustedComms.BrandedCallList]'; } } sdk/src/Twilio/Rest/Preview/TrustedComms/PhoneCallOptions.php 0000644 00000053535 15002236443 0020316 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\TrustedComms; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ abstract class PhoneCallOptions { /** * @param string $reason The business reason for this phone call * @param string $applicationSid Refers to the Voice API Initiate Call parameter * @param string $callerId Refers to the Voice API Initiate Call parameter * @param string $fallbackMethod Refers to the Voice API Initiate Call parameter * @param string $fallbackUrl Refers to the Voice API Initiate Call parameter * @param string $machineDetection Refers to the Voice API Initiate Call * parameter * @param int $machineDetectionSilenceTimeout Refers to the Voice API Initiate * Call parameter * @param int $machineDetectionSpeechEndThreshold Refers to the Voice API * Initiate Call parameter * @param int $machineDetectionSpeechThreshold Refers to the Voice API Initiate * Call parameter * @param int $machineDetectionTimeout Refers to the Voice API Initiate Call * parameter * @param string $method Refers to the Voice API Initiate Call parameter * @param bool $record Refers to the Voice API Initiate Call parameter * @param string $recordingChannels Refers to the Voice API Initiate Call * parameter * @param string $recordingStatusCallback Refers to the Voice API Initiate Call * parameter * @param string $recordingStatusCallbackEvent Refers to the Voice API Initiate * Call parameter * @param string $recordingStatusCallbackMethod Refers to the Voice API * Initiate Call parameter * @param string $sendDigits Refers to the Voice API Initiate Call parameter * @param string $sipAuthPassword Refers to the Voice API Initiate Call * parameter * @param string $sipAuthUsername Refers to the Voice API Initiate Call * parameter * @param string $statusCallback Refers to the Voice API Initiate Call parameter * @param string $statusCallbackEvent Refers to the Voice API Initiate Call * parameter * @param string $statusCallbackMethod Refers to the Voice API Initiate Call * parameter * @param int $timeout Refers to the Voice API Initiate Call parameter * @param string $trim Refers to the Voice API Initiate Call parameter * @param string $url Refers to the Voice API Initiate Call parameter * @return CreatePhoneCallOptions Options builder */ public static function create($reason = Values::NONE, $applicationSid = Values::NONE, $callerId = Values::NONE, $fallbackMethod = Values::NONE, $fallbackUrl = Values::NONE, $machineDetection = Values::NONE, $machineDetectionSilenceTimeout = Values::NONE, $machineDetectionSpeechEndThreshold = Values::NONE, $machineDetectionSpeechThreshold = Values::NONE, $machineDetectionTimeout = Values::NONE, $method = Values::NONE, $record = Values::NONE, $recordingChannels = Values::NONE, $recordingStatusCallback = Values::NONE, $recordingStatusCallbackEvent = Values::NONE, $recordingStatusCallbackMethod = Values::NONE, $sendDigits = Values::NONE, $sipAuthPassword = Values::NONE, $sipAuthUsername = Values::NONE, $statusCallback = Values::NONE, $statusCallbackEvent = Values::NONE, $statusCallbackMethod = Values::NONE, $timeout = Values::NONE, $trim = Values::NONE, $url = Values::NONE) { return new CreatePhoneCallOptions($reason, $applicationSid, $callerId, $fallbackMethod, $fallbackUrl, $machineDetection, $machineDetectionSilenceTimeout, $machineDetectionSpeechEndThreshold, $machineDetectionSpeechThreshold, $machineDetectionTimeout, $method, $record, $recordingChannels, $recordingStatusCallback, $recordingStatusCallbackEvent, $recordingStatusCallbackMethod, $sendDigits, $sipAuthPassword, $sipAuthUsername, $statusCallback, $statusCallbackEvent, $statusCallbackMethod, $timeout, $trim, $url); } } class CreatePhoneCallOptions extends Options { /** * @param string $reason The business reason for this phone call * @param string $applicationSid Refers to the Voice API Initiate Call parameter * @param string $callerId Refers to the Voice API Initiate Call parameter * @param string $fallbackMethod Refers to the Voice API Initiate Call parameter * @param string $fallbackUrl Refers to the Voice API Initiate Call parameter * @param string $machineDetection Refers to the Voice API Initiate Call * parameter * @param int $machineDetectionSilenceTimeout Refers to the Voice API Initiate * Call parameter * @param int $machineDetectionSpeechEndThreshold Refers to the Voice API * Initiate Call parameter * @param int $machineDetectionSpeechThreshold Refers to the Voice API Initiate * Call parameter * @param int $machineDetectionTimeout Refers to the Voice API Initiate Call * parameter * @param string $method Refers to the Voice API Initiate Call parameter * @param bool $record Refers to the Voice API Initiate Call parameter * @param string $recordingChannels Refers to the Voice API Initiate Call * parameter * @param string $recordingStatusCallback Refers to the Voice API Initiate Call * parameter * @param string $recordingStatusCallbackEvent Refers to the Voice API Initiate * Call parameter * @param string $recordingStatusCallbackMethod Refers to the Voice API * Initiate Call parameter * @param string $sendDigits Refers to the Voice API Initiate Call parameter * @param string $sipAuthPassword Refers to the Voice API Initiate Call * parameter * @param string $sipAuthUsername Refers to the Voice API Initiate Call * parameter * @param string $statusCallback Refers to the Voice API Initiate Call parameter * @param string $statusCallbackEvent Refers to the Voice API Initiate Call * parameter * @param string $statusCallbackMethod Refers to the Voice API Initiate Call * parameter * @param int $timeout Refers to the Voice API Initiate Call parameter * @param string $trim Refers to the Voice API Initiate Call parameter * @param string $url Refers to the Voice API Initiate Call parameter */ public function __construct($reason = Values::NONE, $applicationSid = Values::NONE, $callerId = Values::NONE, $fallbackMethod = Values::NONE, $fallbackUrl = Values::NONE, $machineDetection = Values::NONE, $machineDetectionSilenceTimeout = Values::NONE, $machineDetectionSpeechEndThreshold = Values::NONE, $machineDetectionSpeechThreshold = Values::NONE, $machineDetectionTimeout = Values::NONE, $method = Values::NONE, $record = Values::NONE, $recordingChannels = Values::NONE, $recordingStatusCallback = Values::NONE, $recordingStatusCallbackEvent = Values::NONE, $recordingStatusCallbackMethod = Values::NONE, $sendDigits = Values::NONE, $sipAuthPassword = Values::NONE, $sipAuthUsername = Values::NONE, $statusCallback = Values::NONE, $statusCallbackEvent = Values::NONE, $statusCallbackMethod = Values::NONE, $timeout = Values::NONE, $trim = Values::NONE, $url = Values::NONE) { $this->options['reason'] = $reason; $this->options['applicationSid'] = $applicationSid; $this->options['callerId'] = $callerId; $this->options['fallbackMethod'] = $fallbackMethod; $this->options['fallbackUrl'] = $fallbackUrl; $this->options['machineDetection'] = $machineDetection; $this->options['machineDetectionSilenceTimeout'] = $machineDetectionSilenceTimeout; $this->options['machineDetectionSpeechEndThreshold'] = $machineDetectionSpeechEndThreshold; $this->options['machineDetectionSpeechThreshold'] = $machineDetectionSpeechThreshold; $this->options['machineDetectionTimeout'] = $machineDetectionTimeout; $this->options['method'] = $method; $this->options['record'] = $record; $this->options['recordingChannels'] = $recordingChannels; $this->options['recordingStatusCallback'] = $recordingStatusCallback; $this->options['recordingStatusCallbackEvent'] = $recordingStatusCallbackEvent; $this->options['recordingStatusCallbackMethod'] = $recordingStatusCallbackMethod; $this->options['sendDigits'] = $sendDigits; $this->options['sipAuthPassword'] = $sipAuthPassword; $this->options['sipAuthUsername'] = $sipAuthUsername; $this->options['statusCallback'] = $statusCallback; $this->options['statusCallbackEvent'] = $statusCallbackEvent; $this->options['statusCallbackMethod'] = $statusCallbackMethod; $this->options['timeout'] = $timeout; $this->options['trim'] = $trim; $this->options['url'] = $url; } /** * The business reason for this phone call that will appear in the terminating device's screen. Max 50 characters. * * @param string $reason The business reason for this phone call * @return $this Fluent Builder */ public function setReason($reason) { $this->options['reason'] = $reason; return $this; } /** * Refers to the parameter with the same name when [initiating a call via Voice API](https://www.twilio.com/docs/voice/api/call#create-a-call-resource) * * @param string $applicationSid Refers to the Voice API Initiate Call parameter * @return $this Fluent Builder */ public function setApplicationSid($applicationSid) { $this->options['applicationSid'] = $applicationSid; return $this; } /** * Refers to the parameter with the same name when [initiating a call via Voice API](https://www.twilio.com/docs/voice/api/call#create-a-call-resource) * * @param string $callerId Refers to the Voice API Initiate Call parameter * @return $this Fluent Builder */ public function setCallerId($callerId) { $this->options['callerId'] = $callerId; return $this; } /** * Refers to the parameter with the same name when [initiating a call via Voice API](https://www.twilio.com/docs/voice/api/call#create-a-call-resource) * * @param string $fallbackMethod Refers to the Voice API Initiate Call parameter * @return $this Fluent Builder */ public function setFallbackMethod($fallbackMethod) { $this->options['fallbackMethod'] = $fallbackMethod; return $this; } /** * Refers to the parameter with the same name when [initiating a call via Voice API](https://www.twilio.com/docs/voice/api/call#create-a-call-resource) * * @param string $fallbackUrl Refers to the Voice API Initiate Call parameter * @return $this Fluent Builder */ public function setFallbackUrl($fallbackUrl) { $this->options['fallbackUrl'] = $fallbackUrl; return $this; } /** * Refers to the parameter with the same name when [initiating a call via Voice API](https://www.twilio.com/docs/voice/api/call#create-a-call-resource) * * @param string $machineDetection Refers to the Voice API Initiate Call * parameter * @return $this Fluent Builder */ public function setMachineDetection($machineDetection) { $this->options['machineDetection'] = $machineDetection; return $this; } /** * Refers to the parameter with the same name when [initiating a call via Voice API](https://www.twilio.com/docs/voice/api/call#create-a-call-resource) * * @param int $machineDetectionSilenceTimeout Refers to the Voice API Initiate * Call parameter * @return $this Fluent Builder */ public function setMachineDetectionSilenceTimeout($machineDetectionSilenceTimeout) { $this->options['machineDetectionSilenceTimeout'] = $machineDetectionSilenceTimeout; return $this; } /** * Refers to the parameter with the same name when [initiating a call via Voice API](https://www.twilio.com/docs/voice/api/call#create-a-call-resource) * * @param int $machineDetectionSpeechEndThreshold Refers to the Voice API * Initiate Call parameter * @return $this Fluent Builder */ public function setMachineDetectionSpeechEndThreshold($machineDetectionSpeechEndThreshold) { $this->options['machineDetectionSpeechEndThreshold'] = $machineDetectionSpeechEndThreshold; return $this; } /** * Refers to the parameter with the same name when [initiating a call via Voice API](https://www.twilio.com/docs/voice/api/call#create-a-call-resource) * * @param int $machineDetectionSpeechThreshold Refers to the Voice API Initiate * Call parameter * @return $this Fluent Builder */ public function setMachineDetectionSpeechThreshold($machineDetectionSpeechThreshold) { $this->options['machineDetectionSpeechThreshold'] = $machineDetectionSpeechThreshold; return $this; } /** * Refers to the parameter with the same name when [initiating a call via Voice API](https://www.twilio.com/docs/voice/api/call#create-a-call-resource) * * @param int $machineDetectionTimeout Refers to the Voice API Initiate Call * parameter * @return $this Fluent Builder */ public function setMachineDetectionTimeout($machineDetectionTimeout) { $this->options['machineDetectionTimeout'] = $machineDetectionTimeout; return $this; } /** * Refers to the parameter with the same name when [initiating a call via Voice API](https://www.twilio.com/docs/voice/api/call#create-a-call-resource) * * @param string $method Refers to the Voice API Initiate Call parameter * @return $this Fluent Builder */ public function setMethod($method) { $this->options['method'] = $method; return $this; } /** * Refers to the parameter with the same name when [initiating a call via Voice API](https://www.twilio.com/docs/voice/api/call#create-a-call-resource) * * @param bool $record Refers to the Voice API Initiate Call parameter * @return $this Fluent Builder */ public function setRecord($record) { $this->options['record'] = $record; return $this; } /** * Refers to the parameter with the same name when [initiating a call via Voice API](https://www.twilio.com/docs/voice/api/call#create-a-call-resource) * * @param string $recordingChannels Refers to the Voice API Initiate Call * parameter * @return $this Fluent Builder */ public function setRecordingChannels($recordingChannels) { $this->options['recordingChannels'] = $recordingChannels; return $this; } /** * Refers to the parameter with the same name when [initiating a call via Voice API](https://www.twilio.com/docs/voice/api/call#create-a-call-resource) * * @param string $recordingStatusCallback Refers to the Voice API Initiate Call * parameter * @return $this Fluent Builder */ public function setRecordingStatusCallback($recordingStatusCallback) { $this->options['recordingStatusCallback'] = $recordingStatusCallback; return $this; } /** * Refers to the parameter with the same name when [initiating a call via Voice API](https://www.twilio.com/docs/voice/api/call#create-a-call-resource) * * @param string $recordingStatusCallbackEvent Refers to the Voice API Initiate * Call parameter * @return $this Fluent Builder */ public function setRecordingStatusCallbackEvent($recordingStatusCallbackEvent) { $this->options['recordingStatusCallbackEvent'] = $recordingStatusCallbackEvent; return $this; } /** * Refers to the parameter with the same name when [initiating a call via Voice API](https://www.twilio.com/docs/voice/api/call#create-a-call-resource) * * @param string $recordingStatusCallbackMethod Refers to the Voice API * Initiate Call parameter * @return $this Fluent Builder */ public function setRecordingStatusCallbackMethod($recordingStatusCallbackMethod) { $this->options['recordingStatusCallbackMethod'] = $recordingStatusCallbackMethod; return $this; } /** * Refers to the parameter with the same name when [initiating a call via Voice API](https://www.twilio.com/docs/voice/api/call#create-a-call-resource) * * @param string $sendDigits Refers to the Voice API Initiate Call parameter * @return $this Fluent Builder */ public function setSendDigits($sendDigits) { $this->options['sendDigits'] = $sendDigits; return $this; } /** * Refers to the parameter with the same name when [initiating a call via Voice API](https://www.twilio.com/docs/voice/api/call#create-a-call-resource) * * @param string $sipAuthPassword Refers to the Voice API Initiate Call * parameter * @return $this Fluent Builder */ public function setSipAuthPassword($sipAuthPassword) { $this->options['sipAuthPassword'] = $sipAuthPassword; return $this; } /** * Refers to the parameter with the same name when [initiating a call via Voice API](https://www.twilio.com/docs/voice/api/call#create-a-call-resource) * * @param string $sipAuthUsername Refers to the Voice API Initiate Call * parameter * @return $this Fluent Builder */ public function setSipAuthUsername($sipAuthUsername) { $this->options['sipAuthUsername'] = $sipAuthUsername; return $this; } /** * Refers to the parameter with the same name when [initiating a call via Voice API](https://www.twilio.com/docs/voice/api/call#create-a-call-resource) * * @param string $statusCallback Refers to the Voice API Initiate Call parameter * @return $this Fluent Builder */ public function setStatusCallback($statusCallback) { $this->options['statusCallback'] = $statusCallback; return $this; } /** * Refers to the parameter with the same name when [initiating a call via Voice API](https://www.twilio.com/docs/voice/api/call#create-a-call-resource) * * @param string $statusCallbackEvent Refers to the Voice API Initiate Call * parameter * @return $this Fluent Builder */ public function setStatusCallbackEvent($statusCallbackEvent) { $this->options['statusCallbackEvent'] = $statusCallbackEvent; return $this; } /** * Refers to the parameter with the same name when [initiating a call via Voice API](https://www.twilio.com/docs/voice/api/call#create-a-call-resource) * * @param string $statusCallbackMethod Refers to the Voice API Initiate Call * parameter * @return $this Fluent Builder */ public function setStatusCallbackMethod($statusCallbackMethod) { $this->options['statusCallbackMethod'] = $statusCallbackMethod; return $this; } /** * Refers to the parameter with the same name when [initiating a call via Voice API](https://www.twilio.com/docs/voice/api/call#create-a-call-resource) * * @param int $timeout Refers to the Voice API Initiate Call parameter * @return $this Fluent Builder */ public function setTimeout($timeout) { $this->options['timeout'] = $timeout; return $this; } /** * Refers to the parameter with the same name when [initiating a call via Voice API](https://www.twilio.com/docs/voice/api/call#create-a-call-resource) * * @param string $trim Refers to the Voice API Initiate Call parameter * @return $this Fluent Builder */ public function setTrim($trim) { $this->options['trim'] = $trim; return $this; } /** * Refers to the parameter with the same name when [initiating a call via Voice API](https://www.twilio.com/docs/voice/api/call#create-a-call-resource) * * @param string $url Refers to the Voice API Initiate Call parameter * @return $this Fluent Builder */ public function setUrl($url) { $this->options['url'] = $url; 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.Preview.TrustedComms.CreatePhoneCallOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Preview/TrustedComms/Business/Insights/SuccessRateOptions.php 0000644 00000012017 15002236443 0024246 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\TrustedComms\Business\Insights; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ abstract class SuccessRateOptions { /** * @param string $brandSid Brand Sid. * @param string $brandedChannelSid Branded Channel Sid. * @param string $phoneNumberSid Phone Number Sid. * @param string $country Country 2-letter ISO 3166 code. * @param \DateTime $start The start date that for this Success Rate. * @param \DateTime $end The end date that for this Success Rate. * @param string $interval The Interval of this Success Rate. * @return FetchSuccessRateOptions Options builder */ public static function fetch($brandSid = Values::NONE, $brandedChannelSid = Values::NONE, $phoneNumberSid = Values::NONE, $country = Values::NONE, $start = Values::NONE, $end = Values::NONE, $interval = Values::NONE) { return new FetchSuccessRateOptions($brandSid, $brandedChannelSid, $phoneNumberSid, $country, $start, $end, $interval); } } class FetchSuccessRateOptions extends Options { /** * @param string $brandSid Brand Sid. * @param string $brandedChannelSid Branded Channel Sid. * @param string $phoneNumberSid Phone Number Sid. * @param string $country Country 2-letter ISO 3166 code. * @param \DateTime $start The start date that for this Success Rate. * @param \DateTime $end The end date that for this Success Rate. * @param string $interval The Interval of this Success Rate. */ public function __construct($brandSid = Values::NONE, $brandedChannelSid = Values::NONE, $phoneNumberSid = Values::NONE, $country = Values::NONE, $start = Values::NONE, $end = Values::NONE, $interval = Values::NONE) { $this->options['brandSid'] = $brandSid; $this->options['brandedChannelSid'] = $brandedChannelSid; $this->options['phoneNumberSid'] = $phoneNumberSid; $this->options['country'] = $country; $this->options['start'] = $start; $this->options['end'] = $end; $this->options['interval'] = $interval; } /** * The unique SID identifier of the Brand to filter by. * * @param string $brandSid Brand Sid. * @return $this Fluent Builder */ public function setBrandSid($brandSid) { $this->options['brandSid'] = $brandSid; return $this; } /** * The unique SID identifier of the Branded Channel to filter by. * * @param string $brandedChannelSid Branded Channel Sid. * @return $this Fluent Builder */ public function setBrandedChannelSid($brandedChannelSid) { $this->options['brandedChannelSid'] = $brandedChannelSid; return $this; } /** * The unique SID identifier of the Phone Number to filter by. * * @param string $phoneNumberSid Phone Number Sid. * @return $this Fluent Builder */ public function setPhoneNumberSid($phoneNumberSid) { $this->options['phoneNumberSid'] = $phoneNumberSid; return $this; } /** * The 2-letter ISO 3166 code of the Country to filter by. * * @param string $country Country 2-letter ISO 3166 code. * @return $this Fluent Builder */ public function setCountry($country) { $this->options['country'] = $country; return $this; } /** * The start date that for this Success Rate, given in ISO 8601 format. Default value is 30 days ago. * * @param \DateTime $start The start date that for this Success Rate. * @return $this Fluent Builder */ public function setStart($start) { $this->options['start'] = $start; return $this; } /** * The end date that for this Success Rate, given in ISO 8601 format. Default value is current timestamp. * * @param \DateTime $end The end date that for this Success Rate. * @return $this Fluent Builder */ public function setEnd($end) { $this->options['end'] = $end; return $this; } /** * The Interval of this Success Rate. One of `minute`, `hour`, `day`, `week` or `month`. * * @param string $interval The Interval of this Success Rate. * @return $this Fluent Builder */ public function setInterval($interval) { $this->options['interval'] = $interval; 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.Preview.TrustedComms.FetchSuccessRateOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Preview/TrustedComms/Business/Insights/SuccessRateInstance.php 0000644 00000007410 15002236443 0024360 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\TrustedComms\Business\Insights; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $accountSid * @property string $businessSid * @property \DateTime $end * @property string $interval * @property array $reports * @property \DateTime $start * @property string $url */ class SuccessRateInstance extends InstanceResource { /** * Initialize the SuccessRateInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $businessSid A string that uniquely identifies this Business. * @return \Twilio\Rest\Preview\TrustedComms\Business\Insights\SuccessRateInstance */ public function __construct(Version $version, array $payload, $businessSid) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'accountSid' => Values::array_get($payload, 'account_sid'), 'businessSid' => Values::array_get($payload, 'business_sid'), 'end' => Deserialize::dateTime(Values::array_get($payload, 'end')), 'interval' => Values::array_get($payload, 'interval'), 'reports' => Values::array_get($payload, 'reports'), 'start' => Deserialize::dateTime(Values::array_get($payload, 'start')), 'url' => Values::array_get($payload, 'url'), ); $this->solution = array('businessSid' => $businessSid, ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Preview\TrustedComms\Business\Insights\SuccessRateContext Context for this * SuccessRateInstance */ protected function proxy() { if (!$this->context) { $this->context = new SuccessRateContext($this->version, $this->solution['businessSid']); } return $this->context; } /** * Fetch a SuccessRateInstance * * @param array|Options $options Optional Arguments * @return SuccessRateInstance Fetched SuccessRateInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch($options = array()) { return $this->proxy()->fetch($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.TrustedComms.SuccessRateInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/TrustedComms/Business/Insights/SuccessRatePage.php 0000644 00000001755 15002236443 0023476 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\TrustedComms\Business\Insights; use Twilio\Page; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class SuccessRatePage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new SuccessRateInstance($this->version, $payload, $this->solution['businessSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Preview.TrustedComms.SuccessRatePage]'; } } sdk/src/Twilio/Rest/Preview/TrustedComms/Business/Insights/SuccessRateContext.php 0000644 00000004760 15002236443 0024245 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\TrustedComms\Business\Insights; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class SuccessRateContext extends InstanceContext { /** * Initialize the SuccessRateContext * * @param \Twilio\Version $version Version that contains the resource * @param string $businessSid Business Sid. * @return \Twilio\Rest\Preview\TrustedComms\Business\Insights\SuccessRateContext */ public function __construct(Version $version, $businessSid) { parent::__construct($version); // Path Solution $this->solution = array('businessSid' => $businessSid, ); $this->uri = '/Businesses/' . \rawurlencode($businessSid) . '/Insights/SuccessRate'; } /** * Fetch a SuccessRateInstance * * @param array|Options $options Optional Arguments * @return SuccessRateInstance Fetched SuccessRateInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch($options = array()) { $options = new Values($options); $params = Values::of(array( 'BrandSid' => $options['brandSid'], 'BrandedChannelSid' => $options['brandedChannelSid'], 'PhoneNumberSid' => $options['phoneNumberSid'], 'Country' => $options['country'], 'Start' => Serialize::iso8601DateTime($options['start']), 'End' => Serialize::iso8601DateTime($options['end']), 'Interval' => $options['interval'], )); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new SuccessRateInstance($this->version, $payload, $this->solution['businessSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.TrustedComms.SuccessRateContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/TrustedComms/Business/Insights/SuccessRateList.php 0000644 00000002677 15002236443 0023541 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\TrustedComms\Business\Insights; use Twilio\ListResource; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class SuccessRateList extends ListResource { /** * Construct the SuccessRateList * * @param Version $version Version that contains the resource * @param string $businessSid A string that uniquely identifies this Business. * @return \Twilio\Rest\Preview\TrustedComms\Business\Insights\SuccessRateList */ public function __construct(Version $version, $businessSid) { parent::__construct($version); // Path Solution $this->solution = array('businessSid' => $businessSid, ); } /** * Constructs a SuccessRateContext * * @return \Twilio\Rest\Preview\TrustedComms\Business\Insights\SuccessRateContext */ public function getContext() { return new SuccessRateContext($this->version, $this->solution['businessSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Preview.TrustedComms.SuccessRateList]'; } } sdk/src/Twilio/Rest/Preview/TrustedComms/Business/InsightsList.php 0000644 00000005474 15002236443 0021313 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\TrustedComms\Business; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Rest\Preview\TrustedComms\Business\Insights\SuccessRateList; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property \Twilio\Rest\Preview\TrustedComms\Business\Insights\SuccessRateList $successRate * @method \Twilio\Rest\Preview\TrustedComms\Business\Insights\SuccessRateContext successRate() */ class InsightsList extends ListResource { protected $_successRate = null; /** * Construct the InsightsList * * @param Version $version Version that contains the resource * @param string $businessSid A string that uniquely identifies this Business. * @return \Twilio\Rest\Preview\TrustedComms\Business\InsightsList */ public function __construct(Version $version, $businessSid) { parent::__construct($version); // Path Solution $this->solution = array('businessSid' => $businessSid, ); } /** * Access the successRate */ protected function getSuccessRate() { if (!$this->_successRate) { $this->_successRate = new SuccessRateList($this->version, $this->solution['businessSid']); } return $this->_successRate; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get($name) { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Preview.TrustedComms.InsightsList]'; } } sdk/src/Twilio/Rest/Preview/TrustedComms/Business/InsightsInstance.php 0000644 00000003523 15002236443 0022135 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\TrustedComms\Business; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class InsightsInstance extends InstanceResource { /** * Initialize the InsightsInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $businessSid A string that uniquely identifies this Business. * @return \Twilio\Rest\Preview\TrustedComms\Business\InsightsInstance */ public function __construct(Version $version, array $payload, $businessSid) { parent::__construct($version); $this->solution = array('businessSid' => $businessSid, ); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Preview.TrustedComms.InsightsInstance]'; } } sdk/src/Twilio/Rest/Preview/TrustedComms/Business/InsightsPage.php 0000644 00000001733 15002236443 0021246 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\TrustedComms\Business; use Twilio\Page; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class InsightsPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new InsightsInstance($this->version, $payload, $this->solution['businessSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Preview.TrustedComms.InsightsPage]'; } } sdk/src/Twilio/Rest/Preview/DeployedDevices/FleetList.php 0000644 00000012731 15002236443 0017400 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\DeployedDevices; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class FleetList extends ListResource { /** * Construct the FleetList * * @param Version $version Version that contains the resource * @return \Twilio\Rest\Preview\DeployedDevices\FleetList */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = array(); $this->uri = '/Fleets'; } /** * Create a new FleetInstance * * @param array|Options $options Optional Arguments * @return FleetInstance Newly created FleetInstance * @throws TwilioException When an HTTP error occurs. */ public function create($options = array()) { $options = new Values($options); $data = Values::of(array('FriendlyName' => $options['friendlyName'], )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new FleetInstance($this->version, $payload); } /** * Streams FleetInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads FleetInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return FleetInstance[] Array of results */ public function read($limit = null, $pageSize = null) { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of FleetInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of FleetInstance */ public function page($pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $params = Values::of(array( 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new FleetPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of FleetInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of FleetInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new FleetPage($this->version, $response, $this->solution); } /** * Constructs a FleetContext * * @param string $sid A string that uniquely identifies the Fleet. * @return \Twilio\Rest\Preview\DeployedDevices\FleetContext */ public function getContext($sid) { return new FleetContext($this->version, $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Preview.DeployedDevices.FleetList]'; } } sdk/src/Twilio/Rest/Preview/DeployedDevices/FleetInstance.php 0000644 00000012514 15002236443 0020230 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\DeployedDevices; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $sid * @property string $url * @property string $uniqueName * @property string $friendlyName * @property string $accountSid * @property string $defaultDeploymentSid * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property array $links */ class FleetInstance extends InstanceResource { protected $_devices = null; protected $_deployments = null; protected $_certificates = null; protected $_keys = null; /** * Initialize the FleetInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid A string that uniquely identifies the Fleet. * @return \Twilio\Rest\Preview\DeployedDevices\FleetInstance */ public function __construct(Version $version, array $payload, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'sid' => Values::array_get($payload, 'sid'), 'url' => Values::array_get($payload, 'url'), 'uniqueName' => Values::array_get($payload, 'unique_name'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'defaultDeploymentSid' => Values::array_get($payload, 'default_deployment_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'links' => Values::array_get($payload, 'links'), ); $this->solution = array('sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Preview\DeployedDevices\FleetContext Context for this * FleetInstance */ protected function proxy() { if (!$this->context) { $this->context = new FleetContext($this->version, $this->solution['sid']); } return $this->context; } /** * Fetch a FleetInstance * * @return FleetInstance Fetched FleetInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the FleetInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Update the FleetInstance * * @param array|Options $options Optional Arguments * @return FleetInstance Updated FleetInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Access the devices * * @return \Twilio\Rest\Preview\DeployedDevices\Fleet\DeviceList */ protected function getDevices() { return $this->proxy()->devices; } /** * Access the deployments * * @return \Twilio\Rest\Preview\DeployedDevices\Fleet\DeploymentList */ protected function getDeployments() { return $this->proxy()->deployments; } /** * Access the certificates * * @return \Twilio\Rest\Preview\DeployedDevices\Fleet\CertificateList */ protected function getCertificates() { return $this->proxy()->certificates; } /** * Access the keys * * @return \Twilio\Rest\Preview\DeployedDevices\Fleet\KeyList */ protected function getKeys() { return $this->proxy()->keys; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.DeployedDevices.FleetInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/DeployedDevices/FleetPage.php 0000644 00000001657 15002236443 0017346 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\DeployedDevices; use Twilio\Page; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class FleetPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new FleetInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Preview.DeployedDevices.FleetPage]'; } } sdk/src/Twilio/Rest/Preview/DeployedDevices/FleetContext.php 0000644 00000014324 15002236443 0020111 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\DeployedDevices; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Rest\Preview\DeployedDevices\Fleet\CertificateList; use Twilio\Rest\Preview\DeployedDevices\Fleet\DeploymentList; use Twilio\Rest\Preview\DeployedDevices\Fleet\DeviceList; use Twilio\Rest\Preview\DeployedDevices\Fleet\KeyList; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property \Twilio\Rest\Preview\DeployedDevices\Fleet\DeviceList $devices * @property \Twilio\Rest\Preview\DeployedDevices\Fleet\DeploymentList $deployments * @property \Twilio\Rest\Preview\DeployedDevices\Fleet\CertificateList $certificates * @property \Twilio\Rest\Preview\DeployedDevices\Fleet\KeyList $keys * @method \Twilio\Rest\Preview\DeployedDevices\Fleet\DeviceContext devices(string $sid) * @method \Twilio\Rest\Preview\DeployedDevices\Fleet\DeploymentContext deployments(string $sid) * @method \Twilio\Rest\Preview\DeployedDevices\Fleet\CertificateContext certificates(string $sid) * @method \Twilio\Rest\Preview\DeployedDevices\Fleet\KeyContext keys(string $sid) */ class FleetContext extends InstanceContext { protected $_devices = null; protected $_deployments = null; protected $_certificates = null; protected $_keys = null; /** * Initialize the FleetContext * * @param \Twilio\Version $version Version that contains the resource * @param string $sid A string that uniquely identifies the Fleet. * @return \Twilio\Rest\Preview\DeployedDevices\FleetContext */ public function __construct(Version $version, $sid) { parent::__construct($version); // Path Solution $this->solution = array('sid' => $sid, ); $this->uri = '/Fleets/' . \rawurlencode($sid) . ''; } /** * Fetch a FleetInstance * * @return FleetInstance Fetched FleetInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new FleetInstance($this->version, $payload, $this->solution['sid']); } /** * Deletes the FleetInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Update the FleetInstance * * @param array|Options $options Optional Arguments * @return FleetInstance Updated FleetInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { $options = new Values($options); $data = Values::of(array( 'FriendlyName' => $options['friendlyName'], 'DefaultDeploymentSid' => $options['defaultDeploymentSid'], )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new FleetInstance($this->version, $payload, $this->solution['sid']); } /** * Access the devices * * @return \Twilio\Rest\Preview\DeployedDevices\Fleet\DeviceList */ protected function getDevices() { if (!$this->_devices) { $this->_devices = new DeviceList($this->version, $this->solution['sid']); } return $this->_devices; } /** * Access the deployments * * @return \Twilio\Rest\Preview\DeployedDevices\Fleet\DeploymentList */ protected function getDeployments() { if (!$this->_deployments) { $this->_deployments = new DeploymentList($this->version, $this->solution['sid']); } return $this->_deployments; } /** * Access the certificates * * @return \Twilio\Rest\Preview\DeployedDevices\Fleet\CertificateList */ protected function getCertificates() { if (!$this->_certificates) { $this->_certificates = new CertificateList($this->version, $this->solution['sid']); } return $this->_certificates; } /** * Access the keys * * @return \Twilio\Rest\Preview\DeployedDevices\Fleet\KeyList */ protected function getKeys() { if (!$this->_keys) { $this->_keys = new KeyList($this->version, $this->solution['sid']); } return $this->_keys; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get($name) { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.DeployedDevices.FleetContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/DeployedDevices/FleetOptions.php 0000644 00000007453 15002236443 0020125 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\DeployedDevices; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ abstract class FleetOptions { /** * @param string $friendlyName A human readable description for this Fleet. * @return CreateFleetOptions Options builder */ public static function create($friendlyName = Values::NONE) { return new CreateFleetOptions($friendlyName); } /** * @param string $friendlyName A human readable description for this Fleet. * @param string $defaultDeploymentSid A default Deployment SID. * @return UpdateFleetOptions Options builder */ public static function update($friendlyName = Values::NONE, $defaultDeploymentSid = Values::NONE) { return new UpdateFleetOptions($friendlyName, $defaultDeploymentSid); } } class CreateFleetOptions extends Options { /** * @param string $friendlyName A human readable description for this Fleet. */ public function __construct($friendlyName = Values::NONE) { $this->options['friendlyName'] = $friendlyName; } /** * Provides a human readable descriptive text for this Fleet, up to 256 characters long. * * @param string $friendlyName A human readable description for this Fleet. * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; 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.Preview.DeployedDevices.CreateFleetOptions ' . \implode(' ', $options) . ']'; } } class UpdateFleetOptions extends Options { /** * @param string $friendlyName A human readable description for this Fleet. * @param string $defaultDeploymentSid A default Deployment SID. */ public function __construct($friendlyName = Values::NONE, $defaultDeploymentSid = Values::NONE) { $this->options['friendlyName'] = $friendlyName; $this->options['defaultDeploymentSid'] = $defaultDeploymentSid; } /** * Provides a human readable descriptive text for this Fleet, up to 256 characters long. * * @param string $friendlyName A human readable description for this Fleet. * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * Provides a string identifier of a Deployment that is going to be used as a default one for this Fleet. * * @param string $defaultDeploymentSid A default Deployment SID. * @return $this Fluent Builder */ public function setDefaultDeploymentSid($defaultDeploymentSid) { $this->options['defaultDeploymentSid'] = $defaultDeploymentSid; 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.Preview.DeployedDevices.UpdateFleetOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Preview/DeployedDevices/Fleet/CertificateContext.php 0000644 00000006253 15002236443 0022335 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\DeployedDevices\Fleet; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class CertificateContext extends InstanceContext { /** * Initialize the CertificateContext * * @param \Twilio\Version $version Version that contains the resource * @param string $fleetSid The fleet_sid * @param string $sid A string that uniquely identifies the Certificate. * @return \Twilio\Rest\Preview\DeployedDevices\Fleet\CertificateContext */ public function __construct(Version $version, $fleetSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array('fleetSid' => $fleetSid, 'sid' => $sid, ); $this->uri = '/Fleets/' . \rawurlencode($fleetSid) . '/Certificates/' . \rawurlencode($sid) . ''; } /** * Fetch a CertificateInstance * * @return CertificateInstance Fetched CertificateInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new CertificateInstance( $this->version, $payload, $this->solution['fleetSid'], $this->solution['sid'] ); } /** * Deletes the CertificateInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Update the CertificateInstance * * @param array|Options $options Optional Arguments * @return CertificateInstance Updated CertificateInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { $options = new Values($options); $data = Values::of(array( 'FriendlyName' => $options['friendlyName'], 'DeviceSid' => $options['deviceSid'], )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new CertificateInstance( $this->version, $payload, $this->solution['fleetSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.DeployedDevices.CertificateContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/DeployedDevices/Fleet/DeviceContext.php 0000644 00000006370 15002236443 0021312 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\DeployedDevices\Fleet; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class DeviceContext extends InstanceContext { /** * Initialize the DeviceContext * * @param \Twilio\Version $version Version that contains the resource * @param string $fleetSid The fleet_sid * @param string $sid A string that uniquely identifies the Device. * @return \Twilio\Rest\Preview\DeployedDevices\Fleet\DeviceContext */ public function __construct(Version $version, $fleetSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array('fleetSid' => $fleetSid, 'sid' => $sid, ); $this->uri = '/Fleets/' . \rawurlencode($fleetSid) . '/Devices/' . \rawurlencode($sid) . ''; } /** * Fetch a DeviceInstance * * @return DeviceInstance Fetched DeviceInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new DeviceInstance( $this->version, $payload, $this->solution['fleetSid'], $this->solution['sid'] ); } /** * Deletes the DeviceInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Update the DeviceInstance * * @param array|Options $options Optional Arguments * @return DeviceInstance Updated DeviceInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { $options = new Values($options); $data = Values::of(array( 'FriendlyName' => $options['friendlyName'], 'Identity' => $options['identity'], 'DeploymentSid' => $options['deploymentSid'], 'Enabled' => Serialize::booleanToString($options['enabled']), )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new DeviceInstance( $this->version, $payload, $this->solution['fleetSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.DeployedDevices.DeviceContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/DeployedDevices/Fleet/CertificatePage.php 0000644 00000001744 15002236443 0021565 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\DeployedDevices\Fleet; use Twilio\Page; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class CertificatePage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new CertificateInstance($this->version, $payload, $this->solution['fleetSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Preview.DeployedDevices.CertificatePage]'; } } sdk/src/Twilio/Rest/Preview/DeployedDevices/Fleet/DeviceInstance.php 0000644 00000011774 15002236443 0021436 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\DeployedDevices\Fleet; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $sid * @property string $url * @property string $uniqueName * @property string $friendlyName * @property string $fleetSid * @property bool $enabled * @property string $accountSid * @property string $identity * @property string $deploymentSid * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property \DateTime $dateAuthenticated */ class DeviceInstance extends InstanceResource { /** * Initialize the DeviceInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $fleetSid The unique identifier of the Fleet. * @param string $sid A string that uniquely identifies the Device. * @return \Twilio\Rest\Preview\DeployedDevices\Fleet\DeviceInstance */ public function __construct(Version $version, array $payload, $fleetSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'sid' => Values::array_get($payload, 'sid'), 'url' => Values::array_get($payload, 'url'), 'uniqueName' => Values::array_get($payload, 'unique_name'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'fleetSid' => Values::array_get($payload, 'fleet_sid'), 'enabled' => Values::array_get($payload, 'enabled'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'identity' => Values::array_get($payload, 'identity'), 'deploymentSid' => Values::array_get($payload, 'deployment_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'dateAuthenticated' => Deserialize::dateTime(Values::array_get($payload, 'date_authenticated')), ); $this->solution = array('fleetSid' => $fleetSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Preview\DeployedDevices\Fleet\DeviceContext Context for * this * DeviceInstance */ protected function proxy() { if (!$this->context) { $this->context = new DeviceContext( $this->version, $this->solution['fleetSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch a DeviceInstance * * @return DeviceInstance Fetched DeviceInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the DeviceInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Update the DeviceInstance * * @param array|Options $options Optional Arguments * @return DeviceInstance Updated DeviceInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.DeployedDevices.DeviceInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/DeployedDevices/Fleet/KeyList.php 0000644 00000014042 15002236443 0020125 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\DeployedDevices\Fleet; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class KeyList extends ListResource { /** * Construct the KeyList * * @param Version $version Version that contains the resource * @param string $fleetSid The unique identifier of the Fleet. * @return \Twilio\Rest\Preview\DeployedDevices\Fleet\KeyList */ public function __construct(Version $version, $fleetSid) { parent::__construct($version); // Path Solution $this->solution = array('fleetSid' => $fleetSid, ); $this->uri = '/Fleets/' . \rawurlencode($fleetSid) . '/Keys'; } /** * Create a new KeyInstance * * @param array|Options $options Optional Arguments * @return KeyInstance Newly created KeyInstance * @throws TwilioException When an HTTP error occurs. */ public function create($options = array()) { $options = new Values($options); $data = Values::of(array( 'FriendlyName' => $options['friendlyName'], 'DeviceSid' => $options['deviceSid'], )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new KeyInstance($this->version, $payload, $this->solution['fleetSid']); } /** * Streams KeyInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($options = array(), $limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads KeyInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return KeyInstance[] Array of results */ public function read($options = array(), $limit = null, $pageSize = null) { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Retrieve a single page of KeyInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of KeyInstance */ public function page($options = array(), $pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $options = new Values($options); $params = Values::of(array( 'DeviceSid' => $options['deviceSid'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new KeyPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of KeyInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of KeyInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new KeyPage($this->version, $response, $this->solution); } /** * Constructs a KeyContext * * @param string $sid A string that uniquely identifies the Key. * @return \Twilio\Rest\Preview\DeployedDevices\Fleet\KeyContext */ public function getContext($sid) { return new KeyContext($this->version, $this->solution['fleetSid'], $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Preview.DeployedDevices.KeyList]'; } } sdk/src/Twilio/Rest/Preview/DeployedDevices/Fleet/KeyOptions.php 0000644 00000013313 15002236443 0020645 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\DeployedDevices\Fleet; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ abstract class KeyOptions { /** * @param string $friendlyName The human readable description for this Key. * @param string $deviceSid The unique identifier of a Key to be authenticated. * @return CreateKeyOptions Options builder */ public static function create($friendlyName = Values::NONE, $deviceSid = Values::NONE) { return new CreateKeyOptions($friendlyName, $deviceSid); } /** * @param string $deviceSid Find all Keys authenticating specified Device. * @return ReadKeyOptions Options builder */ public static function read($deviceSid = Values::NONE) { return new ReadKeyOptions($deviceSid); } /** * @param string $friendlyName The human readable description for this Key. * @param string $deviceSid The unique identifier of a Key to be authenticated. * @return UpdateKeyOptions Options builder */ public static function update($friendlyName = Values::NONE, $deviceSid = Values::NONE) { return new UpdateKeyOptions($friendlyName, $deviceSid); } } class CreateKeyOptions extends Options { /** * @param string $friendlyName The human readable description for this Key. * @param string $deviceSid The unique identifier of a Key to be authenticated. */ public function __construct($friendlyName = Values::NONE, $deviceSid = Values::NONE) { $this->options['friendlyName'] = $friendlyName; $this->options['deviceSid'] = $deviceSid; } /** * Provides a human readable descriptive text for this Key credential, up to 256 characters long. * * @param string $friendlyName The human readable description for this Key. * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * Provides the unique string identifier of an existing Device to become authenticated with this Key credential. * * @param string $deviceSid The unique identifier of a Key to be authenticated. * @return $this Fluent Builder */ public function setDeviceSid($deviceSid) { $this->options['deviceSid'] = $deviceSid; 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.Preview.DeployedDevices.CreateKeyOptions ' . \implode(' ', $options) . ']'; } } class ReadKeyOptions extends Options { /** * @param string $deviceSid Find all Keys authenticating specified Device. */ public function __construct($deviceSid = Values::NONE) { $this->options['deviceSid'] = $deviceSid; } /** * Filters the resulting list of Keys by a unique string identifier of an authenticated Device. * * @param string $deviceSid Find all Keys authenticating specified Device. * @return $this Fluent Builder */ public function setDeviceSid($deviceSid) { $this->options['deviceSid'] = $deviceSid; 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.Preview.DeployedDevices.ReadKeyOptions ' . \implode(' ', $options) . ']'; } } class UpdateKeyOptions extends Options { /** * @param string $friendlyName The human readable description for this Key. * @param string $deviceSid The unique identifier of a Key to be authenticated. */ public function __construct($friendlyName = Values::NONE, $deviceSid = Values::NONE) { $this->options['friendlyName'] = $friendlyName; $this->options['deviceSid'] = $deviceSid; } /** * Provides a human readable descriptive text for this Key credential, up to 256 characters long. * * @param string $friendlyName The human readable description for this Key. * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * Provides the unique string identifier of an existing Device to become authenticated with this Key credential. * * @param string $deviceSid The unique identifier of a Key to be authenticated. * @return $this Fluent Builder */ public function setDeviceSid($deviceSid) { $this->options['deviceSid'] = $deviceSid; 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.Preview.DeployedDevices.UpdateKeyOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Preview/DeployedDevices/Fleet/CertificateList.php 0000644 00000014532 15002236443 0021623 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\DeployedDevices\Fleet; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class CertificateList extends ListResource { /** * Construct the CertificateList * * @param Version $version Version that contains the resource * @param string $fleetSid The unique identifier of the Fleet. * @return \Twilio\Rest\Preview\DeployedDevices\Fleet\CertificateList */ public function __construct(Version $version, $fleetSid) { parent::__construct($version); // Path Solution $this->solution = array('fleetSid' => $fleetSid, ); $this->uri = '/Fleets/' . \rawurlencode($fleetSid) . '/Certificates'; } /** * Create a new CertificateInstance * * @param string $certificateData The public certificate data. * @param array|Options $options Optional Arguments * @return CertificateInstance Newly created CertificateInstance * @throws TwilioException When an HTTP error occurs. */ public function create($certificateData, $options = array()) { $options = new Values($options); $data = Values::of(array( 'CertificateData' => $certificateData, 'FriendlyName' => $options['friendlyName'], 'DeviceSid' => $options['deviceSid'], )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new CertificateInstance($this->version, $payload, $this->solution['fleetSid']); } /** * Streams CertificateInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($options = array(), $limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads CertificateInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return CertificateInstance[] Array of results */ public function read($options = array(), $limit = null, $pageSize = null) { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Retrieve a single page of CertificateInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of CertificateInstance */ public function page($options = array(), $pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $options = new Values($options); $params = Values::of(array( 'DeviceSid' => $options['deviceSid'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new CertificatePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of CertificateInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of CertificateInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new CertificatePage($this->version, $response, $this->solution); } /** * Constructs a CertificateContext * * @param string $sid A string that uniquely identifies the Certificate. * @return \Twilio\Rest\Preview\DeployedDevices\Fleet\CertificateContext */ public function getContext($sid) { return new CertificateContext($this->version, $this->solution['fleetSid'], $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Preview.DeployedDevices.CertificateList]'; } } sdk/src/Twilio/Rest/Preview/DeployedDevices/Fleet/DevicePage.php 0000644 00000001725 15002236443 0020541 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\DeployedDevices\Fleet; use Twilio\Page; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class DevicePage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new DeviceInstance($this->version, $payload, $this->solution['fleetSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Preview.DeployedDevices.DevicePage]'; } } sdk/src/Twilio/Rest/Preview/DeployedDevices/Fleet/DeviceOptions.php 0000644 00000021266 15002236443 0021322 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\DeployedDevices\Fleet; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ abstract class DeviceOptions { /** * @param string $uniqueName A unique, addressable name of this Device. * @param string $friendlyName A human readable description for this Device. * @param string $identity An identifier of the Device user. * @param string $deploymentSid The unique SID of the Deployment group. * @param bool $enabled The enabled * @return CreateDeviceOptions Options builder */ public static function create($uniqueName = Values::NONE, $friendlyName = Values::NONE, $identity = Values::NONE, $deploymentSid = Values::NONE, $enabled = Values::NONE) { return new CreateDeviceOptions($uniqueName, $friendlyName, $identity, $deploymentSid, $enabled); } /** * @param string $deploymentSid Find all Devices grouped under the specified * Deployment. * @return ReadDeviceOptions Options builder */ public static function read($deploymentSid = Values::NONE) { return new ReadDeviceOptions($deploymentSid); } /** * @param string $friendlyName A human readable description for this Device. * @param string $identity An identifier of the Device user. * @param string $deploymentSid The unique SID of the Deployment group. * @param bool $enabled The enabled * @return UpdateDeviceOptions Options builder */ public static function update($friendlyName = Values::NONE, $identity = Values::NONE, $deploymentSid = Values::NONE, $enabled = Values::NONE) { return new UpdateDeviceOptions($friendlyName, $identity, $deploymentSid, $enabled); } } class CreateDeviceOptions extends Options { /** * @param string $uniqueName A unique, addressable name of this Device. * @param string $friendlyName A human readable description for this Device. * @param string $identity An identifier of the Device user. * @param string $deploymentSid The unique SID of the Deployment group. * @param bool $enabled The enabled */ public function __construct($uniqueName = Values::NONE, $friendlyName = Values::NONE, $identity = Values::NONE, $deploymentSid = Values::NONE, $enabled = Values::NONE) { $this->options['uniqueName'] = $uniqueName; $this->options['friendlyName'] = $friendlyName; $this->options['identity'] = $identity; $this->options['deploymentSid'] = $deploymentSid; $this->options['enabled'] = $enabled; } /** * Provides a unique and addressable name to be assigned to this Device, to be used in addition to SID, up to 128 characters long. * * @param string $uniqueName A unique, addressable name of this Device. * @return $this Fluent Builder */ public function setUniqueName($uniqueName) { $this->options['uniqueName'] = $uniqueName; return $this; } /** * Provides a human readable descriptive text to be assigned to this Device, up to 256 characters long. * * @param string $friendlyName A human readable description for this Device. * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * Provides an arbitrary string identifier representing a human user to be associated with this Device, up to 256 characters long. * * @param string $identity An identifier of the Device user. * @return $this Fluent Builder */ public function setIdentity($identity) { $this->options['identity'] = $identity; return $this; } /** * Specifies the unique string identifier of the Deployment group that this Device is going to be associated with. * * @param string $deploymentSid The unique SID of the Deployment group. * @return $this Fluent Builder */ public function setDeploymentSid($deploymentSid) { $this->options['deploymentSid'] = $deploymentSid; return $this; } /** * The enabled * * @param bool $enabled The enabled * @return $this Fluent Builder */ public function setEnabled($enabled) { $this->options['enabled'] = $enabled; 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.Preview.DeployedDevices.CreateDeviceOptions ' . \implode(' ', $options) . ']'; } } class ReadDeviceOptions extends Options { /** * @param string $deploymentSid Find all Devices grouped under the specified * Deployment. */ public function __construct($deploymentSid = Values::NONE) { $this->options['deploymentSid'] = $deploymentSid; } /** * Filters the resulting list of Devices by a unique string identifier of the Deployment they are associated with. * * @param string $deploymentSid Find all Devices grouped under the specified * Deployment. * @return $this Fluent Builder */ public function setDeploymentSid($deploymentSid) { $this->options['deploymentSid'] = $deploymentSid; 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.Preview.DeployedDevices.ReadDeviceOptions ' . \implode(' ', $options) . ']'; } } class UpdateDeviceOptions extends Options { /** * @param string $friendlyName A human readable description for this Device. * @param string $identity An identifier of the Device user. * @param string $deploymentSid The unique SID of the Deployment group. * @param bool $enabled The enabled */ public function __construct($friendlyName = Values::NONE, $identity = Values::NONE, $deploymentSid = Values::NONE, $enabled = Values::NONE) { $this->options['friendlyName'] = $friendlyName; $this->options['identity'] = $identity; $this->options['deploymentSid'] = $deploymentSid; $this->options['enabled'] = $enabled; } /** * Provides a human readable descriptive text to be assigned to this Device, up to 256 characters long. * * @param string $friendlyName A human readable description for this Device. * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * Provides an arbitrary string identifier representing a human user to be associated with this Device, up to 256 characters long. * * @param string $identity An identifier of the Device user. * @return $this Fluent Builder */ public function setIdentity($identity) { $this->options['identity'] = $identity; return $this; } /** * Specifies the unique string identifier of the Deployment group that this Device is going to be associated with. * * @param string $deploymentSid The unique SID of the Deployment group. * @return $this Fluent Builder */ public function setDeploymentSid($deploymentSid) { $this->options['deploymentSid'] = $deploymentSid; return $this; } /** * The enabled * * @param bool $enabled The enabled * @return $this Fluent Builder */ public function setEnabled($enabled) { $this->options['enabled'] = $enabled; 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.Preview.DeployedDevices.UpdateDeviceOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Preview/DeployedDevices/Fleet/DeploymentInstance.php 0000644 00000011324 15002236443 0022346 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\DeployedDevices\Fleet; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $sid * @property string $url * @property string $friendlyName * @property string $fleetSid * @property string $accountSid * @property string $syncServiceSid * @property \DateTime $dateCreated * @property \DateTime $dateUpdated */ class DeploymentInstance extends InstanceResource { /** * Initialize the DeploymentInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $fleetSid The unique identifier of the Fleet. * @param string $sid A string that uniquely identifies the Deployment. * @return \Twilio\Rest\Preview\DeployedDevices\Fleet\DeploymentInstance */ public function __construct(Version $version, array $payload, $fleetSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'sid' => Values::array_get($payload, 'sid'), 'url' => Values::array_get($payload, 'url'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'fleetSid' => Values::array_get($payload, 'fleet_sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'syncServiceSid' => Values::array_get($payload, 'sync_service_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), ); $this->solution = array('fleetSid' => $fleetSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Preview\DeployedDevices\Fleet\DeploymentContext Context * for * this * DeploymentInstance */ protected function proxy() { if (!$this->context) { $this->context = new DeploymentContext( $this->version, $this->solution['fleetSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch a DeploymentInstance * * @return DeploymentInstance Fetched DeploymentInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the DeploymentInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Update the DeploymentInstance * * @param array|Options $options Optional Arguments * @return DeploymentInstance Updated DeploymentInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.DeployedDevices.DeploymentInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/DeployedDevices/Fleet/DeploymentList.php 0000644 00000013563 15002236443 0021524 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\DeployedDevices\Fleet; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class DeploymentList extends ListResource { /** * Construct the DeploymentList * * @param Version $version Version that contains the resource * @param string $fleetSid The unique identifier of the Fleet. * @return \Twilio\Rest\Preview\DeployedDevices\Fleet\DeploymentList */ public function __construct(Version $version, $fleetSid) { parent::__construct($version); // Path Solution $this->solution = array('fleetSid' => $fleetSid, ); $this->uri = '/Fleets/' . \rawurlencode($fleetSid) . '/Deployments'; } /** * Create a new DeploymentInstance * * @param array|Options $options Optional Arguments * @return DeploymentInstance Newly created DeploymentInstance * @throws TwilioException When an HTTP error occurs. */ public function create($options = array()) { $options = new Values($options); $data = Values::of(array( 'FriendlyName' => $options['friendlyName'], 'SyncServiceSid' => $options['syncServiceSid'], )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new DeploymentInstance($this->version, $payload, $this->solution['fleetSid']); } /** * Streams DeploymentInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads DeploymentInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return DeploymentInstance[] Array of results */ public function read($limit = null, $pageSize = null) { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of DeploymentInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of DeploymentInstance */ public function page($pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $params = Values::of(array( 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new DeploymentPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of DeploymentInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of DeploymentInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new DeploymentPage($this->version, $response, $this->solution); } /** * Constructs a DeploymentContext * * @param string $sid A string that uniquely identifies the Deployment. * @return \Twilio\Rest\Preview\DeployedDevices\Fleet\DeploymentContext */ public function getContext($sid) { return new DeploymentContext($this->version, $this->solution['fleetSid'], $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Preview.DeployedDevices.DeploymentList]'; } } sdk/src/Twilio/Rest/Preview/DeployedDevices/Fleet/DeploymentPage.php 0000644 00000001741 15002236443 0021460 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\DeployedDevices\Fleet; use Twilio\Page; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class DeploymentPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new DeploymentInstance($this->version, $payload, $this->solution['fleetSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Preview.DeployedDevices.DeploymentPage]'; } } sdk/src/Twilio/Rest/Preview/DeployedDevices/Fleet/CertificateOptions.php 0000644 00000014647 15002236443 0022352 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\DeployedDevices\Fleet; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ abstract class CertificateOptions { /** * @param string $friendlyName The human readable description for this * Certificate. * @param string $deviceSid The unique identifier of a Device to be * authenticated. * @return CreateCertificateOptions Options builder */ public static function create($friendlyName = Values::NONE, $deviceSid = Values::NONE) { return new CreateCertificateOptions($friendlyName, $deviceSid); } /** * @param string $deviceSid Find all Certificates authenticating specified * Device. * @return ReadCertificateOptions Options builder */ public static function read($deviceSid = Values::NONE) { return new ReadCertificateOptions($deviceSid); } /** * @param string $friendlyName The human readable description for this * Certificate. * @param string $deviceSid The unique identifier of a Device to be * authenticated. * @return UpdateCertificateOptions Options builder */ public static function update($friendlyName = Values::NONE, $deviceSid = Values::NONE) { return new UpdateCertificateOptions($friendlyName, $deviceSid); } } class CreateCertificateOptions extends Options { /** * @param string $friendlyName The human readable description for this * Certificate. * @param string $deviceSid The unique identifier of a Device to be * authenticated. */ public function __construct($friendlyName = Values::NONE, $deviceSid = Values::NONE) { $this->options['friendlyName'] = $friendlyName; $this->options['deviceSid'] = $deviceSid; } /** * Provides a human readable descriptive text for this Certificate credential, up to 256 characters long. * * @param string $friendlyName The human readable description for this * Certificate. * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * Provides the unique string identifier of an existing Device to become authenticated with this Certificate credential. * * @param string $deviceSid The unique identifier of a Device to be * authenticated. * @return $this Fluent Builder */ public function setDeviceSid($deviceSid) { $this->options['deviceSid'] = $deviceSid; 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.Preview.DeployedDevices.CreateCertificateOptions ' . \implode(' ', $options) . ']'; } } class ReadCertificateOptions extends Options { /** * @param string $deviceSid Find all Certificates authenticating specified * Device. */ public function __construct($deviceSid = Values::NONE) { $this->options['deviceSid'] = $deviceSid; } /** * Filters the resulting list of Certificates by a unique string identifier of an authenticated Device. * * @param string $deviceSid Find all Certificates authenticating specified * Device. * @return $this Fluent Builder */ public function setDeviceSid($deviceSid) { $this->options['deviceSid'] = $deviceSid; 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.Preview.DeployedDevices.ReadCertificateOptions ' . \implode(' ', $options) . ']'; } } class UpdateCertificateOptions extends Options { /** * @param string $friendlyName The human readable description for this * Certificate. * @param string $deviceSid The unique identifier of a Device to be * authenticated. */ public function __construct($friendlyName = Values::NONE, $deviceSid = Values::NONE) { $this->options['friendlyName'] = $friendlyName; $this->options['deviceSid'] = $deviceSid; } /** * Provides a human readable descriptive text for this Certificate credential, up to 256 characters long. * * @param string $friendlyName The human readable description for this * Certificate. * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * Provides the unique string identifier of an existing Device to become authenticated with this Certificate credential. * * @param string $deviceSid The unique identifier of a Device to be * authenticated. * @return $this Fluent Builder */ public function setDeviceSid($deviceSid) { $this->options['deviceSid'] = $deviceSid; 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.Preview.DeployedDevices.UpdateCertificateOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Preview/DeployedDevices/Fleet/KeyInstance.php 0000644 00000011134 15002236443 0020755 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\DeployedDevices\Fleet; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $sid * @property string $url * @property string $friendlyName * @property string $fleetSid * @property string $accountSid * @property string $deviceSid * @property string $secret * @property \DateTime $dateCreated * @property \DateTime $dateUpdated */ class KeyInstance extends InstanceResource { /** * Initialize the KeyInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $fleetSid The unique identifier of the Fleet. * @param string $sid A string that uniquely identifies the Key. * @return \Twilio\Rest\Preview\DeployedDevices\Fleet\KeyInstance */ public function __construct(Version $version, array $payload, $fleetSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'sid' => Values::array_get($payload, 'sid'), 'url' => Values::array_get($payload, 'url'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'fleetSid' => Values::array_get($payload, 'fleet_sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'deviceSid' => Values::array_get($payload, 'device_sid'), 'secret' => Values::array_get($payload, 'secret'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), ); $this->solution = array('fleetSid' => $fleetSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Preview\DeployedDevices\Fleet\KeyContext Context for * this * KeyInstance */ protected function proxy() { if (!$this->context) { $this->context = new KeyContext( $this->version, $this->solution['fleetSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch a KeyInstance * * @return KeyInstance Fetched KeyInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the KeyInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Update the KeyInstance * * @param array|Options $options Optional Arguments * @return KeyInstance Updated KeyInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.DeployedDevices.KeyInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/DeployedDevices/Fleet/CertificateInstance.php 0000644 00000011126 15002236443 0022450 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\DeployedDevices\Fleet; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $sid * @property string $url * @property string $friendlyName * @property string $fleetSid * @property string $accountSid * @property string $deviceSid * @property string $thumbprint * @property \DateTime $dateCreated * @property \DateTime $dateUpdated */ class CertificateInstance extends InstanceResource { /** * Initialize the CertificateInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $fleetSid The unique identifier of the Fleet. * @param string $sid A string that uniquely identifies the Certificate. * @return \Twilio\Rest\Preview\DeployedDevices\Fleet\CertificateInstance */ public function __construct(Version $version, array $payload, $fleetSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'sid' => Values::array_get($payload, 'sid'), 'url' => Values::array_get($payload, 'url'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'fleetSid' => Values::array_get($payload, 'fleet_sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'deviceSid' => Values::array_get($payload, 'device_sid'), 'thumbprint' => Values::array_get($payload, 'thumbprint'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), ); $this->solution = array('fleetSid' => $fleetSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Preview\DeployedDevices\Fleet\CertificateContext Context for this CertificateInstance */ protected function proxy() { if (!$this->context) { $this->context = new CertificateContext( $this->version, $this->solution['fleetSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch a CertificateInstance * * @return CertificateInstance Fetched CertificateInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the CertificateInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Update the CertificateInstance * * @param array|Options $options Optional Arguments * @return CertificateInstance Updated CertificateInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.DeployedDevices.CertificateInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/DeployedDevices/Fleet/KeyPage.php 0000644 00000001714 15002236443 0020070 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\DeployedDevices\Fleet; use Twilio\Page; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class KeyPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new KeyInstance($this->version, $payload, $this->solution['fleetSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Preview.DeployedDevices.KeyPage]'; } } sdk/src/Twilio/Rest/Preview/DeployedDevices/Fleet/KeyContext.php 0000644 00000006063 15002236443 0020642 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\DeployedDevices\Fleet; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class KeyContext extends InstanceContext { /** * Initialize the KeyContext * * @param \Twilio\Version $version Version that contains the resource * @param string $fleetSid The fleet_sid * @param string $sid A string that uniquely identifies the Key. * @return \Twilio\Rest\Preview\DeployedDevices\Fleet\KeyContext */ public function __construct(Version $version, $fleetSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array('fleetSid' => $fleetSid, 'sid' => $sid, ); $this->uri = '/Fleets/' . \rawurlencode($fleetSid) . '/Keys/' . \rawurlencode($sid) . ''; } /** * Fetch a KeyInstance * * @return KeyInstance Fetched KeyInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new KeyInstance( $this->version, $payload, $this->solution['fleetSid'], $this->solution['sid'] ); } /** * Deletes the KeyInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Update the KeyInstance * * @param array|Options $options Optional Arguments * @return KeyInstance Updated KeyInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { $options = new Values($options); $data = Values::of(array( 'FriendlyName' => $options['friendlyName'], 'DeviceSid' => $options['deviceSid'], )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new KeyInstance( $this->version, $payload, $this->solution['fleetSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.DeployedDevices.KeyContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/DeployedDevices/Fleet/DeviceList.php 0000644 00000014470 15002236443 0020601 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\DeployedDevices\Fleet; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class DeviceList extends ListResource { /** * Construct the DeviceList * * @param Version $version Version that contains the resource * @param string $fleetSid The unique identifier of the Fleet. * @return \Twilio\Rest\Preview\DeployedDevices\Fleet\DeviceList */ public function __construct(Version $version, $fleetSid) { parent::__construct($version); // Path Solution $this->solution = array('fleetSid' => $fleetSid, ); $this->uri = '/Fleets/' . \rawurlencode($fleetSid) . '/Devices'; } /** * Create a new DeviceInstance * * @param array|Options $options Optional Arguments * @return DeviceInstance Newly created DeviceInstance * @throws TwilioException When an HTTP error occurs. */ public function create($options = array()) { $options = new Values($options); $data = Values::of(array( 'UniqueName' => $options['uniqueName'], 'FriendlyName' => $options['friendlyName'], 'Identity' => $options['identity'], 'DeploymentSid' => $options['deploymentSid'], 'Enabled' => Serialize::booleanToString($options['enabled']), )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new DeviceInstance($this->version, $payload, $this->solution['fleetSid']); } /** * Streams DeviceInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($options = array(), $limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads DeviceInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return DeviceInstance[] Array of results */ public function read($options = array(), $limit = null, $pageSize = null) { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Retrieve a single page of DeviceInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of DeviceInstance */ public function page($options = array(), $pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $options = new Values($options); $params = Values::of(array( 'DeploymentSid' => $options['deploymentSid'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new DevicePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of DeviceInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of DeviceInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new DevicePage($this->version, $response, $this->solution); } /** * Constructs a DeviceContext * * @param string $sid A string that uniquely identifies the Device. * @return \Twilio\Rest\Preview\DeployedDevices\Fleet\DeviceContext */ public function getContext($sid) { return new DeviceContext($this->version, $this->solution['fleetSid'], $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Preview.DeployedDevices.DeviceList]'; } } sdk/src/Twilio/Rest/Preview/DeployedDevices/Fleet/DeploymentContext.php 0000644 00000006246 15002236443 0022235 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\DeployedDevices\Fleet; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class DeploymentContext extends InstanceContext { /** * Initialize the DeploymentContext * * @param \Twilio\Version $version Version that contains the resource * @param string $fleetSid The fleet_sid * @param string $sid A string that uniquely identifies the Deployment. * @return \Twilio\Rest\Preview\DeployedDevices\Fleet\DeploymentContext */ public function __construct(Version $version, $fleetSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array('fleetSid' => $fleetSid, 'sid' => $sid, ); $this->uri = '/Fleets/' . \rawurlencode($fleetSid) . '/Deployments/' . \rawurlencode($sid) . ''; } /** * Fetch a DeploymentInstance * * @return DeploymentInstance Fetched DeploymentInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new DeploymentInstance( $this->version, $payload, $this->solution['fleetSid'], $this->solution['sid'] ); } /** * Deletes the DeploymentInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Update the DeploymentInstance * * @param array|Options $options Optional Arguments * @return DeploymentInstance Updated DeploymentInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { $options = new Values($options); $data = Values::of(array( 'FriendlyName' => $options['friendlyName'], 'SyncServiceSid' => $options['syncServiceSid'], )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new DeploymentInstance( $this->version, $payload, $this->solution['fleetSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.DeployedDevices.DeploymentContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/DeployedDevices/Fleet/DeploymentOptions.php 0000644 00000011565 15002236443 0022244 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\DeployedDevices\Fleet; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ abstract class DeploymentOptions { /** * @param string $friendlyName A human readable description for this Deployment. * @param string $syncServiceSid The unique identifier of the Sync service * instance. * @return CreateDeploymentOptions Options builder */ public static function create($friendlyName = Values::NONE, $syncServiceSid = Values::NONE) { return new CreateDeploymentOptions($friendlyName, $syncServiceSid); } /** * @param string $friendlyName A human readable description for this Deployment. * @param string $syncServiceSid The unique identifier of the Sync service * instance. * @return UpdateDeploymentOptions Options builder */ public static function update($friendlyName = Values::NONE, $syncServiceSid = Values::NONE) { return new UpdateDeploymentOptions($friendlyName, $syncServiceSid); } } class CreateDeploymentOptions extends Options { /** * @param string $friendlyName A human readable description for this Deployment. * @param string $syncServiceSid The unique identifier of the Sync service * instance. */ public function __construct($friendlyName = Values::NONE, $syncServiceSid = Values::NONE) { $this->options['friendlyName'] = $friendlyName; $this->options['syncServiceSid'] = $syncServiceSid; } /** * Provides a human readable descriptive text for this Deployment, up to 256 characters long. * * @param string $friendlyName A human readable description for this Deployment. * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * Provides the unique string identifier of the Twilio Sync service instance that will be linked to and accessible by this Deployment. * * @param string $syncServiceSid The unique identifier of the Sync service * instance. * @return $this Fluent Builder */ public function setSyncServiceSid($syncServiceSid) { $this->options['syncServiceSid'] = $syncServiceSid; 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.Preview.DeployedDevices.CreateDeploymentOptions ' . \implode(' ', $options) . ']'; } } class UpdateDeploymentOptions extends Options { /** * @param string $friendlyName A human readable description for this Deployment. * @param string $syncServiceSid The unique identifier of the Sync service * instance. */ public function __construct($friendlyName = Values::NONE, $syncServiceSid = Values::NONE) { $this->options['friendlyName'] = $friendlyName; $this->options['syncServiceSid'] = $syncServiceSid; } /** * Provides a human readable descriptive text for this Deployment, up to 64 characters long * * @param string $friendlyName A human readable description for this Deployment. * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * Provides the unique string identifier of the Twilio Sync service instance that will be linked to and accessible by this Deployment. * * @param string $syncServiceSid The unique identifier of the Sync service * instance. * @return $this Fluent Builder */ public function setSyncServiceSid($syncServiceSid) { $this->options['syncServiceSid'] = $syncServiceSid; 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.Preview.DeployedDevices.UpdateDeploymentOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Preview/Marketplace.php 0000644 00000005744 15002236443 0014673 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\Rest\Preview\Marketplace\AvailableAddOnList; use Twilio\Rest\Preview\Marketplace\InstalledAddOnList; use Twilio\Version; /** * @property \Twilio\Rest\Preview\Marketplace\AvailableAddOnList $availableAddOns * @property \Twilio\Rest\Preview\Marketplace\InstalledAddOnList $installedAddOns * @method \Twilio\Rest\Preview\Marketplace\AvailableAddOnContext availableAddOns(string $sid) * @method \Twilio\Rest\Preview\Marketplace\InstalledAddOnContext installedAddOns(string $sid) */ class Marketplace extends Version { protected $_availableAddOns = null; protected $_installedAddOns = null; /** * Construct the Marketplace version of Preview * * @param \Twilio\Domain $domain Domain that contains the version * @return \Twilio\Rest\Preview\Marketplace Marketplace version of Preview */ public function __construct(Domain $domain) { parent::__construct($domain); $this->version = 'marketplace'; } /** * @return \Twilio\Rest\Preview\Marketplace\AvailableAddOnList */ protected function getAvailableAddOns() { if (!$this->_availableAddOns) { $this->_availableAddOns = new AvailableAddOnList($this); } return $this->_availableAddOns; } /** * @return \Twilio\Rest\Preview\Marketplace\InstalledAddOnList */ protected function getInstalledAddOns() { if (!$this->_installedAddOns) { $this->_installedAddOns = new InstalledAddOnList($this); } return $this->_installedAddOns; } /** * Magic getter to lazy load root resources * * @param string $name Resource to return * @return \Twilio\ListResource The requested resource * @throws TwilioException For unknown resource */ public function __get($name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown resource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Preview.Marketplace]'; } } sdk/src/Twilio/Rest/Preview/HostedNumbers.php 0000644 00000006170 15002236443 0015217 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\Rest\Preview\HostedNumbers\AuthorizationDocumentList; use Twilio\Rest\Preview\HostedNumbers\HostedNumberOrderList; use Twilio\Version; /** * @property \Twilio\Rest\Preview\HostedNumbers\AuthorizationDocumentList $authorizationDocuments * @property \Twilio\Rest\Preview\HostedNumbers\HostedNumberOrderList $hostedNumberOrders * @method \Twilio\Rest\Preview\HostedNumbers\AuthorizationDocumentContext authorizationDocuments(string $sid) * @method \Twilio\Rest\Preview\HostedNumbers\HostedNumberOrderContext hostedNumberOrders(string $sid) */ class HostedNumbers extends Version { protected $_authorizationDocuments = null; protected $_hostedNumberOrders = null; /** * Construct the HostedNumbers version of Preview * * @param \Twilio\Domain $domain Domain that contains the version * @return \Twilio\Rest\Preview\HostedNumbers HostedNumbers version of Preview */ public function __construct(Domain $domain) { parent::__construct($domain); $this->version = 'HostedNumbers'; } /** * @return \Twilio\Rest\Preview\HostedNumbers\AuthorizationDocumentList */ protected function getAuthorizationDocuments() { if (!$this->_authorizationDocuments) { $this->_authorizationDocuments = new AuthorizationDocumentList($this); } return $this->_authorizationDocuments; } /** * @return \Twilio\Rest\Preview\HostedNumbers\HostedNumberOrderList */ protected function getHostedNumberOrders() { if (!$this->_hostedNumberOrders) { $this->_hostedNumberOrders = new HostedNumberOrderList($this); } return $this->_hostedNumberOrders; } /** * Magic getter to lazy load root resources * * @param string $name Resource to return * @return \Twilio\ListResource The requested resource * @throws TwilioException For unknown resource */ public function __get($name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown resource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Preview.HostedNumbers]'; } } sdk/src/Twilio/Rest/Preview/Sync/ServiceOptions.php 0000644 00000014165 15002236443 0016330 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Sync; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ abstract class ServiceOptions { /** * @param string $friendlyName The friendly_name * @param string $webhookUrl The webhook_url * @param bool $reachabilityWebhooksEnabled The reachability_webhooks_enabled * @param bool $aclEnabled The acl_enabled * @return CreateServiceOptions Options builder */ public static function create($friendlyName = Values::NONE, $webhookUrl = Values::NONE, $reachabilityWebhooksEnabled = Values::NONE, $aclEnabled = Values::NONE) { return new CreateServiceOptions($friendlyName, $webhookUrl, $reachabilityWebhooksEnabled, $aclEnabled); } /** * @param string $webhookUrl The webhook_url * @param string $friendlyName The friendly_name * @param bool $reachabilityWebhooksEnabled The reachability_webhooks_enabled * @param bool $aclEnabled The acl_enabled * @return UpdateServiceOptions Options builder */ public static function update($webhookUrl = Values::NONE, $friendlyName = Values::NONE, $reachabilityWebhooksEnabled = Values::NONE, $aclEnabled = Values::NONE) { return new UpdateServiceOptions($webhookUrl, $friendlyName, $reachabilityWebhooksEnabled, $aclEnabled); } } class CreateServiceOptions extends Options { /** * @param string $friendlyName The friendly_name * @param string $webhookUrl The webhook_url * @param bool $reachabilityWebhooksEnabled The reachability_webhooks_enabled * @param bool $aclEnabled The acl_enabled */ public function __construct($friendlyName = Values::NONE, $webhookUrl = Values::NONE, $reachabilityWebhooksEnabled = Values::NONE, $aclEnabled = Values::NONE) { $this->options['friendlyName'] = $friendlyName; $this->options['webhookUrl'] = $webhookUrl; $this->options['reachabilityWebhooksEnabled'] = $reachabilityWebhooksEnabled; $this->options['aclEnabled'] = $aclEnabled; } /** * The friendly_name * * @param string $friendlyName The friendly_name * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The webhook_url * * @param string $webhookUrl The webhook_url * @return $this Fluent Builder */ public function setWebhookUrl($webhookUrl) { $this->options['webhookUrl'] = $webhookUrl; return $this; } /** * The reachability_webhooks_enabled * * @param bool $reachabilityWebhooksEnabled The reachability_webhooks_enabled * @return $this Fluent Builder */ public function setReachabilityWebhooksEnabled($reachabilityWebhooksEnabled) { $this->options['reachabilityWebhooksEnabled'] = $reachabilityWebhooksEnabled; return $this; } /** * The acl_enabled * * @param bool $aclEnabled The acl_enabled * @return $this Fluent Builder */ public function setAclEnabled($aclEnabled) { $this->options['aclEnabled'] = $aclEnabled; 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.Preview.Sync.CreateServiceOptions ' . \implode(' ', $options) . ']'; } } class UpdateServiceOptions extends Options { /** * @param string $webhookUrl The webhook_url * @param string $friendlyName The friendly_name * @param bool $reachabilityWebhooksEnabled The reachability_webhooks_enabled * @param bool $aclEnabled The acl_enabled */ public function __construct($webhookUrl = Values::NONE, $friendlyName = Values::NONE, $reachabilityWebhooksEnabled = Values::NONE, $aclEnabled = Values::NONE) { $this->options['webhookUrl'] = $webhookUrl; $this->options['friendlyName'] = $friendlyName; $this->options['reachabilityWebhooksEnabled'] = $reachabilityWebhooksEnabled; $this->options['aclEnabled'] = $aclEnabled; } /** * The webhook_url * * @param string $webhookUrl The webhook_url * @return $this Fluent Builder */ public function setWebhookUrl($webhookUrl) { $this->options['webhookUrl'] = $webhookUrl; return $this; } /** * The friendly_name * * @param string $friendlyName The friendly_name * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The reachability_webhooks_enabled * * @param bool $reachabilityWebhooksEnabled The reachability_webhooks_enabled * @return $this Fluent Builder */ public function setReachabilityWebhooksEnabled($reachabilityWebhooksEnabled) { $this->options['reachabilityWebhooksEnabled'] = $reachabilityWebhooksEnabled; return $this; } /** * The acl_enabled * * @param bool $aclEnabled The acl_enabled * @return $this Fluent Builder */ public function setAclEnabled($aclEnabled) { $this->options['aclEnabled'] = $aclEnabled; 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.Preview.Sync.UpdateServiceOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Preview/Sync/ServiceList.php 0000644 00000013323 15002236443 0015603 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Sync; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class ServiceList extends ListResource { /** * Construct the ServiceList * * @param Version $version Version that contains the resource * @return \Twilio\Rest\Preview\Sync\ServiceList */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = array(); $this->uri = '/Services'; } /** * Create a new ServiceInstance * * @param array|Options $options Optional Arguments * @return ServiceInstance Newly created ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function create($options = array()) { $options = new Values($options); $data = Values::of(array( 'FriendlyName' => $options['friendlyName'], 'WebhookUrl' => $options['webhookUrl'], 'ReachabilityWebhooksEnabled' => Serialize::booleanToString($options['reachabilityWebhooksEnabled']), 'AclEnabled' => Serialize::booleanToString($options['aclEnabled']), )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new ServiceInstance($this->version, $payload); } /** * Streams ServiceInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads ServiceInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return ServiceInstance[] Array of results */ public function read($limit = null, $pageSize = null) { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of ServiceInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of ServiceInstance */ public function page($pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $params = Values::of(array( 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new ServicePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of ServiceInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of ServiceInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new ServicePage($this->version, $response, $this->solution); } /** * Constructs a ServiceContext * * @param string $sid The sid * @return \Twilio\Rest\Preview\Sync\ServiceContext */ public function getContext($sid) { return new ServiceContext($this->version, $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Preview.Sync.ServiceList]'; } } sdk/src/Twilio/Rest/Preview/Sync/ServicePage.php 0000644 00000001637 15002236443 0015551 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Sync; use Twilio\Page; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class ServicePage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new ServiceInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Preview.Sync.ServicePage]'; } } sdk/src/Twilio/Rest/Preview/Sync/ServiceInstance.php 0000644 00000012174 15002236443 0016437 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Sync; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $sid * @property string $accountSid * @property string $friendlyName * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $url * @property string $webhookUrl * @property bool $reachabilityWebhooksEnabled * @property bool $aclEnabled * @property array $links */ class ServiceInstance extends InstanceResource { protected $_documents = null; protected $_syncLists = null; protected $_syncMaps = null; /** * Initialize the ServiceInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The sid * @return \Twilio\Rest\Preview\Sync\ServiceInstance */ public function __construct(Version $version, array $payload, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), 'webhookUrl' => Values::array_get($payload, 'webhook_url'), 'reachabilityWebhooksEnabled' => Values::array_get($payload, 'reachability_webhooks_enabled'), 'aclEnabled' => Values::array_get($payload, 'acl_enabled'), 'links' => Values::array_get($payload, 'links'), ); $this->solution = array('sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Preview\Sync\ServiceContext Context for this * ServiceInstance */ protected function proxy() { if (!$this->context) { $this->context = new ServiceContext($this->version, $this->solution['sid']); } return $this->context; } /** * Fetch a ServiceInstance * * @return ServiceInstance Fetched ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the ServiceInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Update the ServiceInstance * * @param array|Options $options Optional Arguments * @return ServiceInstance Updated ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Access the documents * * @return \Twilio\Rest\Preview\Sync\Service\DocumentList */ protected function getDocuments() { return $this->proxy()->documents; } /** * Access the syncLists * * @return \Twilio\Rest\Preview\Sync\Service\SyncListList */ protected function getSyncLists() { return $this->proxy()->syncLists; } /** * Access the syncMaps * * @return \Twilio\Rest\Preview\Sync\Service\SyncMapList */ protected function getSyncMaps() { return $this->proxy()->syncMaps; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.Sync.ServiceInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/Sync/Service/SyncMapPage.php 0000644 00000001706 15002236443 0017120 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Sync\Service; use Twilio\Page; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class SyncMapPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new SyncMapInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Preview.Sync.SyncMapPage]'; } } sdk/src/Twilio/Rest/Preview/Sync/Service/SyncMapOptions.php 0000644 00000003121 15002236443 0017670 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Sync\Service; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ abstract class SyncMapOptions { /** * @param string $uniqueName The unique_name * @return CreateSyncMapOptions Options builder */ public static function create($uniqueName = Values::NONE) { return new CreateSyncMapOptions($uniqueName); } } class CreateSyncMapOptions extends Options { /** * @param string $uniqueName The unique_name */ public function __construct($uniqueName = Values::NONE) { $this->options['uniqueName'] = $uniqueName; } /** * The unique_name * * @param string $uniqueName The unique_name * @return $this Fluent Builder */ public function setUniqueName($uniqueName) { $this->options['uniqueName'] = $uniqueName; 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.Preview.Sync.CreateSyncMapOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Preview/Sync/Service/SyncListOptions.php 0000644 00000003126 15002236443 0020073 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Sync\Service; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ abstract class SyncListOptions { /** * @param string $uniqueName The unique_name * @return CreateSyncListOptions Options builder */ public static function create($uniqueName = Values::NONE) { return new CreateSyncListOptions($uniqueName); } } class CreateSyncListOptions extends Options { /** * @param string $uniqueName The unique_name */ public function __construct($uniqueName = Values::NONE) { $this->options['uniqueName'] = $uniqueName; } /** * The unique_name * * @param string $uniqueName The unique_name * @return $this Fluent Builder */ public function setUniqueName($uniqueName) { $this->options['uniqueName'] = $uniqueName; 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.Preview.Sync.CreateSyncListOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Preview/Sync/Service/SyncListPage.php 0000644 00000001711 15002236443 0017312 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Sync\Service; use Twilio\Page; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class SyncListPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new SyncListInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Preview.Sync.SyncListPage]'; } } sdk/src/Twilio/Rest/Preview/Sync/Service/SyncMapInstance.php 0000644 00000011432 15002236443 0020005 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Sync\Service; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $sid * @property string $uniqueName * @property string $accountSid * @property string $serviceSid * @property string $url * @property array $links * @property string $revision * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $createdBy */ class SyncMapInstance extends InstanceResource { protected $_syncMapItems = null; protected $_syncMapPermissions = null; /** * Initialize the SyncMapInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The service_sid * @param string $sid The sid * @return \Twilio\Rest\Preview\Sync\Service\SyncMapInstance */ public function __construct(Version $version, array $payload, $serviceSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'sid' => Values::array_get($payload, 'sid'), 'uniqueName' => Values::array_get($payload, 'unique_name'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), 'revision' => Values::array_get($payload, 'revision'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'createdBy' => Values::array_get($payload, 'created_by'), ); $this->solution = array('serviceSid' => $serviceSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Preview\Sync\Service\SyncMapContext Context for this * SyncMapInstance */ protected function proxy() { if (!$this->context) { $this->context = new SyncMapContext( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch a SyncMapInstance * * @return SyncMapInstance Fetched SyncMapInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the SyncMapInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Access the syncMapItems * * @return \Twilio\Rest\Preview\Sync\Service\SyncMap\SyncMapItemList */ protected function getSyncMapItems() { return $this->proxy()->syncMapItems; } /** * Access the syncMapPermissions * * @return \Twilio\Rest\Preview\Sync\Service\SyncMap\SyncMapPermissionList */ protected function getSyncMapPermissions() { return $this->proxy()->syncMapPermissions; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.Sync.SyncMapInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/Sync/Service/SyncList/SyncListItemContext.php 0000644 00000006307 15002236443 0022457 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Sync\Service\SyncList; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class SyncListItemContext extends InstanceContext { /** * Initialize the SyncListItemContext * * @param \Twilio\Version $version Version that contains the resource * @param string $serviceSid The service_sid * @param string $listSid The list_sid * @param int $index The index * @return \Twilio\Rest\Preview\Sync\Service\SyncList\SyncListItemContext */ public function __construct(Version $version, $serviceSid, $listSid, $index) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, 'listSid' => $listSid, 'index' => $index, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Lists/' . \rawurlencode($listSid) . '/Items/' . \rawurlencode($index) . ''; } /** * Fetch a SyncListItemInstance * * @return SyncListItemInstance Fetched SyncListItemInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new SyncListItemInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['listSid'], $this->solution['index'] ); } /** * Deletes the SyncListItemInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Update the SyncListItemInstance * * @param array $data The data * @return SyncListItemInstance Updated SyncListItemInstance * @throws TwilioException When an HTTP error occurs. */ public function update($data) { $data = Values::of(array('Data' => Serialize::jsonObject($data), )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new SyncListItemInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['listSid'], $this->solution['index'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.Sync.SyncListItemContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/Sync/Service/SyncList/SyncListPermissionList.php 0000644 00000012736 15002236443 0023203 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Sync\Service\SyncList; use Twilio\ListResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class SyncListPermissionList extends ListResource { /** * Construct the SyncListPermissionList * * @param Version $version Version that contains the resource * @param string $serviceSid Sync Service Instance SID. * @param string $listSid Sync List SID. * @return \Twilio\Rest\Preview\Sync\Service\SyncList\SyncListPermissionList */ public function __construct(Version $version, $serviceSid, $listSid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, 'listSid' => $listSid, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Lists/' . \rawurlencode($listSid) . '/Permissions'; } /** * Streams SyncListPermissionInstance records from the API as a generator * stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads SyncListPermissionInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return SyncListPermissionInstance[] Array of results */ public function read($limit = null, $pageSize = null) { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of SyncListPermissionInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of SyncListPermissionInstance */ public function page($pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $params = Values::of(array( 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new SyncListPermissionPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of SyncListPermissionInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of SyncListPermissionInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new SyncListPermissionPage($this->version, $response, $this->solution); } /** * Constructs a SyncListPermissionContext * * @param string $identity Identity of the user to whom the Sync List * Permission applies. * @return \Twilio\Rest\Preview\Sync\Service\SyncList\SyncListPermissionContext */ public function getContext($identity) { return new SyncListPermissionContext( $this->version, $this->solution['serviceSid'], $this->solution['listSid'], $identity ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Preview.Sync.SyncListPermissionList]'; } } sdk/src/Twilio/Rest/Preview/Sync/Service/SyncList/SyncListPermissionPage.php 0000644 00000002106 15002236443 0023132 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Sync\Service\SyncList; use Twilio\Page; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class SyncListPermissionPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new SyncListPermissionInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['listSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Preview.Sync.SyncListPermissionPage]'; } } sdk/src/Twilio/Rest/Preview/Sync/Service/SyncList/SyncListItemPage.php 0000644 00000002064 15002236443 0021703 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Sync\Service\SyncList; use Twilio\Page; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class SyncListItemPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new SyncListItemInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['listSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Preview.Sync.SyncListItemPage]'; } } sdk/src/Twilio/Rest/Preview/Sync/Service/SyncList/SyncListItemList.php 0000644 00000014623 15002236443 0021746 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Sync\Service\SyncList; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class SyncListItemList extends ListResource { /** * Construct the SyncListItemList * * @param Version $version Version that contains the resource * @param string $serviceSid The service_sid * @param string $listSid The list_sid * @return \Twilio\Rest\Preview\Sync\Service\SyncList\SyncListItemList */ public function __construct(Version $version, $serviceSid, $listSid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, 'listSid' => $listSid, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Lists/' . \rawurlencode($listSid) . '/Items'; } /** * Create a new SyncListItemInstance * * @param array $data The data * @return SyncListItemInstance Newly created SyncListItemInstance * @throws TwilioException When an HTTP error occurs. */ public function create($data) { $data = Values::of(array('Data' => Serialize::jsonObject($data), )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new SyncListItemInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['listSid'] ); } /** * Streams SyncListItemInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($options = array(), $limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads SyncListItemInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return SyncListItemInstance[] Array of results */ public function read($options = array(), $limit = null, $pageSize = null) { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Retrieve a single page of SyncListItemInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of SyncListItemInstance */ public function page($options = array(), $pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $options = new Values($options); $params = Values::of(array( 'Order' => $options['order'], 'From' => $options['from'], 'Bounds' => $options['bounds'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new SyncListItemPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of SyncListItemInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of SyncListItemInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new SyncListItemPage($this->version, $response, $this->solution); } /** * Constructs a SyncListItemContext * * @param int $index The index * @return \Twilio\Rest\Preview\Sync\Service\SyncList\SyncListItemContext */ public function getContext($index) { return new SyncListItemContext( $this->version, $this->solution['serviceSid'], $this->solution['listSid'], $index ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Preview.Sync.SyncListItemList]'; } } sdk/src/Twilio/Rest/Preview/Sync/Service/SyncList/SyncListItemOptions.php 0000644 00000004455 15002236443 0022470 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Sync\Service\SyncList; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ abstract class SyncListItemOptions { /** * @param string $order The order * @param string $from The from * @param string $bounds The bounds * @return ReadSyncListItemOptions Options builder */ public static function read($order = Values::NONE, $from = Values::NONE, $bounds = Values::NONE) { return new ReadSyncListItemOptions($order, $from, $bounds); } } class ReadSyncListItemOptions extends Options { /** * @param string $order The order * @param string $from The from * @param string $bounds The bounds */ public function __construct($order = Values::NONE, $from = Values::NONE, $bounds = Values::NONE) { $this->options['order'] = $order; $this->options['from'] = $from; $this->options['bounds'] = $bounds; } /** * The order * * @param string $order The order * @return $this Fluent Builder */ public function setOrder($order) { $this->options['order'] = $order; return $this; } /** * The from * * @param string $from The from * @return $this Fluent Builder */ public function setFrom($from) { $this->options['from'] = $from; return $this; } /** * The bounds * * @param string $bounds The bounds * @return $this Fluent Builder */ public function setBounds($bounds) { $this->options['bounds'] = $bounds; 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.Preview.Sync.ReadSyncListItemOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Preview/Sync/Service/SyncList/SyncListPermissionContext.php 0000644 00000007275 15002236443 0023716 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Sync\Service\SyncList; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class SyncListPermissionContext extends InstanceContext { /** * Initialize the SyncListPermissionContext * * @param \Twilio\Version $version Version that contains the resource * @param string $serviceSid The service_sid * @param string $listSid Sync List SID or unique name. * @param string $identity Identity of the user to whom the Sync List * Permission applies. * @return \Twilio\Rest\Preview\Sync\Service\SyncList\SyncListPermissionContext */ public function __construct(Version $version, $serviceSid, $listSid, $identity) { parent::__construct($version); // Path Solution $this->solution = array( 'serviceSid' => $serviceSid, 'listSid' => $listSid, 'identity' => $identity, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Lists/' . \rawurlencode($listSid) . '/Permissions/' . \rawurlencode($identity) . ''; } /** * Fetch a SyncListPermissionInstance * * @return SyncListPermissionInstance Fetched SyncListPermissionInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new SyncListPermissionInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['listSid'], $this->solution['identity'] ); } /** * Deletes the SyncListPermissionInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Update the SyncListPermissionInstance * * @param bool $read Read access. * @param bool $write Write access. * @param bool $manage Manage access. * @return SyncListPermissionInstance Updated SyncListPermissionInstance * @throws TwilioException When an HTTP error occurs. */ public function update($read, $write, $manage) { $data = Values::of(array( 'Read' => Serialize::booleanToString($read), 'Write' => Serialize::booleanToString($write), 'Manage' => Serialize::booleanToString($manage), )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new SyncListPermissionInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['listSid'], $this->solution['identity'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.Sync.SyncListPermissionContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/Sync/Service/SyncList/SyncListPermissionInstance.php 0000644 00000011366 15002236443 0024032 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Sync\Service\SyncList; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $accountSid * @property string $serviceSid * @property string $listSid * @property string $identity * @property bool $read * @property bool $write * @property bool $manage * @property string $url */ class SyncListPermissionInstance extends InstanceResource { /** * Initialize the SyncListPermissionInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid Sync Service Instance SID. * @param string $listSid Sync List SID. * @param string $identity Identity of the user to whom the Sync List * Permission applies. * @return \Twilio\Rest\Preview\Sync\Service\SyncList\SyncListPermissionInstance */ public function __construct(Version $version, array $payload, $serviceSid, $listSid, $identity = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'listSid' => Values::array_get($payload, 'list_sid'), 'identity' => Values::array_get($payload, 'identity'), 'read' => Values::array_get($payload, 'read'), 'write' => Values::array_get($payload, 'write'), 'manage' => Values::array_get($payload, 'manage'), 'url' => Values::array_get($payload, 'url'), ); $this->solution = array( 'serviceSid' => $serviceSid, 'listSid' => $listSid, 'identity' => $identity ?: $this->properties['identity'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Preview\Sync\Service\SyncList\SyncListPermissionContext Context for this SyncListPermissionInstance */ protected function proxy() { if (!$this->context) { $this->context = new SyncListPermissionContext( $this->version, $this->solution['serviceSid'], $this->solution['listSid'], $this->solution['identity'] ); } return $this->context; } /** * Fetch a SyncListPermissionInstance * * @return SyncListPermissionInstance Fetched SyncListPermissionInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the SyncListPermissionInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Update the SyncListPermissionInstance * * @param bool $read Read access. * @param bool $write Write access. * @param bool $manage Manage access. * @return SyncListPermissionInstance Updated SyncListPermissionInstance * @throws TwilioException When an HTTP error occurs. */ public function update($read, $write, $manage) { return $this->proxy()->update($read, $write, $manage); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.Sync.SyncListPermissionInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/Sync/Service/SyncList/SyncListItemInstance.php 0000644 00000011343 15002236443 0022573 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Sync\Service\SyncList; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property int $index * @property string $accountSid * @property string $serviceSid * @property string $listSid * @property string $url * @property string $revision * @property array $data * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $createdBy */ class SyncListItemInstance extends InstanceResource { /** * Initialize the SyncListItemInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The service_sid * @param string $listSid The list_sid * @param int $index The index * @return \Twilio\Rest\Preview\Sync\Service\SyncList\SyncListItemInstance */ public function __construct(Version $version, array $payload, $serviceSid, $listSid, $index = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'index' => Values::array_get($payload, 'index'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'listSid' => Values::array_get($payload, 'list_sid'), 'url' => Values::array_get($payload, 'url'), 'revision' => Values::array_get($payload, 'revision'), 'data' => Values::array_get($payload, 'data'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'createdBy' => Values::array_get($payload, 'created_by'), ); $this->solution = array( 'serviceSid' => $serviceSid, 'listSid' => $listSid, 'index' => $index ?: $this->properties['index'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Preview\Sync\Service\SyncList\SyncListItemContext Context for this SyncListItemInstance */ protected function proxy() { if (!$this->context) { $this->context = new SyncListItemContext( $this->version, $this->solution['serviceSid'], $this->solution['listSid'], $this->solution['index'] ); } return $this->context; } /** * Fetch a SyncListItemInstance * * @return SyncListItemInstance Fetched SyncListItemInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the SyncListItemInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Update the SyncListItemInstance * * @param array $data The data * @return SyncListItemInstance Updated SyncListItemInstance * @throws TwilioException When an HTTP error occurs. */ public function update($data) { return $this->proxy()->update($data); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.Sync.SyncListItemInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/Sync/Service/SyncMapContext.php 0000644 00000011542 15002236443 0017667 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Sync\Service; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Rest\Preview\Sync\Service\SyncMap\SyncMapItemList; use Twilio\Rest\Preview\Sync\Service\SyncMap\SyncMapPermissionList; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property \Twilio\Rest\Preview\Sync\Service\SyncMap\SyncMapItemList $syncMapItems * @property \Twilio\Rest\Preview\Sync\Service\SyncMap\SyncMapPermissionList $syncMapPermissions * @method \Twilio\Rest\Preview\Sync\Service\SyncMap\SyncMapItemContext syncMapItems(string $key) * @method \Twilio\Rest\Preview\Sync\Service\SyncMap\SyncMapPermissionContext syncMapPermissions(string $identity) */ class SyncMapContext extends InstanceContext { protected $_syncMapItems = null; protected $_syncMapPermissions = null; /** * Initialize the SyncMapContext * * @param \Twilio\Version $version Version that contains the resource * @param string $serviceSid The service_sid * @param string $sid The sid * @return \Twilio\Rest\Preview\Sync\Service\SyncMapContext */ public function __construct(Version $version, $serviceSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, 'sid' => $sid, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Maps/' . \rawurlencode($sid) . ''; } /** * Fetch a SyncMapInstance * * @return SyncMapInstance Fetched SyncMapInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new SyncMapInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Deletes the SyncMapInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Access the syncMapItems * * @return \Twilio\Rest\Preview\Sync\Service\SyncMap\SyncMapItemList */ protected function getSyncMapItems() { if (!$this->_syncMapItems) { $this->_syncMapItems = new SyncMapItemList( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->_syncMapItems; } /** * Access the syncMapPermissions * * @return \Twilio\Rest\Preview\Sync\Service\SyncMap\SyncMapPermissionList */ protected function getSyncMapPermissions() { if (!$this->_syncMapPermissions) { $this->_syncMapPermissions = new SyncMapPermissionList( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->_syncMapPermissions; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get($name) { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.Sync.SyncMapContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/Sync/Service/SyncMapList.php 0000644 00000013207 15002236443 0017156 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Sync\Service; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class SyncMapList extends ListResource { /** * Construct the SyncMapList * * @param Version $version Version that contains the resource * @param string $serviceSid The service_sid * @return \Twilio\Rest\Preview\Sync\Service\SyncMapList */ public function __construct(Version $version, $serviceSid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Maps'; } /** * Create a new SyncMapInstance * * @param array|Options $options Optional Arguments * @return SyncMapInstance Newly created SyncMapInstance * @throws TwilioException When an HTTP error occurs. */ public function create($options = array()) { $options = new Values($options); $data = Values::of(array('UniqueName' => $options['uniqueName'], )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new SyncMapInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Streams SyncMapInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads SyncMapInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return SyncMapInstance[] Array of results */ public function read($limit = null, $pageSize = null) { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of SyncMapInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of SyncMapInstance */ public function page($pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $params = Values::of(array( 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new SyncMapPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of SyncMapInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of SyncMapInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new SyncMapPage($this->version, $response, $this->solution); } /** * Constructs a SyncMapContext * * @param string $sid The sid * @return \Twilio\Rest\Preview\Sync\Service\SyncMapContext */ public function getContext($sid) { return new SyncMapContext($this->version, $this->solution['serviceSid'], $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Preview.Sync.SyncMapList]'; } } sdk/src/Twilio/Rest/Preview/Sync/Service/SyncListContext.php 0000644 00000011615 15002236443 0020066 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Sync\Service; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Rest\Preview\Sync\Service\SyncList\SyncListItemList; use Twilio\Rest\Preview\Sync\Service\SyncList\SyncListPermissionList; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property \Twilio\Rest\Preview\Sync\Service\SyncList\SyncListItemList $syncListItems * @property \Twilio\Rest\Preview\Sync\Service\SyncList\SyncListPermissionList $syncListPermissions * @method \Twilio\Rest\Preview\Sync\Service\SyncList\SyncListItemContext syncListItems(int $index) * @method \Twilio\Rest\Preview\Sync\Service\SyncList\SyncListPermissionContext syncListPermissions(string $identity) */ class SyncListContext extends InstanceContext { protected $_syncListItems = null; protected $_syncListPermissions = null; /** * Initialize the SyncListContext * * @param \Twilio\Version $version Version that contains the resource * @param string $serviceSid The service_sid * @param string $sid The sid * @return \Twilio\Rest\Preview\Sync\Service\SyncListContext */ public function __construct(Version $version, $serviceSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, 'sid' => $sid, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Lists/' . \rawurlencode($sid) . ''; } /** * Fetch a SyncListInstance * * @return SyncListInstance Fetched SyncListInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new SyncListInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Deletes the SyncListInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Access the syncListItems * * @return \Twilio\Rest\Preview\Sync\Service\SyncList\SyncListItemList */ protected function getSyncListItems() { if (!$this->_syncListItems) { $this->_syncListItems = new SyncListItemList( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->_syncListItems; } /** * Access the syncListPermissions * * @return \Twilio\Rest\Preview\Sync\Service\SyncList\SyncListPermissionList */ protected function getSyncListPermissions() { if (!$this->_syncListPermissions) { $this->_syncListPermissions = new SyncListPermissionList( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->_syncListPermissions; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get($name) { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.Sync.SyncListContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/Sync/Service/SyncListList.php 0000644 00000013234 15002236443 0017354 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Sync\Service; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class SyncListList extends ListResource { /** * Construct the SyncListList * * @param Version $version Version that contains the resource * @param string $serviceSid The service_sid * @return \Twilio\Rest\Preview\Sync\Service\SyncListList */ public function __construct(Version $version, $serviceSid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Lists'; } /** * Create a new SyncListInstance * * @param array|Options $options Optional Arguments * @return SyncListInstance Newly created SyncListInstance * @throws TwilioException When an HTTP error occurs. */ public function create($options = array()) { $options = new Values($options); $data = Values::of(array('UniqueName' => $options['uniqueName'], )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new SyncListInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Streams SyncListInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads SyncListInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return SyncListInstance[] Array of results */ public function read($limit = null, $pageSize = null) { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of SyncListInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of SyncListInstance */ public function page($pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $params = Values::of(array( 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new SyncListPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of SyncListInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of SyncListInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new SyncListPage($this->version, $response, $this->solution); } /** * Constructs a SyncListContext * * @param string $sid The sid * @return \Twilio\Rest\Preview\Sync\Service\SyncListContext */ public function getContext($sid) { return new SyncListContext($this->version, $this->solution['serviceSid'], $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Preview.Sync.SyncListList]'; } } sdk/src/Twilio/Rest/Preview/Sync/Service/DocumentInstance.php 0000644 00000011646 15002236443 0020220 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Sync\Service; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $sid * @property string $uniqueName * @property string $accountSid * @property string $serviceSid * @property string $url * @property array $links * @property string $revision * @property array $data * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $createdBy */ class DocumentInstance extends InstanceResource { protected $_documentPermissions = null; /** * Initialize the DocumentInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The service_sid * @param string $sid The sid * @return \Twilio\Rest\Preview\Sync\Service\DocumentInstance */ public function __construct(Version $version, array $payload, $serviceSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'sid' => Values::array_get($payload, 'sid'), 'uniqueName' => Values::array_get($payload, 'unique_name'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), 'revision' => Values::array_get($payload, 'revision'), 'data' => Values::array_get($payload, 'data'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'createdBy' => Values::array_get($payload, 'created_by'), ); $this->solution = array('serviceSid' => $serviceSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Preview\Sync\Service\DocumentContext Context for this * DocumentInstance */ protected function proxy() { if (!$this->context) { $this->context = new DocumentContext( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch a DocumentInstance * * @return DocumentInstance Fetched DocumentInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the DocumentInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Update the DocumentInstance * * @param array $data The data * @return DocumentInstance Updated DocumentInstance * @throws TwilioException When an HTTP error occurs. */ public function update($data) { return $this->proxy()->update($data); } /** * Access the documentPermissions * * @return \Twilio\Rest\Preview\Sync\Service\Document\DocumentPermissionList */ protected function getDocumentPermissions() { return $this->proxy()->documentPermissions; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.Sync.DocumentInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/Sync/Service/DocumentContext.php 0000644 00000011475 15002236443 0020100 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Sync\Service; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Rest\Preview\Sync\Service\Document\DocumentPermissionList; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property \Twilio\Rest\Preview\Sync\Service\Document\DocumentPermissionList $documentPermissions * @method \Twilio\Rest\Preview\Sync\Service\Document\DocumentPermissionContext documentPermissions(string $identity) */ class DocumentContext extends InstanceContext { protected $_documentPermissions = null; /** * Initialize the DocumentContext * * @param \Twilio\Version $version Version that contains the resource * @param string $serviceSid The service_sid * @param string $sid The sid * @return \Twilio\Rest\Preview\Sync\Service\DocumentContext */ public function __construct(Version $version, $serviceSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, 'sid' => $sid, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Documents/' . \rawurlencode($sid) . ''; } /** * Fetch a DocumentInstance * * @return DocumentInstance Fetched DocumentInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new DocumentInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Deletes the DocumentInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Update the DocumentInstance * * @param array $data The data * @return DocumentInstance Updated DocumentInstance * @throws TwilioException When an HTTP error occurs. */ public function update($data) { $data = Values::of(array('Data' => Serialize::jsonObject($data), )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new DocumentInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Access the documentPermissions * * @return \Twilio\Rest\Preview\Sync\Service\Document\DocumentPermissionList */ protected function getDocumentPermissions() { if (!$this->_documentPermissions) { $this->_documentPermissions = new DocumentPermissionList( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->_documentPermissions; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get($name) { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.Sync.DocumentContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/Sync/Service/DocumentList.php 0000644 00000013412 15002236443 0017360 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Sync\Service; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class DocumentList extends ListResource { /** * Construct the DocumentList * * @param Version $version Version that contains the resource * @param string $serviceSid The service_sid * @return \Twilio\Rest\Preview\Sync\Service\DocumentList */ public function __construct(Version $version, $serviceSid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Documents'; } /** * Create a new DocumentInstance * * @param array|Options $options Optional Arguments * @return DocumentInstance Newly created DocumentInstance * @throws TwilioException When an HTTP error occurs. */ public function create($options = array()) { $options = new Values($options); $data = Values::of(array( 'UniqueName' => $options['uniqueName'], 'Data' => Serialize::jsonObject($options['data']), )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new DocumentInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Streams DocumentInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads DocumentInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return DocumentInstance[] Array of results */ public function read($limit = null, $pageSize = null) { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of DocumentInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of DocumentInstance */ public function page($pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $params = Values::of(array( 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new DocumentPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of DocumentInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of DocumentInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new DocumentPage($this->version, $response, $this->solution); } /** * Constructs a DocumentContext * * @param string $sid The sid * @return \Twilio\Rest\Preview\Sync\Service\DocumentContext */ public function getContext($sid) { return new DocumentContext($this->version, $this->solution['serviceSid'], $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Preview.Sync.DocumentList]'; } } sdk/src/Twilio/Rest/Preview/Sync/Service/SyncListInstance.php 0000644 00000011462 15002236443 0020206 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Sync\Service; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $sid * @property string $uniqueName * @property string $accountSid * @property string $serviceSid * @property string $url * @property array $links * @property string $revision * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $createdBy */ class SyncListInstance extends InstanceResource { protected $_syncListItems = null; protected $_syncListPermissions = null; /** * Initialize the SyncListInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The service_sid * @param string $sid The sid * @return \Twilio\Rest\Preview\Sync\Service\SyncListInstance */ public function __construct(Version $version, array $payload, $serviceSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'sid' => Values::array_get($payload, 'sid'), 'uniqueName' => Values::array_get($payload, 'unique_name'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), 'revision' => Values::array_get($payload, 'revision'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'createdBy' => Values::array_get($payload, 'created_by'), ); $this->solution = array('serviceSid' => $serviceSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Preview\Sync\Service\SyncListContext Context for this * SyncListInstance */ protected function proxy() { if (!$this->context) { $this->context = new SyncListContext( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch a SyncListInstance * * @return SyncListInstance Fetched SyncListInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the SyncListInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Access the syncListItems * * @return \Twilio\Rest\Preview\Sync\Service\SyncList\SyncListItemList */ protected function getSyncListItems() { return $this->proxy()->syncListItems; } /** * Access the syncListPermissions * * @return \Twilio\Rest\Preview\Sync\Service\SyncList\SyncListPermissionList */ protected function getSyncListPermissions() { return $this->proxy()->syncListPermissions; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.Sync.SyncListInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/Sync/Service/DocumentPage.php 0000644 00000001711 15002236443 0017320 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Sync\Service; use Twilio\Page; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class DocumentPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new DocumentInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Preview.Sync.DocumentPage]'; } } sdk/src/Twilio/Rest/Preview/Sync/Service/SyncMap/SyncMapItemOptions.php 0000644 00000004447 15002236443 0022075 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Sync\Service\SyncMap; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ abstract class SyncMapItemOptions { /** * @param string $order The order * @param string $from The from * @param string $bounds The bounds * @return ReadSyncMapItemOptions Options builder */ public static function read($order = Values::NONE, $from = Values::NONE, $bounds = Values::NONE) { return new ReadSyncMapItemOptions($order, $from, $bounds); } } class ReadSyncMapItemOptions extends Options { /** * @param string $order The order * @param string $from The from * @param string $bounds The bounds */ public function __construct($order = Values::NONE, $from = Values::NONE, $bounds = Values::NONE) { $this->options['order'] = $order; $this->options['from'] = $from; $this->options['bounds'] = $bounds; } /** * The order * * @param string $order The order * @return $this Fluent Builder */ public function setOrder($order) { $this->options['order'] = $order; return $this; } /** * The from * * @param string $from The from * @return $this Fluent Builder */ public function setFrom($from) { $this->options['from'] = $from; return $this; } /** * The bounds * * @param string $bounds The bounds * @return $this Fluent Builder */ public function setBounds($bounds) { $this->options['bounds'] = $bounds; 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.Preview.Sync.ReadSyncMapItemOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Preview/Sync/Service/SyncMap/SyncMapItemPage.php 0000644 00000002057 15002236443 0021311 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Sync\Service\SyncMap; use Twilio\Page; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class SyncMapItemPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new SyncMapItemInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['mapSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Preview.Sync.SyncMapItemPage]'; } } sdk/src/Twilio/Rest/Preview/Sync/Service/SyncMap/SyncMapPermissionPage.php 0000644 00000002101 15002236443 0022531 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Sync\Service\SyncMap; use Twilio\Page; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class SyncMapPermissionPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new SyncMapPermissionInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['mapSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Preview.Sync.SyncMapPermissionPage]'; } } sdk/src/Twilio/Rest/Preview/Sync/Service/SyncMap/SyncMapItemList.php 0000644 00000014645 15002236443 0021356 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Sync\Service\SyncMap; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class SyncMapItemList extends ListResource { /** * Construct the SyncMapItemList * * @param Version $version Version that contains the resource * @param string $serviceSid The service_sid * @param string $mapSid The map_sid * @return \Twilio\Rest\Preview\Sync\Service\SyncMap\SyncMapItemList */ public function __construct(Version $version, $serviceSid, $mapSid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, 'mapSid' => $mapSid, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Maps/' . \rawurlencode($mapSid) . '/Items'; } /** * Create a new SyncMapItemInstance * * @param string $key The key * @param array $data The data * @return SyncMapItemInstance Newly created SyncMapItemInstance * @throws TwilioException When an HTTP error occurs. */ public function create($key, $data) { $data = Values::of(array('Key' => $key, 'Data' => Serialize::jsonObject($data), )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new SyncMapItemInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['mapSid'] ); } /** * Streams SyncMapItemInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($options = array(), $limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads SyncMapItemInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return SyncMapItemInstance[] Array of results */ public function read($options = array(), $limit = null, $pageSize = null) { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Retrieve a single page of SyncMapItemInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of SyncMapItemInstance */ public function page($options = array(), $pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $options = new Values($options); $params = Values::of(array( 'Order' => $options['order'], 'From' => $options['from'], 'Bounds' => $options['bounds'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new SyncMapItemPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of SyncMapItemInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of SyncMapItemInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new SyncMapItemPage($this->version, $response, $this->solution); } /** * Constructs a SyncMapItemContext * * @param string $key The key * @return \Twilio\Rest\Preview\Sync\Service\SyncMap\SyncMapItemContext */ public function getContext($key) { return new SyncMapItemContext( $this->version, $this->solution['serviceSid'], $this->solution['mapSid'], $key ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Preview.Sync.SyncMapItemList]'; } } sdk/src/Twilio/Rest/Preview/Sync/Service/SyncMap/SyncMapPermissionList.php 0000644 00000012673 15002236443 0022607 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Sync\Service\SyncMap; use Twilio\ListResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class SyncMapPermissionList extends ListResource { /** * Construct the SyncMapPermissionList * * @param Version $version Version that contains the resource * @param string $serviceSid Sync Service Instance SID. * @param string $mapSid Sync Map SID. * @return \Twilio\Rest\Preview\Sync\Service\SyncMap\SyncMapPermissionList */ public function __construct(Version $version, $serviceSid, $mapSid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, 'mapSid' => $mapSid, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Maps/' . \rawurlencode($mapSid) . '/Permissions'; } /** * Streams SyncMapPermissionInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads SyncMapPermissionInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return SyncMapPermissionInstance[] Array of results */ public function read($limit = null, $pageSize = null) { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of SyncMapPermissionInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of SyncMapPermissionInstance */ public function page($pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $params = Values::of(array( 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new SyncMapPermissionPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of SyncMapPermissionInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of SyncMapPermissionInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new SyncMapPermissionPage($this->version, $response, $this->solution); } /** * Constructs a SyncMapPermissionContext * * @param string $identity Identity of the user to whom the Sync Map Permission * applies. * @return \Twilio\Rest\Preview\Sync\Service\SyncMap\SyncMapPermissionContext */ public function getContext($identity) { return new SyncMapPermissionContext( $this->version, $this->solution['serviceSid'], $this->solution['mapSid'], $identity ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Preview.Sync.SyncMapPermissionList]'; } } sdk/src/Twilio/Rest/Preview/Sync/Service/SyncMap/SyncMapItemInstance.php 0000644 00000011637 15002236443 0022205 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Sync\Service\SyncMap; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $key * @property string $accountSid * @property string $serviceSid * @property string $mapSid * @property string $url * @property string $revision * @property array $data * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $createdBy */ class SyncMapItemInstance extends InstanceResource { /** * Initialize the SyncMapItemInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The service_sid * @param string $mapSid The map_sid * @param string $key The key * @return \Twilio\Rest\Preview\Sync\Service\SyncMap\SyncMapItemInstance */ public function __construct(Version $version, array $payload, $serviceSid, $mapSid, $key = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'key' => Values::array_get($payload, 'key'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'mapSid' => Values::array_get($payload, 'map_sid'), 'url' => Values::array_get($payload, 'url'), 'revision' => Values::array_get($payload, 'revision'), 'data' => Values::array_get($payload, 'data'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'createdBy' => Values::array_get($payload, 'created_by'), ); $this->solution = array( 'serviceSid' => $serviceSid, 'mapSid' => $mapSid, 'key' => $key ?: $this->properties['key'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Preview\Sync\Service\SyncMap\SyncMapItemContext Context * for * this * SyncMapItemInstance */ protected function proxy() { if (!$this->context) { $this->context = new SyncMapItemContext( $this->version, $this->solution['serviceSid'], $this->solution['mapSid'], $this->solution['key'] ); } return $this->context; } /** * Fetch a SyncMapItemInstance * * @return SyncMapItemInstance Fetched SyncMapItemInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the SyncMapItemInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Update the SyncMapItemInstance * * @param array $data The data * @return SyncMapItemInstance Updated SyncMapItemInstance * @throws TwilioException When an HTTP error occurs. */ public function update($data) { return $this->proxy()->update($data); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.Sync.SyncMapItemInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/Sync/Service/SyncMap/SyncMapItemContext.php 0000644 00000006242 15002236443 0022061 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Sync\Service\SyncMap; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class SyncMapItemContext extends InstanceContext { /** * Initialize the SyncMapItemContext * * @param \Twilio\Version $version Version that contains the resource * @param string $serviceSid The service_sid * @param string $mapSid The map_sid * @param string $key The key * @return \Twilio\Rest\Preview\Sync\Service\SyncMap\SyncMapItemContext */ public function __construct(Version $version, $serviceSid, $mapSid, $key) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, 'mapSid' => $mapSid, 'key' => $key, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Maps/' . \rawurlencode($mapSid) . '/Items/' . \rawurlencode($key) . ''; } /** * Fetch a SyncMapItemInstance * * @return SyncMapItemInstance Fetched SyncMapItemInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new SyncMapItemInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['mapSid'], $this->solution['key'] ); } /** * Deletes the SyncMapItemInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Update the SyncMapItemInstance * * @param array $data The data * @return SyncMapItemInstance Updated SyncMapItemInstance * @throws TwilioException When an HTTP error occurs. */ public function update($data) { $data = Values::of(array('Data' => Serialize::jsonObject($data), )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new SyncMapItemInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['mapSid'], $this->solution['key'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.Sync.SyncMapItemContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/Sync/Service/SyncMap/SyncMapPermissionContext.php 0000644 00000007167 15002236443 0023322 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Sync\Service\SyncMap; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class SyncMapPermissionContext extends InstanceContext { /** * Initialize the SyncMapPermissionContext * * @param \Twilio\Version $version Version that contains the resource * @param string $serviceSid The service_sid * @param string $mapSid Sync Map SID or unique name. * @param string $identity Identity of the user to whom the Sync Map Permission * applies. * @return \Twilio\Rest\Preview\Sync\Service\SyncMap\SyncMapPermissionContext */ public function __construct(Version $version, $serviceSid, $mapSid, $identity) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, 'mapSid' => $mapSid, 'identity' => $identity, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Maps/' . \rawurlencode($mapSid) . '/Permissions/' . \rawurlencode($identity) . ''; } /** * Fetch a SyncMapPermissionInstance * * @return SyncMapPermissionInstance Fetched SyncMapPermissionInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new SyncMapPermissionInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['mapSid'], $this->solution['identity'] ); } /** * Deletes the SyncMapPermissionInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Update the SyncMapPermissionInstance * * @param bool $read Read access. * @param bool $write Write access. * @param bool $manage Manage access. * @return SyncMapPermissionInstance Updated SyncMapPermissionInstance * @throws TwilioException When an HTTP error occurs. */ public function update($read, $write, $manage) { $data = Values::of(array( 'Read' => Serialize::booleanToString($read), 'Write' => Serialize::booleanToString($write), 'Manage' => Serialize::booleanToString($manage), )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new SyncMapPermissionInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['mapSid'], $this->solution['identity'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.Sync.SyncMapPermissionContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/Sync/Service/SyncMap/SyncMapPermissionInstance.php 0000644 00000011333 15002236443 0023430 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Sync\Service\SyncMap; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $accountSid * @property string $serviceSid * @property string $mapSid * @property string $identity * @property bool $read * @property bool $write * @property bool $manage * @property string $url */ class SyncMapPermissionInstance extends InstanceResource { /** * Initialize the SyncMapPermissionInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid Sync Service Instance SID. * @param string $mapSid Sync Map SID. * @param string $identity Identity of the user to whom the Sync Map Permission * applies. * @return \Twilio\Rest\Preview\Sync\Service\SyncMap\SyncMapPermissionInstance */ public function __construct(Version $version, array $payload, $serviceSid, $mapSid, $identity = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'mapSid' => Values::array_get($payload, 'map_sid'), 'identity' => Values::array_get($payload, 'identity'), 'read' => Values::array_get($payload, 'read'), 'write' => Values::array_get($payload, 'write'), 'manage' => Values::array_get($payload, 'manage'), 'url' => Values::array_get($payload, 'url'), ); $this->solution = array( 'serviceSid' => $serviceSid, 'mapSid' => $mapSid, 'identity' => $identity ?: $this->properties['identity'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Preview\Sync\Service\SyncMap\SyncMapPermissionContext Context for this SyncMapPermissionInstance */ protected function proxy() { if (!$this->context) { $this->context = new SyncMapPermissionContext( $this->version, $this->solution['serviceSid'], $this->solution['mapSid'], $this->solution['identity'] ); } return $this->context; } /** * Fetch a SyncMapPermissionInstance * * @return SyncMapPermissionInstance Fetched SyncMapPermissionInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the SyncMapPermissionInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Update the SyncMapPermissionInstance * * @param bool $read Read access. * @param bool $write Write access. * @param bool $manage Manage access. * @return SyncMapPermissionInstance Updated SyncMapPermissionInstance * @throws TwilioException When an HTTP error occurs. */ public function update($read, $write, $manage) { return $this->proxy()->update($read, $write, $manage); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.Sync.SyncMapPermissionInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/Sync/Service/DocumentOptions.php 0000644 00000003717 15002236443 0020107 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Sync\Service; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ abstract class DocumentOptions { /** * @param string $uniqueName The unique_name * @param array $data The data * @return CreateDocumentOptions Options builder */ public static function create($uniqueName = Values::NONE, $data = Values::NONE) { return new CreateDocumentOptions($uniqueName, $data); } } class CreateDocumentOptions extends Options { /** * @param string $uniqueName The unique_name * @param array $data The data */ public function __construct($uniqueName = Values::NONE, $data = Values::NONE) { $this->options['uniqueName'] = $uniqueName; $this->options['data'] = $data; } /** * The unique_name * * @param string $uniqueName The unique_name * @return $this Fluent Builder */ public function setUniqueName($uniqueName) { $this->options['uniqueName'] = $uniqueName; return $this; } /** * The data * * @param array $data The data * @return $this Fluent Builder */ public function setData($data) { $this->options['data'] = $data; 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.Preview.Sync.CreateDocumentOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Preview/Sync/Service/Document/DocumentPermissionPage.php 0000644 00000002112 15002236443 0023143 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Sync\Service\Document; use Twilio\Page; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class DocumentPermissionPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new DocumentPermissionInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['documentSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Preview.Sync.DocumentPermissionPage]'; } } sdk/src/Twilio/Rest/Preview/Sync/Service/Document/DocumentPermissionInstance.php 0000644 00000011436 15002236443 0024044 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Sync\Service\Document; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $accountSid * @property string $serviceSid * @property string $documentSid * @property string $identity * @property bool $read * @property bool $write * @property bool $manage * @property string $url */ class DocumentPermissionInstance extends InstanceResource { /** * Initialize the DocumentPermissionInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid Sync Service Instance SID. * @param string $documentSid Sync Document SID. * @param string $identity Identity of the user to whom the Sync Document * Permission applies. * @return \Twilio\Rest\Preview\Sync\Service\Document\DocumentPermissionInstance */ public function __construct(Version $version, array $payload, $serviceSid, $documentSid, $identity = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'documentSid' => Values::array_get($payload, 'document_sid'), 'identity' => Values::array_get($payload, 'identity'), 'read' => Values::array_get($payload, 'read'), 'write' => Values::array_get($payload, 'write'), 'manage' => Values::array_get($payload, 'manage'), 'url' => Values::array_get($payload, 'url'), ); $this->solution = array( 'serviceSid' => $serviceSid, 'documentSid' => $documentSid, 'identity' => $identity ?: $this->properties['identity'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Preview\Sync\Service\Document\DocumentPermissionContext Context for this DocumentPermissionInstance */ protected function proxy() { if (!$this->context) { $this->context = new DocumentPermissionContext( $this->version, $this->solution['serviceSid'], $this->solution['documentSid'], $this->solution['identity'] ); } return $this->context; } /** * Fetch a DocumentPermissionInstance * * @return DocumentPermissionInstance Fetched DocumentPermissionInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the DocumentPermissionInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Update the DocumentPermissionInstance * * @param bool $read Read access. * @param bool $write Write access. * @param bool $manage Manage access. * @return DocumentPermissionInstance Updated DocumentPermissionInstance * @throws TwilioException When an HTTP error occurs. */ public function update($read, $write, $manage) { return $this->proxy()->update($read, $write, $manage); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.Sync.DocumentPermissionInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/Sync/Service/Document/DocumentPermissionList.php 0000644 00000013002 15002236443 0023202 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Sync\Service\Document; use Twilio\ListResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class DocumentPermissionList extends ListResource { /** * Construct the DocumentPermissionList * * @param Version $version Version that contains the resource * @param string $serviceSid Sync Service Instance SID. * @param string $documentSid Sync Document SID. * @return \Twilio\Rest\Preview\Sync\Service\Document\DocumentPermissionList */ public function __construct(Version $version, $serviceSid, $documentSid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, 'documentSid' => $documentSid, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Documents/' . \rawurlencode($documentSid) . '/Permissions'; } /** * Streams DocumentPermissionInstance records from the API as a generator * stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads DocumentPermissionInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return DocumentPermissionInstance[] Array of results */ public function read($limit = null, $pageSize = null) { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of DocumentPermissionInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of DocumentPermissionInstance */ public function page($pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $params = Values::of(array( 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new DocumentPermissionPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of DocumentPermissionInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of DocumentPermissionInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new DocumentPermissionPage($this->version, $response, $this->solution); } /** * Constructs a DocumentPermissionContext * * @param string $identity Identity of the user to whom the Sync Document * Permission applies. * @return \Twilio\Rest\Preview\Sync\Service\Document\DocumentPermissionContext */ public function getContext($identity) { return new DocumentPermissionContext( $this->version, $this->solution['serviceSid'], $this->solution['documentSid'], $identity ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Preview.Sync.DocumentPermissionList]'; } } sdk/src/Twilio/Rest/Preview/Sync/Service/Document/DocumentPermissionContext.php 0000644 00000007345 15002236443 0023730 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Sync\Service\Document; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class DocumentPermissionContext extends InstanceContext { /** * Initialize the DocumentPermissionContext * * @param \Twilio\Version $version Version that contains the resource * @param string $serviceSid The service_sid * @param string $documentSid Sync Document SID or unique name. * @param string $identity Identity of the user to whom the Sync Document * Permission applies. * @return \Twilio\Rest\Preview\Sync\Service\Document\DocumentPermissionContext */ public function __construct(Version $version, $serviceSid, $documentSid, $identity) { parent::__construct($version); // Path Solution $this->solution = array( 'serviceSid' => $serviceSid, 'documentSid' => $documentSid, 'identity' => $identity, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Documents/' . \rawurlencode($documentSid) . '/Permissions/' . \rawurlencode($identity) . ''; } /** * Fetch a DocumentPermissionInstance * * @return DocumentPermissionInstance Fetched DocumentPermissionInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new DocumentPermissionInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['documentSid'], $this->solution['identity'] ); } /** * Deletes the DocumentPermissionInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Update the DocumentPermissionInstance * * @param bool $read Read access. * @param bool $write Write access. * @param bool $manage Manage access. * @return DocumentPermissionInstance Updated DocumentPermissionInstance * @throws TwilioException When an HTTP error occurs. */ public function update($read, $write, $manage) { $data = Values::of(array( 'Read' => Serialize::booleanToString($read), 'Write' => Serialize::booleanToString($write), 'Manage' => Serialize::booleanToString($manage), )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new DocumentPermissionInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['documentSid'], $this->solution['identity'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.Sync.DocumentPermissionContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/Sync/ServiceContext.php 0000644 00000013262 15002236443 0016316 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Sync; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Rest\Preview\Sync\Service\DocumentList; use Twilio\Rest\Preview\Sync\Service\SyncListList; use Twilio\Rest\Preview\Sync\Service\SyncMapList; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property \Twilio\Rest\Preview\Sync\Service\DocumentList $documents * @property \Twilio\Rest\Preview\Sync\Service\SyncListList $syncLists * @property \Twilio\Rest\Preview\Sync\Service\SyncMapList $syncMaps * @method \Twilio\Rest\Preview\Sync\Service\DocumentContext documents(string $sid) * @method \Twilio\Rest\Preview\Sync\Service\SyncListContext syncLists(string $sid) * @method \Twilio\Rest\Preview\Sync\Service\SyncMapContext syncMaps(string $sid) */ class ServiceContext extends InstanceContext { protected $_documents = null; protected $_syncLists = null; protected $_syncMaps = null; /** * Initialize the ServiceContext * * @param \Twilio\Version $version Version that contains the resource * @param string $sid The sid * @return \Twilio\Rest\Preview\Sync\ServiceContext */ public function __construct(Version $version, $sid) { parent::__construct($version); // Path Solution $this->solution = array('sid' => $sid, ); $this->uri = '/Services/' . \rawurlencode($sid) . ''; } /** * Fetch a ServiceInstance * * @return ServiceInstance Fetched ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new ServiceInstance($this->version, $payload, $this->solution['sid']); } /** * Deletes the ServiceInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Update the ServiceInstance * * @param array|Options $options Optional Arguments * @return ServiceInstance Updated ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { $options = new Values($options); $data = Values::of(array( 'WebhookUrl' => $options['webhookUrl'], 'FriendlyName' => $options['friendlyName'], 'ReachabilityWebhooksEnabled' => Serialize::booleanToString($options['reachabilityWebhooksEnabled']), 'AclEnabled' => Serialize::booleanToString($options['aclEnabled']), )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new ServiceInstance($this->version, $payload, $this->solution['sid']); } /** * Access the documents * * @return \Twilio\Rest\Preview\Sync\Service\DocumentList */ protected function getDocuments() { if (!$this->_documents) { $this->_documents = new DocumentList($this->version, $this->solution['sid']); } return $this->_documents; } /** * Access the syncLists * * @return \Twilio\Rest\Preview\Sync\Service\SyncListList */ protected function getSyncLists() { if (!$this->_syncLists) { $this->_syncLists = new SyncListList($this->version, $this->solution['sid']); } return $this->_syncLists; } /** * Access the syncMaps * * @return \Twilio\Rest\Preview\Sync\Service\SyncMapList */ protected function getSyncMaps() { if (!$this->_syncMaps) { $this->_syncMaps = new SyncMapList($this->version, $this->solution['sid']); } return $this->_syncMaps; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get($name) { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.Sync.ServiceContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/Marketplace/InstalledAddOnList.php 0000644 00000014141 15002236443 0020343 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Marketplace; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class InstalledAddOnList extends ListResource { /** * Construct the InstalledAddOnList * * @param Version $version Version that contains the resource * @return \Twilio\Rest\Preview\Marketplace\InstalledAddOnList */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = array(); $this->uri = '/InstalledAddOns'; } /** * Create a new InstalledAddOnInstance * * @param string $availableAddOnSid The SID of the AvaliableAddOn to install * @param bool $acceptTermsOfService Whether the Terms of Service were accepted * @param array|Options $options Optional Arguments * @return InstalledAddOnInstance Newly created InstalledAddOnInstance * @throws TwilioException When an HTTP error occurs. */ public function create($availableAddOnSid, $acceptTermsOfService, $options = array()) { $options = new Values($options); $data = Values::of(array( 'AvailableAddOnSid' => $availableAddOnSid, 'AcceptTermsOfService' => Serialize::booleanToString($acceptTermsOfService), 'Configuration' => Serialize::jsonObject($options['configuration']), 'UniqueName' => $options['uniqueName'], )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new InstalledAddOnInstance($this->version, $payload); } /** * Streams InstalledAddOnInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads InstalledAddOnInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return InstalledAddOnInstance[] Array of results */ public function read($limit = null, $pageSize = null) { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of InstalledAddOnInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of InstalledAddOnInstance */ public function page($pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $params = Values::of(array( 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new InstalledAddOnPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of InstalledAddOnInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of InstalledAddOnInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new InstalledAddOnPage($this->version, $response, $this->solution); } /** * Constructs a InstalledAddOnContext * * @param string $sid The SID of the InstalledAddOn resource to fetch * @return \Twilio\Rest\Preview\Marketplace\InstalledAddOnContext */ public function getContext($sid) { return new InstalledAddOnContext($this->version, $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Preview.Marketplace.InstalledAddOnList]'; } } sdk/src/Twilio/Rest/Preview/Marketplace/AvailableAddOnList.php 0000644 00000011714 15002236443 0020307 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Marketplace; use Twilio\ListResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class AvailableAddOnList extends ListResource { /** * Construct the AvailableAddOnList * * @param Version $version Version that contains the resource * @return \Twilio\Rest\Preview\Marketplace\AvailableAddOnList */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = array(); $this->uri = '/AvailableAddOns'; } /** * Streams AvailableAddOnInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads AvailableAddOnInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return AvailableAddOnInstance[] Array of results */ public function read($limit = null, $pageSize = null) { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of AvailableAddOnInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of AvailableAddOnInstance */ public function page($pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $params = Values::of(array( 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new AvailableAddOnPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of AvailableAddOnInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of AvailableAddOnInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new AvailableAddOnPage($this->version, $response, $this->solution); } /** * Constructs a AvailableAddOnContext * * @param string $sid The SID of the AvailableAddOn resource to fetch * @return \Twilio\Rest\Preview\Marketplace\AvailableAddOnContext */ public function getContext($sid) { return new AvailableAddOnContext($this->version, $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Preview.Marketplace.AvailableAddOnList]'; } } sdk/src/Twilio/Rest/Preview/Marketplace/InstalledAddOnOptions.php 0000644 00000011630 15002236443 0021063 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Marketplace; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ abstract class InstalledAddOnOptions { /** * @param array $configuration The JSON object representing the configuration * @param string $uniqueName An application-defined string that uniquely * identifies the resource * @return CreateInstalledAddOnOptions Options builder */ public static function create($configuration = Values::NONE, $uniqueName = Values::NONE) { return new CreateInstalledAddOnOptions($configuration, $uniqueName); } /** * @param array $configuration The JSON object representing the configuration * @param string $uniqueName An application-defined string that uniquely * identifies the resource * @return UpdateInstalledAddOnOptions Options builder */ public static function update($configuration = Values::NONE, $uniqueName = Values::NONE) { return new UpdateInstalledAddOnOptions($configuration, $uniqueName); } } class CreateInstalledAddOnOptions extends Options { /** * @param array $configuration The JSON object representing the configuration * @param string $uniqueName An application-defined string that uniquely * identifies the resource */ public function __construct($configuration = Values::NONE, $uniqueName = Values::NONE) { $this->options['configuration'] = $configuration; $this->options['uniqueName'] = $uniqueName; } /** * The JSON object that represents the configuration of the new Add-on being installed. * * @param array $configuration The JSON object representing the configuration * @return $this Fluent Builder */ public function setConfiguration($configuration) { $this->options['configuration'] = $configuration; return $this; } /** * An application-defined string that uniquely identifies the resource. This value must be unique within the Account. * * @param string $uniqueName An application-defined string that uniquely * identifies the resource * @return $this Fluent Builder */ public function setUniqueName($uniqueName) { $this->options['uniqueName'] = $uniqueName; 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.Preview.Marketplace.CreateInstalledAddOnOptions ' . \implode(' ', $options) . ']'; } } class UpdateInstalledAddOnOptions extends Options { /** * @param array $configuration The JSON object representing the configuration * @param string $uniqueName An application-defined string that uniquely * identifies the resource */ public function __construct($configuration = Values::NONE, $uniqueName = Values::NONE) { $this->options['configuration'] = $configuration; $this->options['uniqueName'] = $uniqueName; } /** * Valid JSON object that conform to the configuration schema exposed by the associated AvailableAddOn resource. This is only required by Add-ons that need to be configured * * @param array $configuration The JSON object representing the configuration * @return $this Fluent Builder */ public function setConfiguration($configuration) { $this->options['configuration'] = $configuration; return $this; } /** * An application-defined string that uniquely identifies the resource. This value must be unique within the Account. * * @param string $uniqueName An application-defined string that uniquely * identifies the resource * @return $this Fluent Builder */ public function setUniqueName($uniqueName) { $this->options['uniqueName'] = $uniqueName; 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.Preview.Marketplace.UpdateInstalledAddOnOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Preview/Marketplace/InstalledAddOnContext.php 0000644 00000011316 15002236443 0021055 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Marketplace; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Rest\Preview\Marketplace\InstalledAddOn\InstalledAddOnExtensionList; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property \Twilio\Rest\Preview\Marketplace\InstalledAddOn\InstalledAddOnExtensionList $extensions * @method \Twilio\Rest\Preview\Marketplace\InstalledAddOn\InstalledAddOnExtensionContext extensions(string $sid) */ class InstalledAddOnContext extends InstanceContext { protected $_extensions = null; /** * Initialize the InstalledAddOnContext * * @param \Twilio\Version $version Version that contains the resource * @param string $sid The SID of the InstalledAddOn resource to fetch * @return \Twilio\Rest\Preview\Marketplace\InstalledAddOnContext */ public function __construct(Version $version, $sid) { parent::__construct($version); // Path Solution $this->solution = array('sid' => $sid, ); $this->uri = '/InstalledAddOns/' . \rawurlencode($sid) . ''; } /** * Deletes the InstalledAddOnInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Fetch a InstalledAddOnInstance * * @return InstalledAddOnInstance Fetched InstalledAddOnInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new InstalledAddOnInstance($this->version, $payload, $this->solution['sid']); } /** * Update the InstalledAddOnInstance * * @param array|Options $options Optional Arguments * @return InstalledAddOnInstance Updated InstalledAddOnInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { $options = new Values($options); $data = Values::of(array( 'Configuration' => Serialize::jsonObject($options['configuration']), 'UniqueName' => $options['uniqueName'], )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new InstalledAddOnInstance($this->version, $payload, $this->solution['sid']); } /** * Access the extensions * * @return \Twilio\Rest\Preview\Marketplace\InstalledAddOn\InstalledAddOnExtensionList */ protected function getExtensions() { if (!$this->_extensions) { $this->_extensions = new InstalledAddOnExtensionList($this->version, $this->solution['sid']); } return $this->_extensions; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get($name) { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.Marketplace.InstalledAddOnContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/Marketplace/AvailableAddOnContext.php 0000644 00000007222 15002236443 0021017 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Marketplace; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Rest\Preview\Marketplace\AvailableAddOn\AvailableAddOnExtensionList; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property \Twilio\Rest\Preview\Marketplace\AvailableAddOn\AvailableAddOnExtensionList $extensions * @method \Twilio\Rest\Preview\Marketplace\AvailableAddOn\AvailableAddOnExtensionContext extensions(string $sid) */ class AvailableAddOnContext extends InstanceContext { protected $_extensions = null; /** * Initialize the AvailableAddOnContext * * @param \Twilio\Version $version Version that contains the resource * @param string $sid The SID of the AvailableAddOn resource to fetch * @return \Twilio\Rest\Preview\Marketplace\AvailableAddOnContext */ public function __construct(Version $version, $sid) { parent::__construct($version); // Path Solution $this->solution = array('sid' => $sid, ); $this->uri = '/AvailableAddOns/' . \rawurlencode($sid) . ''; } /** * Fetch a AvailableAddOnInstance * * @return AvailableAddOnInstance Fetched AvailableAddOnInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new AvailableAddOnInstance($this->version, $payload, $this->solution['sid']); } /** * Access the extensions * * @return \Twilio\Rest\Preview\Marketplace\AvailableAddOn\AvailableAddOnExtensionList */ protected function getExtensions() { if (!$this->_extensions) { $this->_extensions = new AvailableAddOnExtensionList($this->version, $this->solution['sid']); } return $this->_extensions; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get($name) { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.Marketplace.AvailableAddOnContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/Marketplace/InstalledAddOnInstance.php 0000644 00000011635 15002236443 0021201 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Marketplace; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $sid * @property string $accountSid * @property string $friendlyName * @property string $description * @property array $configuration * @property string $uniqueName * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $url * @property array $links */ class InstalledAddOnInstance extends InstanceResource { protected $_extensions = null; /** * Initialize the InstalledAddOnInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The SID of the InstalledAddOn resource to fetch * @return \Twilio\Rest\Preview\Marketplace\InstalledAddOnInstance */ public function __construct(Version $version, array $payload, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'description' => Values::array_get($payload, 'description'), 'configuration' => Values::array_get($payload, 'configuration'), 'uniqueName' => Values::array_get($payload, 'unique_name'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ); $this->solution = array('sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Preview\Marketplace\InstalledAddOnContext Context for * this * InstalledAddOnInstance */ protected function proxy() { if (!$this->context) { $this->context = new InstalledAddOnContext($this->version, $this->solution['sid']); } return $this->context; } /** * Deletes the InstalledAddOnInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Fetch a InstalledAddOnInstance * * @return InstalledAddOnInstance Fetched InstalledAddOnInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Update the InstalledAddOnInstance * * @param array|Options $options Optional Arguments * @return InstalledAddOnInstance Updated InstalledAddOnInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Access the extensions * * @return \Twilio\Rest\Preview\Marketplace\InstalledAddOn\InstalledAddOnExtensionList */ protected function getExtensions() { return $this->proxy()->extensions; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.Marketplace.InstalledAddOnInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/Marketplace/InstalledAddOn/InstalledAddOnExtensionContext.php 0000644 00000006310 15002236443 0025575 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Marketplace\InstalledAddOn; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class InstalledAddOnExtensionContext extends InstanceContext { /** * Initialize the InstalledAddOnExtensionContext * * @param \Twilio\Version $version Version that contains the resource * @param string $installedAddOnSid The SID of the InstalledAddOn resource with * the extension to fetch * @param string $sid The SID of the InstalledAddOn Extension resource to fetch * @return \Twilio\Rest\Preview\Marketplace\InstalledAddOn\InstalledAddOnExtensionContext */ public function __construct(Version $version, $installedAddOnSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array('installedAddOnSid' => $installedAddOnSid, 'sid' => $sid, ); $this->uri = '/InstalledAddOns/' . \rawurlencode($installedAddOnSid) . '/Extensions/' . \rawurlencode($sid) . ''; } /** * Fetch a InstalledAddOnExtensionInstance * * @return InstalledAddOnExtensionInstance Fetched * InstalledAddOnExtensionInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new InstalledAddOnExtensionInstance( $this->version, $payload, $this->solution['installedAddOnSid'], $this->solution['sid'] ); } /** * Update the InstalledAddOnExtensionInstance * * @param bool $enabled Whether the Extension should be invoked * @return InstalledAddOnExtensionInstance Updated * InstalledAddOnExtensionInstance * @throws TwilioException When an HTTP error occurs. */ public function update($enabled) { $data = Values::of(array('Enabled' => Serialize::booleanToString($enabled), )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new InstalledAddOnExtensionInstance( $this->version, $payload, $this->solution['installedAddOnSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.Marketplace.InstalledAddOnExtensionContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/Marketplace/InstalledAddOn/InstalledAddOnExtensionList.php 0000644 00000013007 15002236443 0025065 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Marketplace\InstalledAddOn; use Twilio\ListResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class InstalledAddOnExtensionList extends ListResource { /** * Construct the InstalledAddOnExtensionList * * @param Version $version Version that contains the resource * @param string $installedAddOnSid The SID of the InstalledAddOn resource to * which this extension applies * @return \Twilio\Rest\Preview\Marketplace\InstalledAddOn\InstalledAddOnExtensionList */ public function __construct(Version $version, $installedAddOnSid) { parent::__construct($version); // Path Solution $this->solution = array('installedAddOnSid' => $installedAddOnSid, ); $this->uri = '/InstalledAddOns/' . \rawurlencode($installedAddOnSid) . '/Extensions'; } /** * Streams InstalledAddOnExtensionInstance records from the API as a generator * stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads InstalledAddOnExtensionInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return InstalledAddOnExtensionInstance[] Array of results */ public function read($limit = null, $pageSize = null) { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of InstalledAddOnExtensionInstance records from the * API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of InstalledAddOnExtensionInstance */ public function page($pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $params = Values::of(array( 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new InstalledAddOnExtensionPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of InstalledAddOnExtensionInstance records from the * API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of InstalledAddOnExtensionInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new InstalledAddOnExtensionPage($this->version, $response, $this->solution); } /** * Constructs a InstalledAddOnExtensionContext * * @param string $sid The SID of the InstalledAddOn Extension resource to fetch * @return \Twilio\Rest\Preview\Marketplace\InstalledAddOn\InstalledAddOnExtensionContext */ public function getContext($sid) { return new InstalledAddOnExtensionContext( $this->version, $this->solution['installedAddOnSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Preview.Marketplace.InstalledAddOnExtensionList]'; } } sdk/src/Twilio/Rest/Preview/Marketplace/InstalledAddOn/InstalledAddOnExtensionPage.php 0000644 00000002100 15002236443 0025016 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Marketplace\InstalledAddOn; use Twilio\Page; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class InstalledAddOnExtensionPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new InstalledAddOnExtensionInstance( $this->version, $payload, $this->solution['installedAddOnSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Preview.Marketplace.InstalledAddOnExtensionPage]'; } } sdk/src/Twilio/Rest/Preview/Marketplace/InstalledAddOn/InstalledAddOnExtensionInstance.php 0000644 00000011066 15002236443 0025721 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Marketplace\InstalledAddOn; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $sid * @property string $installedAddOnSid * @property string $friendlyName * @property string $productName * @property string $uniqueName * @property bool $enabled * @property string $url */ class InstalledAddOnExtensionInstance extends InstanceResource { /** * Initialize the InstalledAddOnExtensionInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $installedAddOnSid The SID of the InstalledAddOn resource to * which this extension applies * @param string $sid The SID of the InstalledAddOn Extension resource to fetch * @return \Twilio\Rest\Preview\Marketplace\InstalledAddOn\InstalledAddOnExtensionInstance */ public function __construct(Version $version, array $payload, $installedAddOnSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'sid' => Values::array_get($payload, 'sid'), 'installedAddOnSid' => Values::array_get($payload, 'installed_add_on_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'productName' => Values::array_get($payload, 'product_name'), 'uniqueName' => Values::array_get($payload, 'unique_name'), 'enabled' => Values::array_get($payload, 'enabled'), 'url' => Values::array_get($payload, 'url'), ); $this->solution = array( 'installedAddOnSid' => $installedAddOnSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Preview\Marketplace\InstalledAddOn\InstalledAddOnExtensionContext Context for this * InstalledAddOnExtensionInstance */ protected function proxy() { if (!$this->context) { $this->context = new InstalledAddOnExtensionContext( $this->version, $this->solution['installedAddOnSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch a InstalledAddOnExtensionInstance * * @return InstalledAddOnExtensionInstance Fetched * InstalledAddOnExtensionInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Update the InstalledAddOnExtensionInstance * * @param bool $enabled Whether the Extension should be invoked * @return InstalledAddOnExtensionInstance Updated * InstalledAddOnExtensionInstance * @throws TwilioException When an HTTP error occurs. */ public function update($enabled) { return $this->proxy()->update($enabled); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.Marketplace.InstalledAddOnExtensionInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/Marketplace/AvailableAddOnPage.php 0000644 00000001702 15002236443 0020244 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Marketplace; use Twilio\Page; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class AvailableAddOnPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new AvailableAddOnInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Preview.Marketplace.AvailableAddOnPage]'; } } sdk/src/Twilio/Rest/Preview/Marketplace/AvailableAddOnInstance.php 0000644 00000007653 15002236443 0021147 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Marketplace; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $sid * @property string $friendlyName * @property string $description * @property string $pricingType * @property array $configurationSchema * @property string $url * @property array $links */ class AvailableAddOnInstance extends InstanceResource { protected $_extensions = null; /** * Initialize the AvailableAddOnInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The SID of the AvailableAddOn resource to fetch * @return \Twilio\Rest\Preview\Marketplace\AvailableAddOnInstance */ public function __construct(Version $version, array $payload, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'sid' => Values::array_get($payload, 'sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'description' => Values::array_get($payload, 'description'), 'pricingType' => Values::array_get($payload, 'pricing_type'), 'configurationSchema' => Values::array_get($payload, 'configuration_schema'), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ); $this->solution = array('sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Preview\Marketplace\AvailableAddOnContext Context for * this * AvailableAddOnInstance */ protected function proxy() { if (!$this->context) { $this->context = new AvailableAddOnContext($this->version, $this->solution['sid']); } return $this->context; } /** * Fetch a AvailableAddOnInstance * * @return AvailableAddOnInstance Fetched AvailableAddOnInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Access the extensions * * @return \Twilio\Rest\Preview\Marketplace\AvailableAddOn\AvailableAddOnExtensionList */ protected function getExtensions() { return $this->proxy()->extensions; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.Marketplace.AvailableAddOnInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/Marketplace/AvailableAddOn/AvailableAddOnExtensionInstance.php 0000644 00000010056 15002236443 0025621 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Marketplace\AvailableAddOn; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $sid * @property string $availableAddOnSid * @property string $friendlyName * @property string $productName * @property string $uniqueName * @property string $url */ class AvailableAddOnExtensionInstance extends InstanceResource { /** * Initialize the AvailableAddOnExtensionInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $availableAddOnSid The SID of the AvailableAddOn resource to * which this extension applies * @param string $sid The SID of the AvailableAddOn Extension resource to fetch * @return \Twilio\Rest\Preview\Marketplace\AvailableAddOn\AvailableAddOnExtensionInstance */ public function __construct(Version $version, array $payload, $availableAddOnSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'sid' => Values::array_get($payload, 'sid'), 'availableAddOnSid' => Values::array_get($payload, 'available_add_on_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'productName' => Values::array_get($payload, 'product_name'), 'uniqueName' => Values::array_get($payload, 'unique_name'), 'url' => Values::array_get($payload, 'url'), ); $this->solution = array( 'availableAddOnSid' => $availableAddOnSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Preview\Marketplace\AvailableAddOn\AvailableAddOnExtensionContext Context for this * AvailableAddOnExtensionInstance */ protected function proxy() { if (!$this->context) { $this->context = new AvailableAddOnExtensionContext( $this->version, $this->solution['availableAddOnSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch a AvailableAddOnExtensionInstance * * @return AvailableAddOnExtensionInstance Fetched * AvailableAddOnExtensionInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.Marketplace.AvailableAddOnExtensionInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/Marketplace/AvailableAddOn/AvailableAddOnExtensionContext.php 0000644 00000004616 15002236443 0025506 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Marketplace\AvailableAddOn; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class AvailableAddOnExtensionContext extends InstanceContext { /** * Initialize the AvailableAddOnExtensionContext * * @param \Twilio\Version $version Version that contains the resource * @param string $availableAddOnSid The SID of the AvailableAddOn resource with * the extension to fetch * @param string $sid The SID of the AvailableAddOn Extension resource to fetch * @return \Twilio\Rest\Preview\Marketplace\AvailableAddOn\AvailableAddOnExtensionContext */ public function __construct(Version $version, $availableAddOnSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array('availableAddOnSid' => $availableAddOnSid, 'sid' => $sid, ); $this->uri = '/AvailableAddOns/' . \rawurlencode($availableAddOnSid) . '/Extensions/' . \rawurlencode($sid) . ''; } /** * Fetch a AvailableAddOnExtensionInstance * * @return AvailableAddOnExtensionInstance Fetched * AvailableAddOnExtensionInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new AvailableAddOnExtensionInstance( $this->version, $payload, $this->solution['availableAddOnSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.Marketplace.AvailableAddOnExtensionContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/Marketplace/AvailableAddOn/AvailableAddOnExtensionPage.php 0000644 00000002100 15002236443 0024720 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Marketplace\AvailableAddOn; use Twilio\Page; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class AvailableAddOnExtensionPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new AvailableAddOnExtensionInstance( $this->version, $payload, $this->solution['availableAddOnSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Preview.Marketplace.AvailableAddOnExtensionPage]'; } } sdk/src/Twilio/Rest/Preview/Marketplace/AvailableAddOn/AvailableAddOnExtensionList.php 0000644 00000013007 15002236443 0024767 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Marketplace\AvailableAddOn; use Twilio\ListResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class AvailableAddOnExtensionList extends ListResource { /** * Construct the AvailableAddOnExtensionList * * @param Version $version Version that contains the resource * @param string $availableAddOnSid The SID of the AvailableAddOn resource to * which this extension applies * @return \Twilio\Rest\Preview\Marketplace\AvailableAddOn\AvailableAddOnExtensionList */ public function __construct(Version $version, $availableAddOnSid) { parent::__construct($version); // Path Solution $this->solution = array('availableAddOnSid' => $availableAddOnSid, ); $this->uri = '/AvailableAddOns/' . \rawurlencode($availableAddOnSid) . '/Extensions'; } /** * Streams AvailableAddOnExtensionInstance records from the API as a generator * stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads AvailableAddOnExtensionInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return AvailableAddOnExtensionInstance[] Array of results */ public function read($limit = null, $pageSize = null) { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of AvailableAddOnExtensionInstance records from the * API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of AvailableAddOnExtensionInstance */ public function page($pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $params = Values::of(array( 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new AvailableAddOnExtensionPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of AvailableAddOnExtensionInstance records from the * API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of AvailableAddOnExtensionInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new AvailableAddOnExtensionPage($this->version, $response, $this->solution); } /** * Constructs a AvailableAddOnExtensionContext * * @param string $sid The SID of the AvailableAddOn Extension resource to fetch * @return \Twilio\Rest\Preview\Marketplace\AvailableAddOn\AvailableAddOnExtensionContext */ public function getContext($sid) { return new AvailableAddOnExtensionContext( $this->version, $this->solution['availableAddOnSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Preview.Marketplace.AvailableAddOnExtensionList]'; } } sdk/src/Twilio/Rest/Preview/Marketplace/InstalledAddOnPage.php 0000644 00000001702 15002236443 0020303 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Marketplace; use Twilio\Page; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class InstalledAddOnPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new InstalledAddOnInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Preview.Marketplace.InstalledAddOnPage]'; } } sdk/src/Twilio/Rest/Preview/AccSecurity.php 0000644 00000004531 15002236443 0014652 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\Rest\Preview\AccSecurity\ServiceList; use Twilio\Version; /** * @property \Twilio\Rest\Preview\AccSecurity\ServiceList $services * @method \Twilio\Rest\Preview\AccSecurity\ServiceContext services(string $sid) */ class AccSecurity extends Version { protected $_services = null; /** * Construct the AccSecurity version of Preview * * @param \Twilio\Domain $domain Domain that contains the version * @return \Twilio\Rest\Preview\AccSecurity AccSecurity version of Preview */ public function __construct(Domain $domain) { parent::__construct($domain); $this->version = 'Verification'; } /** * @return \Twilio\Rest\Preview\AccSecurity\ServiceList */ protected function getServices() { if (!$this->_services) { $this->_services = new ServiceList($this); } return $this->_services; } /** * Magic getter to lazy load root resources * * @param string $name Resource to return * @return \Twilio\ListResource The requested resource * @throws TwilioException For unknown resource */ public function __get($name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown resource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Preview.AccSecurity]'; } } sdk/src/Twilio/Rest/Preview/AccSecurity/ServiceOptions.php 0000644 00000007065 15002236443 0017633 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\AccSecurity; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ abstract class ServiceOptions { /** * @param int $codeLength Length of verification code. Valid values are 4-10 * @return CreateServiceOptions Options builder */ public static function create($codeLength = Values::NONE) { return new CreateServiceOptions($codeLength); } /** * @param string $name Friendly name of the service * @param int $codeLength Length of verification code. Valid values are 4-10 * @return UpdateServiceOptions Options builder */ public static function update($name = Values::NONE, $codeLength = Values::NONE) { return new UpdateServiceOptions($name, $codeLength); } } class CreateServiceOptions extends Options { /** * @param int $codeLength Length of verification code. Valid values are 4-10 */ public function __construct($codeLength = Values::NONE) { $this->options['codeLength'] = $codeLength; } /** * The length of the verification code to be generated. Must be an integer value between 4-10 * * @param int $codeLength Length of verification code. Valid values are 4-10 * @return $this Fluent Builder */ public function setCodeLength($codeLength) { $this->options['codeLength'] = $codeLength; 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.Preview.AccSecurity.CreateServiceOptions ' . \implode(' ', $options) . ']'; } } class UpdateServiceOptions extends Options { /** * @param string $name Friendly name of the service * @param int $codeLength Length of verification code. Valid values are 4-10 */ public function __construct($name = Values::NONE, $codeLength = Values::NONE) { $this->options['name'] = $name; $this->options['codeLength'] = $codeLength; } /** * A 1-64 character string with friendly name of service * * @param string $name Friendly name of the service * @return $this Fluent Builder */ public function setName($name) { $this->options['name'] = $name; return $this; } /** * The length of the verification code to be generated. Must be an integer value between 4-10 * * @param int $codeLength Length of verification code. Valid values are 4-10 * @return $this Fluent Builder */ public function setCodeLength($codeLength) { $this->options['codeLength'] = $codeLength; 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.Preview.AccSecurity.UpdateServiceOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Preview/AccSecurity/ServiceList.php 0000644 00000013065 15002236443 0017110 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\AccSecurity; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class ServiceList extends ListResource { /** * Construct the ServiceList * * @param Version $version Version that contains the resource * @return \Twilio\Rest\Preview\AccSecurity\ServiceList */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = array(); $this->uri = '/Services'; } /** * Create a new ServiceInstance * * @param string $name Friendly name of the service * @param array|Options $options Optional Arguments * @return ServiceInstance Newly created ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function create($name, $options = array()) { $options = new Values($options); $data = Values::of(array('Name' => $name, 'CodeLength' => $options['codeLength'], )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new ServiceInstance($this->version, $payload); } /** * Streams ServiceInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads ServiceInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return ServiceInstance[] Array of results */ public function read($limit = null, $pageSize = null) { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of ServiceInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of ServiceInstance */ public function page($pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $params = Values::of(array( 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new ServicePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of ServiceInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of ServiceInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new ServicePage($this->version, $response, $this->solution); } /** * Constructs a ServiceContext * * @param string $sid Verification Service Instance SID. * @return \Twilio\Rest\Preview\AccSecurity\ServiceContext */ public function getContext($sid) { return new ServiceContext($this->version, $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Preview.AccSecurity.ServiceList]'; } } sdk/src/Twilio/Rest/Preview/AccSecurity/ServicePage.php 0000644 00000001655 15002236443 0017053 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\AccSecurity; use Twilio\Page; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class ServicePage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new ServiceInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Preview.AccSecurity.ServicePage]'; } } sdk/src/Twilio/Rest/Preview/AccSecurity/ServiceInstance.php 0000644 00000011003 15002236443 0017727 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\AccSecurity; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $sid * @property string $accountSid * @property string $name * @property int $codeLength * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $url * @property array $links */ class ServiceInstance extends InstanceResource { protected $_verifications = null; protected $_verificationChecks = null; /** * Initialize the ServiceInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid Verification Service Instance SID. * @return \Twilio\Rest\Preview\AccSecurity\ServiceInstance */ public function __construct(Version $version, array $payload, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'name' => Values::array_get($payload, 'name'), 'codeLength' => Values::array_get($payload, 'code_length'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ); $this->solution = array('sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Preview\AccSecurity\ServiceContext Context for this * ServiceInstance */ protected function proxy() { if (!$this->context) { $this->context = new ServiceContext($this->version, $this->solution['sid']); } return $this->context; } /** * Fetch a ServiceInstance * * @return ServiceInstance Fetched ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Update the ServiceInstance * * @param array|Options $options Optional Arguments * @return ServiceInstance Updated ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Access the verifications * * @return \Twilio\Rest\Preview\AccSecurity\Service\VerificationList */ protected function getVerifications() { return $this->proxy()->verifications; } /** * Access the verificationChecks * * @return \Twilio\Rest\Preview\AccSecurity\Service\VerificationCheckList */ protected function getVerificationChecks() { return $this->proxy()->verificationChecks; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.AccSecurity.ServiceInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/AccSecurity/Service/VerificationPage.php 0000644 00000001743 15002236443 0021473 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\AccSecurity\Service; use Twilio\Page; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class VerificationPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new VerificationInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Preview.AccSecurity.VerificationPage]'; } } sdk/src/Twilio/Rest/Preview/AccSecurity/Service/VerificationCheckInstance.php 0000644 00000005476 15002236443 0023330 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\AccSecurity\Service; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $sid * @property string $serviceSid * @property string $accountSid * @property string $to * @property string $channel * @property string $status * @property bool $valid * @property \DateTime $dateCreated * @property \DateTime $dateUpdated */ class VerificationCheckInstance extends InstanceResource { /** * Initialize the VerificationCheckInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid Service Sid. * @return \Twilio\Rest\Preview\AccSecurity\Service\VerificationCheckInstance */ public function __construct(Version $version, array $payload, $serviceSid) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'sid' => Values::array_get($payload, 'sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'to' => Values::array_get($payload, 'to'), 'channel' => Values::array_get($payload, 'channel'), 'status' => Values::array_get($payload, 'status'), 'valid' => Values::array_get($payload, 'valid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), ); $this->solution = array('serviceSid' => $serviceSid, ); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Preview.AccSecurity.VerificationCheckInstance]'; } } sdk/src/Twilio/Rest/Preview/AccSecurity/Service/VerificationOptions.php 0000644 00000003426 15002236443 0022252 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\AccSecurity\Service; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ abstract class VerificationOptions { /** * @param string $customMessage A custom message for this verification * @return CreateVerificationOptions Options builder */ public static function create($customMessage = Values::NONE) { return new CreateVerificationOptions($customMessage); } } class CreateVerificationOptions extends Options { /** * @param string $customMessage A custom message for this verification */ public function __construct($customMessage = Values::NONE) { $this->options['customMessage'] = $customMessage; } /** * A character string containing a custom message for this verification * * @param string $customMessage A custom message for this verification * @return $this Fluent Builder */ public function setCustomMessage($customMessage) { $this->options['customMessage'] = $customMessage; 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.Preview.AccSecurity.CreateVerificationOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Preview/AccSecurity/Service/VerificationInstance.php 0000644 00000005452 15002236443 0022364 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\AccSecurity\Service; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $sid * @property string $serviceSid * @property string $accountSid * @property string $to * @property string $channel * @property string $status * @property bool $valid * @property \DateTime $dateCreated * @property \DateTime $dateUpdated */ class VerificationInstance extends InstanceResource { /** * Initialize the VerificationInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid Service Sid. * @return \Twilio\Rest\Preview\AccSecurity\Service\VerificationInstance */ public function __construct(Version $version, array $payload, $serviceSid) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'sid' => Values::array_get($payload, 'sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'to' => Values::array_get($payload, 'to'), 'channel' => Values::array_get($payload, 'channel'), 'status' => Values::array_get($payload, 'status'), 'valid' => Values::array_get($payload, 'valid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), ); $this->solution = array('serviceSid' => $serviceSid, ); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Preview.AccSecurity.VerificationInstance]'; } } sdk/src/Twilio/Rest/Preview/AccSecurity/Service/VerificationCheckList.php 0000644 00000004015 15002236443 0022463 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\AccSecurity\Service; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class VerificationCheckList extends ListResource { /** * Construct the VerificationCheckList * * @param Version $version Version that contains the resource * @param string $serviceSid Service Sid. * @return \Twilio\Rest\Preview\AccSecurity\Service\VerificationCheckList */ public function __construct(Version $version, $serviceSid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/VerificationCheck'; } /** * Create a new VerificationCheckInstance * * @param string $code The verification string * @param array|Options $options Optional Arguments * @return VerificationCheckInstance Newly created VerificationCheckInstance * @throws TwilioException When an HTTP error occurs. */ public function create($code, $options = array()) { $options = new Values($options); $data = Values::of(array('Code' => $code, 'To' => $options['to'], )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new VerificationCheckInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Preview.AccSecurity.VerificationCheckList]'; } } sdk/src/Twilio/Rest/Preview/AccSecurity/Service/VerificationList.php 0000644 00000004136 15002236443 0021531 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\AccSecurity\Service; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class VerificationList extends ListResource { /** * Construct the VerificationList * * @param Version $version Version that contains the resource * @param string $serviceSid Service Sid. * @return \Twilio\Rest\Preview\AccSecurity\Service\VerificationList */ public function __construct(Version $version, $serviceSid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Verifications'; } /** * Create a new VerificationInstance * * @param string $to To phonenumber * @param string $channel sms or call * @param array|Options $options Optional Arguments * @return VerificationInstance Newly created VerificationInstance * @throws TwilioException When an HTTP error occurs. */ public function create($to, $channel, $options = array()) { $options = new Values($options); $data = Values::of(array( 'To' => $to, 'Channel' => $channel, 'CustomMessage' => $options['customMessage'], )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new VerificationInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Preview.AccSecurity.VerificationList]'; } } sdk/src/Twilio/Rest/Preview/AccSecurity/Service/VerificationCheckPage.php 0000644 00000001762 15002236443 0022432 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\AccSecurity\Service; use Twilio\Page; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class VerificationCheckPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new VerificationCheckInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Preview.AccSecurity.VerificationCheckPage]'; } } sdk/src/Twilio/Rest/Preview/AccSecurity/Service/VerificationCheckOptions.php 0000644 00000003115 15002236443 0023203 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\AccSecurity\Service; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ abstract class VerificationCheckOptions { /** * @param string $to To phonenumber * @return CreateVerificationCheckOptions Options builder */ public static function create($to = Values::NONE) { return new CreateVerificationCheckOptions($to); } } class CreateVerificationCheckOptions extends Options { /** * @param string $to To phonenumber */ public function __construct($to = Values::NONE) { $this->options['to'] = $to; } /** * The To phonenumber of the phone being verified * * @param string $to To phonenumber * @return $this Fluent Builder */ public function setTo($to) { $this->options['to'] = $to; 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.Preview.AccSecurity.CreateVerificationCheckOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Preview/AccSecurity/ServiceContext.php 0000644 00000011247 15002236443 0017621 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\AccSecurity; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Rest\Preview\AccSecurity\Service\VerificationCheckList; use Twilio\Rest\Preview\AccSecurity\Service\VerificationList; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property \Twilio\Rest\Preview\AccSecurity\Service\VerificationList $verifications * @property \Twilio\Rest\Preview\AccSecurity\Service\VerificationCheckList $verificationChecks */ class ServiceContext extends InstanceContext { protected $_verifications = null; protected $_verificationChecks = null; /** * Initialize the ServiceContext * * @param \Twilio\Version $version Version that contains the resource * @param string $sid Verification Service Instance SID. * @return \Twilio\Rest\Preview\AccSecurity\ServiceContext */ public function __construct(Version $version, $sid) { parent::__construct($version); // Path Solution $this->solution = array('sid' => $sid, ); $this->uri = '/Services/' . \rawurlencode($sid) . ''; } /** * Fetch a ServiceInstance * * @return ServiceInstance Fetched ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new ServiceInstance($this->version, $payload, $this->solution['sid']); } /** * Update the ServiceInstance * * @param array|Options $options Optional Arguments * @return ServiceInstance Updated ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { $options = new Values($options); $data = Values::of(array('Name' => $options['name'], 'CodeLength' => $options['codeLength'], )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new ServiceInstance($this->version, $payload, $this->solution['sid']); } /** * Access the verifications * * @return \Twilio\Rest\Preview\AccSecurity\Service\VerificationList */ protected function getVerifications() { if (!$this->_verifications) { $this->_verifications = new VerificationList($this->version, $this->solution['sid']); } return $this->_verifications; } /** * Access the verificationChecks * * @return \Twilio\Rest\Preview\AccSecurity\Service\VerificationCheckList */ protected function getVerificationChecks() { if (!$this->_verificationChecks) { $this->_verificationChecks = new VerificationCheckList($this->version, $this->solution['sid']); } return $this->_verificationChecks; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get($name) { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.AccSecurity.ServiceContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/Wireless.php 0000644 00000006306 15002236443 0014233 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\Rest\Preview\Wireless\CommandList; use Twilio\Rest\Preview\Wireless\RatePlanList; use Twilio\Rest\Preview\Wireless\SimList; use Twilio\Version; /** * @property \Twilio\Rest\Preview\Wireless\CommandList $commands * @property \Twilio\Rest\Preview\Wireless\RatePlanList $ratePlans * @property \Twilio\Rest\Preview\Wireless\SimList $sims * @method \Twilio\Rest\Preview\Wireless\CommandContext commands(string $sid) * @method \Twilio\Rest\Preview\Wireless\RatePlanContext ratePlans(string $sid) * @method \Twilio\Rest\Preview\Wireless\SimContext sims(string $sid) */ class Wireless extends Version { protected $_commands = null; protected $_ratePlans = null; protected $_sims = null; /** * Construct the Wireless version of Preview * * @param \Twilio\Domain $domain Domain that contains the version * @return \Twilio\Rest\Preview\Wireless Wireless version of Preview */ public function __construct(Domain $domain) { parent::__construct($domain); $this->version = 'wireless'; } /** * @return \Twilio\Rest\Preview\Wireless\CommandList */ protected function getCommands() { if (!$this->_commands) { $this->_commands = new CommandList($this); } return $this->_commands; } /** * @return \Twilio\Rest\Preview\Wireless\RatePlanList */ protected function getRatePlans() { if (!$this->_ratePlans) { $this->_ratePlans = new RatePlanList($this); } return $this->_ratePlans; } /** * @return \Twilio\Rest\Preview\Wireless\SimList */ protected function getSims() { if (!$this->_sims) { $this->_sims = new SimList($this); } return $this->_sims; } /** * Magic getter to lazy load root resources * * @param string $name Resource to return * @return \Twilio\ListResource The requested resource * @throws TwilioException For unknown resource */ public function __get($name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown resource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Preview.Wireless]'; } } sdk/src/Twilio/Rest/Preview/TrustedComms.php 0000644 00000010617 15002236443 0015067 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\Rest\Preview\TrustedComms\BrandedCallList; use Twilio\Rest\Preview\TrustedComms\BusinessList; use Twilio\Rest\Preview\TrustedComms\CpsList; use Twilio\Rest\Preview\TrustedComms\CurrentCallList; use Twilio\Rest\Preview\TrustedComms\DeviceList; use Twilio\Rest\Preview\TrustedComms\PhoneCallList; use Twilio\Version; /** * @property \Twilio\Rest\Preview\TrustedComms\BrandedCallList $brandedCalls * @property \Twilio\Rest\Preview\TrustedComms\BusinessList $businesses * @property \Twilio\Rest\Preview\TrustedComms\CpsList $cps * @property \Twilio\Rest\Preview\TrustedComms\CurrentCallList $currentCalls * @property \Twilio\Rest\Preview\TrustedComms\DeviceList $devices * @property \Twilio\Rest\Preview\TrustedComms\PhoneCallList $phoneCalls * @method \Twilio\Rest\Preview\TrustedComms\BusinessContext businesses(string $sid) */ class TrustedComms extends Version { protected $_brandedCalls = null; protected $_businesses = null; protected $_cps = null; protected $_currentCalls = null; protected $_devices = null; protected $_phoneCalls = null; /** * Construct the TrustedComms version of Preview * * @param \Twilio\Domain $domain Domain that contains the version * @return \Twilio\Rest\Preview\TrustedComms TrustedComms version of Preview */ public function __construct(Domain $domain) { parent::__construct($domain); $this->version = 'TrustedComms'; } /** * @return \Twilio\Rest\Preview\TrustedComms\BrandedCallList */ protected function getBrandedCalls() { if (!$this->_brandedCalls) { $this->_brandedCalls = new BrandedCallList($this); } return $this->_brandedCalls; } /** * @return \Twilio\Rest\Preview\TrustedComms\BusinessList */ protected function getBusinesses() { if (!$this->_businesses) { $this->_businesses = new BusinessList($this); } return $this->_businesses; } /** * @return \Twilio\Rest\Preview\TrustedComms\CpsList */ protected function getCps() { if (!$this->_cps) { $this->_cps = new CpsList($this); } return $this->_cps; } /** * @return \Twilio\Rest\Preview\TrustedComms\CurrentCallList */ protected function getCurrentCalls() { if (!$this->_currentCalls) { $this->_currentCalls = new CurrentCallList($this); } return $this->_currentCalls; } /** * @return \Twilio\Rest\Preview\TrustedComms\DeviceList */ protected function getDevices() { if (!$this->_devices) { $this->_devices = new DeviceList($this); } return $this->_devices; } /** * @return \Twilio\Rest\Preview\TrustedComms\PhoneCallList */ protected function getPhoneCalls() { if (!$this->_phoneCalls) { $this->_phoneCalls = new PhoneCallList($this); } return $this->_phoneCalls; } /** * Magic getter to lazy load root resources * * @param string $name Resource to return * @return \Twilio\ListResource The requested resource * @throws TwilioException For unknown resource */ public function __get($name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown resource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Preview.TrustedComms]'; } } sdk/src/Twilio/Rest/Preview/HostedNumbers/HostedNumberOrderInstance.php 0000644 00000014253 15002236443 0022300 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\HostedNumbers; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $sid * @property string $accountSid * @property string $incomingPhoneNumberSid * @property string $addressSid * @property string $signingDocumentSid * @property string $phoneNumber * @property string $capabilities * @property string $friendlyName * @property string $uniqueName * @property string $status * @property string $failureReason * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property int $verificationAttempts * @property string $email * @property string $ccEmails * @property string $url * @property string $verificationType * @property string $verificationDocumentSid * @property string $extension * @property int $callDelay * @property string $verificationCode * @property string $verificationCallSids */ class HostedNumberOrderInstance extends InstanceResource { /** * Initialize the HostedNumberOrderInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid HostedNumberOrder sid. * @return \Twilio\Rest\Preview\HostedNumbers\HostedNumberOrderInstance */ public function __construct(Version $version, array $payload, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'incomingPhoneNumberSid' => Values::array_get($payload, 'incoming_phone_number_sid'), 'addressSid' => Values::array_get($payload, 'address_sid'), 'signingDocumentSid' => Values::array_get($payload, 'signing_document_sid'), 'phoneNumber' => Values::array_get($payload, 'phone_number'), 'capabilities' => Values::array_get($payload, 'capabilities'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'uniqueName' => Values::array_get($payload, 'unique_name'), 'status' => Values::array_get($payload, 'status'), 'failureReason' => Values::array_get($payload, 'failure_reason'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'verificationAttempts' => Values::array_get($payload, 'verification_attempts'), 'email' => Values::array_get($payload, 'email'), 'ccEmails' => Values::array_get($payload, 'cc_emails'), 'url' => Values::array_get($payload, 'url'), 'verificationType' => Values::array_get($payload, 'verification_type'), 'verificationDocumentSid' => Values::array_get($payload, 'verification_document_sid'), 'extension' => Values::array_get($payload, 'extension'), 'callDelay' => Values::array_get($payload, 'call_delay'), 'verificationCode' => Values::array_get($payload, 'verification_code'), 'verificationCallSids' => Values::array_get($payload, 'verification_call_sids'), ); $this->solution = array('sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Preview\HostedNumbers\HostedNumberOrderContext Context * for this * HostedNumberOrderInstance */ protected function proxy() { if (!$this->context) { $this->context = new HostedNumberOrderContext($this->version, $this->solution['sid']); } return $this->context; } /** * Fetch a HostedNumberOrderInstance * * @return HostedNumberOrderInstance Fetched HostedNumberOrderInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the HostedNumberOrderInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Update the HostedNumberOrderInstance * * @param array|Options $options Optional Arguments * @return HostedNumberOrderInstance Updated HostedNumberOrderInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.HostedNumbers.HostedNumberOrderInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/HostedNumbers/AuthorizationDocumentOptions.php 0000644 00000022011 15002236443 0023122 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\HostedNumbers; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ abstract class AuthorizationDocumentOptions { /** * @param string $hostedNumberOrderSids A list of HostedNumberOrder sids. * @param string $addressSid Address sid. * @param string $email Email. * @param string $ccEmails A list of emails. * @param string $status The Status of this AuthorizationDocument. * @param string $contactTitle Title of signee of this Authorization Document. * @param string $contactPhoneNumber Authorization Document's signee's phone * number. * @return UpdateAuthorizationDocumentOptions Options builder */ public static function update($hostedNumberOrderSids = Values::NONE, $addressSid = Values::NONE, $email = Values::NONE, $ccEmails = Values::NONE, $status = Values::NONE, $contactTitle = Values::NONE, $contactPhoneNumber = Values::NONE) { return new UpdateAuthorizationDocumentOptions($hostedNumberOrderSids, $addressSid, $email, $ccEmails, $status, $contactTitle, $contactPhoneNumber); } /** * @param string $email Email. * @param string $status The Status of this AuthorizationDocument. * @return ReadAuthorizationDocumentOptions Options builder */ public static function read($email = Values::NONE, $status = Values::NONE) { return new ReadAuthorizationDocumentOptions($email, $status); } /** * @param string $ccEmails A list of emails. * @return CreateAuthorizationDocumentOptions Options builder */ public static function create($ccEmails = Values::NONE) { return new CreateAuthorizationDocumentOptions($ccEmails); } } class UpdateAuthorizationDocumentOptions extends Options { /** * @param string $hostedNumberOrderSids A list of HostedNumberOrder sids. * @param string $addressSid Address sid. * @param string $email Email. * @param string $ccEmails A list of emails. * @param string $status The Status of this AuthorizationDocument. * @param string $contactTitle Title of signee of this Authorization Document. * @param string $contactPhoneNumber Authorization Document's signee's phone * number. */ public function __construct($hostedNumberOrderSids = Values::NONE, $addressSid = Values::NONE, $email = Values::NONE, $ccEmails = Values::NONE, $status = Values::NONE, $contactTitle = Values::NONE, $contactPhoneNumber = Values::NONE) { $this->options['hostedNumberOrderSids'] = $hostedNumberOrderSids; $this->options['addressSid'] = $addressSid; $this->options['email'] = $email; $this->options['ccEmails'] = $ccEmails; $this->options['status'] = $status; $this->options['contactTitle'] = $contactTitle; $this->options['contactPhoneNumber'] = $contactPhoneNumber; } /** * A list of HostedNumberOrder sids that this AuthorizationDocument will authorize for hosting phone number capabilities on Twilio's platform. * * @param string $hostedNumberOrderSids A list of HostedNumberOrder sids. * @return $this Fluent Builder */ public function setHostedNumberOrderSids($hostedNumberOrderSids) { $this->options['hostedNumberOrderSids'] = $hostedNumberOrderSids; return $this; } /** * A 34 character string that uniquely identifies the Address resource that is associated with this AuthorizationDocument. * * @param string $addressSid Address sid. * @return $this Fluent Builder */ public function setAddressSid($addressSid) { $this->options['addressSid'] = $addressSid; return $this; } /** * Email that this AuthorizationDocument will be sent to for signing. * * @param string $email Email. * @return $this Fluent Builder */ public function setEmail($email) { $this->options['email'] = $email; return $this; } /** * Email recipients who will be informed when an Authorization Document has been sent and signed * * @param string $ccEmails A list of emails. * @return $this Fluent Builder */ public function setCcEmails($ccEmails) { $this->options['ccEmails'] = $ccEmails; return $this; } /** * Status of an instance resource. It can hold one of the values: 1. opened 2. signing, 3. signed LOA, 4. canceled, 5. failed. See the section entitled [Status Values](https://www.twilio.com/docs/api/phone-numbers/hosted-number-authorization-documents#status-values) for more information on each of these statuses. * * @param string $status The Status of this AuthorizationDocument. * @return $this Fluent Builder */ public function setStatus($status) { $this->options['status'] = $status; return $this; } /** * The title of the person authorized to sign the Authorization Document for this phone number. * * @param string $contactTitle Title of signee of this Authorization Document. * @return $this Fluent Builder */ public function setContactTitle($contactTitle) { $this->options['contactTitle'] = $contactTitle; return $this; } /** * The contact phone number of the person authorized to sign the Authorization Document. * * @param string $contactPhoneNumber Authorization Document's signee's phone * number. * @return $this Fluent Builder */ public function setContactPhoneNumber($contactPhoneNumber) { $this->options['contactPhoneNumber'] = $contactPhoneNumber; 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.Preview.HostedNumbers.UpdateAuthorizationDocumentOptions ' . \implode(' ', $options) . ']'; } } class ReadAuthorizationDocumentOptions extends Options { /** * @param string $email Email. * @param string $status The Status of this AuthorizationDocument. */ public function __construct($email = Values::NONE, $status = Values::NONE) { $this->options['email'] = $email; $this->options['status'] = $status; } /** * Email that this AuthorizationDocument will be sent to for signing. * * @param string $email Email. * @return $this Fluent Builder */ public function setEmail($email) { $this->options['email'] = $email; return $this; } /** * Status of an instance resource. It can hold one of the values: 1. opened 2. signing, 3. signed LOA, 4. canceled, 5. failed. See the section entitled [Status Values](https://www.twilio.com/docs/api/phone-numbers/hosted-number-authorization-documents#status-values) for more information on each of these statuses. * * @param string $status The Status of this AuthorizationDocument. * @return $this Fluent Builder */ public function setStatus($status) { $this->options['status'] = $status; 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.Preview.HostedNumbers.ReadAuthorizationDocumentOptions ' . \implode(' ', $options) . ']'; } } class CreateAuthorizationDocumentOptions extends Options { /** * @param string $ccEmails A list of emails. */ public function __construct($ccEmails = Values::NONE) { $this->options['ccEmails'] = $ccEmails; } /** * Email recipients who will be informed when an Authorization Document has been sent and signed. * * @param string $ccEmails A list of emails. * @return $this Fluent Builder */ public function setCcEmails($ccEmails) { $this->options['ccEmails'] = $ccEmails; 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.Preview.HostedNumbers.CreateAuthorizationDocumentOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Preview/HostedNumbers/AuthorizationDocumentContext.php 0000644 00000011653 15002236443 0023125 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\HostedNumbers; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Rest\Preview\HostedNumbers\AuthorizationDocument\DependentHostedNumberOrderList; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property \Twilio\Rest\Preview\HostedNumbers\AuthorizationDocument\DependentHostedNumberOrderList $dependentHostedNumberOrders */ class AuthorizationDocumentContext extends InstanceContext { protected $_dependentHostedNumberOrders = null; /** * Initialize the AuthorizationDocumentContext * * @param \Twilio\Version $version Version that contains the resource * @param string $sid AuthorizationDocument sid. * @return \Twilio\Rest\Preview\HostedNumbers\AuthorizationDocumentContext */ public function __construct(Version $version, $sid) { parent::__construct($version); // Path Solution $this->solution = array('sid' => $sid, ); $this->uri = '/AuthorizationDocuments/' . \rawurlencode($sid) . ''; } /** * Fetch a AuthorizationDocumentInstance * * @return AuthorizationDocumentInstance Fetched AuthorizationDocumentInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new AuthorizationDocumentInstance($this->version, $payload, $this->solution['sid']); } /** * Update the AuthorizationDocumentInstance * * @param array|Options $options Optional Arguments * @return AuthorizationDocumentInstance Updated AuthorizationDocumentInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { $options = new Values($options); $data = Values::of(array( 'HostedNumberOrderSids' => Serialize::map($options['hostedNumberOrderSids'], function($e) { return $e; }), 'AddressSid' => $options['addressSid'], 'Email' => $options['email'], 'CcEmails' => Serialize::map($options['ccEmails'], function($e) { return $e; }), 'Status' => $options['status'], 'ContactTitle' => $options['contactTitle'], 'ContactPhoneNumber' => $options['contactPhoneNumber'], )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new AuthorizationDocumentInstance($this->version, $payload, $this->solution['sid']); } /** * Access the dependentHostedNumberOrders * * @return \Twilio\Rest\Preview\HostedNumbers\AuthorizationDocument\DependentHostedNumberOrderList */ protected function getDependentHostedNumberOrders() { if (!$this->_dependentHostedNumberOrders) { $this->_dependentHostedNumberOrders = new DependentHostedNumberOrderList( $this->version, $this->solution['sid'] ); } return $this->_dependentHostedNumberOrders; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get($name) { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.HostedNumbers.AuthorizationDocumentContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/HostedNumbers/HostedNumberOrderOptions.php 0000644 00000054665 15002236443 0022202 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\HostedNumbers; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ abstract class HostedNumberOrderOptions { /** * @param string $friendlyName A human readable description of this resource. * @param string $uniqueName A unique, developer assigned name of this * HostedNumberOrder. * @param string $email Email. * @param string $ccEmails A list of emails. * @param string $status The Status of this HostedNumberOrder. * @param string $verificationCode A verification code. * @param string $verificationType Verification Type. * @param string $verificationDocumentSid Verification Document Sid * @param string $extension Digits to dial after connecting the verification * call. * @param int $callDelay The number of seconds, between 0 and 60, to delay * before initiating the verification call. * @return UpdateHostedNumberOrderOptions Options builder */ public static function update($friendlyName = Values::NONE, $uniqueName = Values::NONE, $email = Values::NONE, $ccEmails = Values::NONE, $status = Values::NONE, $verificationCode = Values::NONE, $verificationType = Values::NONE, $verificationDocumentSid = Values::NONE, $extension = Values::NONE, $callDelay = Values::NONE) { return new UpdateHostedNumberOrderOptions($friendlyName, $uniqueName, $email, $ccEmails, $status, $verificationCode, $verificationType, $verificationDocumentSid, $extension, $callDelay); } /** * @param string $status The Status of this HostedNumberOrder. * @param string $phoneNumber An E164 formatted phone number. * @param string $incomingPhoneNumberSid IncomingPhoneNumber sid. * @param string $friendlyName A human readable description of this resource. * @param string $uniqueName A unique, developer assigned name of this * HostedNumberOrder. * @return ReadHostedNumberOrderOptions Options builder */ public static function read($status = Values::NONE, $phoneNumber = Values::NONE, $incomingPhoneNumberSid = Values::NONE, $friendlyName = Values::NONE, $uniqueName = Values::NONE) { return new ReadHostedNumberOrderOptions($status, $phoneNumber, $incomingPhoneNumberSid, $friendlyName, $uniqueName); } /** * @param string $accountSid Account Sid. * @param string $friendlyName A human readable description of this resource. * @param string $uniqueName A unique, developer assigned name of this * HostedNumberOrder. * @param string $ccEmails A list of emails. * @param string $smsUrl SMS URL. * @param string $smsMethod SMS Method. * @param string $smsFallbackUrl SMS Fallback URL. * @param string $smsFallbackMethod SMS Fallback Method. * @param string $statusCallbackUrl Status Callback URL. * @param string $statusCallbackMethod Status Callback Method. * @param string $smsApplicationSid SMS Application Sid. * @param string $addressSid Address sid. * @param string $email Email. * @param string $verificationType Verification Type. * @param string $verificationDocumentSid Verification Document Sid * @return CreateHostedNumberOrderOptions Options builder */ public static function create($accountSid = Values::NONE, $friendlyName = Values::NONE, $uniqueName = Values::NONE, $ccEmails = Values::NONE, $smsUrl = Values::NONE, $smsMethod = Values::NONE, $smsFallbackUrl = Values::NONE, $smsFallbackMethod = Values::NONE, $statusCallbackUrl = Values::NONE, $statusCallbackMethod = Values::NONE, $smsApplicationSid = Values::NONE, $addressSid = Values::NONE, $email = Values::NONE, $verificationType = Values::NONE, $verificationDocumentSid = Values::NONE) { return new CreateHostedNumberOrderOptions($accountSid, $friendlyName, $uniqueName, $ccEmails, $smsUrl, $smsMethod, $smsFallbackUrl, $smsFallbackMethod, $statusCallbackUrl, $statusCallbackMethod, $smsApplicationSid, $addressSid, $email, $verificationType, $verificationDocumentSid); } } class UpdateHostedNumberOrderOptions extends Options { /** * @param string $friendlyName A human readable description of this resource. * @param string $uniqueName A unique, developer assigned name of this * HostedNumberOrder. * @param string $email Email. * @param string $ccEmails A list of emails. * @param string $status The Status of this HostedNumberOrder. * @param string $verificationCode A verification code. * @param string $verificationType Verification Type. * @param string $verificationDocumentSid Verification Document Sid * @param string $extension Digits to dial after connecting the verification * call. * @param int $callDelay The number of seconds, between 0 and 60, to delay * before initiating the verification call. */ public function __construct($friendlyName = Values::NONE, $uniqueName = Values::NONE, $email = Values::NONE, $ccEmails = Values::NONE, $status = Values::NONE, $verificationCode = Values::NONE, $verificationType = Values::NONE, $verificationDocumentSid = Values::NONE, $extension = Values::NONE, $callDelay = Values::NONE) { $this->options['friendlyName'] = $friendlyName; $this->options['uniqueName'] = $uniqueName; $this->options['email'] = $email; $this->options['ccEmails'] = $ccEmails; $this->options['status'] = $status; $this->options['verificationCode'] = $verificationCode; $this->options['verificationType'] = $verificationType; $this->options['verificationDocumentSid'] = $verificationDocumentSid; $this->options['extension'] = $extension; $this->options['callDelay'] = $callDelay; } /** * A 64 character string that is a human readable text that describes this resource. * * @param string $friendlyName A human readable description of this resource. * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * Provides a unique and addressable name to be assigned to this HostedNumberOrder, assigned by the developer, to be optionally used in addition to SID. * * @param string $uniqueName A unique, developer assigned name of this * HostedNumberOrder. * @return $this Fluent Builder */ public function setUniqueName($uniqueName) { $this->options['uniqueName'] = $uniqueName; return $this; } /** * Email of the owner of this phone number that is being hosted. * * @param string $email Email. * @return $this Fluent Builder */ public function setEmail($email) { $this->options['email'] = $email; return $this; } /** * Optional. A list of emails that LOA document for this HostedNumberOrder will be carbon copied to. * * @param string $ccEmails A list of emails. * @return $this Fluent Builder */ public function setCcEmails($ccEmails) { $this->options['ccEmails'] = $ccEmails; return $this; } /** * User can only post to `pending-verification` status to transition the HostedNumberOrder to initiate a verification call or verification of ownership with a copy of a phone bill. * * @param string $status The Status of this HostedNumberOrder. * @return $this Fluent Builder */ public function setStatus($status) { $this->options['status'] = $status; return $this; } /** * A verification code that is given to the user via a phone call to the phone number that is being hosted. * * @param string $verificationCode A verification code. * @return $this Fluent Builder */ public function setVerificationCode($verificationCode) { $this->options['verificationCode'] = $verificationCode; return $this; } /** * Optional. The method used for verifying ownership of the number to be hosted. One of phone-call (default) or phone-bill. * * @param string $verificationType Verification Type. * @return $this Fluent Builder */ public function setVerificationType($verificationType) { $this->options['verificationType'] = $verificationType; return $this; } /** * Optional. The unique sid identifier of the Identity Document that represents the document for verifying ownership of the number to be hosted. Required when VerificationType is phone-bill. * * @param string $verificationDocumentSid Verification Document Sid * @return $this Fluent Builder */ public function setVerificationDocumentSid($verificationDocumentSid) { $this->options['verificationDocumentSid'] = $verificationDocumentSid; return $this; } /** * Digits to dial after connecting the verification call. * * @param string $extension Digits to dial after connecting the verification * call. * @return $this Fluent Builder */ public function setExtension($extension) { $this->options['extension'] = $extension; return $this; } /** * The number of seconds, between 0 and 60, to delay before initiating the verification call. Defaults to 0. * * @param int $callDelay The number of seconds, between 0 and 60, to delay * before initiating the verification call. * @return $this Fluent Builder */ public function setCallDelay($callDelay) { $this->options['callDelay'] = $callDelay; 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.Preview.HostedNumbers.UpdateHostedNumberOrderOptions ' . \implode(' ', $options) . ']'; } } class ReadHostedNumberOrderOptions extends Options { /** * @param string $status The Status of this HostedNumberOrder. * @param string $phoneNumber An E164 formatted phone number. * @param string $incomingPhoneNumberSid IncomingPhoneNumber sid. * @param string $friendlyName A human readable description of this resource. * @param string $uniqueName A unique, developer assigned name of this * HostedNumberOrder. */ public function __construct($status = Values::NONE, $phoneNumber = Values::NONE, $incomingPhoneNumberSid = Values::NONE, $friendlyName = Values::NONE, $uniqueName = Values::NONE) { $this->options['status'] = $status; $this->options['phoneNumber'] = $phoneNumber; $this->options['incomingPhoneNumberSid'] = $incomingPhoneNumberSid; $this->options['friendlyName'] = $friendlyName; $this->options['uniqueName'] = $uniqueName; } /** * The Status of this HostedNumberOrder. One of `received`, `pending-verification`, `verified`, `pending-loa`, `carrier-processing`, `testing`, `completed`, `failed`, or `action-required`. * * @param string $status The Status of this HostedNumberOrder. * @return $this Fluent Builder */ public function setStatus($status) { $this->options['status'] = $status; return $this; } /** * An E164 formatted phone number hosted by this HostedNumberOrder. * * @param string $phoneNumber An E164 formatted phone number. * @return $this Fluent Builder */ public function setPhoneNumber($phoneNumber) { $this->options['phoneNumber'] = $phoneNumber; return $this; } /** * A 34 character string that uniquely identifies the IncomingPhoneNumber resource created by this HostedNumberOrder. * * @param string $incomingPhoneNumberSid IncomingPhoneNumber sid. * @return $this Fluent Builder */ public function setIncomingPhoneNumberSid($incomingPhoneNumberSid) { $this->options['incomingPhoneNumberSid'] = $incomingPhoneNumberSid; return $this; } /** * A human readable description of this resource, up to 64 characters. * * @param string $friendlyName A human readable description of this resource. * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * Provides a unique and addressable name to be assigned to this HostedNumberOrder, assigned by the developer, to be optionally used in addition to SID. * * @param string $uniqueName A unique, developer assigned name of this * HostedNumberOrder. * @return $this Fluent Builder */ public function setUniqueName($uniqueName) { $this->options['uniqueName'] = $uniqueName; 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.Preview.HostedNumbers.ReadHostedNumberOrderOptions ' . \implode(' ', $options) . ']'; } } class CreateHostedNumberOrderOptions extends Options { /** * @param string $accountSid Account Sid. * @param string $friendlyName A human readable description of this resource. * @param string $uniqueName A unique, developer assigned name of this * HostedNumberOrder. * @param string $ccEmails A list of emails. * @param string $smsUrl SMS URL. * @param string $smsMethod SMS Method. * @param string $smsFallbackUrl SMS Fallback URL. * @param string $smsFallbackMethod SMS Fallback Method. * @param string $statusCallbackUrl Status Callback URL. * @param string $statusCallbackMethod Status Callback Method. * @param string $smsApplicationSid SMS Application Sid. * @param string $addressSid Address sid. * @param string $email Email. * @param string $verificationType Verification Type. * @param string $verificationDocumentSid Verification Document Sid */ public function __construct($accountSid = Values::NONE, $friendlyName = Values::NONE, $uniqueName = Values::NONE, $ccEmails = Values::NONE, $smsUrl = Values::NONE, $smsMethod = Values::NONE, $smsFallbackUrl = Values::NONE, $smsFallbackMethod = Values::NONE, $statusCallbackUrl = Values::NONE, $statusCallbackMethod = Values::NONE, $smsApplicationSid = Values::NONE, $addressSid = Values::NONE, $email = Values::NONE, $verificationType = Values::NONE, $verificationDocumentSid = Values::NONE) { $this->options['accountSid'] = $accountSid; $this->options['friendlyName'] = $friendlyName; $this->options['uniqueName'] = $uniqueName; $this->options['ccEmails'] = $ccEmails; $this->options['smsUrl'] = $smsUrl; $this->options['smsMethod'] = $smsMethod; $this->options['smsFallbackUrl'] = $smsFallbackUrl; $this->options['smsFallbackMethod'] = $smsFallbackMethod; $this->options['statusCallbackUrl'] = $statusCallbackUrl; $this->options['statusCallbackMethod'] = $statusCallbackMethod; $this->options['smsApplicationSid'] = $smsApplicationSid; $this->options['addressSid'] = $addressSid; $this->options['email'] = $email; $this->options['verificationType'] = $verificationType; $this->options['verificationDocumentSid'] = $verificationDocumentSid; } /** * This defaults to the AccountSid of the authorization the user is using. This can be provided to specify a subaccount to add the HostedNumberOrder to. * * @param string $accountSid Account Sid. * @return $this Fluent Builder */ public function setAccountSid($accountSid) { $this->options['accountSid'] = $accountSid; return $this; } /** * A 64 character string that is a human readable text that describes this resource. * * @param string $friendlyName A human readable description of this resource. * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * Optional. Provides a unique and addressable name to be assigned to this HostedNumberOrder, assigned by the developer, to be optionally used in addition to SID. * * @param string $uniqueName A unique, developer assigned name of this * HostedNumberOrder. * @return $this Fluent Builder */ public function setUniqueName($uniqueName) { $this->options['uniqueName'] = $uniqueName; return $this; } /** * Optional. A list of emails that the LOA document for this HostedNumberOrder will be carbon copied to. * * @param string $ccEmails A list of emails. * @return $this Fluent Builder */ public function setCcEmails($ccEmails) { $this->options['ccEmails'] = $ccEmails; return $this; } /** * The URL that Twilio should request when somebody sends an SMS to the phone number. This will be copied onto the IncomingPhoneNumber resource. * * @param string $smsUrl SMS URL. * @return $this Fluent Builder */ public function setSmsUrl($smsUrl) { $this->options['smsUrl'] = $smsUrl; return $this; } /** * The HTTP method that should be used to request the SmsUrl. Must be either `GET` or `POST`. This will be copied onto the IncomingPhoneNumber resource. * * @param string $smsMethod SMS Method. * @return $this Fluent Builder */ public function setSmsMethod($smsMethod) { $this->options['smsMethod'] = $smsMethod; return $this; } /** * A URL that Twilio will request if an error occurs requesting or executing the TwiML defined by SmsUrl. This will be copied onto the IncomingPhoneNumber resource. * * @param string $smsFallbackUrl SMS Fallback URL. * @return $this Fluent Builder */ public function setSmsFallbackUrl($smsFallbackUrl) { $this->options['smsFallbackUrl'] = $smsFallbackUrl; return $this; } /** * The HTTP method that should be used to request the SmsFallbackUrl. Must be either `GET` or `POST`. This will be copied onto the IncomingPhoneNumber resource. * * @param string $smsFallbackMethod SMS Fallback Method. * @return $this Fluent Builder */ public function setSmsFallbackMethod($smsFallbackMethod) { $this->options['smsFallbackMethod'] = $smsFallbackMethod; return $this; } /** * Optional. The Status Callback URL attached to the IncomingPhoneNumber resource. * * @param string $statusCallbackUrl Status Callback URL. * @return $this Fluent Builder */ public function setStatusCallbackUrl($statusCallbackUrl) { $this->options['statusCallbackUrl'] = $statusCallbackUrl; return $this; } /** * Optional. The Status Callback Method attached to the IncomingPhoneNumber resource. * * @param string $statusCallbackMethod Status Callback Method. * @return $this Fluent Builder */ public function setStatusCallbackMethod($statusCallbackMethod) { $this->options['statusCallbackMethod'] = $statusCallbackMethod; return $this; } /** * Optional. The 34 character sid of the application Twilio should use to handle SMS messages sent to this number. If a `SmsApplicationSid` is present, Twilio will ignore all of the SMS urls above and use those set on the application. * * @param string $smsApplicationSid SMS Application Sid. * @return $this Fluent Builder */ public function setSmsApplicationSid($smsApplicationSid) { $this->options['smsApplicationSid'] = $smsApplicationSid; return $this; } /** * Optional. A 34 character string that uniquely identifies the Address resource that represents the address of the owner of this phone number. * * @param string $addressSid Address sid. * @return $this Fluent Builder */ public function setAddressSid($addressSid) { $this->options['addressSid'] = $addressSid; return $this; } /** * Optional. Email of the owner of this phone number that is being hosted. * * @param string $email Email. * @return $this Fluent Builder */ public function setEmail($email) { $this->options['email'] = $email; return $this; } /** * Optional. The method used for verifying ownership of the number to be hosted. One of phone-call (default) or phone-bill. * * @param string $verificationType Verification Type. * @return $this Fluent Builder */ public function setVerificationType($verificationType) { $this->options['verificationType'] = $verificationType; return $this; } /** * Optional. The unique sid identifier of the Identity Document that represents the document for verifying ownership of the number to be hosted. Required when VerificationType is phone-bill. * * @param string $verificationDocumentSid Verification Document Sid * @return $this Fluent Builder */ public function setVerificationDocumentSid($verificationDocumentSid) { $this->options['verificationDocumentSid'] = $verificationDocumentSid; 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.Preview.HostedNumbers.CreateHostedNumberOrderOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Preview/HostedNumbers/HostedNumberOrderList.php 0000644 00000016616 15002236443 0021454 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\HostedNumbers; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class HostedNumberOrderList extends ListResource { /** * Construct the HostedNumberOrderList * * @param Version $version Version that contains the resource * @return \Twilio\Rest\Preview\HostedNumbers\HostedNumberOrderList */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = array(); $this->uri = '/HostedNumberOrders'; } /** * Streams HostedNumberOrderInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($options = array(), $limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads HostedNumberOrderInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return HostedNumberOrderInstance[] Array of results */ public function read($options = array(), $limit = null, $pageSize = null) { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Retrieve a single page of HostedNumberOrderInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of HostedNumberOrderInstance */ public function page($options = array(), $pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $options = new Values($options); $params = Values::of(array( 'Status' => $options['status'], 'PhoneNumber' => $options['phoneNumber'], 'IncomingPhoneNumberSid' => $options['incomingPhoneNumberSid'], 'FriendlyName' => $options['friendlyName'], 'UniqueName' => $options['uniqueName'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new HostedNumberOrderPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of HostedNumberOrderInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of HostedNumberOrderInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new HostedNumberOrderPage($this->version, $response, $this->solution); } /** * Create a new HostedNumberOrderInstance * * @param string $phoneNumber An E164 formatted phone number. * @param bool $smsCapability Specify SMS capability to host. * @param array|Options $options Optional Arguments * @return HostedNumberOrderInstance Newly created HostedNumberOrderInstance * @throws TwilioException When an HTTP error occurs. */ public function create($phoneNumber, $smsCapability, $options = array()) { $options = new Values($options); $data = Values::of(array( 'PhoneNumber' => $phoneNumber, 'SmsCapability' => Serialize::booleanToString($smsCapability), 'AccountSid' => $options['accountSid'], 'FriendlyName' => $options['friendlyName'], 'UniqueName' => $options['uniqueName'], 'CcEmails' => Serialize::map($options['ccEmails'], function($e) { return $e; }), 'SmsUrl' => $options['smsUrl'], 'SmsMethod' => $options['smsMethod'], 'SmsFallbackUrl' => $options['smsFallbackUrl'], 'SmsFallbackMethod' => $options['smsFallbackMethod'], 'StatusCallbackUrl' => $options['statusCallbackUrl'], 'StatusCallbackMethod' => $options['statusCallbackMethod'], 'SmsApplicationSid' => $options['smsApplicationSid'], 'AddressSid' => $options['addressSid'], 'Email' => $options['email'], 'VerificationType' => $options['verificationType'], 'VerificationDocumentSid' => $options['verificationDocumentSid'], )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new HostedNumberOrderInstance($this->version, $payload); } /** * Constructs a HostedNumberOrderContext * * @param string $sid HostedNumberOrder sid. * @return \Twilio\Rest\Preview\HostedNumbers\HostedNumberOrderContext */ public function getContext($sid) { return new HostedNumberOrderContext($this->version, $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Preview.HostedNumbers.HostedNumberOrderList]'; } } sdk/src/Twilio/Rest/Preview/HostedNumbers/AuthorizationDocumentInstance.php 0000644 00000011013 15002236443 0023233 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\HostedNumbers; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $sid * @property string $addressSid * @property string $status * @property string $email * @property string $ccEmails * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $url * @property array $links */ class AuthorizationDocumentInstance extends InstanceResource { protected $_dependentHostedNumberOrders = null; /** * Initialize the AuthorizationDocumentInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid AuthorizationDocument sid. * @return \Twilio\Rest\Preview\HostedNumbers\AuthorizationDocumentInstance */ public function __construct(Version $version, array $payload, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'sid' => Values::array_get($payload, 'sid'), 'addressSid' => Values::array_get($payload, 'address_sid'), 'status' => Values::array_get($payload, 'status'), 'email' => Values::array_get($payload, 'email'), 'ccEmails' => Values::array_get($payload, 'cc_emails'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ); $this->solution = array('sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Preview\HostedNumbers\AuthorizationDocumentContext Context for this AuthorizationDocumentInstance */ protected function proxy() { if (!$this->context) { $this->context = new AuthorizationDocumentContext($this->version, $this->solution['sid']); } return $this->context; } /** * Fetch a AuthorizationDocumentInstance * * @return AuthorizationDocumentInstance Fetched AuthorizationDocumentInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Update the AuthorizationDocumentInstance * * @param array|Options $options Optional Arguments * @return AuthorizationDocumentInstance Updated AuthorizationDocumentInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Access the dependentHostedNumberOrders * * @return \Twilio\Rest\Preview\HostedNumbers\AuthorizationDocument\DependentHostedNumberOrderList */ protected function getDependentHostedNumberOrders() { return $this->proxy()->dependentHostedNumberOrders; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.HostedNumbers.AuthorizationDocumentInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Preview/HostedNumbers/HostedNumberOrderPage.php 0000644 00000001717 15002236443 0021411 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\HostedNumbers; use Twilio\Page; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class HostedNumberOrderPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new HostedNumberOrderInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Preview.HostedNumbers.HostedNumberOrderPage]'; } } sdk/src/Twilio/Rest/Preview/HostedNumbers/AuthorizationDocumentList.php 0000644 00000015760 15002236443 0022417 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\HostedNumbers; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class AuthorizationDocumentList extends ListResource { /** * Construct the AuthorizationDocumentList * * @param Version $version Version that contains the resource * @return \Twilio\Rest\Preview\HostedNumbers\AuthorizationDocumentList */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = array(); $this->uri = '/AuthorizationDocuments'; } /** * Streams AuthorizationDocumentInstance records from the API as a generator * stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($options = array(), $limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads AuthorizationDocumentInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return AuthorizationDocumentInstance[] Array of results */ public function read($options = array(), $limit = null, $pageSize = null) { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Retrieve a single page of AuthorizationDocumentInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of AuthorizationDocumentInstance */ public function page($options = array(), $pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $options = new Values($options); $params = Values::of(array( 'Email' => $options['email'], 'Status' => $options['status'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new AuthorizationDocumentPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of AuthorizationDocumentInstance records from the * API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of AuthorizationDocumentInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new AuthorizationDocumentPage($this->version, $response, $this->solution); } /** * Create a new AuthorizationDocumentInstance * * @param string $hostedNumberOrderSids A list of HostedNumberOrder sids. * @param string $addressSid Address sid. * @param string $email Email. * @param string $contactTitle Title of signee of this Authorization Document. * @param string $contactPhoneNumber Authorization Document's signee's phone * number. * @param array|Options $options Optional Arguments * @return AuthorizationDocumentInstance Newly created * AuthorizationDocumentInstance * @throws TwilioException When an HTTP error occurs. */ public function create($hostedNumberOrderSids, $addressSid, $email, $contactTitle, $contactPhoneNumber, $options = array()) { $options = new Values($options); $data = Values::of(array( 'HostedNumberOrderSids' => Serialize::map($hostedNumberOrderSids, function($e) { return $e; }), 'AddressSid' => $addressSid, 'Email' => $email, 'ContactTitle' => $contactTitle, 'ContactPhoneNumber' => $contactPhoneNumber, 'CcEmails' => Serialize::map($options['ccEmails'], function($e) { return $e; }), )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new AuthorizationDocumentInstance($this->version, $payload); } /** * Constructs a AuthorizationDocumentContext * * @param string $sid AuthorizationDocument sid. * @return \Twilio\Rest\Preview\HostedNumbers\AuthorizationDocumentContext */ public function getContext($sid) { return new AuthorizationDocumentContext($this->version, $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Preview.HostedNumbers.AuthorizationDocumentList]'; } } sdk/src/Twilio/Rest/Preview/HostedNumbers/AuthorizationDocumentPage.php 0000644 00000001733 15002236443 0022353 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\HostedNumbers; use Twilio\Page; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class AuthorizationDocumentPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new AuthorizationDocumentInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Preview.HostedNumbers.AuthorizationDocumentPage]'; } } sdk/src/Twilio/Rest/Preview/HostedNumbers/AuthorizationDocument/DependentHostedNumberOrderList.php 0000644 00000013212 15002236443 0027627 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\HostedNumbers\AuthorizationDocument; use Twilio\ListResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class DependentHostedNumberOrderList extends ListResource { /** * Construct the DependentHostedNumberOrderList * * @param Version $version Version that contains the resource * @param string $signingDocumentSid LOA document sid. * @return \Twilio\Rest\Preview\HostedNumbers\AuthorizationDocument\DependentHostedNumberOrderList */ public function __construct(Version $version, $signingDocumentSid) { parent::__construct($version); // Path Solution $this->solution = array('signingDocumentSid' => $signingDocumentSid, ); $this->uri = '/AuthorizationDocuments/' . \rawurlencode($signingDocumentSid) . '/DependentHostedNumberOrders'; } /** * Streams DependentHostedNumberOrderInstance records from the API as a * generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($options = array(), $limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads DependentHostedNumberOrderInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return DependentHostedNumberOrderInstance[] Array of results */ public function read($options = array(), $limit = null, $pageSize = null) { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Retrieve a single page of DependentHostedNumberOrderInstance records from * the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of DependentHostedNumberOrderInstance */ public function page($options = array(), $pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $options = new Values($options); $params = Values::of(array( 'Status' => $options['status'], 'PhoneNumber' => $options['phoneNumber'], 'IncomingPhoneNumberSid' => $options['incomingPhoneNumberSid'], 'FriendlyName' => $options['friendlyName'], 'UniqueName' => $options['uniqueName'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new DependentHostedNumberOrderPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of DependentHostedNumberOrderInstance records from * the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of DependentHostedNumberOrderInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new DependentHostedNumberOrderPage($this->version, $response, $this->solution); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Preview.HostedNumbers.DependentHostedNumberOrderList]'; } } sdk/src/Twilio/Rest/Preview/HostedNumbers/AuthorizationDocument/DependentHostedNumberOrderPage.php 0000644 00000002125 15002236443 0027571 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\HostedNumbers\AuthorizationDocument; use Twilio\Page; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class DependentHostedNumberOrderPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new DependentHostedNumberOrderInstance( $this->version, $payload, $this->solution['signingDocumentSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Preview.HostedNumbers.DependentHostedNumberOrderPage]'; } } src/Twilio/Rest/Preview/HostedNumbers/AuthorizationDocument/DependentHostedNumberOrderInstance.php 0000644 00000010742 15002236443 0030406 0 ustar 00 sdk <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\HostedNumbers\AuthorizationDocument; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $sid * @property string $accountSid * @property string $incomingPhoneNumberSid * @property string $addressSid * @property string $signingDocumentSid * @property string $phoneNumber * @property string $capabilities * @property string $friendlyName * @property string $uniqueName * @property string $status * @property string $failureReason * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property int $verificationAttempts * @property string $email * @property string $ccEmails * @property string $verificationType * @property string $verificationDocumentSid * @property string $extension * @property int $callDelay * @property string $verificationCode * @property string $verificationCallSids */ class DependentHostedNumberOrderInstance extends InstanceResource { /** * Initialize the DependentHostedNumberOrderInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $signingDocumentSid LOA document sid. * @return \Twilio\Rest\Preview\HostedNumbers\AuthorizationDocument\DependentHostedNumberOrderInstance */ public function __construct(Version $version, array $payload, $signingDocumentSid) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'incomingPhoneNumberSid' => Values::array_get($payload, 'incoming_phone_number_sid'), 'addressSid' => Values::array_get($payload, 'address_sid'), 'signingDocumentSid' => Values::array_get($payload, 'signing_document_sid'), 'phoneNumber' => Values::array_get($payload, 'phone_number'), 'capabilities' => Values::array_get($payload, 'capabilities'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'uniqueName' => Values::array_get($payload, 'unique_name'), 'status' => Values::array_get($payload, 'status'), 'failureReason' => Values::array_get($payload, 'failure_reason'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'verificationAttempts' => Values::array_get($payload, 'verification_attempts'), 'email' => Values::array_get($payload, 'email'), 'ccEmails' => Values::array_get($payload, 'cc_emails'), 'verificationType' => Values::array_get($payload, 'verification_type'), 'verificationDocumentSid' => Values::array_get($payload, 'verification_document_sid'), 'extension' => Values::array_get($payload, 'extension'), 'callDelay' => Values::array_get($payload, 'call_delay'), 'verificationCode' => Values::array_get($payload, 'verification_code'), 'verificationCallSids' => Values::array_get($payload, 'verification_call_sids'), ); $this->solution = array('signingDocumentSid' => $signingDocumentSid, ); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Preview.HostedNumbers.DependentHostedNumberOrderInstance]'; } } src/Twilio/Rest/Preview/HostedNumbers/AuthorizationDocument/DependentHostedNumberOrderOptions.php 0000644 00000011424 15002236443 0030273 0 ustar 00 sdk <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\HostedNumbers\AuthorizationDocument; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ abstract class DependentHostedNumberOrderOptions { /** * @param string $status The Status of this HostedNumberOrder. * @param string $phoneNumber An E164 formatted phone number. * @param string $incomingPhoneNumberSid IncomingPhoneNumber sid. * @param string $friendlyName A human readable description of this resource. * @param string $uniqueName A unique, developer assigned name of this * HostedNumberOrder. * @return ReadDependentHostedNumberOrderOptions Options builder */ public static function read($status = Values::NONE, $phoneNumber = Values::NONE, $incomingPhoneNumberSid = Values::NONE, $friendlyName = Values::NONE, $uniqueName = Values::NONE) { return new ReadDependentHostedNumberOrderOptions($status, $phoneNumber, $incomingPhoneNumberSid, $friendlyName, $uniqueName); } } class ReadDependentHostedNumberOrderOptions extends Options { /** * @param string $status The Status of this HostedNumberOrder. * @param string $phoneNumber An E164 formatted phone number. * @param string $incomingPhoneNumberSid IncomingPhoneNumber sid. * @param string $friendlyName A human readable description of this resource. * @param string $uniqueName A unique, developer assigned name of this * HostedNumberOrder. */ public function __construct($status = Values::NONE, $phoneNumber = Values::NONE, $incomingPhoneNumberSid = Values::NONE, $friendlyName = Values::NONE, $uniqueName = Values::NONE) { $this->options['status'] = $status; $this->options['phoneNumber'] = $phoneNumber; $this->options['incomingPhoneNumberSid'] = $incomingPhoneNumberSid; $this->options['friendlyName'] = $friendlyName; $this->options['uniqueName'] = $uniqueName; } /** * Status of an instance resource. It can hold one of the values: 1. opened 2. signing, 3. signed LOA, 4. canceled, 5. failed. See the section entitled [Status Values](https://www.twilio.com/docs/api/phone-numbers/hosted-number-authorization-documents#status-values) for more information on each of these statuses. * * @param string $status The Status of this HostedNumberOrder. * @return $this Fluent Builder */ public function setStatus($status) { $this->options['status'] = $status; return $this; } /** * An E164 formatted phone number hosted by this HostedNumberOrder. * * @param string $phoneNumber An E164 formatted phone number. * @return $this Fluent Builder */ public function setPhoneNumber($phoneNumber) { $this->options['phoneNumber'] = $phoneNumber; return $this; } /** * A 34 character string that uniquely identifies the IncomingPhoneNumber resource created by this HostedNumberOrder. * * @param string $incomingPhoneNumberSid IncomingPhoneNumber sid. * @return $this Fluent Builder */ public function setIncomingPhoneNumberSid($incomingPhoneNumberSid) { $this->options['incomingPhoneNumberSid'] = $incomingPhoneNumberSid; return $this; } /** * A human readable description of this resource, up to 64 characters. * * @param string $friendlyName A human readable description of this resource. * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * Provides a unique and addressable name to be assigned to this HostedNumberOrder, assigned by the developer, to be optionally used in addition to SID. * * @param string $uniqueName A unique, developer assigned name of this * HostedNumberOrder. * @return $this Fluent Builder */ public function setUniqueName($uniqueName) { $this->options['uniqueName'] = $uniqueName; 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.Preview.HostedNumbers.ReadDependentHostedNumberOrderOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Preview/HostedNumbers/HostedNumberOrderContext.php 0000644 00000006647 15002236443 0022170 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\HostedNumbers; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class HostedNumberOrderContext extends InstanceContext { /** * Initialize the HostedNumberOrderContext * * @param \Twilio\Version $version Version that contains the resource * @param string $sid HostedNumberOrder sid. * @return \Twilio\Rest\Preview\HostedNumbers\HostedNumberOrderContext */ public function __construct(Version $version, $sid) { parent::__construct($version); // Path Solution $this->solution = array('sid' => $sid, ); $this->uri = '/HostedNumberOrders/' . \rawurlencode($sid) . ''; } /** * Fetch a HostedNumberOrderInstance * * @return HostedNumberOrderInstance Fetched HostedNumberOrderInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new HostedNumberOrderInstance($this->version, $payload, $this->solution['sid']); } /** * Deletes the HostedNumberOrderInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Update the HostedNumberOrderInstance * * @param array|Options $options Optional Arguments * @return HostedNumberOrderInstance Updated HostedNumberOrderInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { $options = new Values($options); $data = Values::of(array( 'FriendlyName' => $options['friendlyName'], 'UniqueName' => $options['uniqueName'], 'Email' => $options['email'], 'CcEmails' => Serialize::map($options['ccEmails'], function($e) { return $e; }), 'Status' => $options['status'], 'VerificationCode' => $options['verificationCode'], 'VerificationType' => $options['verificationType'], 'VerificationDocumentSid' => $options['verificationDocumentSid'], 'Extension' => $options['extension'], 'CallDelay' => $options['callDelay'], )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new HostedNumberOrderInstance($this->version, $payload, $this->solution['sid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Preview.HostedNumbers.HostedNumberOrderContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Proxy/V1.php 0000644 00000004354 15002236443 0012425 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Proxy; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\Rest\Proxy\V1\ServiceList; use Twilio\Version; /** * @property \Twilio\Rest\Proxy\V1\ServiceList $services * @method \Twilio\Rest\Proxy\V1\ServiceContext services(string $sid) */ class V1 extends Version { protected $_services = null; /** * Construct the V1 version of Proxy * * @param \Twilio\Domain $domain Domain that contains the version * @return \Twilio\Rest\Proxy\V1 V1 version of Proxy */ public function __construct(Domain $domain) { parent::__construct($domain); $this->version = 'v1'; } /** * @return \Twilio\Rest\Proxy\V1\ServiceList */ protected function getServices() { if (!$this->_services) { $this->_services = new ServiceList($this); } return $this->_services; } /** * Magic getter to lazy load root resources * * @param string $name Resource to return * @return \Twilio\ListResource The requested resource * @throws TwilioException For unknown resource */ public function __get($name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown resource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Proxy.V1]'; } } sdk/src/Twilio/Rest/Proxy/V1/ServiceOptions.php 0000644 00000041557 15002236443 0015407 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Proxy\V1; 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 ServiceOptions { /** * @param int $defaultTtl Default TTL for a Session, in seconds * @param string $callbackUrl The URL we should call when the interaction * status changes * @param string $geoMatchLevel Where a proxy number must be located relative * to the participant identifier * @param string $numberSelectionBehavior The preference for Proxy Number * selection for the Service instance * @param string $interceptCallbackUrl The URL we call on each interaction * @param string $outOfSessionCallbackUrl The URL we call when an inbound call * or SMS action occurs on a closed or * non-existent Session * @param string $chatInstanceSid The SID of the Chat Service Instance * @return CreateServiceOptions Options builder */ public static function create($defaultTtl = Values::NONE, $callbackUrl = Values::NONE, $geoMatchLevel = Values::NONE, $numberSelectionBehavior = Values::NONE, $interceptCallbackUrl = Values::NONE, $outOfSessionCallbackUrl = Values::NONE, $chatInstanceSid = Values::NONE) { return new CreateServiceOptions($defaultTtl, $callbackUrl, $geoMatchLevel, $numberSelectionBehavior, $interceptCallbackUrl, $outOfSessionCallbackUrl, $chatInstanceSid); } /** * @param string $uniqueName An application-defined string that uniquely * identifies the resource * @param int $defaultTtl Default TTL for a Session, in seconds * @param string $callbackUrl The URL we should call when the interaction * status changes * @param string $geoMatchLevel Where a proxy number must be located relative * to the participant identifier * @param string $numberSelectionBehavior The preference for Proxy Number * selection for the Service instance * @param string $interceptCallbackUrl The URL we call on each interaction * @param string $outOfSessionCallbackUrl The URL we call when an inbound call * or SMS action occurs on a closed or * non-existent Session * @param string $chatInstanceSid The SID of the Chat Service Instance * @return UpdateServiceOptions Options builder */ public static function update($uniqueName = Values::NONE, $defaultTtl = Values::NONE, $callbackUrl = Values::NONE, $geoMatchLevel = Values::NONE, $numberSelectionBehavior = Values::NONE, $interceptCallbackUrl = Values::NONE, $outOfSessionCallbackUrl = Values::NONE, $chatInstanceSid = Values::NONE) { return new UpdateServiceOptions($uniqueName, $defaultTtl, $callbackUrl, $geoMatchLevel, $numberSelectionBehavior, $interceptCallbackUrl, $outOfSessionCallbackUrl, $chatInstanceSid); } } class CreateServiceOptions extends Options { /** * @param int $defaultTtl Default TTL for a Session, in seconds * @param string $callbackUrl The URL we should call when the interaction * status changes * @param string $geoMatchLevel Where a proxy number must be located relative * to the participant identifier * @param string $numberSelectionBehavior The preference for Proxy Number * selection for the Service instance * @param string $interceptCallbackUrl The URL we call on each interaction * @param string $outOfSessionCallbackUrl The URL we call when an inbound call * or SMS action occurs on a closed or * non-existent Session * @param string $chatInstanceSid The SID of the Chat Service Instance */ public function __construct($defaultTtl = Values::NONE, $callbackUrl = Values::NONE, $geoMatchLevel = Values::NONE, $numberSelectionBehavior = Values::NONE, $interceptCallbackUrl = Values::NONE, $outOfSessionCallbackUrl = Values::NONE, $chatInstanceSid = Values::NONE) { $this->options['defaultTtl'] = $defaultTtl; $this->options['callbackUrl'] = $callbackUrl; $this->options['geoMatchLevel'] = $geoMatchLevel; $this->options['numberSelectionBehavior'] = $numberSelectionBehavior; $this->options['interceptCallbackUrl'] = $interceptCallbackUrl; $this->options['outOfSessionCallbackUrl'] = $outOfSessionCallbackUrl; $this->options['chatInstanceSid'] = $chatInstanceSid; } /** * The default `ttl` value to set for Sessions created in the Service. The TTL (time to live) is measured in seconds after the Session's last create or last Interaction. The default value of `0` indicates an unlimited Session length. You can override a Session's default TTL value by setting its `ttl` value. * * @param int $defaultTtl Default TTL for a Session, in seconds * @return $this Fluent Builder */ public function setDefaultTtl($defaultTtl) { $this->options['defaultTtl'] = $defaultTtl; return $this; } /** * The URL we should call when the interaction status changes. * * @param string $callbackUrl The URL we should call when the interaction * status changes * @return $this Fluent Builder */ public function setCallbackUrl($callbackUrl) { $this->options['callbackUrl'] = $callbackUrl; return $this; } /** * Where a proxy number must be located relative to the participant identifier. Can be: `country`, `area-code`, or `extended-area-code`. The default value is `country` and more specific areas than `country` are only available in North America. * * @param string $geoMatchLevel Where a proxy number must be located relative * to the participant identifier * @return $this Fluent Builder */ public function setGeoMatchLevel($geoMatchLevel) { $this->options['geoMatchLevel'] = $geoMatchLevel; return $this; } /** * The preference for Proxy Number selection in the Service instance. Can be: `prefer-sticky` or `avoid-sticky` and the default is `prefer-sticky`. `prefer-sticky` means that we will try and select the same Proxy Number for a given participant if they have previous [Sessions](https://www.twilio.com/docs/proxy/api/session), but we will not fail if that Proxy Number cannot be used. `avoid-sticky` means that we will try to use different Proxy Numbers as long as that is possible within a given pool rather than try and use a previously assigned number. * * @param string $numberSelectionBehavior The preference for Proxy Number * selection for the Service instance * @return $this Fluent Builder */ public function setNumberSelectionBehavior($numberSelectionBehavior) { $this->options['numberSelectionBehavior'] = $numberSelectionBehavior; return $this; } /** * The URL we call on each interaction. If we receive a 403 status, we block the interaction; otherwise the interaction continues. * * @param string $interceptCallbackUrl The URL we call on each interaction * @return $this Fluent Builder */ public function setInterceptCallbackUrl($interceptCallbackUrl) { $this->options['interceptCallbackUrl'] = $interceptCallbackUrl; return $this; } /** * The URL we should call when an inbound call or SMS action occurs on a closed or non-existent Session. If your server (or a Twilio [function](https://www.twilio.com/functions)) responds with valid [TwiML](https://www.twilio.com/docs/voice/twiml), we will process it. This means it is possible, for example, to play a message for a call, send an automated text message response, or redirect a call to another Phone Number. See [Out-of-Session Callback Response Guide](https://www.twilio.com/docs/proxy/out-session-callback-response-guide) for more information. * * @param string $outOfSessionCallbackUrl The URL we call when an inbound call * or SMS action occurs on a closed or * non-existent Session * @return $this Fluent Builder */ public function setOutOfSessionCallbackUrl($outOfSessionCallbackUrl) { $this->options['outOfSessionCallbackUrl'] = $outOfSessionCallbackUrl; return $this; } /** * The SID of the Chat Service Instance managed by Proxy Service. The Chat Service enables Proxy to forward SMS and channel messages to this chat instance. This is a one-to-one relationship. * * @param string $chatInstanceSid The SID of the Chat Service Instance * @return $this Fluent Builder */ public function setChatInstanceSid($chatInstanceSid) { $this->options['chatInstanceSid'] = $chatInstanceSid; 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.Proxy.V1.CreateServiceOptions ' . \implode(' ', $options) . ']'; } } class UpdateServiceOptions extends Options { /** * @param string $uniqueName An application-defined string that uniquely * identifies the resource * @param int $defaultTtl Default TTL for a Session, in seconds * @param string $callbackUrl The URL we should call when the interaction * status changes * @param string $geoMatchLevel Where a proxy number must be located relative * to the participant identifier * @param string $numberSelectionBehavior The preference for Proxy Number * selection for the Service instance * @param string $interceptCallbackUrl The URL we call on each interaction * @param string $outOfSessionCallbackUrl The URL we call when an inbound call * or SMS action occurs on a closed or * non-existent Session * @param string $chatInstanceSid The SID of the Chat Service Instance */ public function __construct($uniqueName = Values::NONE, $defaultTtl = Values::NONE, $callbackUrl = Values::NONE, $geoMatchLevel = Values::NONE, $numberSelectionBehavior = Values::NONE, $interceptCallbackUrl = Values::NONE, $outOfSessionCallbackUrl = Values::NONE, $chatInstanceSid = Values::NONE) { $this->options['uniqueName'] = $uniqueName; $this->options['defaultTtl'] = $defaultTtl; $this->options['callbackUrl'] = $callbackUrl; $this->options['geoMatchLevel'] = $geoMatchLevel; $this->options['numberSelectionBehavior'] = $numberSelectionBehavior; $this->options['interceptCallbackUrl'] = $interceptCallbackUrl; $this->options['outOfSessionCallbackUrl'] = $outOfSessionCallbackUrl; $this->options['chatInstanceSid'] = $chatInstanceSid; } /** * An application-defined string that uniquely identifies the resource. This value must be 191 characters or fewer in length and be unique. **This value should not have PII.** * * @param string $uniqueName An application-defined string that uniquely * identifies the resource * @return $this Fluent Builder */ public function setUniqueName($uniqueName) { $this->options['uniqueName'] = $uniqueName; return $this; } /** * The default `ttl` value to set for Sessions created in the Service. The TTL (time to live) is measured in seconds after the Session's last create or last Interaction. The default value of `0` indicates an unlimited Session length. You can override a Session's default TTL value by setting its `ttl` value. * * @param int $defaultTtl Default TTL for a Session, in seconds * @return $this Fluent Builder */ public function setDefaultTtl($defaultTtl) { $this->options['defaultTtl'] = $defaultTtl; return $this; } /** * The URL we should call when the interaction status changes. * * @param string $callbackUrl The URL we should call when the interaction * status changes * @return $this Fluent Builder */ public function setCallbackUrl($callbackUrl) { $this->options['callbackUrl'] = $callbackUrl; return $this; } /** * Where a proxy number must be located relative to the participant identifier. Can be: `country`, `area-code`, or `extended-area-code`. The default value is `country` and more specific areas than `country` are only available in North America. * * @param string $geoMatchLevel Where a proxy number must be located relative * to the participant identifier * @return $this Fluent Builder */ public function setGeoMatchLevel($geoMatchLevel) { $this->options['geoMatchLevel'] = $geoMatchLevel; return $this; } /** * The preference for Proxy Number selection in the Service instance. Can be: `prefer-sticky` or `avoid-sticky` and the default is `prefer-sticky`. `prefer-sticky` means that we will try and select the same Proxy Number for a given participant if they have previous [Sessions](https://www.twilio.com/docs/proxy/api/session), but we will not fail if that Proxy Number cannot be used. `avoid-sticky` means that we will try to use different Proxy Numbers as long as that is possible within a given pool rather than try and use a previously assigned number. * * @param string $numberSelectionBehavior The preference for Proxy Number * selection for the Service instance * @return $this Fluent Builder */ public function setNumberSelectionBehavior($numberSelectionBehavior) { $this->options['numberSelectionBehavior'] = $numberSelectionBehavior; return $this; } /** * The URL we call on each interaction. If we receive a 403 status, we block the interaction; otherwise the interaction continues. * * @param string $interceptCallbackUrl The URL we call on each interaction * @return $this Fluent Builder */ public function setInterceptCallbackUrl($interceptCallbackUrl) { $this->options['interceptCallbackUrl'] = $interceptCallbackUrl; return $this; } /** * The URL we should call when an inbound call or SMS action occurs on a closed or non-existent Session. If your server (or a Twilio [function](https://www.twilio.com/functions)) responds with valid [TwiML](https://www.twilio.com/docs/voice/twiml), we will process it. This means it is possible, for example, to play a message for a call, send an automated text message response, or redirect a call to another Phone Number. See [Out-of-Session Callback Response Guide](https://www.twilio.com/docs/proxy/out-session-callback-response-guide) for more information. * * @param string $outOfSessionCallbackUrl The URL we call when an inbound call * or SMS action occurs on a closed or * non-existent Session * @return $this Fluent Builder */ public function setOutOfSessionCallbackUrl($outOfSessionCallbackUrl) { $this->options['outOfSessionCallbackUrl'] = $outOfSessionCallbackUrl; return $this; } /** * The SID of the Chat Service Instance managed by Proxy Service. The Chat Service enables Proxy to forward SMS and channel messages to this chat instance. This is a one-to-one relationship. * * @param string $chatInstanceSid The SID of the Chat Service Instance * @return $this Fluent Builder */ public function setChatInstanceSid($chatInstanceSid) { $this->options['chatInstanceSid'] = $chatInstanceSid; 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.Proxy.V1.UpdateServiceOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Proxy/V1/ServiceList.php 0000644 00000013716 15002236443 0014663 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Proxy\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class ServiceList extends ListResource { /** * Construct the ServiceList * * @param Version $version Version that contains the resource * @return \Twilio\Rest\Proxy\V1\ServiceList */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = array(); $this->uri = '/Services'; } /** * Streams ServiceInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads ServiceInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return ServiceInstance[] Array of results */ public function read($limit = null, $pageSize = null) { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of ServiceInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of ServiceInstance */ public function page($pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $params = Values::of(array( 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new ServicePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of ServiceInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of ServiceInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new ServicePage($this->version, $response, $this->solution); } /** * Create a new ServiceInstance * * @param string $uniqueName An application-defined string that uniquely * identifies the resource * @param array|Options $options Optional Arguments * @return ServiceInstance Newly created ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function create($uniqueName, $options = array()) { $options = new Values($options); $data = Values::of(array( 'UniqueName' => $uniqueName, 'DefaultTtl' => $options['defaultTtl'], 'CallbackUrl' => $options['callbackUrl'], 'GeoMatchLevel' => $options['geoMatchLevel'], 'NumberSelectionBehavior' => $options['numberSelectionBehavior'], 'InterceptCallbackUrl' => $options['interceptCallbackUrl'], 'OutOfSessionCallbackUrl' => $options['outOfSessionCallbackUrl'], 'ChatInstanceSid' => $options['chatInstanceSid'], )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new ServiceInstance($this->version, $payload); } /** * Constructs a ServiceContext * * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Proxy\V1\ServiceContext */ public function getContext($sid) { return new ServiceContext($this->version, $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Proxy.V1.ServiceList]'; } } sdk/src/Twilio/Rest/Proxy/V1/ServicePage.php 0000644 00000001475 15002236443 0014623 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Proxy\V1; use Twilio\Page; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class ServicePage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new ServiceInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Proxy.V1.ServicePage]'; } } sdk/src/Twilio/Rest/Proxy/V1/ServiceInstance.php 0000644 00000012776 15002236443 0015521 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Proxy\V1; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * * @property string $sid * @property string $uniqueName * @property string $accountSid * @property string $chatInstanceSid * @property string $callbackUrl * @property int $defaultTtl * @property string $numberSelectionBehavior * @property string $geoMatchLevel * @property string $interceptCallbackUrl * @property string $outOfSessionCallbackUrl * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $url * @property array $links */ class ServiceInstance extends InstanceResource { protected $_sessions = null; protected $_phoneNumbers = null; protected $_shortCodes = null; /** * Initialize the ServiceInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Proxy\V1\ServiceInstance */ public function __construct(Version $version, array $payload, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'sid' => Values::array_get($payload, 'sid'), 'uniqueName' => Values::array_get($payload, 'unique_name'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'chatInstanceSid' => Values::array_get($payload, 'chat_instance_sid'), 'callbackUrl' => Values::array_get($payload, 'callback_url'), 'defaultTtl' => Values::array_get($payload, 'default_ttl'), 'numberSelectionBehavior' => Values::array_get($payload, 'number_selection_behavior'), 'geoMatchLevel' => Values::array_get($payload, 'geo_match_level'), 'interceptCallbackUrl' => Values::array_get($payload, 'intercept_callback_url'), 'outOfSessionCallbackUrl' => Values::array_get($payload, 'out_of_session_callback_url'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ); $this->solution = array('sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Proxy\V1\ServiceContext Context for this ServiceInstance */ protected function proxy() { if (!$this->context) { $this->context = new ServiceContext($this->version, $this->solution['sid']); } return $this->context; } /** * Fetch a ServiceInstance * * @return ServiceInstance Fetched ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the ServiceInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Update the ServiceInstance * * @param array|Options $options Optional Arguments * @return ServiceInstance Updated ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Access the sessions * * @return \Twilio\Rest\Proxy\V1\Service\SessionList */ protected function getSessions() { return $this->proxy()->sessions; } /** * Access the phoneNumbers * * @return \Twilio\Rest\Proxy\V1\Service\PhoneNumberList */ protected function getPhoneNumbers() { return $this->proxy()->phoneNumbers; } /** * Access the shortCodes * * @return \Twilio\Rest\Proxy\V1\Service\ShortCodeList */ protected function getShortCodes() { return $this->proxy()->shortCodes; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Proxy.V1.ServiceInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Proxy/V1/Service/ShortCodeContext.php 0000644 00000006113 15002236443 0017257 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Proxy\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class ShortCodeContext extends InstanceContext { /** * Initialize the ShortCodeContext * * @param \Twilio\Version $version Version that contains the resource * @param string $serviceSid The SID of the parent Service to fetch the * resource from * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Proxy\V1\Service\ShortCodeContext */ public function __construct(Version $version, $serviceSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, 'sid' => $sid, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/ShortCodes/' . \rawurlencode($sid) . ''; } /** * Deletes the ShortCodeInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Fetch a ShortCodeInstance * * @return ShortCodeInstance Fetched ShortCodeInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new ShortCodeInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Update the ShortCodeInstance * * @param array|Options $options Optional Arguments * @return ShortCodeInstance Updated ShortCodeInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { $options = new Values($options); $data = Values::of(array('IsReserved' => Serialize::booleanToString($options['isReserved']), )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new ShortCodeInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Proxy.V1.ShortCodeContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Proxy/V1/Service/SessionInstance.php 0000644 00000013360 15002236443 0017132 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Proxy\V1\Service; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * * @property string $sid * @property string $serviceSid * @property string $accountSid * @property \DateTime $dateStarted * @property \DateTime $dateEnded * @property \DateTime $dateLastInteraction * @property \DateTime $dateExpiry * @property string $uniqueName * @property string $status * @property string $closedReason * @property int $ttl * @property string $mode * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $url * @property array $links */ class SessionInstance extends InstanceResource { protected $_interactions = null; protected $_participants = null; /** * Initialize the SessionInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the resource's parent Service * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Proxy\V1\Service\SessionInstance */ public function __construct(Version $version, array $payload, $serviceSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'sid' => Values::array_get($payload, 'sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'dateStarted' => Deserialize::dateTime(Values::array_get($payload, 'date_started')), 'dateEnded' => Deserialize::dateTime(Values::array_get($payload, 'date_ended')), 'dateLastInteraction' => Deserialize::dateTime(Values::array_get($payload, 'date_last_interaction')), 'dateExpiry' => Deserialize::dateTime(Values::array_get($payload, 'date_expiry')), 'uniqueName' => Values::array_get($payload, 'unique_name'), 'status' => Values::array_get($payload, 'status'), 'closedReason' => Values::array_get($payload, 'closed_reason'), 'ttl' => Values::array_get($payload, 'ttl'), 'mode' => Values::array_get($payload, 'mode'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ); $this->solution = array('serviceSid' => $serviceSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Proxy\V1\Service\SessionContext Context for this * SessionInstance */ protected function proxy() { if (!$this->context) { $this->context = new SessionContext( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch a SessionInstance * * @return SessionInstance Fetched SessionInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the SessionInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Update the SessionInstance * * @param array|Options $options Optional Arguments * @return SessionInstance Updated SessionInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Access the interactions * * @return \Twilio\Rest\Proxy\V1\Service\Session\InteractionList */ protected function getInteractions() { return $this->proxy()->interactions; } /** * Access the participants * * @return \Twilio\Rest\Proxy\V1\Service\Session\ParticipantList */ protected function getParticipants() { return $this->proxy()->participants; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Proxy.V1.SessionInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Proxy/V1/Service/ShortCodeOptions.php 0000644 00000003743 15002236443 0017274 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Proxy\V1\Service; 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 ShortCodeOptions { /** * @param bool $isReserved Whether the short code should be reserved for manual * assignment to participants only * @return UpdateShortCodeOptions Options builder */ public static function update($isReserved = Values::NONE) { return new UpdateShortCodeOptions($isReserved); } } class UpdateShortCodeOptions extends Options { /** * @param bool $isReserved Whether the short code should be reserved for manual * assignment to participants only */ public function __construct($isReserved = Values::NONE) { $this->options['isReserved'] = $isReserved; } /** * Whether the short code should be reserved and not be assigned to a participant using proxy pool logic. See [Reserved Phone Numbers](https://www.twilio.com/docs/proxy/reserved-phone-numbers) for more information. * * @param bool $isReserved Whether the short code should be reserved for manual * assignment to participants only * @return $this Fluent Builder */ public function setIsReserved($isReserved) { $this->options['isReserved'] = $isReserved; 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.Proxy.V1.UpdateShortCodeOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Proxy/V1/Service/ShortCodePage.php 0000644 00000001552 15002236443 0016511 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Proxy\V1\Service; use Twilio\Page; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class ShortCodePage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new ShortCodeInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Proxy.V1.ShortCodePage]'; } } sdk/src/Twilio/Rest/Proxy/V1/Service/Session/InteractionList.php 0000644 00000012372 15002236443 0020562 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Proxy\V1\Service\Session; use Twilio\ListResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class InteractionList extends ListResource { /** * Construct the InteractionList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the resource's parent Service * @param string $sessionSid The SID of the resource's parent Session * @return \Twilio\Rest\Proxy\V1\Service\Session\InteractionList */ public function __construct(Version $version, $serviceSid, $sessionSid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, 'sessionSid' => $sessionSid, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Sessions/' . \rawurlencode($sessionSid) . '/Interactions'; } /** * Streams InteractionInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads InteractionInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return InteractionInstance[] Array of results */ public function read($limit = null, $pageSize = null) { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of InteractionInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of InteractionInstance */ public function page($pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $params = Values::of(array( 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new InteractionPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of InteractionInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of InteractionInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new InteractionPage($this->version, $response, $this->solution); } /** * Constructs a InteractionContext * * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Proxy\V1\Service\Session\InteractionContext */ public function getContext($sid) { return new InteractionContext( $this->version, $this->solution['serviceSid'], $this->solution['sessionSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Proxy.V1.InteractionList]'; } } sdk/src/Twilio/Rest/Proxy/V1/Service/Session/ParticipantInstance.php 0000644 00000012352 15002236443 0021410 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Proxy\V1\Service\Session; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * * @property string $sid * @property string $sessionSid * @property string $serviceSid * @property string $accountSid * @property string $friendlyName * @property string $identifier * @property string $proxyIdentifier * @property string $proxyIdentifierSid * @property \DateTime $dateDeleted * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $url * @property array $links */ class ParticipantInstance extends InstanceResource { protected $_messageInteractions = null; /** * Initialize the ParticipantInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the resource's parent Service * @param string $sessionSid The SID of the resource's parent Session * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Proxy\V1\Service\Session\ParticipantInstance */ public function __construct(Version $version, array $payload, $serviceSid, $sessionSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'sid' => Values::array_get($payload, 'sid'), 'sessionSid' => Values::array_get($payload, 'session_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'identifier' => Values::array_get($payload, 'identifier'), 'proxyIdentifier' => Values::array_get($payload, 'proxy_identifier'), 'proxyIdentifierSid' => Values::array_get($payload, 'proxy_identifier_sid'), 'dateDeleted' => Deserialize::dateTime(Values::array_get($payload, 'date_deleted')), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ); $this->solution = array( 'serviceSid' => $serviceSid, 'sessionSid' => $sessionSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Proxy\V1\Service\Session\ParticipantContext Context for * this * ParticipantInstance */ protected function proxy() { if (!$this->context) { $this->context = new ParticipantContext( $this->version, $this->solution['serviceSid'], $this->solution['sessionSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch a ParticipantInstance * * @return ParticipantInstance Fetched ParticipantInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the ParticipantInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Access the messageInteractions * * @return \Twilio\Rest\Proxy\V1\Service\Session\Participant\MessageInteractionList */ protected function getMessageInteractions() { return $this->proxy()->messageInteractions; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Proxy.V1.ParticipantInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Proxy/V1/Service/Session/ParticipantList.php 0000644 00000014465 15002236443 0020566 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Proxy\V1\Service\Session; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class ParticipantList extends ListResource { /** * Construct the ParticipantList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the resource's parent Service * @param string $sessionSid The SID of the resource's parent Session * @return \Twilio\Rest\Proxy\V1\Service\Session\ParticipantList */ public function __construct(Version $version, $serviceSid, $sessionSid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, 'sessionSid' => $sessionSid, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Sessions/' . \rawurlencode($sessionSid) . '/Participants'; } /** * Streams ParticipantInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads ParticipantInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return ParticipantInstance[] Array of results */ public function read($limit = null, $pageSize = null) { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of ParticipantInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of ParticipantInstance */ public function page($pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $params = Values::of(array( 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new ParticipantPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of ParticipantInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of ParticipantInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new ParticipantPage($this->version, $response, $this->solution); } /** * Create a new ParticipantInstance * * @param string $identifier The phone number of the Participant * @param array|Options $options Optional Arguments * @return ParticipantInstance Newly created ParticipantInstance * @throws TwilioException When an HTTP error occurs. */ public function create($identifier, $options = array()) { $options = new Values($options); $data = Values::of(array( 'Identifier' => $identifier, 'FriendlyName' => $options['friendlyName'], 'ProxyIdentifier' => $options['proxyIdentifier'], 'ProxyIdentifierSid' => $options['proxyIdentifierSid'], )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new ParticipantInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sessionSid'] ); } /** * Constructs a ParticipantContext * * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Proxy\V1\Service\Session\ParticipantContext */ public function getContext($sid) { return new ParticipantContext( $this->version, $this->solution['serviceSid'], $this->solution['sessionSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Proxy.V1.ParticipantList]'; } } sdk/src/Twilio/Rest/Proxy/V1/Service/Session/InteractionInstance.php 0000644 00000013377 15002236443 0021421 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Proxy\V1\Service\Session; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * * @property string $sid * @property string $sessionSid * @property string $serviceSid * @property string $accountSid * @property string $data * @property string $type * @property string $inboundParticipantSid * @property string $inboundResourceSid * @property string $inboundResourceStatus * @property string $inboundResourceType * @property string $inboundResourceUrl * @property string $outboundParticipantSid * @property string $outboundResourceSid * @property string $outboundResourceStatus * @property string $outboundResourceType * @property string $outboundResourceUrl * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $url */ class InteractionInstance extends InstanceResource { /** * Initialize the InteractionInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the resource's parent Service * @param string $sessionSid The SID of the resource's parent Session * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Proxy\V1\Service\Session\InteractionInstance */ public function __construct(Version $version, array $payload, $serviceSid, $sessionSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'sid' => Values::array_get($payload, 'sid'), 'sessionSid' => Values::array_get($payload, 'session_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'data' => Values::array_get($payload, 'data'), 'type' => Values::array_get($payload, 'type'), 'inboundParticipantSid' => Values::array_get($payload, 'inbound_participant_sid'), 'inboundResourceSid' => Values::array_get($payload, 'inbound_resource_sid'), 'inboundResourceStatus' => Values::array_get($payload, 'inbound_resource_status'), 'inboundResourceType' => Values::array_get($payload, 'inbound_resource_type'), 'inboundResourceUrl' => Values::array_get($payload, 'inbound_resource_url'), 'outboundParticipantSid' => Values::array_get($payload, 'outbound_participant_sid'), 'outboundResourceSid' => Values::array_get($payload, 'outbound_resource_sid'), 'outboundResourceStatus' => Values::array_get($payload, 'outbound_resource_status'), 'outboundResourceType' => Values::array_get($payload, 'outbound_resource_type'), 'outboundResourceUrl' => Values::array_get($payload, 'outbound_resource_url'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), ); $this->solution = array( 'serviceSid' => $serviceSid, 'sessionSid' => $sessionSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Proxy\V1\Service\Session\InteractionContext Context for * this * InteractionInstance */ protected function proxy() { if (!$this->context) { $this->context = new InteractionContext( $this->version, $this->solution['serviceSid'], $this->solution['sessionSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch a InteractionInstance * * @return InteractionInstance Fetched InteractionInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the InteractionInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Proxy.V1.InteractionInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Proxy/V1/Service/Session/InteractionPage.php 0000644 00000001721 15002236443 0020517 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Proxy\V1\Service\Session; use Twilio\Page; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class InteractionPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new InteractionInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sessionSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Proxy.V1.InteractionPage]'; } } sdk/src/Twilio/Rest/Proxy/V1/Service/Session/ParticipantContext.php 0000644 00000011033 15002236443 0021263 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Proxy\V1\Service\Session; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Rest\Proxy\V1\Service\Session\Participant\MessageInteractionList; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * * @property \Twilio\Rest\Proxy\V1\Service\Session\Participant\MessageInteractionList $messageInteractions * @method \Twilio\Rest\Proxy\V1\Service\Session\Participant\MessageInteractionContext messageInteractions(string $sid) */ class ParticipantContext extends InstanceContext { protected $_messageInteractions = null; /** * Initialize the ParticipantContext * * @param \Twilio\Version $version Version that contains the resource * @param string $serviceSid The SID of the parent Service of the resource to * fetch * @param string $sessionSid The SID of the parent Session of the resource to * fetch * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Proxy\V1\Service\Session\ParticipantContext */ public function __construct(Version $version, $serviceSid, $sessionSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, 'sessionSid' => $sessionSid, 'sid' => $sid, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Sessions/' . \rawurlencode($sessionSid) . '/Participants/' . \rawurlencode($sid) . ''; } /** * Fetch a ParticipantInstance * * @return ParticipantInstance Fetched ParticipantInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new ParticipantInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sessionSid'], $this->solution['sid'] ); } /** * Deletes the ParticipantInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Access the messageInteractions * * @return \Twilio\Rest\Proxy\V1\Service\Session\Participant\MessageInteractionList */ protected function getMessageInteractions() { if (!$this->_messageInteractions) { $this->_messageInteractions = new MessageInteractionList( $this->version, $this->solution['serviceSid'], $this->solution['sessionSid'], $this->solution['sid'] ); } return $this->_messageInteractions; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get($name) { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Proxy.V1.ParticipantContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Proxy/V1/Service/Session/Participant/MessageInteractionOptions.php 0000644 00000003706 15002236443 0025066 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Proxy\V1\Service\Session\Participant; 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 MessageInteractionOptions { /** * @param string $body Message body * @param string $mediaUrl Reserved * @return CreateMessageInteractionOptions Options builder */ public static function create($body = Values::NONE, $mediaUrl = Values::NONE) { return new CreateMessageInteractionOptions($body, $mediaUrl); } } class CreateMessageInteractionOptions extends Options { /** * @param string $body Message body * @param string $mediaUrl Reserved */ public function __construct($body = Values::NONE, $mediaUrl = Values::NONE) { $this->options['body'] = $body; $this->options['mediaUrl'] = $mediaUrl; } /** * The message to send to the participant * * @param string $body Message body * @return $this Fluent Builder */ public function setBody($body) { $this->options['body'] = $body; return $this; } /** * Reserved. Not currently supported. * * @param string $mediaUrl Reserved * @return $this Fluent Builder */ public function setMediaUrl($mediaUrl) { $this->options['mediaUrl'] = $mediaUrl; 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.Proxy.V1.CreateMessageInteractionOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Proxy/V1/Service/Session/Participant/MessageInteractionPage.php 0000644 00000002041 15002236443 0024276 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Proxy\V1\Service\Session\Participant; use Twilio\Page; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class MessageInteractionPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new MessageInteractionInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sessionSid'], $this->solution['participantSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Proxy.V1.MessageInteractionPage]'; } } sdk/src/Twilio/Rest/Proxy/V1/Service/Session/Participant/MessageInteractionInstance.php 0000644 00000013537 15002236443 0025202 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Proxy\V1\Service\Session\Participant; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * * @property string $sid * @property string $sessionSid * @property string $serviceSid * @property string $accountSid * @property string $data * @property string $type * @property string $participantSid * @property string $inboundParticipantSid * @property string $inboundResourceSid * @property string $inboundResourceStatus * @property string $inboundResourceType * @property string $inboundResourceUrl * @property string $outboundParticipantSid * @property string $outboundResourceSid * @property string $outboundResourceStatus * @property string $outboundResourceType * @property string $outboundResourceUrl * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $url */ class MessageInteractionInstance extends InstanceResource { /** * Initialize the MessageInteractionInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the resource's parent Service * @param string $sessionSid The SID of the resource's parent Session * @param string $participantSid The SID of the Participant resource * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Proxy\V1\Service\Session\Participant\MessageInteractionInstance */ public function __construct(Version $version, array $payload, $serviceSid, $sessionSid, $participantSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'sid' => Values::array_get($payload, 'sid'), 'sessionSid' => Values::array_get($payload, 'session_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'data' => Values::array_get($payload, 'data'), 'type' => Values::array_get($payload, 'type'), 'participantSid' => Values::array_get($payload, 'participant_sid'), 'inboundParticipantSid' => Values::array_get($payload, 'inbound_participant_sid'), 'inboundResourceSid' => Values::array_get($payload, 'inbound_resource_sid'), 'inboundResourceStatus' => Values::array_get($payload, 'inbound_resource_status'), 'inboundResourceType' => Values::array_get($payload, 'inbound_resource_type'), 'inboundResourceUrl' => Values::array_get($payload, 'inbound_resource_url'), 'outboundParticipantSid' => Values::array_get($payload, 'outbound_participant_sid'), 'outboundResourceSid' => Values::array_get($payload, 'outbound_resource_sid'), 'outboundResourceStatus' => Values::array_get($payload, 'outbound_resource_status'), 'outboundResourceType' => Values::array_get($payload, 'outbound_resource_type'), 'outboundResourceUrl' => Values::array_get($payload, 'outbound_resource_url'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), ); $this->solution = array( 'serviceSid' => $serviceSid, 'sessionSid' => $sessionSid, 'participantSid' => $participantSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Proxy\V1\Service\Session\Participant\MessageInteractionContext Context for this * MessageInteractionInstance */ protected function proxy() { if (!$this->context) { $this->context = new MessageInteractionContext( $this->version, $this->solution['serviceSid'], $this->solution['sessionSid'], $this->solution['participantSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch a MessageInteractionInstance * * @return MessageInteractionInstance Fetched MessageInteractionInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Proxy.V1.MessageInteractionInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Proxy/V1/Service/Session/Participant/MessageInteractionList.php 0000644 00000015227 15002236443 0024347 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Proxy\V1\Service\Session\Participant; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class MessageInteractionList extends ListResource { /** * Construct the MessageInteractionList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the resource's parent Service * @param string $sessionSid The SID of the resource's parent Session * @param string $participantSid The SID of the Participant resource * @return \Twilio\Rest\Proxy\V1\Service\Session\Participant\MessageInteractionList */ public function __construct(Version $version, $serviceSid, $sessionSid, $participantSid) { parent::__construct($version); // Path Solution $this->solution = array( 'serviceSid' => $serviceSid, 'sessionSid' => $sessionSid, 'participantSid' => $participantSid, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Sessions/' . \rawurlencode($sessionSid) . '/Participants/' . \rawurlencode($participantSid) . '/MessageInteractions'; } /** * Create a new MessageInteractionInstance * * @param array|Options $options Optional Arguments * @return MessageInteractionInstance Newly created MessageInteractionInstance * @throws TwilioException When an HTTP error occurs. */ public function create($options = array()) { $options = new Values($options); $data = Values::of(array( 'Body' => $options['body'], 'MediaUrl' => Serialize::map($options['mediaUrl'], function($e) { return $e; }), )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new MessageInteractionInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sessionSid'], $this->solution['participantSid'] ); } /** * Streams MessageInteractionInstance records from the API as a generator * stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads MessageInteractionInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return MessageInteractionInstance[] Array of results */ public function read($limit = null, $pageSize = null) { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of MessageInteractionInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of MessageInteractionInstance */ public function page($pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $params = Values::of(array( 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new MessageInteractionPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of MessageInteractionInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of MessageInteractionInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new MessageInteractionPage($this->version, $response, $this->solution); } /** * Constructs a MessageInteractionContext * * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Proxy\V1\Service\Session\Participant\MessageInteractionContext */ public function getContext($sid) { return new MessageInteractionContext( $this->version, $this->solution['serviceSid'], $this->solution['sessionSid'], $this->solution['participantSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Proxy.V1.MessageInteractionList]'; } } sdk/src/Twilio/Rest/Proxy/V1/Service/Session/Participant/MessageInteractionContext.php 0000644 00000005105 15002236443 0025052 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Proxy\V1\Service\Session\Participant; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class MessageInteractionContext extends InstanceContext { /** * Initialize the MessageInteractionContext * * @param \Twilio\Version $version Version that contains the resource * @param string $serviceSid The SID of the Service to fetch the resource from * @param string $sessionSid The SID of the parent Session * @param string $participantSid The SID of the Participant resource * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Proxy\V1\Service\Session\Participant\MessageInteractionContext */ public function __construct(Version $version, $serviceSid, $sessionSid, $participantSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array( 'serviceSid' => $serviceSid, 'sessionSid' => $sessionSid, 'participantSid' => $participantSid, 'sid' => $sid, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Sessions/' . \rawurlencode($sessionSid) . '/Participants/' . \rawurlencode($participantSid) . '/MessageInteractions/' . \rawurlencode($sid) . ''; } /** * Fetch a MessageInteractionInstance * * @return MessageInteractionInstance Fetched MessageInteractionInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new MessageInteractionInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sessionSid'], $this->solution['participantSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Proxy.V1.MessageInteractionContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Proxy/V1/Service/Session/ParticipantPage.php 0000644 00000001721 15002236443 0020516 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Proxy\V1\Service\Session; use Twilio\Page; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class ParticipantPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new ParticipantInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sessionSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Proxy.V1.ParticipantPage]'; } } sdk/src/Twilio/Rest/Proxy/V1/Service/Session/InteractionContext.php 0000644 00000005115 15002236443 0021270 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Proxy\V1\Service\Session; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class InteractionContext extends InstanceContext { /** * Initialize the InteractionContext * * @param \Twilio\Version $version Version that contains the resource * @param string $serviceSid The SID of the parent Service of the resource to * fetch * @param string $sessionSid he SID of the parent Session of the resource to * fetch * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Proxy\V1\Service\Session\InteractionContext */ public function __construct(Version $version, $serviceSid, $sessionSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, 'sessionSid' => $sessionSid, 'sid' => $sid, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Sessions/' . \rawurlencode($sessionSid) . '/Interactions/' . \rawurlencode($sid) . ''; } /** * Fetch a InteractionInstance * * @return InteractionInstance Fetched InteractionInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new InteractionInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sessionSid'], $this->solution['sid'] ); } /** * Deletes the InteractionInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Proxy.V1.InteractionContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Proxy/V1/Service/Session/ParticipantOptions.php 0000644 00000006535 15002236443 0021305 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Proxy\V1\Service\Session; 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 ParticipantOptions { /** * @param string $friendlyName The string that you assigned to describe the * participant * @param string $proxyIdentifier The proxy phone number to use for the * Participant * @param string $proxyIdentifierSid The Proxy Identifier Sid * @return CreateParticipantOptions Options builder */ public static function create($friendlyName = Values::NONE, $proxyIdentifier = Values::NONE, $proxyIdentifierSid = Values::NONE) { return new CreateParticipantOptions($friendlyName, $proxyIdentifier, $proxyIdentifierSid); } } class CreateParticipantOptions extends Options { /** * @param string $friendlyName The string that you assigned to describe the * participant * @param string $proxyIdentifier The proxy phone number to use for the * Participant * @param string $proxyIdentifierSid The Proxy Identifier Sid */ public function __construct($friendlyName = Values::NONE, $proxyIdentifier = Values::NONE, $proxyIdentifierSid = Values::NONE) { $this->options['friendlyName'] = $friendlyName; $this->options['proxyIdentifier'] = $proxyIdentifier; $this->options['proxyIdentifierSid'] = $proxyIdentifierSid; } /** * The string that you assigned to describe the participant. This value must be 255 characters or fewer. **This value should not have PII.** * * @param string $friendlyName The string that you assigned to describe the * participant * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The proxy phone number to use for the Participant. If not specified, Proxy will select a number from the pool. * * @param string $proxyIdentifier The proxy phone number to use for the * Participant * @return $this Fluent Builder */ public function setProxyIdentifier($proxyIdentifier) { $this->options['proxyIdentifier'] = $proxyIdentifier; return $this; } /** * The SID of the Proxy Identifier to assign to the Participant. * * @param string $proxyIdentifierSid The Proxy Identifier Sid * @return $this Fluent Builder */ public function setProxyIdentifierSid($proxyIdentifierSid) { $this->options['proxyIdentifierSid'] = $proxyIdentifierSid; 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.Proxy.V1.CreateParticipantOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Proxy/V1/Service/PhoneNumberPage.php 0000644 00000001560 15002236443 0017040 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Proxy\V1\Service; use Twilio\Page; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class PhoneNumberPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new PhoneNumberInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Proxy.V1.PhoneNumberPage]'; } } sdk/src/Twilio/Rest/Proxy/V1/Service/ShortCodeInstance.php 0000644 00000011137 15002236443 0017401 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Proxy\V1\Service; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * * @property string $sid * @property string $accountSid * @property string $serviceSid * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $shortCode * @property string $isoCountry * @property string $capabilities * @property string $url * @property bool $isReserved */ class ShortCodeInstance extends InstanceResource { /** * Initialize the ShortCodeInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the resource's parent Service * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Proxy\V1\Service\ShortCodeInstance */ public function __construct(Version $version, array $payload, $serviceSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'shortCode' => Values::array_get($payload, 'short_code'), 'isoCountry' => Values::array_get($payload, 'iso_country'), 'capabilities' => Values::array_get($payload, 'capabilities'), 'url' => Values::array_get($payload, 'url'), 'isReserved' => Values::array_get($payload, 'is_reserved'), ); $this->solution = array('serviceSid' => $serviceSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Proxy\V1\Service\ShortCodeContext Context for this * ShortCodeInstance */ protected function proxy() { if (!$this->context) { $this->context = new ShortCodeContext( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->context; } /** * Deletes the ShortCodeInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Fetch a ShortCodeInstance * * @return ShortCodeInstance Fetched ShortCodeInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Update the ShortCodeInstance * * @param array|Options $options Optional Arguments * @return ShortCodeInstance Updated ShortCodeInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Proxy.V1.ShortCodeInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Proxy/V1/Service/SessionPage.php 0000644 00000001544 15002236443 0016243 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Proxy\V1\Service; use Twilio\Page; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class SessionPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new SessionInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Proxy.V1.SessionPage]'; } } sdk/src/Twilio/Rest/Proxy/V1/Service/ShortCodeList.php 0000644 00000013057 15002236443 0016553 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Proxy\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class ShortCodeList extends ListResource { /** * Construct the ShortCodeList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the resource's parent Service * @return \Twilio\Rest\Proxy\V1\Service\ShortCodeList */ public function __construct(Version $version, $serviceSid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/ShortCodes'; } /** * Create a new ShortCodeInstance * * @param string $sid The SID of a Twilio ShortCode resource * @return ShortCodeInstance Newly created ShortCodeInstance * @throws TwilioException When an HTTP error occurs. */ public function create($sid) { $data = Values::of(array('Sid' => $sid, )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new ShortCodeInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Streams ShortCodeInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads ShortCodeInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return ShortCodeInstance[] Array of results */ public function read($limit = null, $pageSize = null) { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of ShortCodeInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of ShortCodeInstance */ public function page($pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $params = Values::of(array( 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new ShortCodePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of ShortCodeInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of ShortCodeInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new ShortCodePage($this->version, $response, $this->solution); } /** * Constructs a ShortCodeContext * * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Proxy\V1\Service\ShortCodeContext */ public function getContext($sid) { return new ShortCodeContext($this->version, $this->solution['serviceSid'], $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Proxy.V1.ShortCodeList]'; } } sdk/src/Twilio/Rest/Proxy/V1/Service/SessionList.php 0000644 00000013722 15002236443 0016303 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Proxy\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class SessionList extends ListResource { /** * Construct the SessionList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the resource's parent Service * @return \Twilio\Rest\Proxy\V1\Service\SessionList */ public function __construct(Version $version, $serviceSid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Sessions'; } /** * Streams SessionInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads SessionInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return SessionInstance[] Array of results */ public function read($limit = null, $pageSize = null) { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of SessionInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of SessionInstance */ public function page($pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $params = Values::of(array( 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new SessionPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of SessionInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of SessionInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new SessionPage($this->version, $response, $this->solution); } /** * Create a new SessionInstance * * @param array|Options $options Optional Arguments * @return SessionInstance Newly created SessionInstance * @throws TwilioException When an HTTP error occurs. */ public function create($options = array()) { $options = new Values($options); $data = Values::of(array( 'UniqueName' => $options['uniqueName'], 'DateExpiry' => Serialize::iso8601DateTime($options['dateExpiry']), 'Ttl' => $options['ttl'], 'Mode' => $options['mode'], 'Status' => $options['status'], 'Participants' => Serialize::map($options['participants'], function($e) { return Serialize::jsonObject($e); }), )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new SessionInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Constructs a SessionContext * * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Proxy\V1\Service\SessionContext */ public function getContext($sid) { return new SessionContext($this->version, $this->solution['serviceSid'], $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Proxy.V1.SessionList]'; } } sdk/src/Twilio/Rest/Proxy/V1/Service/PhoneNumberContext.php 0000644 00000006172 15002236443 0017614 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Proxy\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class PhoneNumberContext extends InstanceContext { /** * Initialize the PhoneNumberContext * * @param \Twilio\Version $version Version that contains the resource * @param string $serviceSid The SID of the parent Service resource of the * PhoneNumber resource to fetch * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Proxy\V1\Service\PhoneNumberContext */ public function __construct(Version $version, $serviceSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, 'sid' => $sid, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/PhoneNumbers/' . \rawurlencode($sid) . ''; } /** * Deletes the PhoneNumberInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Fetch a PhoneNumberInstance * * @return PhoneNumberInstance Fetched PhoneNumberInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new PhoneNumberInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Update the PhoneNumberInstance * * @param array|Options $options Optional Arguments * @return PhoneNumberInstance Updated PhoneNumberInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { $options = new Values($options); $data = Values::of(array('IsReserved' => Serialize::booleanToString($options['isReserved']), )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new PhoneNumberInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Proxy.V1.PhoneNumberContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Proxy/V1/Service/SessionOptions.php 0000644 00000016641 15002236443 0017026 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Proxy\V1\Service; 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 SessionOptions { /** * @param string $uniqueName An application-defined string that uniquely * identifies the resource * @param \DateTime $dateExpiry The ISO 8601 date when the Session should expire * @param int $ttl When the session will expire * @param string $mode The Mode of the Session * @param string $status Session status * @param array $participants The Participant objects to include in the new * session * @return CreateSessionOptions Options builder */ public static function create($uniqueName = Values::NONE, $dateExpiry = Values::NONE, $ttl = Values::NONE, $mode = Values::NONE, $status = Values::NONE, $participants = Values::NONE) { return new CreateSessionOptions($uniqueName, $dateExpiry, $ttl, $mode, $status, $participants); } /** * @param \DateTime $dateExpiry The ISO 8601 date when the Session should expire * @param int $ttl When the session will expire * @param string $status The new status of the resource * @return UpdateSessionOptions Options builder */ public static function update($dateExpiry = Values::NONE, $ttl = Values::NONE, $status = Values::NONE) { return new UpdateSessionOptions($dateExpiry, $ttl, $status); } } class CreateSessionOptions extends Options { /** * @param string $uniqueName An application-defined string that uniquely * identifies the resource * @param \DateTime $dateExpiry The ISO 8601 date when the Session should expire * @param int $ttl When the session will expire * @param string $mode The Mode of the Session * @param string $status Session status * @param array $participants The Participant objects to include in the new * session */ public function __construct($uniqueName = Values::NONE, $dateExpiry = Values::NONE, $ttl = Values::NONE, $mode = Values::NONE, $status = Values::NONE, $participants = Values::NONE) { $this->options['uniqueName'] = $uniqueName; $this->options['dateExpiry'] = $dateExpiry; $this->options['ttl'] = $ttl; $this->options['mode'] = $mode; $this->options['status'] = $status; $this->options['participants'] = $participants; } /** * An application-defined string that uniquely identifies the resource. This value must be 191 characters or fewer in length and be unique. **This value should not have PII.** * * @param string $uniqueName An application-defined string that uniquely * identifies the resource * @return $this Fluent Builder */ public function setUniqueName($uniqueName) { $this->options['uniqueName'] = $uniqueName; return $this; } /** * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date when the Session should expire. If this is value is present, it overrides the `ttl` value. * * @param \DateTime $dateExpiry The ISO 8601 date when the Session should expire * @return $this Fluent Builder */ public function setDateExpiry($dateExpiry) { $this->options['dateExpiry'] = $dateExpiry; return $this; } /** * The time, in seconds, when the session will expire. The time is measured from the last Session create or the Session's last Interaction. * * @param int $ttl When the session will expire * @return $this Fluent Builder */ public function setTtl($ttl) { $this->options['ttl'] = $ttl; return $this; } /** * The Mode of the Session. Can be: `message-only`, `voice-only`, or `voice-and-message` and the default value is `voice-and-message`. * * @param string $mode The Mode of the Session * @return $this Fluent Builder */ public function setMode($mode) { $this->options['mode'] = $mode; return $this; } /** * The initial status of the Session. Can be: `open`, `in-progress`, `closed`, `failed`, or `unknown`. The default is `open` on create. * * @param string $status Session status * @return $this Fluent Builder */ public function setStatus($status) { $this->options['status'] = $status; return $this; } /** * The Participant objects to include in the new session. * * @param array $participants The Participant objects to include in the new * session * @return $this Fluent Builder */ public function setParticipants($participants) { $this->options['participants'] = $participants; 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.Proxy.V1.CreateSessionOptions ' . \implode(' ', $options) . ']'; } } class UpdateSessionOptions extends Options { /** * @param \DateTime $dateExpiry The ISO 8601 date when the Session should expire * @param int $ttl When the session will expire * @param string $status The new status of the resource */ public function __construct($dateExpiry = Values::NONE, $ttl = Values::NONE, $status = Values::NONE) { $this->options['dateExpiry'] = $dateExpiry; $this->options['ttl'] = $ttl; $this->options['status'] = $status; } /** * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date when the Session should expire. If this is value is present, it overrides the `ttl` value. * * @param \DateTime $dateExpiry The ISO 8601 date when the Session should expire * @return $this Fluent Builder */ public function setDateExpiry($dateExpiry) { $this->options['dateExpiry'] = $dateExpiry; return $this; } /** * The time, in seconds, when the session will expire. The time is measured from the last Session create or the Session's last Interaction. * * @param int $ttl When the session will expire * @return $this Fluent Builder */ public function setTtl($ttl) { $this->options['ttl'] = $ttl; return $this; } /** * The new status of the resource. Can be: `in-progress` to re-open a session or `closed` to close a session. * * @param string $status The new status of the resource * @return $this Fluent Builder */ public function setStatus($status) { $this->options['status'] = $status; 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.Proxy.V1.UpdateSessionOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Proxy/V1/Service/PhoneNumberInstance.php 0000644 00000011575 15002236443 0017737 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Proxy\V1\Service; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * * @property string $sid * @property string $accountSid * @property string $serviceSid * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $phoneNumber * @property string $friendlyName * @property string $isoCountry * @property string $capabilities * @property string $url * @property bool $isReserved * @property int $inUse */ class PhoneNumberInstance extends InstanceResource { /** * Initialize the PhoneNumberInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the PhoneNumber resource's parent * Service resource * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Proxy\V1\Service\PhoneNumberInstance */ public function __construct(Version $version, array $payload, $serviceSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'phoneNumber' => Values::array_get($payload, 'phone_number'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'isoCountry' => Values::array_get($payload, 'iso_country'), 'capabilities' => Values::array_get($payload, 'capabilities'), 'url' => Values::array_get($payload, 'url'), 'isReserved' => Values::array_get($payload, 'is_reserved'), 'inUse' => Values::array_get($payload, 'in_use'), ); $this->solution = array('serviceSid' => $serviceSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Proxy\V1\Service\PhoneNumberContext Context for this * PhoneNumberInstance */ protected function proxy() { if (!$this->context) { $this->context = new PhoneNumberContext( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->context; } /** * Deletes the PhoneNumberInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Fetch a PhoneNumberInstance * * @return PhoneNumberInstance Fetched PhoneNumberInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Update the PhoneNumberInstance * * @param array|Options $options Optional Arguments * @return PhoneNumberInstance Updated PhoneNumberInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Proxy.V1.PhoneNumberInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Proxy/V1/Service/PhoneNumberOptions.php 0000644 00000011224 15002236443 0017615 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Proxy\V1\Service; 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 PhoneNumberOptions { /** * @param string $sid The SID of a Twilio IncomingPhoneNumber resource * @param string $phoneNumber The phone number in E.164 format * @param bool $isReserved Whether the new phone number should be reserved * @return CreatePhoneNumberOptions Options builder */ public static function create($sid = Values::NONE, $phoneNumber = Values::NONE, $isReserved = Values::NONE) { return new CreatePhoneNumberOptions($sid, $phoneNumber, $isReserved); } /** * @param bool $isReserved Whether the new phone number should be reserved * @return UpdatePhoneNumberOptions Options builder */ public static function update($isReserved = Values::NONE) { return new UpdatePhoneNumberOptions($isReserved); } } class CreatePhoneNumberOptions extends Options { /** * @param string $sid The SID of a Twilio IncomingPhoneNumber resource * @param string $phoneNumber The phone number in E.164 format * @param bool $isReserved Whether the new phone number should be reserved */ public function __construct($sid = Values::NONE, $phoneNumber = Values::NONE, $isReserved = Values::NONE) { $this->options['sid'] = $sid; $this->options['phoneNumber'] = $phoneNumber; $this->options['isReserved'] = $isReserved; } /** * The SID of a Twilio [IncomingPhoneNumber](https://www.twilio.com/docs/phone-numbers/api/incomingphonenumber-resource) resource that represents the Twilio Number you would like to assign to your Proxy Service. * * @param string $sid The SID of a Twilio IncomingPhoneNumber resource * @return $this Fluent Builder */ public function setSid($sid) { $this->options['sid'] = $sid; return $this; } /** * The phone number in [E.164](https://www.twilio.com/docs/glossary/what-e164) format. E.164 phone numbers consist of a + followed by the country code and subscriber number without punctuation characters. For example, +14155551234. * * @param string $phoneNumber The phone number in E.164 format * @return $this Fluent Builder */ public function setPhoneNumber($phoneNumber) { $this->options['phoneNumber'] = $phoneNumber; return $this; } /** * Whether the new phone number should be reserved and not be assigned to a participant using proxy pool logic. See [Reserved Phone Numbers](https://www.twilio.com/docs/proxy/reserved-phone-numbers) for more information. * * @param bool $isReserved Whether the new phone number should be reserved * @return $this Fluent Builder */ public function setIsReserved($isReserved) { $this->options['isReserved'] = $isReserved; 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.Proxy.V1.CreatePhoneNumberOptions ' . \implode(' ', $options) . ']'; } } class UpdatePhoneNumberOptions extends Options { /** * @param bool $isReserved Whether the new phone number should be reserved */ public function __construct($isReserved = Values::NONE) { $this->options['isReserved'] = $isReserved; } /** * Whether the phone number should be reserved and not be assigned to a participant using proxy pool logic. See [Reserved Phone Numbers](https://www.twilio.com/docs/proxy/reserved-phone-numbers) for more information. * * @param bool $isReserved Whether the new phone number should be reserved * @return $this Fluent Builder */ public function setIsReserved($isReserved) { $this->options['isReserved'] = $isReserved; 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.Proxy.V1.UpdatePhoneNumberOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Proxy/V1/Service/SessionContext.php 0000644 00000013116 15002236443 0017011 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Proxy\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Rest\Proxy\V1\Service\Session\InteractionList; use Twilio\Rest\Proxy\V1\Service\Session\ParticipantList; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * * @property \Twilio\Rest\Proxy\V1\Service\Session\InteractionList $interactions * @property \Twilio\Rest\Proxy\V1\Service\Session\ParticipantList $participants * @method \Twilio\Rest\Proxy\V1\Service\Session\InteractionContext interactions(string $sid) * @method \Twilio\Rest\Proxy\V1\Service\Session\ParticipantContext participants(string $sid) */ class SessionContext extends InstanceContext { protected $_interactions = null; protected $_participants = null; /** * Initialize the SessionContext * * @param \Twilio\Version $version Version that contains the resource * @param string $serviceSid The SID of the Service to fetch the resource from * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Proxy\V1\Service\SessionContext */ public function __construct(Version $version, $serviceSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, 'sid' => $sid, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Sessions/' . \rawurlencode($sid) . ''; } /** * Fetch a SessionInstance * * @return SessionInstance Fetched SessionInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new SessionInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Deletes the SessionInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Update the SessionInstance * * @param array|Options $options Optional Arguments * @return SessionInstance Updated SessionInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { $options = new Values($options); $data = Values::of(array( 'DateExpiry' => Serialize::iso8601DateTime($options['dateExpiry']), 'Ttl' => $options['ttl'], 'Status' => $options['status'], )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new SessionInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Access the interactions * * @return \Twilio\Rest\Proxy\V1\Service\Session\InteractionList */ protected function getInteractions() { if (!$this->_interactions) { $this->_interactions = new InteractionList( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->_interactions; } /** * Access the participants * * @return \Twilio\Rest\Proxy\V1\Service\Session\ParticipantList */ protected function getParticipants() { if (!$this->_participants) { $this->_participants = new ParticipantList( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->_participants; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get($name) { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Proxy.V1.SessionContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Proxy/V1/Service/PhoneNumberList.php 0000644 00000013616 15002236443 0017104 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Proxy\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class PhoneNumberList extends ListResource { /** * Construct the PhoneNumberList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the PhoneNumber resource's parent * Service resource * @return \Twilio\Rest\Proxy\V1\Service\PhoneNumberList */ public function __construct(Version $version, $serviceSid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/PhoneNumbers'; } /** * Create a new PhoneNumberInstance * * @param array|Options $options Optional Arguments * @return PhoneNumberInstance Newly created PhoneNumberInstance * @throws TwilioException When an HTTP error occurs. */ public function create($options = array()) { $options = new Values($options); $data = Values::of(array( 'Sid' => $options['sid'], 'PhoneNumber' => $options['phoneNumber'], 'IsReserved' => Serialize::booleanToString($options['isReserved']), )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new PhoneNumberInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Streams PhoneNumberInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads PhoneNumberInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return PhoneNumberInstance[] Array of results */ public function read($limit = null, $pageSize = null) { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of PhoneNumberInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of PhoneNumberInstance */ public function page($pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $params = Values::of(array( 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new PhoneNumberPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of PhoneNumberInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of PhoneNumberInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new PhoneNumberPage($this->version, $response, $this->solution); } /** * Constructs a PhoneNumberContext * * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Proxy\V1\Service\PhoneNumberContext */ public function getContext($sid) { return new PhoneNumberContext($this->version, $this->solution['serviceSid'], $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Proxy.V1.PhoneNumberList]'; } } sdk/src/Twilio/Rest/Proxy/V1/ServiceContext.php 0000644 00000013455 15002236443 0015374 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Proxy\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Rest\Proxy\V1\Service\PhoneNumberList; use Twilio\Rest\Proxy\V1\Service\SessionList; use Twilio\Rest\Proxy\V1\Service\ShortCodeList; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * * @property \Twilio\Rest\Proxy\V1\Service\SessionList $sessions * @property \Twilio\Rest\Proxy\V1\Service\PhoneNumberList $phoneNumbers * @property \Twilio\Rest\Proxy\V1\Service\ShortCodeList $shortCodes * @method \Twilio\Rest\Proxy\V1\Service\SessionContext sessions(string $sid) * @method \Twilio\Rest\Proxy\V1\Service\PhoneNumberContext phoneNumbers(string $sid) * @method \Twilio\Rest\Proxy\V1\Service\ShortCodeContext shortCodes(string $sid) */ class ServiceContext extends InstanceContext { protected $_sessions = null; protected $_phoneNumbers = null; protected $_shortCodes = null; /** * Initialize the ServiceContext * * @param \Twilio\Version $version Version that contains the resource * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Proxy\V1\ServiceContext */ public function __construct(Version $version, $sid) { parent::__construct($version); // Path Solution $this->solution = array('sid' => $sid, ); $this->uri = '/Services/' . \rawurlencode($sid) . ''; } /** * Fetch a ServiceInstance * * @return ServiceInstance Fetched ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new ServiceInstance($this->version, $payload, $this->solution['sid']); } /** * Deletes the ServiceInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Update the ServiceInstance * * @param array|Options $options Optional Arguments * @return ServiceInstance Updated ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { $options = new Values($options); $data = Values::of(array( 'UniqueName' => $options['uniqueName'], 'DefaultTtl' => $options['defaultTtl'], 'CallbackUrl' => $options['callbackUrl'], 'GeoMatchLevel' => $options['geoMatchLevel'], 'NumberSelectionBehavior' => $options['numberSelectionBehavior'], 'InterceptCallbackUrl' => $options['interceptCallbackUrl'], 'OutOfSessionCallbackUrl' => $options['outOfSessionCallbackUrl'], 'ChatInstanceSid' => $options['chatInstanceSid'], )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new ServiceInstance($this->version, $payload, $this->solution['sid']); } /** * Access the sessions * * @return \Twilio\Rest\Proxy\V1\Service\SessionList */ protected function getSessions() { if (!$this->_sessions) { $this->_sessions = new SessionList($this->version, $this->solution['sid']); } return $this->_sessions; } /** * Access the phoneNumbers * * @return \Twilio\Rest\Proxy\V1\Service\PhoneNumberList */ protected function getPhoneNumbers() { if (!$this->_phoneNumbers) { $this->_phoneNumbers = new PhoneNumberList($this->version, $this->solution['sid']); } return $this->_phoneNumbers; } /** * Access the shortCodes * * @return \Twilio\Rest\Proxy\V1\Service\ShortCodeList */ protected function getShortCodes() { if (!$this->_shortCodes) { $this->_shortCodes = new ShortCodeList($this->version, $this->solution['sid']); } return $this->_shortCodes; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get($name) { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Proxy.V1.ServiceContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Proxy.php 0000644 00000005167 15002236443 0012142 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\Rest\Proxy\V1; /** * @property \Twilio\Rest\Proxy\V1 $v1 * @property \Twilio\Rest\Proxy\V1\ServiceList $services * @method \Twilio\Rest\Proxy\V1\ServiceContext services(string $sid) */ class Proxy extends Domain { protected $_v1 = null; /** * Construct the Proxy Domain * * @param \Twilio\Rest\Client $client Twilio\Rest\Client to communicate with * Twilio * @return \Twilio\Rest\Proxy Domain for Proxy */ public function __construct(Client $client) { parent::__construct($client); $this->baseUrl = 'https://proxy.twilio.com'; } /** * @return \Twilio\Rest\Proxy\V1 Version v1 of proxy */ protected function getV1() { if (!$this->_v1) { $this->_v1 = new V1($this); } return $this->_v1; } /** * Magic getter to lazy load version * * @param string $name Version to return * @return \Twilio\Version The requested version * @throws TwilioException For unknown versions */ public function __get($name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown version ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $method = 'context' . \ucfirst($name); if (\method_exists($this, $method)) { return \call_user_func_array(array($this, $method), $arguments); } throw new TwilioException('Unknown context ' . $name); } /** * @return \Twilio\Rest\Proxy\V1\ServiceList */ protected function getServices() { return $this->v1->services; } /** * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Proxy\V1\ServiceContext */ protected function contextServices($sid) { return $this->v1->services($sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Proxy]'; } } sdk/src/Twilio/Rest/Autopilot/V1.php 0000644 00000004450 15002236443 0013261 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Autopilot; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\Rest\Autopilot\V1\AssistantList; use Twilio\Version; /** * @property \Twilio\Rest\Autopilot\V1\AssistantList $assistants * @method \Twilio\Rest\Autopilot\V1\AssistantContext assistants(string $sid) */ class V1 extends Version { protected $_assistants = null; /** * Construct the V1 version of Autopilot * * @param \Twilio\Domain $domain Domain that contains the version * @return \Twilio\Rest\Autopilot\V1 V1 version of Autopilot */ public function __construct(Domain $domain) { parent::__construct($domain); $this->version = 'v1'; } /** * @return \Twilio\Rest\Autopilot\V1\AssistantList */ protected function getAssistants() { if (!$this->_assistants) { $this->_assistants = new AssistantList($this); } return $this->_assistants; } /** * Magic getter to lazy load root resources * * @param string $name Resource to return * @return \Twilio\ListResource The requested resource * @throws TwilioException For unknown resource */ public function __get($name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown resource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Autopilot.V1]'; } } sdk/src/Twilio/Rest/Autopilot/V1/AssistantOptions.php 0000644 00000031476 15002236443 0016616 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Autopilot\V1; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ abstract class AssistantOptions { /** * @param string $friendlyName A string to describe the new resource * @param bool $logQueries Whether queries should be logged and kept after * training * @param string $uniqueName An application-defined string that uniquely * identifies the new resource * @param string $callbackUrl Reserved * @param string $callbackEvents Reserved * @param array $styleSheet A JSON string that defines the Assistant's style * sheet * @param array $defaults A JSON object that defines the Assistant's default * tasks for various scenarios * @return CreateAssistantOptions Options builder */ public static function create($friendlyName = Values::NONE, $logQueries = Values::NONE, $uniqueName = Values::NONE, $callbackUrl = Values::NONE, $callbackEvents = Values::NONE, $styleSheet = Values::NONE, $defaults = Values::NONE) { return new CreateAssistantOptions($friendlyName, $logQueries, $uniqueName, $callbackUrl, $callbackEvents, $styleSheet, $defaults); } /** * @param string $friendlyName A string to describe the resource * @param bool $logQueries Whether queries should be logged and kept after * training * @param string $uniqueName An application-defined string that uniquely * identifies the resource * @param string $callbackUrl Reserved * @param string $callbackEvents Reserved * @param array $styleSheet A JSON string that defines the Assistant's style * sheet * @param array $defaults A JSON object that defines the Assistant's [default * tasks](https://www.twilio.com/docs/autopilot/api/assistant/defaults) for various scenarios * @param string $developmentStage A string describing the state of the * assistant. * @return UpdateAssistantOptions Options builder */ public static function update($friendlyName = Values::NONE, $logQueries = Values::NONE, $uniqueName = Values::NONE, $callbackUrl = Values::NONE, $callbackEvents = Values::NONE, $styleSheet = Values::NONE, $defaults = Values::NONE, $developmentStage = Values::NONE) { return new UpdateAssistantOptions($friendlyName, $logQueries, $uniqueName, $callbackUrl, $callbackEvents, $styleSheet, $defaults, $developmentStage); } } class CreateAssistantOptions extends Options { /** * @param string $friendlyName A string to describe the new resource * @param bool $logQueries Whether queries should be logged and kept after * training * @param string $uniqueName An application-defined string that uniquely * identifies the new resource * @param string $callbackUrl Reserved * @param string $callbackEvents Reserved * @param array $styleSheet A JSON string that defines the Assistant's style * sheet * @param array $defaults A JSON object that defines the Assistant's default * tasks for various scenarios */ public function __construct($friendlyName = Values::NONE, $logQueries = Values::NONE, $uniqueName = Values::NONE, $callbackUrl = Values::NONE, $callbackEvents = Values::NONE, $styleSheet = Values::NONE, $defaults = Values::NONE) { $this->options['friendlyName'] = $friendlyName; $this->options['logQueries'] = $logQueries; $this->options['uniqueName'] = $uniqueName; $this->options['callbackUrl'] = $callbackUrl; $this->options['callbackEvents'] = $callbackEvents; $this->options['styleSheet'] = $styleSheet; $this->options['defaults'] = $defaults; } /** * A descriptive string that you create to describe the new resource. It is not unique and can be up to 255 characters long. * * @param string $friendlyName A string to describe the new resource * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * Whether queries should be logged and kept after training. Can be: `true` or `false` and defaults to `true`. If `true`, queries are stored for 30 days, and then deleted. If `false`, no queries are stored. * * @param bool $logQueries Whether queries should be logged and kept after * training * @return $this Fluent Builder */ public function setLogQueries($logQueries) { $this->options['logQueries'] = $logQueries; return $this; } /** * An application-defined string that uniquely identifies the new resource. It can be used as an alternative to the `sid` in the URL path to address the resource. The first 64 characters must be unique. * * @param string $uniqueName An application-defined string that uniquely * identifies the new resource * @return $this Fluent Builder */ public function setUniqueName($uniqueName) { $this->options['uniqueName'] = $uniqueName; return $this; } /** * Reserved. * * @param string $callbackUrl Reserved * @return $this Fluent Builder */ public function setCallbackUrl($callbackUrl) { $this->options['callbackUrl'] = $callbackUrl; return $this; } /** * Reserved. * * @param string $callbackEvents Reserved * @return $this Fluent Builder */ public function setCallbackEvents($callbackEvents) { $this->options['callbackEvents'] = $callbackEvents; return $this; } /** * The JSON string that defines the Assistant's [style sheet](https://www.twilio.com/docs/autopilot/api/assistant/stylesheet) * * @param array $styleSheet A JSON string that defines the Assistant's style * sheet * @return $this Fluent Builder */ public function setStyleSheet($styleSheet) { $this->options['styleSheet'] = $styleSheet; return $this; } /** * A JSON object that defines the Assistant's [default tasks](https://www.twilio.com/docs/autopilot/api/assistant/defaults) for various scenarios, including initiation actions and fallback tasks. * * @param array $defaults A JSON object that defines the Assistant's default * tasks for various scenarios * @return $this Fluent Builder */ public function setDefaults($defaults) { $this->options['defaults'] = $defaults; 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.Autopilot.V1.CreateAssistantOptions ' . \implode(' ', $options) . ']'; } } class UpdateAssistantOptions extends Options { /** * @param string $friendlyName A string to describe the resource * @param bool $logQueries Whether queries should be logged and kept after * training * @param string $uniqueName An application-defined string that uniquely * identifies the resource * @param string $callbackUrl Reserved * @param string $callbackEvents Reserved * @param array $styleSheet A JSON string that defines the Assistant's style * sheet * @param array $defaults A JSON object that defines the Assistant's [default * tasks](https://www.twilio.com/docs/autopilot/api/assistant/defaults) for various scenarios * @param string $developmentStage A string describing the state of the * assistant. */ public function __construct($friendlyName = Values::NONE, $logQueries = Values::NONE, $uniqueName = Values::NONE, $callbackUrl = Values::NONE, $callbackEvents = Values::NONE, $styleSheet = Values::NONE, $defaults = Values::NONE, $developmentStage = Values::NONE) { $this->options['friendlyName'] = $friendlyName; $this->options['logQueries'] = $logQueries; $this->options['uniqueName'] = $uniqueName; $this->options['callbackUrl'] = $callbackUrl; $this->options['callbackEvents'] = $callbackEvents; $this->options['styleSheet'] = $styleSheet; $this->options['defaults'] = $defaults; $this->options['developmentStage'] = $developmentStage; } /** * A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. * * @param string $friendlyName A string to describe the resource * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * Whether queries should be logged and kept after training. Can be: `true` or `false` and defaults to `true`. If `true`, queries are stored for 30 days, and then deleted. If `false`, no queries are stored. * * @param bool $logQueries Whether queries should be logged and kept after * training * @return $this Fluent Builder */ public function setLogQueries($logQueries) { $this->options['logQueries'] = $logQueries; return $this; } /** * An application-defined string that uniquely identifies the resource. It can be used as an alternative to the `sid` in the URL path to address the resource. The first 64 characters must be unique. * * @param string $uniqueName An application-defined string that uniquely * identifies the resource * @return $this Fluent Builder */ public function setUniqueName($uniqueName) { $this->options['uniqueName'] = $uniqueName; return $this; } /** * Reserved. * * @param string $callbackUrl Reserved * @return $this Fluent Builder */ public function setCallbackUrl($callbackUrl) { $this->options['callbackUrl'] = $callbackUrl; return $this; } /** * Reserved. * * @param string $callbackEvents Reserved * @return $this Fluent Builder */ public function setCallbackEvents($callbackEvents) { $this->options['callbackEvents'] = $callbackEvents; return $this; } /** * The JSON string that defines the Assistant's [style sheet](https://www.twilio.com/docs/autopilot/api/assistant/stylesheet) * * @param array $styleSheet A JSON string that defines the Assistant's style * sheet * @return $this Fluent Builder */ public function setStyleSheet($styleSheet) { $this->options['styleSheet'] = $styleSheet; return $this; } /** * A JSON object that defines the Assistant's [default tasks](https://www.twilio.com/docs/autopilot/api/assistant/defaults) for various scenarios, including initiation actions and fallback tasks. * * @param array $defaults A JSON object that defines the Assistant's [default * tasks](https://www.twilio.com/docs/autopilot/api/assistant/defaults) for various scenarios * @return $this Fluent Builder */ public function setDefaults($defaults) { $this->options['defaults'] = $defaults; return $this; } /** * A string describing the state of the assistant. * * @param string $developmentStage A string describing the state of the * assistant. * @return $this Fluent Builder */ public function setDevelopmentStage($developmentStage) { $this->options['developmentStage'] = $developmentStage; 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.Autopilot.V1.UpdateAssistantOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Autopilot/V1/AssistantContext.php 0000644 00000022565 15002236443 0016606 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Autopilot\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Rest\Autopilot\V1\Assistant\DefaultsList; use Twilio\Rest\Autopilot\V1\Assistant\DialogueList; use Twilio\Rest\Autopilot\V1\Assistant\ExportAssistantList; use Twilio\Rest\Autopilot\V1\Assistant\FieldTypeList; use Twilio\Rest\Autopilot\V1\Assistant\ModelBuildList; use Twilio\Rest\Autopilot\V1\Assistant\QueryList; use Twilio\Rest\Autopilot\V1\Assistant\StyleSheetList; use Twilio\Rest\Autopilot\V1\Assistant\TaskList; use Twilio\Rest\Autopilot\V1\Assistant\WebhookList; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property \Twilio\Rest\Autopilot\V1\Assistant\FieldTypeList $fieldTypes * @property \Twilio\Rest\Autopilot\V1\Assistant\TaskList $tasks * @property \Twilio\Rest\Autopilot\V1\Assistant\ModelBuildList $modelBuilds * @property \Twilio\Rest\Autopilot\V1\Assistant\QueryList $queries * @property \Twilio\Rest\Autopilot\V1\Assistant\StyleSheetList $styleSheet * @property \Twilio\Rest\Autopilot\V1\Assistant\DefaultsList $defaults * @property \Twilio\Rest\Autopilot\V1\Assistant\DialogueList $dialogues * @property \Twilio\Rest\Autopilot\V1\Assistant\WebhookList $webhooks * @property \Twilio\Rest\Autopilot\V1\Assistant\ExportAssistantList $exportAssistant * @method \Twilio\Rest\Autopilot\V1\Assistant\FieldTypeContext fieldTypes(string $sid) * @method \Twilio\Rest\Autopilot\V1\Assistant\TaskContext tasks(string $sid) * @method \Twilio\Rest\Autopilot\V1\Assistant\ModelBuildContext modelBuilds(string $sid) * @method \Twilio\Rest\Autopilot\V1\Assistant\QueryContext queries(string $sid) * @method \Twilio\Rest\Autopilot\V1\Assistant\StyleSheetContext styleSheet() * @method \Twilio\Rest\Autopilot\V1\Assistant\DefaultsContext defaults() * @method \Twilio\Rest\Autopilot\V1\Assistant\DialogueContext dialogues(string $sid) * @method \Twilio\Rest\Autopilot\V1\Assistant\WebhookContext webhooks(string $sid) * @method \Twilio\Rest\Autopilot\V1\Assistant\ExportAssistantContext exportAssistant() */ class AssistantContext extends InstanceContext { protected $_fieldTypes = null; protected $_tasks = null; protected $_modelBuilds = null; protected $_queries = null; protected $_styleSheet = null; protected $_defaults = null; protected $_dialogues = null; protected $_webhooks = null; protected $_exportAssistant = null; /** * Initialize the AssistantContext * * @param \Twilio\Version $version Version that contains the resource * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Autopilot\V1\AssistantContext */ public function __construct(Version $version, $sid) { parent::__construct($version); // Path Solution $this->solution = array('sid' => $sid, ); $this->uri = '/Assistants/' . \rawurlencode($sid) . ''; } /** * Fetch a AssistantInstance * * @return AssistantInstance Fetched AssistantInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new AssistantInstance($this->version, $payload, $this->solution['sid']); } /** * Update the AssistantInstance * * @param array|Options $options Optional Arguments * @return AssistantInstance Updated AssistantInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { $options = new Values($options); $data = Values::of(array( 'FriendlyName' => $options['friendlyName'], 'LogQueries' => Serialize::booleanToString($options['logQueries']), 'UniqueName' => $options['uniqueName'], 'CallbackUrl' => $options['callbackUrl'], 'CallbackEvents' => $options['callbackEvents'], 'StyleSheet' => Serialize::jsonObject($options['styleSheet']), 'Defaults' => Serialize::jsonObject($options['defaults']), 'DevelopmentStage' => $options['developmentStage'], )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new AssistantInstance($this->version, $payload, $this->solution['sid']); } /** * Deletes the AssistantInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Access the fieldTypes * * @return \Twilio\Rest\Autopilot\V1\Assistant\FieldTypeList */ protected function getFieldTypes() { if (!$this->_fieldTypes) { $this->_fieldTypes = new FieldTypeList($this->version, $this->solution['sid']); } return $this->_fieldTypes; } /** * Access the tasks * * @return \Twilio\Rest\Autopilot\V1\Assistant\TaskList */ protected function getTasks() { if (!$this->_tasks) { $this->_tasks = new TaskList($this->version, $this->solution['sid']); } return $this->_tasks; } /** * Access the modelBuilds * * @return \Twilio\Rest\Autopilot\V1\Assistant\ModelBuildList */ protected function getModelBuilds() { if (!$this->_modelBuilds) { $this->_modelBuilds = new ModelBuildList($this->version, $this->solution['sid']); } return $this->_modelBuilds; } /** * Access the queries * * @return \Twilio\Rest\Autopilot\V1\Assistant\QueryList */ protected function getQueries() { if (!$this->_queries) { $this->_queries = new QueryList($this->version, $this->solution['sid']); } return $this->_queries; } /** * Access the styleSheet * * @return \Twilio\Rest\Autopilot\V1\Assistant\StyleSheetList */ protected function getStyleSheet() { if (!$this->_styleSheet) { $this->_styleSheet = new StyleSheetList($this->version, $this->solution['sid']); } return $this->_styleSheet; } /** * Access the defaults * * @return \Twilio\Rest\Autopilot\V1\Assistant\DefaultsList */ protected function getDefaults() { if (!$this->_defaults) { $this->_defaults = new DefaultsList($this->version, $this->solution['sid']); } return $this->_defaults; } /** * Access the dialogues * * @return \Twilio\Rest\Autopilot\V1\Assistant\DialogueList */ protected function getDialogues() { if (!$this->_dialogues) { $this->_dialogues = new DialogueList($this->version, $this->solution['sid']); } return $this->_dialogues; } /** * Access the webhooks * * @return \Twilio\Rest\Autopilot\V1\Assistant\WebhookList */ protected function getWebhooks() { if (!$this->_webhooks) { $this->_webhooks = new WebhookList($this->version, $this->solution['sid']); } return $this->_webhooks; } /** * Access the exportAssistant * * @return \Twilio\Rest\Autopilot\V1\Assistant\ExportAssistantList */ protected function getExportAssistant() { if (!$this->_exportAssistant) { $this->_exportAssistant = new ExportAssistantList($this->version, $this->solution['sid']); } return $this->_exportAssistant; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get($name) { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Autopilot.V1.AssistantContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Autopilot/V1/AssistantList.php 0000644 00000013666 15002236443 0016077 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Autopilot\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class AssistantList extends ListResource { /** * Construct the AssistantList * * @param Version $version Version that contains the resource * @return \Twilio\Rest\Autopilot\V1\AssistantList */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = array(); $this->uri = '/Assistants'; } /** * Streams AssistantInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads AssistantInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return AssistantInstance[] Array of results */ public function read($limit = null, $pageSize = null) { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of AssistantInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of AssistantInstance */ public function page($pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $params = Values::of(array( 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new AssistantPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of AssistantInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of AssistantInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new AssistantPage($this->version, $response, $this->solution); } /** * Create a new AssistantInstance * * @param array|Options $options Optional Arguments * @return AssistantInstance Newly created AssistantInstance * @throws TwilioException When an HTTP error occurs. */ public function create($options = array()) { $options = new Values($options); $data = Values::of(array( 'FriendlyName' => $options['friendlyName'], 'LogQueries' => Serialize::booleanToString($options['logQueries']), 'UniqueName' => $options['uniqueName'], 'CallbackUrl' => $options['callbackUrl'], 'CallbackEvents' => $options['callbackEvents'], 'StyleSheet' => Serialize::jsonObject($options['styleSheet']), 'Defaults' => Serialize::jsonObject($options['defaults']), )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new AssistantInstance($this->version, $payload); } /** * Constructs a AssistantContext * * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Autopilot\V1\AssistantContext */ public function getContext($sid) { return new AssistantContext($this->version, $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Autopilot.V1.AssistantList]'; } } sdk/src/Twilio/Rest/Autopilot/V1/Assistant/QueryContext.php 0000644 00000006210 15002236443 0017700 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Autopilot\V1\Assistant; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class QueryContext extends InstanceContext { /** * Initialize the QueryContext * * @param \Twilio\Version $version Version that contains the resource * @param string $assistantSid The SID of the Assistant that is the parent of * the resource to fetch * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Autopilot\V1\Assistant\QueryContext */ public function __construct(Version $version, $assistantSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array('assistantSid' => $assistantSid, 'sid' => $sid, ); $this->uri = '/Assistants/' . \rawurlencode($assistantSid) . '/Queries/' . \rawurlencode($sid) . ''; } /** * Fetch a QueryInstance * * @return QueryInstance Fetched QueryInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new QueryInstance( $this->version, $payload, $this->solution['assistantSid'], $this->solution['sid'] ); } /** * Update the QueryInstance * * @param array|Options $options Optional Arguments * @return QueryInstance Updated QueryInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { $options = new Values($options); $data = Values::of(array('SampleSid' => $options['sampleSid'], 'Status' => $options['status'], )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new QueryInstance( $this->version, $payload, $this->solution['assistantSid'], $this->solution['sid'] ); } /** * Deletes the QueryInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Autopilot.V1.QueryContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Autopilot/V1/Assistant/WebhookInstance.php 0000644 00000011402 15002236443 0020310 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Autopilot\V1\Assistant; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $url * @property string $accountSid * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $assistantSid * @property string $sid * @property string $uniqueName * @property string $events * @property string $webhookUrl * @property string $webhookMethod */ class WebhookInstance extends InstanceResource { /** * Initialize the WebhookInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $assistantSid The SID of the Assistant that is the parent of * the resource * @param string $sid The unique string that identifies the resource to fetch * @return \Twilio\Rest\Autopilot\V1\Assistant\WebhookInstance */ public function __construct(Version $version, array $payload, $assistantSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'url' => Values::array_get($payload, 'url'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'assistantSid' => Values::array_get($payload, 'assistant_sid'), 'sid' => Values::array_get($payload, 'sid'), 'uniqueName' => Values::array_get($payload, 'unique_name'), 'events' => Values::array_get($payload, 'events'), 'webhookUrl' => Values::array_get($payload, 'webhook_url'), 'webhookMethod' => Values::array_get($payload, 'webhook_method'), ); $this->solution = array('assistantSid' => $assistantSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Autopilot\V1\Assistant\WebhookContext Context for this * WebhookInstance */ protected function proxy() { if (!$this->context) { $this->context = new WebhookContext( $this->version, $this->solution['assistantSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch a WebhookInstance * * @return WebhookInstance Fetched WebhookInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Update the WebhookInstance * * @param array|Options $options Optional Arguments * @return WebhookInstance Updated WebhookInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Deletes the WebhookInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Autopilot.V1.WebhookInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Autopilot/V1/Assistant/DefaultsInstance.php 0000644 00000007161 15002236443 0020470 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Autopilot\V1\Assistant; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $accountSid * @property string $assistantSid * @property string $url * @property array $data */ class DefaultsInstance extends InstanceResource { /** * Initialize the DefaultsInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $assistantSid The SID of the Assistant that is the parent of * the resource * @return \Twilio\Rest\Autopilot\V1\Assistant\DefaultsInstance */ public function __construct(Version $version, array $payload, $assistantSid) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'accountSid' => Values::array_get($payload, 'account_sid'), 'assistantSid' => Values::array_get($payload, 'assistant_sid'), 'url' => Values::array_get($payload, 'url'), 'data' => Values::array_get($payload, 'data'), ); $this->solution = array('assistantSid' => $assistantSid, ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Autopilot\V1\Assistant\DefaultsContext Context for this * DefaultsInstance */ protected function proxy() { if (!$this->context) { $this->context = new DefaultsContext($this->version, $this->solution['assistantSid']); } return $this->context; } /** * Fetch a DefaultsInstance * * @return DefaultsInstance Fetched DefaultsInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Update the DefaultsInstance * * @param array|Options $options Optional Arguments * @return DefaultsInstance Updated DefaultsInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Autopilot.V1.DefaultsInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Autopilot/V1/Assistant/ExportAssistantContext.php 0000644 00000003673 15002236443 0021760 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Autopilot\V1\Assistant; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class ExportAssistantContext extends InstanceContext { /** * Initialize the ExportAssistantContext * * @param \Twilio\Version $version Version that contains the resource * @param string $assistantSid The SID of the Assistant to export. * @return \Twilio\Rest\Autopilot\V1\Assistant\ExportAssistantContext */ public function __construct(Version $version, $assistantSid) { parent::__construct($version); // Path Solution $this->solution = array('assistantSid' => $assistantSid, ); $this->uri = '/Assistants/' . \rawurlencode($assistantSid) . '/Export'; } /** * Fetch a ExportAssistantInstance * * @return ExportAssistantInstance Fetched ExportAssistantInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new ExportAssistantInstance($this->version, $payload, $this->solution['assistantSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Autopilot.V1.ExportAssistantContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Autopilot/V1/Assistant/StyleSheetPage.php 0000644 00000001723 15002236443 0020120 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Autopilot\V1\Assistant; use Twilio\Page; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class StyleSheetPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new StyleSheetInstance($this->version, $payload, $this->solution['assistantSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Autopilot.V1.StyleSheetPage]'; } } sdk/src/Twilio/Rest/Autopilot/V1/Assistant/ModelBuildInstance.php 0000644 00000011542 15002236443 0020737 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Autopilot\V1\Assistant; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $accountSid * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $assistantSid * @property string $sid * @property string $status * @property string $uniqueName * @property string $url * @property int $buildDuration * @property int $errorCode */ class ModelBuildInstance extends InstanceResource { /** * Initialize the ModelBuildInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $assistantSid The SID of the Assistant that is the parent of * the resource * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Autopilot\V1\Assistant\ModelBuildInstance */ public function __construct(Version $version, array $payload, $assistantSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'accountSid' => Values::array_get($payload, 'account_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'assistantSid' => Values::array_get($payload, 'assistant_sid'), 'sid' => Values::array_get($payload, 'sid'), 'status' => Values::array_get($payload, 'status'), 'uniqueName' => Values::array_get($payload, 'unique_name'), 'url' => Values::array_get($payload, 'url'), 'buildDuration' => Values::array_get($payload, 'build_duration'), 'errorCode' => Values::array_get($payload, 'error_code'), ); $this->solution = array('assistantSid' => $assistantSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Autopilot\V1\Assistant\ModelBuildContext Context for * this * ModelBuildInstance */ protected function proxy() { if (!$this->context) { $this->context = new ModelBuildContext( $this->version, $this->solution['assistantSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch a ModelBuildInstance * * @return ModelBuildInstance Fetched ModelBuildInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Update the ModelBuildInstance * * @param array|Options $options Optional Arguments * @return ModelBuildInstance Updated ModelBuildInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Deletes the ModelBuildInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Autopilot.V1.ModelBuildInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Autopilot/V1/Assistant/StyleSheetOptions.php 0000644 00000003530 15002236443 0020675 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Autopilot\V1\Assistant; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ abstract class StyleSheetOptions { /** * @param array $styleSheet The JSON string that describes the style sheet * object * @return UpdateStyleSheetOptions Options builder */ public static function update($styleSheet = Values::NONE) { return new UpdateStyleSheetOptions($styleSheet); } } class UpdateStyleSheetOptions extends Options { /** * @param array $styleSheet The JSON string that describes the style sheet * object */ public function __construct($styleSheet = Values::NONE) { $this->options['styleSheet'] = $styleSheet; } /** * The JSON string that describes the style sheet object. * * @param array $styleSheet The JSON string that describes the style sheet * object * @return $this Fluent Builder */ public function setStyleSheet($styleSheet) { $this->options['styleSheet'] = $styleSheet; 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.Autopilot.V1.UpdateStyleSheetOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Autopilot/V1/Assistant/TaskOptions.php 0000644 00000016275 15002236443 0017520 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Autopilot\V1\Assistant; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ abstract class TaskOptions { /** * @param string $friendlyName descriptive string that you create to describe * the new resource * @param array $actions The JSON string that specifies the actions that * instruct the Assistant on how to perform the task * @param string $actionsUrl The URL from which the Assistant can fetch actions * @return CreateTaskOptions Options builder */ public static function create($friendlyName = Values::NONE, $actions = Values::NONE, $actionsUrl = Values::NONE) { return new CreateTaskOptions($friendlyName, $actions, $actionsUrl); } /** * @param string $friendlyName A string to describe the resource * @param string $uniqueName An application-defined string that uniquely * identifies the resource * @param array $actions The JSON string that specifies the actions that * instruct the Assistant on how to perform the task * @param string $actionsUrl The URL from which the Assistant can fetch actions * @return UpdateTaskOptions Options builder */ public static function update($friendlyName = Values::NONE, $uniqueName = Values::NONE, $actions = Values::NONE, $actionsUrl = Values::NONE) { return new UpdateTaskOptions($friendlyName, $uniqueName, $actions, $actionsUrl); } } class CreateTaskOptions extends Options { /** * @param string $friendlyName descriptive string that you create to describe * the new resource * @param array $actions The JSON string that specifies the actions that * instruct the Assistant on how to perform the task * @param string $actionsUrl The URL from which the Assistant can fetch actions */ public function __construct($friendlyName = Values::NONE, $actions = Values::NONE, $actionsUrl = Values::NONE) { $this->options['friendlyName'] = $friendlyName; $this->options['actions'] = $actions; $this->options['actionsUrl'] = $actionsUrl; } /** * A descriptive string that you create to describe the new resource. It is not unique and can be up to 255 characters long. * * @param string $friendlyName descriptive string that you create to describe * the new resource * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The JSON string that specifies the [actions](https://www.twilio.com/docs/autopilot/actions) that instruct the Assistant on how to perform the task. It is optional and not unique. * * @param array $actions The JSON string that specifies the actions that * instruct the Assistant on how to perform the task * @return $this Fluent Builder */ public function setActions($actions) { $this->options['actions'] = $actions; return $this; } /** * The URL from which the Assistant can fetch actions. * * @param string $actionsUrl The URL from which the Assistant can fetch actions * @return $this Fluent Builder */ public function setActionsUrl($actionsUrl) { $this->options['actionsUrl'] = $actionsUrl; 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.Autopilot.V1.CreateTaskOptions ' . \implode(' ', $options) . ']'; } } class UpdateTaskOptions extends Options { /** * @param string $friendlyName A string to describe the resource * @param string $uniqueName An application-defined string that uniquely * identifies the resource * @param array $actions The JSON string that specifies the actions that * instruct the Assistant on how to perform the task * @param string $actionsUrl The URL from which the Assistant can fetch actions */ public function __construct($friendlyName = Values::NONE, $uniqueName = Values::NONE, $actions = Values::NONE, $actionsUrl = Values::NONE) { $this->options['friendlyName'] = $friendlyName; $this->options['uniqueName'] = $uniqueName; $this->options['actions'] = $actions; $this->options['actionsUrl'] = $actionsUrl; } /** * A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. * * @param string $friendlyName A string to describe the resource * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * An application-defined string that uniquely identifies the resource. This value must be 64 characters or less in length and be unique. It can be used as an alternative to the `sid` in the URL path to address the resource. * * @param string $uniqueName An application-defined string that uniquely * identifies the resource * @return $this Fluent Builder */ public function setUniqueName($uniqueName) { $this->options['uniqueName'] = $uniqueName; return $this; } /** * The JSON string that specifies the [actions](https://www.twilio.com/docs/autopilot/actions) that instruct the Assistant on how to perform the task. * * @param array $actions The JSON string that specifies the actions that * instruct the Assistant on how to perform the task * @return $this Fluent Builder */ public function setActions($actions) { $this->options['actions'] = $actions; return $this; } /** * The URL from which the Assistant can fetch actions. * * @param string $actionsUrl The URL from which the Assistant can fetch actions * @return $this Fluent Builder */ public function setActionsUrl($actionsUrl) { $this->options['actionsUrl'] = $actionsUrl; 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.Autopilot.V1.UpdateTaskOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Autopilot/V1/Assistant/ExportAssistantList.php 0000644 00000002633 15002236443 0021242 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Autopilot\V1\Assistant; use Twilio\ListResource; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class ExportAssistantList extends ListResource { /** * Construct the ExportAssistantList * * @param Version $version Version that contains the resource * @param string $assistantSid The SID of the Assistant to export. * @return \Twilio\Rest\Autopilot\V1\Assistant\ExportAssistantList */ public function __construct(Version $version, $assistantSid) { parent::__construct($version); // Path Solution $this->solution = array('assistantSid' => $assistantSid, ); } /** * Constructs a ExportAssistantContext * * @return \Twilio\Rest\Autopilot\V1\Assistant\ExportAssistantContext */ public function getContext() { return new ExportAssistantContext($this->version, $this->solution['assistantSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Autopilot.V1.ExportAssistantList]'; } } sdk/src/Twilio/Rest/Autopilot/V1/Assistant/WebhookOptions.php 0000644 00000013014 15002236443 0020200 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Autopilot\V1\Assistant; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ abstract class WebhookOptions { /** * @param string $webhookMethod The method to be used when calling the * webhook's URL. * @return CreateWebhookOptions Options builder */ public static function create($webhookMethod = Values::NONE) { return new CreateWebhookOptions($webhookMethod); } /** * @param string $uniqueName An application-defined string that uniquely * identifies the resource * @param string $events The list of space-separated events that this Webhook * will subscribe to. * @param string $webhookUrl The URL associated with this Webhook. * @param string $webhookMethod The method to be used when calling the * webhook's URL. * @return UpdateWebhookOptions Options builder */ public static function update($uniqueName = Values::NONE, $events = Values::NONE, $webhookUrl = Values::NONE, $webhookMethod = Values::NONE) { return new UpdateWebhookOptions($uniqueName, $events, $webhookUrl, $webhookMethod); } } class CreateWebhookOptions extends Options { /** * @param string $webhookMethod The method to be used when calling the * webhook's URL. */ public function __construct($webhookMethod = Values::NONE) { $this->options['webhookMethod'] = $webhookMethod; } /** * The method to be used when calling the webhook's URL. * * @param string $webhookMethod The method to be used when calling the * webhook's URL. * @return $this Fluent Builder */ public function setWebhookMethod($webhookMethod) { $this->options['webhookMethod'] = $webhookMethod; 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.Autopilot.V1.CreateWebhookOptions ' . \implode(' ', $options) . ']'; } } class UpdateWebhookOptions extends Options { /** * @param string $uniqueName An application-defined string that uniquely * identifies the resource * @param string $events The list of space-separated events that this Webhook * will subscribe to. * @param string $webhookUrl The URL associated with this Webhook. * @param string $webhookMethod The method to be used when calling the * webhook's URL. */ public function __construct($uniqueName = Values::NONE, $events = Values::NONE, $webhookUrl = Values::NONE, $webhookMethod = Values::NONE) { $this->options['uniqueName'] = $uniqueName; $this->options['events'] = $events; $this->options['webhookUrl'] = $webhookUrl; $this->options['webhookMethod'] = $webhookMethod; } /** * An application-defined string that uniquely identifies the new resource. It can be used as an alternative to the `sid` in the URL path to address the resource. This value must be unique and 64 characters or less in length. * * @param string $uniqueName An application-defined string that uniquely * identifies the resource * @return $this Fluent Builder */ public function setUniqueName($uniqueName) { $this->options['uniqueName'] = $uniqueName; return $this; } /** * The list of space-separated events that this Webhook will subscribe to. * * @param string $events The list of space-separated events that this Webhook * will subscribe to. * @return $this Fluent Builder */ public function setEvents($events) { $this->options['events'] = $events; return $this; } /** * The URL associated with this Webhook. * * @param string $webhookUrl The URL associated with this Webhook. * @return $this Fluent Builder */ public function setWebhookUrl($webhookUrl) { $this->options['webhookUrl'] = $webhookUrl; return $this; } /** * The method to be used when calling the webhook's URL. * * @param string $webhookMethod The method to be used when calling the * webhook's URL. * @return $this Fluent Builder */ public function setWebhookMethod($webhookMethod) { $this->options['webhookMethod'] = $webhookMethod; 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.Autopilot.V1.UpdateWebhookOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Autopilot/V1/Assistant/Task/FieldInstance.php 0000644 00000011244 15002236443 0020643 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Autopilot\V1\Assistant\Task; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $accountSid * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $fieldType * @property string $taskSid * @property string $assistantSid * @property string $sid * @property string $uniqueName * @property string $url */ class FieldInstance extends InstanceResource { /** * Initialize the FieldInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $assistantSid The SID of the Assistant that is the parent of * the Task associated with the resource * @param string $taskSid The SID of the * [Task](https://www.twilio.com/docs/autopilot/api/task) resource associated with this Field * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Autopilot\V1\Assistant\Task\FieldInstance */ public function __construct(Version $version, array $payload, $assistantSid, $taskSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'accountSid' => Values::array_get($payload, 'account_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'fieldType' => Values::array_get($payload, 'field_type'), 'taskSid' => Values::array_get($payload, 'task_sid'), 'assistantSid' => Values::array_get($payload, 'assistant_sid'), 'sid' => Values::array_get($payload, 'sid'), 'uniqueName' => Values::array_get($payload, 'unique_name'), 'url' => Values::array_get($payload, 'url'), ); $this->solution = array( 'assistantSid' => $assistantSid, 'taskSid' => $taskSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Autopilot\V1\Assistant\Task\FieldContext Context for * this * FieldInstance */ protected function proxy() { if (!$this->context) { $this->context = new FieldContext( $this->version, $this->solution['assistantSid'], $this->solution['taskSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch a FieldInstance * * @return FieldInstance Fetched FieldInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the FieldInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Autopilot.V1.FieldInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Autopilot/V1/Assistant/Task/FieldList.php 0000644 00000014424 15002236443 0020015 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Autopilot\V1\Assistant\Task; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class FieldList extends ListResource { /** * Construct the FieldList * * @param Version $version Version that contains the resource * @param string $assistantSid The SID of the Assistant that is the parent of * the Task associated with the resource * @param string $taskSid The SID of the * [Task](https://www.twilio.com/docs/autopilot/api/task) resource associated with this Field * @return \Twilio\Rest\Autopilot\V1\Assistant\Task\FieldList */ public function __construct(Version $version, $assistantSid, $taskSid) { parent::__construct($version); // Path Solution $this->solution = array('assistantSid' => $assistantSid, 'taskSid' => $taskSid, ); $this->uri = '/Assistants/' . \rawurlencode($assistantSid) . '/Tasks/' . \rawurlencode($taskSid) . '/Fields'; } /** * Streams FieldInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads FieldInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return FieldInstance[] Array of results */ public function read($limit = null, $pageSize = null) { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of FieldInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of FieldInstance */ public function page($pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $params = Values::of(array( 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new FieldPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of FieldInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of FieldInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new FieldPage($this->version, $response, $this->solution); } /** * Create a new FieldInstance * * @param string $fieldType The Field Type of this field * @param string $uniqueName An application-defined string that uniquely * identifies the new resource * @return FieldInstance Newly created FieldInstance * @throws TwilioException When an HTTP error occurs. */ public function create($fieldType, $uniqueName) { $data = Values::of(array('FieldType' => $fieldType, 'UniqueName' => $uniqueName, )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new FieldInstance( $this->version, $payload, $this->solution['assistantSid'], $this->solution['taskSid'] ); } /** * Constructs a FieldContext * * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Autopilot\V1\Assistant\Task\FieldContext */ public function getContext($sid) { return new FieldContext( $this->version, $this->solution['assistantSid'], $this->solution['taskSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Autopilot.V1.FieldList]'; } } sdk/src/Twilio/Rest/Autopilot/V1/Assistant/Task/TaskActionsInstance.php 0000644 00000010074 15002236443 0022043 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Autopilot\V1\Assistant\Task; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $accountSid * @property string $assistantSid * @property string $taskSid * @property string $url * @property array $data */ class TaskActionsInstance extends InstanceResource { /** * Initialize the TaskActionsInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $assistantSid The SID of the Assistant that is the parent of * the Task associated with the resource * @param string $taskSid The SID of the Task associated with the resource * @return \Twilio\Rest\Autopilot\V1\Assistant\Task\TaskActionsInstance */ public function __construct(Version $version, array $payload, $assistantSid, $taskSid) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'accountSid' => Values::array_get($payload, 'account_sid'), 'assistantSid' => Values::array_get($payload, 'assistant_sid'), 'taskSid' => Values::array_get($payload, 'task_sid'), 'url' => Values::array_get($payload, 'url'), 'data' => Values::array_get($payload, 'data'), ); $this->solution = array('assistantSid' => $assistantSid, 'taskSid' => $taskSid, ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Autopilot\V1\Assistant\Task\TaskActionsContext Context * for this * TaskActionsInstance */ protected function proxy() { if (!$this->context) { $this->context = new TaskActionsContext( $this->version, $this->solution['assistantSid'], $this->solution['taskSid'] ); } return $this->context; } /** * Fetch a TaskActionsInstance * * @return TaskActionsInstance Fetched TaskActionsInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Update the TaskActionsInstance * * @param array|Options $options Optional Arguments * @return TaskActionsInstance Updated TaskActionsInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Autopilot.V1.TaskActionsInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Autopilot/V1/Assistant/Task/TaskStatisticsContext.php 0000644 00000004440 15002236443 0022455 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Autopilot\V1\Assistant\Task; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class TaskStatisticsContext extends InstanceContext { /** * Initialize the TaskStatisticsContext * * @param \Twilio\Version $version Version that contains the resource * @param string $assistantSid The SID of the Assistant that is the parent of * the resource to fetch * @param string $taskSid The SID of the Task that is associated with the * resource to fetch * @return \Twilio\Rest\Autopilot\V1\Assistant\Task\TaskStatisticsContext */ public function __construct(Version $version, $assistantSid, $taskSid) { parent::__construct($version); // Path Solution $this->solution = array('assistantSid' => $assistantSid, 'taskSid' => $taskSid, ); $this->uri = '/Assistants/' . \rawurlencode($assistantSid) . '/Tasks/' . \rawurlencode($taskSid) . '/Statistics'; } /** * Fetch a TaskStatisticsInstance * * @return TaskStatisticsInstance Fetched TaskStatisticsInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new TaskStatisticsInstance( $this->version, $payload, $this->solution['assistantSid'], $this->solution['taskSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Autopilot.V1.TaskStatisticsContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Autopilot/V1/Assistant/Task/TaskStatisticsList.php 0000644 00000003332 15002236443 0021743 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Autopilot\V1\Assistant\Task; use Twilio\ListResource; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class TaskStatisticsList extends ListResource { /** * Construct the TaskStatisticsList * * @param Version $version Version that contains the resource * @param string $assistantSid The SID of the Assistant that is the parent of * the Task associated with the resource * @param string $taskSid The SID of the Task for which the statistics were * collected * @return \Twilio\Rest\Autopilot\V1\Assistant\Task\TaskStatisticsList */ public function __construct(Version $version, $assistantSid, $taskSid) { parent::__construct($version); // Path Solution $this->solution = array('assistantSid' => $assistantSid, 'taskSid' => $taskSid, ); } /** * Constructs a TaskStatisticsContext * * @return \Twilio\Rest\Autopilot\V1\Assistant\Task\TaskStatisticsContext */ public function getContext() { return new TaskStatisticsContext( $this->version, $this->solution['assistantSid'], $this->solution['taskSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Autopilot.V1.TaskStatisticsList]'; } } sdk/src/Twilio/Rest/Autopilot/V1/Assistant/Task/FieldContext.php 0000644 00000005331 15002236443 0020523 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Autopilot\V1\Assistant\Task; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class FieldContext extends InstanceContext { /** * Initialize the FieldContext * * @param \Twilio\Version $version Version that contains the resource * @param string $assistantSid The SID of the Assistant that is the parent of * the Task associated with the resource to fetch * @param string $taskSid The SID of the * [Task](https://www.twilio.com/docs/autopilot/api/task) resource associated with the Field resource to fetch * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Autopilot\V1\Assistant\Task\FieldContext */ public function __construct(Version $version, $assistantSid, $taskSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array('assistantSid' => $assistantSid, 'taskSid' => $taskSid, 'sid' => $sid, ); $this->uri = '/Assistants/' . \rawurlencode($assistantSid) . '/Tasks/' . \rawurlencode($taskSid) . '/Fields/' . \rawurlencode($sid) . ''; } /** * Fetch a FieldInstance * * @return FieldInstance Fetched FieldInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new FieldInstance( $this->version, $payload, $this->solution['assistantSid'], $this->solution['taskSid'], $this->solution['sid'] ); } /** * Deletes the FieldInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Autopilot.V1.FieldContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Autopilot/V1/Assistant/Task/SampleList.php 0000644 00000015513 15002236443 0020213 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Autopilot\V1\Assistant\Task; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class SampleList extends ListResource { /** * Construct the SampleList * * @param Version $version Version that contains the resource * @param string $assistantSid The SID of the Assistant that is the parent of * the Task associated with the resource * @param string $taskSid The SID of the Task associated with the resource * @return \Twilio\Rest\Autopilot\V1\Assistant\Task\SampleList */ public function __construct(Version $version, $assistantSid, $taskSid) { parent::__construct($version); // Path Solution $this->solution = array('assistantSid' => $assistantSid, 'taskSid' => $taskSid, ); $this->uri = '/Assistants/' . \rawurlencode($assistantSid) . '/Tasks/' . \rawurlencode($taskSid) . '/Samples'; } /** * Streams SampleInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($options = array(), $limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads SampleInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return SampleInstance[] Array of results */ public function read($options = array(), $limit = null, $pageSize = null) { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Retrieve a single page of SampleInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of SampleInstance */ public function page($options = array(), $pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $options = new Values($options); $params = Values::of(array( 'Language' => $options['language'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new SamplePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of SampleInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of SampleInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new SamplePage($this->version, $response, $this->solution); } /** * Create a new SampleInstance * * @param string $language The ISO language-country string that specifies the * language used for the new sample * @param string $taggedText The text example of how end users might express * the task * @param array|Options $options Optional Arguments * @return SampleInstance Newly created SampleInstance * @throws TwilioException When an HTTP error occurs. */ public function create($language, $taggedText, $options = array()) { $options = new Values($options); $data = Values::of(array( 'Language' => $language, 'TaggedText' => $taggedText, 'SourceChannel' => $options['sourceChannel'], )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new SampleInstance( $this->version, $payload, $this->solution['assistantSid'], $this->solution['taskSid'] ); } /** * Constructs a SampleContext * * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Autopilot\V1\Assistant\Task\SampleContext */ public function getContext($sid) { return new SampleContext( $this->version, $this->solution['assistantSid'], $this->solution['taskSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Autopilot.V1.SampleList]'; } } sdk/src/Twilio/Rest/Autopilot/V1/Assistant/Task/TaskStatisticsPage.php 0000644 00000002072 15002236443 0021704 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Autopilot\V1\Assistant\Task; use Twilio\Page; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class TaskStatisticsPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new TaskStatisticsInstance( $this->version, $payload, $this->solution['assistantSid'], $this->solution['taskSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Autopilot.V1.TaskStatisticsPage]'; } } sdk/src/Twilio/Rest/Autopilot/V1/Assistant/Task/TaskActionsOptions.php 0000644 00000004026 15002236443 0021732 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Autopilot\V1\Assistant\Task; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ abstract class TaskActionsOptions { /** * @param array $actions The JSON string that specifies the actions that * instruct the Assistant on how to perform the task * @return UpdateTaskActionsOptions Options builder */ public static function update($actions = Values::NONE) { return new UpdateTaskActionsOptions($actions); } } class UpdateTaskActionsOptions extends Options { /** * @param array $actions The JSON string that specifies the actions that * instruct the Assistant on how to perform the task */ public function __construct($actions = Values::NONE) { $this->options['actions'] = $actions; } /** * The JSON string that specifies the [actions](https://www.twilio.com/docs/autopilot/actions) that instruct the Assistant on how to perform the task. * * @param array $actions The JSON string that specifies the actions that * instruct the Assistant on how to perform the task * @return $this Fluent Builder */ public function setActions($actions) { $this->options['actions'] = $actions; 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.Autopilot.V1.UpdateTaskActionsOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Autopilot/V1/Assistant/Task/TaskActionsContext.php 0000644 00000006153 15002236443 0021726 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Autopilot\V1\Assistant\Task; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class TaskActionsContext extends InstanceContext { /** * Initialize the TaskActionsContext * * @param \Twilio\Version $version Version that contains the resource * @param string $assistantSid The SID of the Assistant that is the parent of * the Task for which the task actions to fetch * were defined * @param string $taskSid The SID of the Task for which the task actions to * fetch were defined * @return \Twilio\Rest\Autopilot\V1\Assistant\Task\TaskActionsContext */ public function __construct(Version $version, $assistantSid, $taskSid) { parent::__construct($version); // Path Solution $this->solution = array('assistantSid' => $assistantSid, 'taskSid' => $taskSid, ); $this->uri = '/Assistants/' . \rawurlencode($assistantSid) . '/Tasks/' . \rawurlencode($taskSid) . '/Actions'; } /** * Fetch a TaskActionsInstance * * @return TaskActionsInstance Fetched TaskActionsInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new TaskActionsInstance( $this->version, $payload, $this->solution['assistantSid'], $this->solution['taskSid'] ); } /** * Update the TaskActionsInstance * * @param array|Options $options Optional Arguments * @return TaskActionsInstance Updated TaskActionsInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { $options = new Values($options); $data = Values::of(array('Actions' => Serialize::jsonObject($options['actions']), )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new TaskActionsInstance( $this->version, $payload, $this->solution['assistantSid'], $this->solution['taskSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Autopilot.V1.TaskActionsContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Autopilot/V1/Assistant/Task/TaskActionsList.php 0000644 00000003234 15002236443 0021212 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Autopilot\V1\Assistant\Task; use Twilio\ListResource; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class TaskActionsList extends ListResource { /** * Construct the TaskActionsList * * @param Version $version Version that contains the resource * @param string $assistantSid The SID of the Assistant that is the parent of * the Task associated with the resource * @param string $taskSid The SID of the Task associated with the resource * @return \Twilio\Rest\Autopilot\V1\Assistant\Task\TaskActionsList */ public function __construct(Version $version, $assistantSid, $taskSid) { parent::__construct($version); // Path Solution $this->solution = array('assistantSid' => $assistantSid, 'taskSid' => $taskSid, ); } /** * Constructs a TaskActionsContext * * @return \Twilio\Rest\Autopilot\V1\Assistant\Task\TaskActionsContext */ public function getContext() { return new TaskActionsContext( $this->version, $this->solution['assistantSid'], $this->solution['taskSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Autopilot.V1.TaskActionsList]'; } } sdk/src/Twilio/Rest/Autopilot/V1/Assistant/Task/SampleContext.php 0000644 00000007056 15002236443 0020727 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Autopilot\V1\Assistant\Task; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class SampleContext extends InstanceContext { /** * Initialize the SampleContext * * @param \Twilio\Version $version Version that contains the resource * @param string $assistantSid The SID of the Assistant that is the parent of * the Task associated with the resource to fetch * @param string $taskSid The SID of the Task associated with the Sample * resource to create * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Autopilot\V1\Assistant\Task\SampleContext */ public function __construct(Version $version, $assistantSid, $taskSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array('assistantSid' => $assistantSid, 'taskSid' => $taskSid, 'sid' => $sid, ); $this->uri = '/Assistants/' . \rawurlencode($assistantSid) . '/Tasks/' . \rawurlencode($taskSid) . '/Samples/' . \rawurlencode($sid) . ''; } /** * Fetch a SampleInstance * * @return SampleInstance Fetched SampleInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new SampleInstance( $this->version, $payload, $this->solution['assistantSid'], $this->solution['taskSid'], $this->solution['sid'] ); } /** * Update the SampleInstance * * @param array|Options $options Optional Arguments * @return SampleInstance Updated SampleInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { $options = new Values($options); $data = Values::of(array( 'Language' => $options['language'], 'TaggedText' => $options['taggedText'], 'SourceChannel' => $options['sourceChannel'], )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new SampleInstance( $this->version, $payload, $this->solution['assistantSid'], $this->solution['taskSid'], $this->solution['sid'] ); } /** * Deletes the SampleInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Autopilot.V1.SampleContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Autopilot/V1/Assistant/Task/TaskStatisticsInstance.php 0000644 00000007401 15002236443 0022575 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Autopilot\V1\Assistant\Task; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $accountSid * @property string $assistantSid * @property string $taskSid * @property int $samplesCount * @property int $fieldsCount * @property string $url */ class TaskStatisticsInstance extends InstanceResource { /** * Initialize the TaskStatisticsInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $assistantSid The SID of the Assistant that is the parent of * the Task associated with the resource * @param string $taskSid The SID of the Task for which the statistics were * collected * @return \Twilio\Rest\Autopilot\V1\Assistant\Task\TaskStatisticsInstance */ public function __construct(Version $version, array $payload, $assistantSid, $taskSid) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'accountSid' => Values::array_get($payload, 'account_sid'), 'assistantSid' => Values::array_get($payload, 'assistant_sid'), 'taskSid' => Values::array_get($payload, 'task_sid'), 'samplesCount' => Values::array_get($payload, 'samples_count'), 'fieldsCount' => Values::array_get($payload, 'fields_count'), 'url' => Values::array_get($payload, 'url'), ); $this->solution = array('assistantSid' => $assistantSid, 'taskSid' => $taskSid, ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Autopilot\V1\Assistant\Task\TaskStatisticsContext Context for this TaskStatisticsInstance */ protected function proxy() { if (!$this->context) { $this->context = new TaskStatisticsContext( $this->version, $this->solution['assistantSid'], $this->solution['taskSid'] ); } return $this->context; } /** * Fetch a TaskStatisticsInstance * * @return TaskStatisticsInstance Fetched TaskStatisticsInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Autopilot.V1.TaskStatisticsInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Autopilot/V1/Assistant/Task/TaskActionsPage.php 0000644 00000002061 15002236443 0021150 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Autopilot\V1\Assistant\Task; use Twilio\Page; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class TaskActionsPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new TaskActionsInstance( $this->version, $payload, $this->solution['assistantSid'], $this->solution['taskSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Autopilot.V1.TaskActionsPage]'; } } sdk/src/Twilio/Rest/Autopilot/V1/Assistant/Task/FieldPage.php 0000644 00000002037 15002236443 0017753 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Autopilot\V1\Assistant\Task; use Twilio\Page; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class FieldPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new FieldInstance( $this->version, $payload, $this->solution['assistantSid'], $this->solution['taskSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Autopilot.V1.FieldPage]'; } } sdk/src/Twilio/Rest/Autopilot/V1/Assistant/Task/SampleInstance.php 0000644 00000012043 15002236443 0021037 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Autopilot\V1\Assistant\Task; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $accountSid * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $taskSid * @property string $language * @property string $assistantSid * @property string $sid * @property string $taggedText * @property string $url * @property string $sourceChannel */ class SampleInstance extends InstanceResource { /** * Initialize the SampleInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $assistantSid The SID of the Assistant that is the parent of * the Task associated with the resource * @param string $taskSid The SID of the Task associated with the resource * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Autopilot\V1\Assistant\Task\SampleInstance */ public function __construct(Version $version, array $payload, $assistantSid, $taskSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'accountSid' => Values::array_get($payload, 'account_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'taskSid' => Values::array_get($payload, 'task_sid'), 'language' => Values::array_get($payload, 'language'), 'assistantSid' => Values::array_get($payload, 'assistant_sid'), 'sid' => Values::array_get($payload, 'sid'), 'taggedText' => Values::array_get($payload, 'tagged_text'), 'url' => Values::array_get($payload, 'url'), 'sourceChannel' => Values::array_get($payload, 'source_channel'), ); $this->solution = array( 'assistantSid' => $assistantSid, 'taskSid' => $taskSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Autopilot\V1\Assistant\Task\SampleContext Context for * this * SampleInstance */ protected function proxy() { if (!$this->context) { $this->context = new SampleContext( $this->version, $this->solution['assistantSid'], $this->solution['taskSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch a SampleInstance * * @return SampleInstance Fetched SampleInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Update the SampleInstance * * @param array|Options $options Optional Arguments * @return SampleInstance Updated SampleInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Deletes the SampleInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Autopilot.V1.SampleInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Autopilot/V1/Assistant/Task/SampleOptions.php 0000644 00000015521 15002236443 0020732 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Autopilot\V1\Assistant\Task; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ abstract class SampleOptions { /** * @param string $language The ISO language-country string that specifies the * language used for the sample * @return ReadSampleOptions Options builder */ public static function read($language = Values::NONE) { return new ReadSampleOptions($language); } /** * @param string $sourceChannel The communication channel from which the new * sample was captured * @return CreateSampleOptions Options builder */ public static function create($sourceChannel = Values::NONE) { return new CreateSampleOptions($sourceChannel); } /** * @param string $language The ISO language-country string that specifies the * language used for the sample * @param string $taggedText The text example of how end users might express * the task * @param string $sourceChannel The communication channel from which the sample * was captured * @return UpdateSampleOptions Options builder */ public static function update($language = Values::NONE, $taggedText = Values::NONE, $sourceChannel = Values::NONE) { return new UpdateSampleOptions($language, $taggedText, $sourceChannel); } } class ReadSampleOptions extends Options { /** * @param string $language The ISO language-country string that specifies the * language used for the sample */ public function __construct($language = Values::NONE) { $this->options['language'] = $language; } /** * The [ISO language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html) string that specifies the language used for the sample. For example: `en-US`. * * @param string $language The ISO language-country string that specifies the * language used for the sample * @return $this Fluent Builder */ public function setLanguage($language) { $this->options['language'] = $language; 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.Autopilot.V1.ReadSampleOptions ' . \implode(' ', $options) . ']'; } } class CreateSampleOptions extends Options { /** * @param string $sourceChannel The communication channel from which the new * sample was captured */ public function __construct($sourceChannel = Values::NONE) { $this->options['sourceChannel'] = $sourceChannel; } /** * The communication channel from which the new sample was captured. Can be: `voice`, `sms`, `chat`, `alexa`, `google-assistant`, `slack`, or null if not included. * * @param string $sourceChannel The communication channel from which the new * sample was captured * @return $this Fluent Builder */ public function setSourceChannel($sourceChannel) { $this->options['sourceChannel'] = $sourceChannel; 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.Autopilot.V1.CreateSampleOptions ' . \implode(' ', $options) . ']'; } } class UpdateSampleOptions extends Options { /** * @param string $language The ISO language-country string that specifies the * language used for the sample * @param string $taggedText The text example of how end users might express * the task * @param string $sourceChannel The communication channel from which the sample * was captured */ public function __construct($language = Values::NONE, $taggedText = Values::NONE, $sourceChannel = Values::NONE) { $this->options['language'] = $language; $this->options['taggedText'] = $taggedText; $this->options['sourceChannel'] = $sourceChannel; } /** * The [ISO language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html) string that specifies the language used for the sample. For example: `en-US`. * * @param string $language The ISO language-country string that specifies the * language used for the sample * @return $this Fluent Builder */ public function setLanguage($language) { $this->options['language'] = $language; return $this; } /** * The text example of how end users might express the task. The sample can contain [Field tag blocks](https://www.twilio.com/docs/autopilot/api/task-sample#field-tagging). * * @param string $taggedText The text example of how end users might express * the task * @return $this Fluent Builder */ public function setTaggedText($taggedText) { $this->options['taggedText'] = $taggedText; return $this; } /** * The communication channel from which the sample was captured. Can be: `voice`, `sms`, `chat`, `alexa`, `google-assistant`, `slack`, or null if not included. * * @param string $sourceChannel The communication channel from which the sample * was captured * @return $this Fluent Builder */ public function setSourceChannel($sourceChannel) { $this->options['sourceChannel'] = $sourceChannel; 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.Autopilot.V1.UpdateSampleOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Autopilot/V1/Assistant/Task/SamplePage.php 0000644 00000002042 15002236443 0020145 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Autopilot\V1\Assistant\Task; use Twilio\Page; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class SamplePage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new SampleInstance( $this->version, $payload, $this->solution['assistantSid'], $this->solution['taskSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Autopilot.V1.SamplePage]'; } } sdk/src/Twilio/Rest/Autopilot/V1/Assistant/DefaultsPage.php 0000644 00000001715 15002236443 0017577 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Autopilot\V1\Assistant; use Twilio\Page; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class DefaultsPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new DefaultsInstance($this->version, $payload, $this->solution['assistantSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Autopilot.V1.DefaultsPage]'; } } sdk/src/Twilio/Rest/Autopilot/V1/Assistant/DialogueList.php 0000644 00000002770 15002236443 0017622 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Autopilot\V1\Assistant; use Twilio\ListResource; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class DialogueList extends ListResource { /** * Construct the DialogueList * * @param Version $version Version that contains the resource * @param string $assistantSid The SID of the Assistant that is the parent of * the resource * @return \Twilio\Rest\Autopilot\V1\Assistant\DialogueList */ public function __construct(Version $version, $assistantSid) { parent::__construct($version); // Path Solution $this->solution = array('assistantSid' => $assistantSid, ); } /** * Constructs a DialogueContext * * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Autopilot\V1\Assistant\DialogueContext */ public function getContext($sid) { return new DialogueContext($this->version, $this->solution['assistantSid'], $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Autopilot.V1.DialogueList]'; } } sdk/src/Twilio/Rest/Autopilot/V1/Assistant/DefaultsContext.php 0000644 00000005205 15002236443 0020345 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Autopilot\V1\Assistant; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class DefaultsContext extends InstanceContext { /** * Initialize the DefaultsContext * * @param \Twilio\Version $version Version that contains the resource * @param string $assistantSid The SID of the Assistant that is the parent of * the resource to fetch * @return \Twilio\Rest\Autopilot\V1\Assistant\DefaultsContext */ public function __construct(Version $version, $assistantSid) { parent::__construct($version); // Path Solution $this->solution = array('assistantSid' => $assistantSid, ); $this->uri = '/Assistants/' . \rawurlencode($assistantSid) . '/Defaults'; } /** * Fetch a DefaultsInstance * * @return DefaultsInstance Fetched DefaultsInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new DefaultsInstance($this->version, $payload, $this->solution['assistantSid']); } /** * Update the DefaultsInstance * * @param array|Options $options Optional Arguments * @return DefaultsInstance Updated DefaultsInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { $options = new Values($options); $data = Values::of(array('Defaults' => Serialize::jsonObject($options['defaults']), )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new DefaultsInstance($this->version, $payload, $this->solution['assistantSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Autopilot.V1.DefaultsContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Autopilot/V1/Assistant/QueryOptions.php 0000644 00000017111 15002236443 0017711 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Autopilot\V1\Assistant; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ abstract class QueryOptions { /** * @param string $language The ISO language-country string that specifies the * language used by the Query resources to read * @param string $modelBuild The SID or unique name of the Model Build to be * queried * @param string $status The status of the resources to read * @return ReadQueryOptions Options builder */ public static function read($language = Values::NONE, $modelBuild = Values::NONE, $status = Values::NONE) { return new ReadQueryOptions($language, $modelBuild, $status); } /** * @param string $tasks The list of tasks to limit the new query to * @param string $modelBuild The SID or unique name of the Model Build to be * queried * @return CreateQueryOptions Options builder */ public static function create($tasks = Values::NONE, $modelBuild = Values::NONE) { return new CreateQueryOptions($tasks, $modelBuild); } /** * @param string $sampleSid The SID of an optional reference to the Sample * created from the query * @param string $status The new status of the resource * @return UpdateQueryOptions Options builder */ public static function update($sampleSid = Values::NONE, $status = Values::NONE) { return new UpdateQueryOptions($sampleSid, $status); } } class ReadQueryOptions extends Options { /** * @param string $language The ISO language-country string that specifies the * language used by the Query resources to read * @param string $modelBuild The SID or unique name of the Model Build to be * queried * @param string $status The status of the resources to read */ public function __construct($language = Values::NONE, $modelBuild = Values::NONE, $status = Values::NONE) { $this->options['language'] = $language; $this->options['modelBuild'] = $modelBuild; $this->options['status'] = $status; } /** * The [ISO language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html) string that specifies the language used by the Query resources to read. For example: `en-US`. * * @param string $language The ISO language-country string that specifies the * language used by the Query resources to read * @return $this Fluent Builder */ public function setLanguage($language) { $this->options['language'] = $language; return $this; } /** * The SID or unique name of the [Model Build](https://www.twilio.com/docs/autopilot/api/model-build) to be queried. * * @param string $modelBuild The SID or unique name of the Model Build to be * queried * @return $this Fluent Builder */ public function setModelBuild($modelBuild) { $this->options['modelBuild'] = $modelBuild; return $this; } /** * The status of the resources to read. Can be: `pending-review`, `reviewed`, or `discarded` * * @param string $status The status of the resources to read * @return $this Fluent Builder */ public function setStatus($status) { $this->options['status'] = $status; 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.Autopilot.V1.ReadQueryOptions ' . \implode(' ', $options) . ']'; } } class CreateQueryOptions extends Options { /** * @param string $tasks The list of tasks to limit the new query to * @param string $modelBuild The SID or unique name of the Model Build to be * queried */ public function __construct($tasks = Values::NONE, $modelBuild = Values::NONE) { $this->options['tasks'] = $tasks; $this->options['modelBuild'] = $modelBuild; } /** * The list of tasks to limit the new query to. Tasks are expressed as a comma-separated list of task `unique_name` values. For example, `task-unique_name-1, task-unique_name-2`. Listing specific tasks is useful to constrain the paths that a user can take. * * @param string $tasks The list of tasks to limit the new query to * @return $this Fluent Builder */ public function setTasks($tasks) { $this->options['tasks'] = $tasks; return $this; } /** * The SID or unique name of the [Model Build](https://www.twilio.com/docs/autopilot/api/model-build) to be queried. * * @param string $modelBuild The SID or unique name of the Model Build to be * queried * @return $this Fluent Builder */ public function setModelBuild($modelBuild) { $this->options['modelBuild'] = $modelBuild; 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.Autopilot.V1.CreateQueryOptions ' . \implode(' ', $options) . ']'; } } class UpdateQueryOptions extends Options { /** * @param string $sampleSid The SID of an optional reference to the Sample * created from the query * @param string $status The new status of the resource */ public function __construct($sampleSid = Values::NONE, $status = Values::NONE) { $this->options['sampleSid'] = $sampleSid; $this->options['status'] = $status; } /** * The SID of an optional reference to the [Sample](https://www.twilio.com/docs/autopilot/api/task-sample) created from the query. * * @param string $sampleSid The SID of an optional reference to the Sample * created from the query * @return $this Fluent Builder */ public function setSampleSid($sampleSid) { $this->options['sampleSid'] = $sampleSid; return $this; } /** * The new status of the resource. Can be: `pending-review`, `reviewed`, or `discarded` * * @param string $status The new status of the resource * @return $this Fluent Builder */ public function setStatus($status) { $this->options['status'] = $status; 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.Autopilot.V1.UpdateQueryOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Autopilot/V1/Assistant/FieldTypePage.php 0000644 00000001720 15002236443 0017711 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Autopilot\V1\Assistant; use Twilio\Page; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class FieldTypePage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new FieldTypeInstance($this->version, $payload, $this->solution['assistantSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Autopilot.V1.FieldTypePage]'; } } sdk/src/Twilio/Rest/Autopilot/V1/Assistant/WebhookPage.php 0000644 00000001712 15002236443 0017423 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Autopilot\V1\Assistant; use Twilio\Page; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class WebhookPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new WebhookInstance($this->version, $payload, $this->solution['assistantSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Autopilot.V1.WebhookPage]'; } } sdk/src/Twilio/Rest/Autopilot/V1/Assistant/FieldTypeOptions.php 0000644 00000010014 15002236443 0020464 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Autopilot\V1\Assistant; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ abstract class FieldTypeOptions { /** * @param string $friendlyName A string to describe the new resource * @return CreateFieldTypeOptions Options builder */ public static function create($friendlyName = Values::NONE) { return new CreateFieldTypeOptions($friendlyName); } /** * @param string $friendlyName A string to describe the resource * @param string $uniqueName An application-defined string that uniquely * identifies the resource * @return UpdateFieldTypeOptions Options builder */ public static function update($friendlyName = Values::NONE, $uniqueName = Values::NONE) { return new UpdateFieldTypeOptions($friendlyName, $uniqueName); } } class CreateFieldTypeOptions extends Options { /** * @param string $friendlyName A string to describe the new resource */ public function __construct($friendlyName = Values::NONE) { $this->options['friendlyName'] = $friendlyName; } /** * A descriptive string that you create to describe the new resource. It is not unique and can be up to 255 characters long. * * @param string $friendlyName A string to describe the new resource * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; 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.Autopilot.V1.CreateFieldTypeOptions ' . \implode(' ', $options) . ']'; } } class UpdateFieldTypeOptions extends Options { /** * @param string $friendlyName A string to describe the resource * @param string $uniqueName An application-defined string that uniquely * identifies the resource */ public function __construct($friendlyName = Values::NONE, $uniqueName = Values::NONE) { $this->options['friendlyName'] = $friendlyName; $this->options['uniqueName'] = $uniqueName; } /** * A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. * * @param string $friendlyName A string to describe the resource * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * An application-defined string that uniquely identifies the resource. It can be used as an alternative to the `sid` in the URL path to address the resource. The first 64 characters must be unique. * * @param string $uniqueName An application-defined string that uniquely * identifies the resource * @return $this Fluent Builder */ public function setUniqueName($uniqueName) { $this->options['uniqueName'] = $uniqueName; 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.Autopilot.V1.UpdateFieldTypeOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Autopilot/V1/Assistant/TaskInstance.php 0000644 00000013227 15002236443 0017623 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Autopilot\V1\Assistant; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $accountSid * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $friendlyName * @property array $links * @property string $assistantSid * @property string $sid * @property string $uniqueName * @property string $actionsUrl * @property string $url */ class TaskInstance extends InstanceResource { protected $_fields = null; protected $_samples = null; protected $_taskActions = null; protected $_statistics = null; /** * Initialize the TaskInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $assistantSid The SID of the Assistant that is the parent of * the resource * @param string $sid The unique string that identifies the resource to fetch * @return \Twilio\Rest\Autopilot\V1\Assistant\TaskInstance */ public function __construct(Version $version, array $payload, $assistantSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'accountSid' => Values::array_get($payload, 'account_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'links' => Values::array_get($payload, 'links'), 'assistantSid' => Values::array_get($payload, 'assistant_sid'), 'sid' => Values::array_get($payload, 'sid'), 'uniqueName' => Values::array_get($payload, 'unique_name'), 'actionsUrl' => Values::array_get($payload, 'actions_url'), 'url' => Values::array_get($payload, 'url'), ); $this->solution = array('assistantSid' => $assistantSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Autopilot\V1\Assistant\TaskContext Context for this * TaskInstance */ protected function proxy() { if (!$this->context) { $this->context = new TaskContext( $this->version, $this->solution['assistantSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch a TaskInstance * * @return TaskInstance Fetched TaskInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Update the TaskInstance * * @param array|Options $options Optional Arguments * @return TaskInstance Updated TaskInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Deletes the TaskInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Access the fields * * @return \Twilio\Rest\Autopilot\V1\Assistant\Task\FieldList */ protected function getFields() { return $this->proxy()->fields; } /** * Access the samples * * @return \Twilio\Rest\Autopilot\V1\Assistant\Task\SampleList */ protected function getSamples() { return $this->proxy()->samples; } /** * Access the taskActions * * @return \Twilio\Rest\Autopilot\V1\Assistant\Task\TaskActionsList */ protected function getTaskActions() { return $this->proxy()->taskActions; } /** * Access the statistics * * @return \Twilio\Rest\Autopilot\V1\Assistant\Task\TaskStatisticsList */ protected function getStatistics() { return $this->proxy()->statistics; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Autopilot.V1.TaskInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Autopilot/V1/Assistant/ModelBuildList.php 0000644 00000013647 15002236443 0020116 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Autopilot\V1\Assistant; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class ModelBuildList extends ListResource { /** * Construct the ModelBuildList * * @param Version $version Version that contains the resource * @param string $assistantSid The SID of the Assistant that is the parent of * the resource * @return \Twilio\Rest\Autopilot\V1\Assistant\ModelBuildList */ public function __construct(Version $version, $assistantSid) { parent::__construct($version); // Path Solution $this->solution = array('assistantSid' => $assistantSid, ); $this->uri = '/Assistants/' . \rawurlencode($assistantSid) . '/ModelBuilds'; } /** * Streams ModelBuildInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads ModelBuildInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return ModelBuildInstance[] Array of results */ public function read($limit = null, $pageSize = null) { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of ModelBuildInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of ModelBuildInstance */ public function page($pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $params = Values::of(array( 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new ModelBuildPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of ModelBuildInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of ModelBuildInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new ModelBuildPage($this->version, $response, $this->solution); } /** * Create a new ModelBuildInstance * * @param array|Options $options Optional Arguments * @return ModelBuildInstance Newly created ModelBuildInstance * @throws TwilioException When an HTTP error occurs. */ public function create($options = array()) { $options = new Values($options); $data = Values::of(array( 'StatusCallback' => $options['statusCallback'], 'UniqueName' => $options['uniqueName'], )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new ModelBuildInstance($this->version, $payload, $this->solution['assistantSid']); } /** * Constructs a ModelBuildContext * * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Autopilot\V1\Assistant\ModelBuildContext */ public function getContext($sid) { return new ModelBuildContext($this->version, $this->solution['assistantSid'], $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Autopilot.V1.ModelBuildList]'; } } sdk/src/Twilio/Rest/Autopilot/V1/Assistant/WebhookList.php 0000644 00000014440 15002236443 0017464 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Autopilot\V1\Assistant; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class WebhookList extends ListResource { /** * Construct the WebhookList * * @param Version $version Version that contains the resource * @param string $assistantSid The SID of the Assistant that is the parent of * the resource * @return \Twilio\Rest\Autopilot\V1\Assistant\WebhookList */ public function __construct(Version $version, $assistantSid) { parent::__construct($version); // Path Solution $this->solution = array('assistantSid' => $assistantSid, ); $this->uri = '/Assistants/' . \rawurlencode($assistantSid) . '/Webhooks'; } /** * Streams WebhookInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads WebhookInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return WebhookInstance[] Array of results */ public function read($limit = null, $pageSize = null) { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of WebhookInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of WebhookInstance */ public function page($pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $params = Values::of(array( 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new WebhookPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of WebhookInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of WebhookInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new WebhookPage($this->version, $response, $this->solution); } /** * Create a new WebhookInstance * * @param string $uniqueName An application-defined string that uniquely * identifies the resource * @param string $events The list of space-separated events that this Webhook * will subscribe to. * @param string $webhookUrl The URL associated with this Webhook. * @param array|Options $options Optional Arguments * @return WebhookInstance Newly created WebhookInstance * @throws TwilioException When an HTTP error occurs. */ public function create($uniqueName, $events, $webhookUrl, $options = array()) { $options = new Values($options); $data = Values::of(array( 'UniqueName' => $uniqueName, 'Events' => $events, 'WebhookUrl' => $webhookUrl, 'WebhookMethod' => $options['webhookMethod'], )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new WebhookInstance($this->version, $payload, $this->solution['assistantSid']); } /** * Constructs a WebhookContext * * @param string $sid The unique string that identifies the resource to fetch * @return \Twilio\Rest\Autopilot\V1\Assistant\WebhookContext */ public function getContext($sid) { return new WebhookContext($this->version, $this->solution['assistantSid'], $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Autopilot.V1.WebhookList]'; } } sdk/src/Twilio/Rest/Autopilot/V1/Assistant/ModelBuildPage.php 0000644 00000001723 15002236443 0020047 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Autopilot\V1\Assistant; use Twilio\Page; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class ModelBuildPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new ModelBuildInstance($this->version, $payload, $this->solution['assistantSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Autopilot.V1.ModelBuildPage]'; } } sdk/src/Twilio/Rest/Autopilot/V1/Assistant/TaskList.php 0000644 00000014105 15002236443 0016766 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Autopilot\V1\Assistant; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class TaskList extends ListResource { /** * Construct the TaskList * * @param Version $version Version that contains the resource * @param string $assistantSid The SID of the Assistant that is the parent of * the resource * @return \Twilio\Rest\Autopilot\V1\Assistant\TaskList */ public function __construct(Version $version, $assistantSid) { parent::__construct($version); // Path Solution $this->solution = array('assistantSid' => $assistantSid, ); $this->uri = '/Assistants/' . \rawurlencode($assistantSid) . '/Tasks'; } /** * Streams TaskInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads TaskInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return TaskInstance[] Array of results */ public function read($limit = null, $pageSize = null) { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of TaskInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of TaskInstance */ public function page($pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $params = Values::of(array( 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new TaskPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of TaskInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of TaskInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new TaskPage($this->version, $response, $this->solution); } /** * Create a new TaskInstance * * @param string $uniqueName An application-defined string that uniquely * identifies the resource * @param array|Options $options Optional Arguments * @return TaskInstance Newly created TaskInstance * @throws TwilioException When an HTTP error occurs. */ public function create($uniqueName, $options = array()) { $options = new Values($options); $data = Values::of(array( 'UniqueName' => $uniqueName, 'FriendlyName' => $options['friendlyName'], 'Actions' => Serialize::jsonObject($options['actions']), 'ActionsUrl' => $options['actionsUrl'], )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new TaskInstance($this->version, $payload, $this->solution['assistantSid']); } /** * Constructs a TaskContext * * @param string $sid The unique string that identifies the resource to fetch * @return \Twilio\Rest\Autopilot\V1\Assistant\TaskContext */ public function getContext($sid) { return new TaskContext($this->version, $this->solution['assistantSid'], $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Autopilot.V1.TaskList]'; } } sdk/src/Twilio/Rest/Autopilot/V1/Assistant/QueryInstance.php 0000644 00000011770 15002236443 0020027 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Autopilot\V1\Assistant; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $accountSid * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property array $results * @property string $language * @property string $modelBuildSid * @property string $query * @property string $sampleSid * @property string $assistantSid * @property string $sid * @property string $status * @property string $url * @property string $sourceChannel */ class QueryInstance extends InstanceResource { /** * Initialize the QueryInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $assistantSid The SID of the Assistant that is the parent of * the resource * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Autopilot\V1\Assistant\QueryInstance */ public function __construct(Version $version, array $payload, $assistantSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'accountSid' => Values::array_get($payload, 'account_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'results' => Values::array_get($payload, 'results'), 'language' => Values::array_get($payload, 'language'), 'modelBuildSid' => Values::array_get($payload, 'model_build_sid'), 'query' => Values::array_get($payload, 'query'), 'sampleSid' => Values::array_get($payload, 'sample_sid'), 'assistantSid' => Values::array_get($payload, 'assistant_sid'), 'sid' => Values::array_get($payload, 'sid'), 'status' => Values::array_get($payload, 'status'), 'url' => Values::array_get($payload, 'url'), 'sourceChannel' => Values::array_get($payload, 'source_channel'), ); $this->solution = array('assistantSid' => $assistantSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Autopilot\V1\Assistant\QueryContext Context for this * QueryInstance */ protected function proxy() { if (!$this->context) { $this->context = new QueryContext( $this->version, $this->solution['assistantSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch a QueryInstance * * @return QueryInstance Fetched QueryInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Update the QueryInstance * * @param array|Options $options Optional Arguments * @return QueryInstance Updated QueryInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Deletes the QueryInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Autopilot.V1.QueryInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Autopilot/V1/Assistant/ModelBuildOptions.php 0000644 00000011134 15002236443 0020623 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Autopilot\V1\Assistant; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ abstract class ModelBuildOptions { /** * @param string $statusCallback The URL we should call using a POST method to * send status information to your application * @param string $uniqueName An application-defined string that uniquely * identifies the new resource * @return CreateModelBuildOptions Options builder */ public static function create($statusCallback = Values::NONE, $uniqueName = Values::NONE) { return new CreateModelBuildOptions($statusCallback, $uniqueName); } /** * @param string $uniqueName An application-defined string that uniquely * identifies the resource * @return UpdateModelBuildOptions Options builder */ public static function update($uniqueName = Values::NONE) { return new UpdateModelBuildOptions($uniqueName); } } class CreateModelBuildOptions extends Options { /** * @param string $statusCallback The URL we should call using a POST method to * send status information to your application * @param string $uniqueName An application-defined string that uniquely * identifies the new resource */ public function __construct($statusCallback = Values::NONE, $uniqueName = Values::NONE) { $this->options['statusCallback'] = $statusCallback; $this->options['uniqueName'] = $uniqueName; } /** * The URL we should call using a POST method to send status information to your application. * * @param string $statusCallback The URL we should call using a POST method to * send status information to your application * @return $this Fluent Builder */ public function setStatusCallback($statusCallback) { $this->options['statusCallback'] = $statusCallback; return $this; } /** * An application-defined string that uniquely identifies the new resource. This value must be a unique string of no more than 64 characters. It can be used as an alternative to the `sid` in the URL path to address the resource. * * @param string $uniqueName An application-defined string that uniquely * identifies the new resource * @return $this Fluent Builder */ public function setUniqueName($uniqueName) { $this->options['uniqueName'] = $uniqueName; 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.Autopilot.V1.CreateModelBuildOptions ' . \implode(' ', $options) . ']'; } } class UpdateModelBuildOptions extends Options { /** * @param string $uniqueName An application-defined string that uniquely * identifies the resource */ public function __construct($uniqueName = Values::NONE) { $this->options['uniqueName'] = $uniqueName; } /** * An application-defined string that uniquely identifies the resource. This value must be a unique string of no more than 64 characters. It can be used as an alternative to the `sid` in the URL path to address the resource. * * @param string $uniqueName An application-defined string that uniquely * identifies the resource * @return $this Fluent Builder */ public function setUniqueName($uniqueName) { $this->options['uniqueName'] = $uniqueName; 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.Autopilot.V1.UpdateModelBuildOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Autopilot/V1/Assistant/StyleSheetList.php 0000644 00000002663 15002236443 0020163 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Autopilot\V1\Assistant; use Twilio\ListResource; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class StyleSheetList extends ListResource { /** * Construct the StyleSheetList * * @param Version $version Version that contains the resource * @param string $assistantSid The SID of the Assistant that is the parent of * the resource * @return \Twilio\Rest\Autopilot\V1\Assistant\StyleSheetList */ public function __construct(Version $version, $assistantSid) { parent::__construct($version); // Path Solution $this->solution = array('assistantSid' => $assistantSid, ); } /** * Constructs a StyleSheetContext * * @return \Twilio\Rest\Autopilot\V1\Assistant\StyleSheetContext */ public function getContext() { return new StyleSheetContext($this->version, $this->solution['assistantSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Autopilot.V1.StyleSheetList]'; } } sdk/src/Twilio/Rest/Autopilot/V1/Assistant/ExportAssistantPage.php 0000644 00000001742 15002236443 0021203 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Autopilot\V1\Assistant; use Twilio\Page; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class ExportAssistantPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new ExportAssistantInstance($this->version, $payload, $this->solution['assistantSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Autopilot.V1.ExportAssistantPage]'; } } sdk/src/Twilio/Rest/Autopilot/V1/Assistant/TaskPage.php 0000644 00000001701 15002236443 0016725 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Autopilot\V1\Assistant; use Twilio\Page; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class TaskPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new TaskInstance($this->version, $payload, $this->solution['assistantSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Autopilot.V1.TaskPage]'; } } sdk/src/Twilio/Rest/Autopilot/V1/Assistant/DialogueInstance.php 0000644 00000007070 15002236443 0020451 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Autopilot\V1\Assistant; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $accountSid * @property string $assistantSid * @property string $sid * @property array $data * @property string $url */ class DialogueInstance extends InstanceResource { /** * Initialize the DialogueInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $assistantSid The SID of the Assistant that is the parent of * the resource * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Autopilot\V1\Assistant\DialogueInstance */ public function __construct(Version $version, array $payload, $assistantSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'accountSid' => Values::array_get($payload, 'account_sid'), 'assistantSid' => Values::array_get($payload, 'assistant_sid'), 'sid' => Values::array_get($payload, 'sid'), 'data' => Values::array_get($payload, 'data'), 'url' => Values::array_get($payload, 'url'), ); $this->solution = array('assistantSid' => $assistantSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Autopilot\V1\Assistant\DialogueContext Context for this * DialogueInstance */ protected function proxy() { if (!$this->context) { $this->context = new DialogueContext( $this->version, $this->solution['assistantSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch a DialogueInstance * * @return DialogueInstance Fetched DialogueInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Autopilot.V1.DialogueInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Autopilot/V1/Assistant/StyleSheetContext.php 0000644 00000005235 15002236443 0020672 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Autopilot\V1\Assistant; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class StyleSheetContext extends InstanceContext { /** * Initialize the StyleSheetContext * * @param \Twilio\Version $version Version that contains the resource * @param string $assistantSid The SID of the Assistant with the StyleSheet * resource to fetch * @return \Twilio\Rest\Autopilot\V1\Assistant\StyleSheetContext */ public function __construct(Version $version, $assistantSid) { parent::__construct($version); // Path Solution $this->solution = array('assistantSid' => $assistantSid, ); $this->uri = '/Assistants/' . \rawurlencode($assistantSid) . '/StyleSheet'; } /** * Fetch a StyleSheetInstance * * @return StyleSheetInstance Fetched StyleSheetInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new StyleSheetInstance($this->version, $payload, $this->solution['assistantSid']); } /** * Update the StyleSheetInstance * * @param array|Options $options Optional Arguments * @return StyleSheetInstance Updated StyleSheetInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { $options = new Values($options); $data = Values::of(array('StyleSheet' => Serialize::jsonObject($options['styleSheet']), )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new StyleSheetInstance($this->version, $payload, $this->solution['assistantSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Autopilot.V1.StyleSheetContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Autopilot/V1/Assistant/WebhookContext.php 0000644 00000006475 15002236443 0020206 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Autopilot\V1\Assistant; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class WebhookContext extends InstanceContext { /** * Initialize the WebhookContext * * @param \Twilio\Version $version Version that contains the resource * @param string $assistantSid The SID of the Assistant that is the parent of * the resource to fetch * @param string $sid The unique string that identifies the resource to fetch * @return \Twilio\Rest\Autopilot\V1\Assistant\WebhookContext */ public function __construct(Version $version, $assistantSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array('assistantSid' => $assistantSid, 'sid' => $sid, ); $this->uri = '/Assistants/' . \rawurlencode($assistantSid) . '/Webhooks/' . \rawurlencode($sid) . ''; } /** * Fetch a WebhookInstance * * @return WebhookInstance Fetched WebhookInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new WebhookInstance( $this->version, $payload, $this->solution['assistantSid'], $this->solution['sid'] ); } /** * Update the WebhookInstance * * @param array|Options $options Optional Arguments * @return WebhookInstance Updated WebhookInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { $options = new Values($options); $data = Values::of(array( 'UniqueName' => $options['uniqueName'], 'Events' => $options['events'], 'WebhookUrl' => $options['webhookUrl'], 'WebhookMethod' => $options['webhookMethod'], )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new WebhookInstance( $this->version, $payload, $this->solution['assistantSid'], $this->solution['sid'] ); } /** * Deletes the WebhookInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Autopilot.V1.WebhookContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Autopilot/V1/Assistant/FieldTypeInstance.php 0000644 00000011757 15002236443 0020614 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Autopilot\V1\Assistant; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $accountSid * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $friendlyName * @property array $links * @property string $assistantSid * @property string $sid * @property string $uniqueName * @property string $url */ class FieldTypeInstance extends InstanceResource { protected $_fieldValues = null; /** * Initialize the FieldTypeInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $assistantSid The SID of the Assistant that is the parent of * the resource * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Autopilot\V1\Assistant\FieldTypeInstance */ public function __construct(Version $version, array $payload, $assistantSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'accountSid' => Values::array_get($payload, 'account_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'links' => Values::array_get($payload, 'links'), 'assistantSid' => Values::array_get($payload, 'assistant_sid'), 'sid' => Values::array_get($payload, 'sid'), 'uniqueName' => Values::array_get($payload, 'unique_name'), 'url' => Values::array_get($payload, 'url'), ); $this->solution = array('assistantSid' => $assistantSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Autopilot\V1\Assistant\FieldTypeContext Context for * this * FieldTypeInstance */ protected function proxy() { if (!$this->context) { $this->context = new FieldTypeContext( $this->version, $this->solution['assistantSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch a FieldTypeInstance * * @return FieldTypeInstance Fetched FieldTypeInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Update the FieldTypeInstance * * @param array|Options $options Optional Arguments * @return FieldTypeInstance Updated FieldTypeInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Deletes the FieldTypeInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Access the fieldValues * * @return \Twilio\Rest\Autopilot\V1\Assistant\FieldType\FieldValueList */ protected function getFieldValues() { return $this->proxy()->fieldValues; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Autopilot.V1.FieldTypeInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Autopilot/V1/Assistant/FieldType/FieldValuePage.php 0000644 00000002070 15002236443 0021730 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Autopilot\V1\Assistant\FieldType; use Twilio\Page; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class FieldValuePage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new FieldValueInstance( $this->version, $payload, $this->solution['assistantSid'], $this->solution['fieldTypeSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Autopilot.V1.FieldValuePage]'; } } sdk/src/Twilio/Rest/Autopilot/V1/Assistant/FieldType/FieldValueList.php 0000644 00000015631 15002236443 0021776 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Autopilot\V1\Assistant\FieldType; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class FieldValueList extends ListResource { /** * Construct the FieldValueList * * @param Version $version Version that contains the resource * @param string $assistantSid The SID of the Assistant that is the parent of * the FieldType associated with the resource * @param string $fieldTypeSid The SID of the Field Type associated with the * Field Value * @return \Twilio\Rest\Autopilot\V1\Assistant\FieldType\FieldValueList */ public function __construct(Version $version, $assistantSid, $fieldTypeSid) { parent::__construct($version); // Path Solution $this->solution = array('assistantSid' => $assistantSid, 'fieldTypeSid' => $fieldTypeSid, ); $this->uri = '/Assistants/' . \rawurlencode($assistantSid) . '/FieldTypes/' . \rawurlencode($fieldTypeSid) . '/FieldValues'; } /** * Streams FieldValueInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($options = array(), $limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads FieldValueInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return FieldValueInstance[] Array of results */ public function read($options = array(), $limit = null, $pageSize = null) { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Retrieve a single page of FieldValueInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of FieldValueInstance */ public function page($options = array(), $pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $options = new Values($options); $params = Values::of(array( 'Language' => $options['language'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new FieldValuePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of FieldValueInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of FieldValueInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new FieldValuePage($this->version, $response, $this->solution); } /** * Create a new FieldValueInstance * * @param string $language The ISO language-country tag that identifies the * language of the value * @param string $value The Field Value data * @param array|Options $options Optional Arguments * @return FieldValueInstance Newly created FieldValueInstance * @throws TwilioException When an HTTP error occurs. */ public function create($language, $value, $options = array()) { $options = new Values($options); $data = Values::of(array( 'Language' => $language, 'Value' => $value, 'SynonymOf' => $options['synonymOf'], )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new FieldValueInstance( $this->version, $payload, $this->solution['assistantSid'], $this->solution['fieldTypeSid'] ); } /** * Constructs a FieldValueContext * * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Autopilot\V1\Assistant\FieldType\FieldValueContext */ public function getContext($sid) { return new FieldValueContext( $this->version, $this->solution['assistantSid'], $this->solution['fieldTypeSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Autopilot.V1.FieldValueList]'; } } sdk/src/Twilio/Rest/Autopilot/V1/Assistant/FieldType/FieldValueOptions.php 0000644 00000006726 15002236443 0022523 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Autopilot\V1\Assistant\FieldType; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ abstract class FieldValueOptions { /** * @param string $language The ISO language-country tag that identifies the * language of the value * @return ReadFieldValueOptions Options builder */ public static function read($language = Values::NONE) { return new ReadFieldValueOptions($language); } /** * @param string $synonymOf The string value that indicates which word the * field value is a synonym of * @return CreateFieldValueOptions Options builder */ public static function create($synonymOf = Values::NONE) { return new CreateFieldValueOptions($synonymOf); } } class ReadFieldValueOptions extends Options { /** * @param string $language The ISO language-country tag that identifies the * language of the value */ public function __construct($language = Values::NONE) { $this->options['language'] = $language; } /** * The [ISO language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html) tag that specifies the language of the value. Currently supported tags: `en-US` * * @param string $language The ISO language-country tag that identifies the * language of the value * @return $this Fluent Builder */ public function setLanguage($language) { $this->options['language'] = $language; 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.Autopilot.V1.ReadFieldValueOptions ' . \implode(' ', $options) . ']'; } } class CreateFieldValueOptions extends Options { /** * @param string $synonymOf The string value that indicates which word the * field value is a synonym of */ public function __construct($synonymOf = Values::NONE) { $this->options['synonymOf'] = $synonymOf; } /** * The string value that indicates which word the field value is a synonym of. * * @param string $synonymOf The string value that indicates which word the * field value is a synonym of * @return $this Fluent Builder */ public function setSynonymOf($synonymOf) { $this->options['synonymOf'] = $synonymOf; 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.Autopilot.V1.CreateFieldValueOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Autopilot/V1/Assistant/FieldType/FieldValueInstance.php 0000644 00000011264 15002236443 0022625 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Autopilot\V1\Assistant\FieldType; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $accountSid * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $fieldTypeSid * @property string $language * @property string $assistantSid * @property string $sid * @property string $value * @property string $url * @property string $synonymOf */ class FieldValueInstance extends InstanceResource { /** * Initialize the FieldValueInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $assistantSid The SID of the Assistant that is the parent of * the FieldType associated with the resource * @param string $fieldTypeSid The SID of the Field Type associated with the * Field Value * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Autopilot\V1\Assistant\FieldType\FieldValueInstance */ public function __construct(Version $version, array $payload, $assistantSid, $fieldTypeSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'accountSid' => Values::array_get($payload, 'account_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'fieldTypeSid' => Values::array_get($payload, 'field_type_sid'), 'language' => Values::array_get($payload, 'language'), 'assistantSid' => Values::array_get($payload, 'assistant_sid'), 'sid' => Values::array_get($payload, 'sid'), 'value' => Values::array_get($payload, 'value'), 'url' => Values::array_get($payload, 'url'), 'synonymOf' => Values::array_get($payload, 'synonym_of'), ); $this->solution = array( 'assistantSid' => $assistantSid, 'fieldTypeSid' => $fieldTypeSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Autopilot\V1\Assistant\FieldType\FieldValueContext Context for this FieldValueInstance */ protected function proxy() { if (!$this->context) { $this->context = new FieldValueContext( $this->version, $this->solution['assistantSid'], $this->solution['fieldTypeSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch a FieldValueInstance * * @return FieldValueInstance Fetched FieldValueInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the FieldValueInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Autopilot.V1.FieldValueInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Autopilot/V1/Assistant/FieldType/FieldValueContext.php 0000644 00000005533 15002236443 0022507 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Autopilot\V1\Assistant\FieldType; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class FieldValueContext extends InstanceContext { /** * Initialize the FieldValueContext * * @param \Twilio\Version $version Version that contains the resource * @param string $assistantSid The SID of the Assistant that is the parent of * the FieldType associated with the resource to * fetch * @param string $fieldTypeSid The SID of the Field Type associated with the * Field Value to fetch * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Autopilot\V1\Assistant\FieldType\FieldValueContext */ public function __construct(Version $version, $assistantSid, $fieldTypeSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array( 'assistantSid' => $assistantSid, 'fieldTypeSid' => $fieldTypeSid, 'sid' => $sid, ); $this->uri = '/Assistants/' . \rawurlencode($assistantSid) . '/FieldTypes/' . \rawurlencode($fieldTypeSid) . '/FieldValues/' . \rawurlencode($sid) . ''; } /** * Fetch a FieldValueInstance * * @return FieldValueInstance Fetched FieldValueInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new FieldValueInstance( $this->version, $payload, $this->solution['assistantSid'], $this->solution['fieldTypeSid'], $this->solution['sid'] ); } /** * Deletes the FieldValueInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Autopilot.V1.FieldValueContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Autopilot/V1/Assistant/DefaultsOptions.php 0000644 00000003426 15002236443 0020357 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Autopilot\V1\Assistant; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ abstract class DefaultsOptions { /** * @param array $defaults A JSON string that describes the default task links. * @return UpdateDefaultsOptions Options builder */ public static function update($defaults = Values::NONE) { return new UpdateDefaultsOptions($defaults); } } class UpdateDefaultsOptions extends Options { /** * @param array $defaults A JSON string that describes the default task links. */ public function __construct($defaults = Values::NONE) { $this->options['defaults'] = $defaults; } /** * A JSON string that describes the default task links for the `assistant_initiation`, `collect`, and `fallback` situations. * * @param array $defaults A JSON string that describes the default task links. * @return $this Fluent Builder */ public function setDefaults($defaults) { $this->options['defaults'] = $defaults; 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.Autopilot.V1.UpdateDefaultsOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Autopilot/V1/Assistant/DialogueContext.php 0000644 00000004226 15002236443 0020331 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Autopilot\V1\Assistant; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class DialogueContext extends InstanceContext { /** * Initialize the DialogueContext * * @param \Twilio\Version $version Version that contains the resource * @param string $assistantSid The SID of the Assistant that is the parent of * the resource to fetch * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Autopilot\V1\Assistant\DialogueContext */ public function __construct(Version $version, $assistantSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array('assistantSid' => $assistantSid, 'sid' => $sid, ); $this->uri = '/Assistants/' . \rawurlencode($assistantSid) . '/Dialogues/' . \rawurlencode($sid) . ''; } /** * Fetch a DialogueInstance * * @return DialogueInstance Fetched DialogueInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new DialogueInstance( $this->version, $payload, $this->solution['assistantSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Autopilot.V1.DialogueContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Autopilot/V1/Assistant/QueryList.php 0000644 00000015010 15002236443 0017165 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Autopilot\V1\Assistant; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class QueryList extends ListResource { /** * Construct the QueryList * * @param Version $version Version that contains the resource * @param string $assistantSid The SID of the Assistant that is the parent of * the resource * @return \Twilio\Rest\Autopilot\V1\Assistant\QueryList */ public function __construct(Version $version, $assistantSid) { parent::__construct($version); // Path Solution $this->solution = array('assistantSid' => $assistantSid, ); $this->uri = '/Assistants/' . \rawurlencode($assistantSid) . '/Queries'; } /** * Streams QueryInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($options = array(), $limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads QueryInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return QueryInstance[] Array of results */ public function read($options = array(), $limit = null, $pageSize = null) { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Retrieve a single page of QueryInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of QueryInstance */ public function page($options = array(), $pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $options = new Values($options); $params = Values::of(array( 'Language' => $options['language'], 'ModelBuild' => $options['modelBuild'], 'Status' => $options['status'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new QueryPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of QueryInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of QueryInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new QueryPage($this->version, $response, $this->solution); } /** * Create a new QueryInstance * * @param string $language The ISO language-country string that specifies the * language used for the new query * @param string $query The end-user's natural language input * @param array|Options $options Optional Arguments * @return QueryInstance Newly created QueryInstance * @throws TwilioException When an HTTP error occurs. */ public function create($language, $query, $options = array()) { $options = new Values($options); $data = Values::of(array( 'Language' => $language, 'Query' => $query, 'Tasks' => $options['tasks'], 'ModelBuild' => $options['modelBuild'], )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new QueryInstance($this->version, $payload, $this->solution['assistantSid']); } /** * Constructs a QueryContext * * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Autopilot\V1\Assistant\QueryContext */ public function getContext($sid) { return new QueryContext($this->version, $this->solution['assistantSid'], $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Autopilot.V1.QueryList]'; } } sdk/src/Twilio/Rest/Autopilot/V1/Assistant/FieldTypeContext.php 0000644 00000012026 15002236443 0020462 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Autopilot\V1\Assistant; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Rest\Autopilot\V1\Assistant\FieldType\FieldValueList; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property \Twilio\Rest\Autopilot\V1\Assistant\FieldType\FieldValueList $fieldValues * @method \Twilio\Rest\Autopilot\V1\Assistant\FieldType\FieldValueContext fieldValues(string $sid) */ class FieldTypeContext extends InstanceContext { protected $_fieldValues = null; /** * Initialize the FieldTypeContext * * @param \Twilio\Version $version Version that contains the resource * @param string $assistantSid The SID of the Assistant that is the parent of * the resource to fetch * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Autopilot\V1\Assistant\FieldTypeContext */ public function __construct(Version $version, $assistantSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array('assistantSid' => $assistantSid, 'sid' => $sid, ); $this->uri = '/Assistants/' . \rawurlencode($assistantSid) . '/FieldTypes/' . \rawurlencode($sid) . ''; } /** * Fetch a FieldTypeInstance * * @return FieldTypeInstance Fetched FieldTypeInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new FieldTypeInstance( $this->version, $payload, $this->solution['assistantSid'], $this->solution['sid'] ); } /** * Update the FieldTypeInstance * * @param array|Options $options Optional Arguments * @return FieldTypeInstance Updated FieldTypeInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { $options = new Values($options); $data = Values::of(array( 'FriendlyName' => $options['friendlyName'], 'UniqueName' => $options['uniqueName'], )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new FieldTypeInstance( $this->version, $payload, $this->solution['assistantSid'], $this->solution['sid'] ); } /** * Deletes the FieldTypeInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Access the fieldValues * * @return \Twilio\Rest\Autopilot\V1\Assistant\FieldType\FieldValueList */ protected function getFieldValues() { if (!$this->_fieldValues) { $this->_fieldValues = new FieldValueList( $this->version, $this->solution['assistantSid'], $this->solution['sid'] ); } return $this->_fieldValues; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get($name) { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Autopilot.V1.FieldTypeContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Autopilot/V1/Assistant/ModelBuildContext.php 0000644 00000006257 15002236443 0020626 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Autopilot\V1\Assistant; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class ModelBuildContext extends InstanceContext { /** * Initialize the ModelBuildContext * * @param \Twilio\Version $version Version that contains the resource * @param string $assistantSid The SID of the Assistant that is the parent of * the resource to fetch * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Autopilot\V1\Assistant\ModelBuildContext */ public function __construct(Version $version, $assistantSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array('assistantSid' => $assistantSid, 'sid' => $sid, ); $this->uri = '/Assistants/' . \rawurlencode($assistantSid) . '/ModelBuilds/' . \rawurlencode($sid) . ''; } /** * Fetch a ModelBuildInstance * * @return ModelBuildInstance Fetched ModelBuildInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new ModelBuildInstance( $this->version, $payload, $this->solution['assistantSid'], $this->solution['sid'] ); } /** * Update the ModelBuildInstance * * @param array|Options $options Optional Arguments * @return ModelBuildInstance Updated ModelBuildInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { $options = new Values($options); $data = Values::of(array('UniqueName' => $options['uniqueName'], )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new ModelBuildInstance( $this->version, $payload, $this->solution['assistantSid'], $this->solution['sid'] ); } /** * Deletes the ModelBuildInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Autopilot.V1.ModelBuildContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Autopilot/V1/Assistant/DefaultsList.php 0000644 00000002645 15002236443 0017641 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Autopilot\V1\Assistant; use Twilio\ListResource; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class DefaultsList extends ListResource { /** * Construct the DefaultsList * * @param Version $version Version that contains the resource * @param string $assistantSid The SID of the Assistant that is the parent of * the resource * @return \Twilio\Rest\Autopilot\V1\Assistant\DefaultsList */ public function __construct(Version $version, $assistantSid) { parent::__construct($version); // Path Solution $this->solution = array('assistantSid' => $assistantSid, ); } /** * Constructs a DefaultsContext * * @return \Twilio\Rest\Autopilot\V1\Assistant\DefaultsContext */ public function getContext() { return new DefaultsContext($this->version, $this->solution['assistantSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Autopilot.V1.DefaultsList]'; } } sdk/src/Twilio/Rest/Autopilot/V1/Assistant/StyleSheetInstance.php 0000644 00000007322 15002236443 0021011 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Autopilot\V1\Assistant; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $accountSid * @property string $assistantSid * @property string $url * @property array $data */ class StyleSheetInstance extends InstanceResource { /** * Initialize the StyleSheetInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $assistantSid The SID of the Assistant that is the parent of * the resource * @return \Twilio\Rest\Autopilot\V1\Assistant\StyleSheetInstance */ public function __construct(Version $version, array $payload, $assistantSid) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'accountSid' => Values::array_get($payload, 'account_sid'), 'assistantSid' => Values::array_get($payload, 'assistant_sid'), 'url' => Values::array_get($payload, 'url'), 'data' => Values::array_get($payload, 'data'), ); $this->solution = array('assistantSid' => $assistantSid, ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Autopilot\V1\Assistant\StyleSheetContext Context for * this * StyleSheetInstance */ protected function proxy() { if (!$this->context) { $this->context = new StyleSheetContext($this->version, $this->solution['assistantSid']); } return $this->context; } /** * Fetch a StyleSheetInstance * * @return StyleSheetInstance Fetched StyleSheetInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Update the StyleSheetInstance * * @param array|Options $options Optional Arguments * @return StyleSheetInstance Updated StyleSheetInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Autopilot.V1.StyleSheetInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Autopilot/V1/Assistant/ExportAssistantInstance.php 0000644 00000007313 15002236443 0022073 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Autopilot\V1\Assistant; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $accountSid * @property string $assistantSid * @property \DateTime $dateCreated * @property string $status * @property int $errorCode * @property string $url * @property array $schema */ class ExportAssistantInstance extends InstanceResource { /** * Initialize the ExportAssistantInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $assistantSid The SID of the Assistant to export. * @return \Twilio\Rest\Autopilot\V1\Assistant\ExportAssistantInstance */ public function __construct(Version $version, array $payload, $assistantSid) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'accountSid' => Values::array_get($payload, 'account_sid'), 'assistantSid' => Values::array_get($payload, 'assistant_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'status' => Values::array_get($payload, 'status'), 'errorCode' => Values::array_get($payload, 'error_code'), 'url' => Values::array_get($payload, 'url'), 'schema' => Values::array_get($payload, 'schema'), ); $this->solution = array('assistantSid' => $assistantSid, ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Autopilot\V1\Assistant\ExportAssistantContext Context * for this * ExportAssistantInstance */ protected function proxy() { if (!$this->context) { $this->context = new ExportAssistantContext($this->version, $this->solution['assistantSid']); } return $this->context; } /** * Fetch a ExportAssistantInstance * * @return ExportAssistantInstance Fetched ExportAssistantInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Autopilot.V1.ExportAssistantInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Autopilot/V1/Assistant/DialoguePage.php 0000644 00000001715 15002236443 0017561 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Autopilot\V1\Assistant; use Twilio\Page; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class DialoguePage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new DialogueInstance($this->version, $payload, $this->solution['assistantSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Autopilot.V1.DialoguePage]'; } } sdk/src/Twilio/Rest/Autopilot/V1/Assistant/FieldTypeList.php 0000644 00000013771 15002236443 0017761 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Autopilot\V1\Assistant; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class FieldTypeList extends ListResource { /** * Construct the FieldTypeList * * @param Version $version Version that contains the resource * @param string $assistantSid The SID of the Assistant that is the parent of * the resource * @return \Twilio\Rest\Autopilot\V1\Assistant\FieldTypeList */ public function __construct(Version $version, $assistantSid) { parent::__construct($version); // Path Solution $this->solution = array('assistantSid' => $assistantSid, ); $this->uri = '/Assistants/' . \rawurlencode($assistantSid) . '/FieldTypes'; } /** * Streams FieldTypeInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads FieldTypeInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return FieldTypeInstance[] Array of results */ public function read($limit = null, $pageSize = null) { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of FieldTypeInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of FieldTypeInstance */ public function page($pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $params = Values::of(array( 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new FieldTypePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of FieldTypeInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of FieldTypeInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new FieldTypePage($this->version, $response, $this->solution); } /** * Create a new FieldTypeInstance * * @param string $uniqueName An application-defined string that uniquely * identifies the new resource * @param array|Options $options Optional Arguments * @return FieldTypeInstance Newly created FieldTypeInstance * @throws TwilioException When an HTTP error occurs. */ public function create($uniqueName, $options = array()) { $options = new Values($options); $data = Values::of(array('UniqueName' => $uniqueName, 'FriendlyName' => $options['friendlyName'], )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new FieldTypeInstance($this->version, $payload, $this->solution['assistantSid']); } /** * Constructs a FieldTypeContext * * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Autopilot\V1\Assistant\FieldTypeContext */ public function getContext($sid) { return new FieldTypeContext($this->version, $this->solution['assistantSid'], $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Autopilot.V1.FieldTypeList]'; } } sdk/src/Twilio/Rest/Autopilot/V1/Assistant/QueryPage.php 0000644 00000001704 15002236443 0017133 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Autopilot\V1\Assistant; use Twilio\Page; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class QueryPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new QueryInstance($this->version, $payload, $this->solution['assistantSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Autopilot.V1.QueryPage]'; } } sdk/src/Twilio/Rest/Autopilot/V1/Assistant/TaskContext.php 0000644 00000016104 15002236443 0017500 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Autopilot\V1\Assistant; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Rest\Autopilot\V1\Assistant\Task\FieldList; use Twilio\Rest\Autopilot\V1\Assistant\Task\SampleList; use Twilio\Rest\Autopilot\V1\Assistant\Task\TaskActionsList; use Twilio\Rest\Autopilot\V1\Assistant\Task\TaskStatisticsList; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property \Twilio\Rest\Autopilot\V1\Assistant\Task\FieldList $fields * @property \Twilio\Rest\Autopilot\V1\Assistant\Task\SampleList $samples * @property \Twilio\Rest\Autopilot\V1\Assistant\Task\TaskActionsList $taskActions * @property \Twilio\Rest\Autopilot\V1\Assistant\Task\TaskStatisticsList $statistics * @method \Twilio\Rest\Autopilot\V1\Assistant\Task\FieldContext fields(string $sid) * @method \Twilio\Rest\Autopilot\V1\Assistant\Task\SampleContext samples(string $sid) * @method \Twilio\Rest\Autopilot\V1\Assistant\Task\TaskActionsContext taskActions() * @method \Twilio\Rest\Autopilot\V1\Assistant\Task\TaskStatisticsContext statistics() */ class TaskContext extends InstanceContext { protected $_fields = null; protected $_samples = null; protected $_taskActions = null; protected $_statistics = null; /** * Initialize the TaskContext * * @param \Twilio\Version $version Version that contains the resource * @param string $assistantSid The SID of the Assistant that is the parent of * the resource to fetch * @param string $sid The unique string that identifies the resource to fetch * @return \Twilio\Rest\Autopilot\V1\Assistant\TaskContext */ public function __construct(Version $version, $assistantSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array('assistantSid' => $assistantSid, 'sid' => $sid, ); $this->uri = '/Assistants/' . \rawurlencode($assistantSid) . '/Tasks/' . \rawurlencode($sid) . ''; } /** * Fetch a TaskInstance * * @return TaskInstance Fetched TaskInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new TaskInstance( $this->version, $payload, $this->solution['assistantSid'], $this->solution['sid'] ); } /** * Update the TaskInstance * * @param array|Options $options Optional Arguments * @return TaskInstance Updated TaskInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { $options = new Values($options); $data = Values::of(array( 'FriendlyName' => $options['friendlyName'], 'UniqueName' => $options['uniqueName'], 'Actions' => Serialize::jsonObject($options['actions']), 'ActionsUrl' => $options['actionsUrl'], )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new TaskInstance( $this->version, $payload, $this->solution['assistantSid'], $this->solution['sid'] ); } /** * Deletes the TaskInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Access the fields * * @return \Twilio\Rest\Autopilot\V1\Assistant\Task\FieldList */ protected function getFields() { if (!$this->_fields) { $this->_fields = new FieldList( $this->version, $this->solution['assistantSid'], $this->solution['sid'] ); } return $this->_fields; } /** * Access the samples * * @return \Twilio\Rest\Autopilot\V1\Assistant\Task\SampleList */ protected function getSamples() { if (!$this->_samples) { $this->_samples = new SampleList( $this->version, $this->solution['assistantSid'], $this->solution['sid'] ); } return $this->_samples; } /** * Access the taskActions * * @return \Twilio\Rest\Autopilot\V1\Assistant\Task\TaskActionsList */ protected function getTaskActions() { if (!$this->_taskActions) { $this->_taskActions = new TaskActionsList( $this->version, $this->solution['assistantSid'], $this->solution['sid'] ); } return $this->_taskActions; } /** * Access the statistics * * @return \Twilio\Rest\Autopilot\V1\Assistant\Task\TaskStatisticsList */ protected function getStatistics() { if (!$this->_statistics) { $this->_statistics = new TaskStatisticsList( $this->version, $this->solution['assistantSid'], $this->solution['sid'] ); } return $this->_statistics; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get($name) { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Autopilot.V1.TaskContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Autopilot/V1/AssistantInstance.php 0000644 00000016046 15002236443 0016723 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Autopilot\V1; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $accountSid * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $friendlyName * @property string $latestModelBuildSid * @property array $links * @property bool $logQueries * @property string $developmentStage * @property bool $needsModelBuild * @property string $sid * @property string $uniqueName * @property string $url * @property string $callbackUrl * @property string $callbackEvents */ class AssistantInstance extends InstanceResource { protected $_fieldTypes = null; protected $_tasks = null; protected $_modelBuilds = null; protected $_queries = null; protected $_styleSheet = null; protected $_defaults = null; protected $_dialogues = null; protected $_webhooks = null; protected $_exportAssistant = null; /** * Initialize the AssistantInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Autopilot\V1\AssistantInstance */ public function __construct(Version $version, array $payload, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'accountSid' => Values::array_get($payload, 'account_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'latestModelBuildSid' => Values::array_get($payload, 'latest_model_build_sid'), 'links' => Values::array_get($payload, 'links'), 'logQueries' => Values::array_get($payload, 'log_queries'), 'developmentStage' => Values::array_get($payload, 'development_stage'), 'needsModelBuild' => Values::array_get($payload, 'needs_model_build'), 'sid' => Values::array_get($payload, 'sid'), 'uniqueName' => Values::array_get($payload, 'unique_name'), 'url' => Values::array_get($payload, 'url'), 'callbackUrl' => Values::array_get($payload, 'callback_url'), 'callbackEvents' => Values::array_get($payload, 'callback_events'), ); $this->solution = array('sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Autopilot\V1\AssistantContext Context for this * AssistantInstance */ protected function proxy() { if (!$this->context) { $this->context = new AssistantContext($this->version, $this->solution['sid']); } return $this->context; } /** * Fetch a AssistantInstance * * @return AssistantInstance Fetched AssistantInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Update the AssistantInstance * * @param array|Options $options Optional Arguments * @return AssistantInstance Updated AssistantInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Deletes the AssistantInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Access the fieldTypes * * @return \Twilio\Rest\Autopilot\V1\Assistant\FieldTypeList */ protected function getFieldTypes() { return $this->proxy()->fieldTypes; } /** * Access the tasks * * @return \Twilio\Rest\Autopilot\V1\Assistant\TaskList */ protected function getTasks() { return $this->proxy()->tasks; } /** * Access the modelBuilds * * @return \Twilio\Rest\Autopilot\V1\Assistant\ModelBuildList */ protected function getModelBuilds() { return $this->proxy()->modelBuilds; } /** * Access the queries * * @return \Twilio\Rest\Autopilot\V1\Assistant\QueryList */ protected function getQueries() { return $this->proxy()->queries; } /** * Access the styleSheet * * @return \Twilio\Rest\Autopilot\V1\Assistant\StyleSheetList */ protected function getStyleSheet() { return $this->proxy()->styleSheet; } /** * Access the defaults * * @return \Twilio\Rest\Autopilot\V1\Assistant\DefaultsList */ protected function getDefaults() { return $this->proxy()->defaults; } /** * Access the dialogues * * @return \Twilio\Rest\Autopilot\V1\Assistant\DialogueList */ protected function getDialogues() { return $this->proxy()->dialogues; } /** * Access the webhooks * * @return \Twilio\Rest\Autopilot\V1\Assistant\WebhookList */ protected function getWebhooks() { return $this->proxy()->webhooks; } /** * Access the exportAssistant * * @return \Twilio\Rest\Autopilot\V1\Assistant\ExportAssistantList */ protected function getExportAssistant() { return $this->proxy()->exportAssistant; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Autopilot.V1.AssistantInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Autopilot/V1/AssistantPage.php 0000644 00000001645 15002236443 0016032 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Autopilot\V1; use Twilio\Page; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class AssistantPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new AssistantInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Autopilot.V1.AssistantPage]'; } } sdk/src/Twilio/Rest/Api.php 0000644 00000035455 15002236443 0011535 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\Rest\Api\V2010; /** * @property \Twilio\Rest\Api\V2010 $v2010 * @property \Twilio\Rest\Api\V2010\AccountList $accounts * @property \Twilio\Rest\Api\V2010\AccountContext $account * @property \Twilio\Rest\Api\V2010\Account\AddressList $addresses * @property \Twilio\Rest\Api\V2010\Account\ApplicationList $applications * @property \Twilio\Rest\Api\V2010\Account\AuthorizedConnectAppList $authorizedConnectApps * @property \Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountryList $availablePhoneNumbers * @property \Twilio\Rest\Api\V2010\Account\BalanceList $balance * @property \Twilio\Rest\Api\V2010\Account\CallList $calls * @property \Twilio\Rest\Api\V2010\Account\ConferenceList $conferences * @property \Twilio\Rest\Api\V2010\Account\ConnectAppList $connectApps * @property \Twilio\Rest\Api\V2010\Account\IncomingPhoneNumberList $incomingPhoneNumbers * @property \Twilio\Rest\Api\V2010\Account\KeyList $keys * @property \Twilio\Rest\Api\V2010\Account\MessageList $messages * @property \Twilio\Rest\Api\V2010\Account\NewKeyList $newKeys * @property \Twilio\Rest\Api\V2010\Account\NewSigningKeyList $newSigningKeys * @property \Twilio\Rest\Api\V2010\Account\NotificationList $notifications * @property \Twilio\Rest\Api\V2010\Account\OutgoingCallerIdList $outgoingCallerIds * @property \Twilio\Rest\Api\V2010\Account\QueueList $queues * @property \Twilio\Rest\Api\V2010\Account\RecordingList $recordings * @property \Twilio\Rest\Api\V2010\Account\SigningKeyList $signingKeys * @property \Twilio\Rest\Api\V2010\Account\SipList $sip * @property \Twilio\Rest\Api\V2010\Account\ShortCodeList $shortCodes * @property \Twilio\Rest\Api\V2010\Account\TokenList $tokens * @property \Twilio\Rest\Api\V2010\Account\TranscriptionList $transcriptions * @property \Twilio\Rest\Api\V2010\Account\UsageList $usage * @property \Twilio\Rest\Api\V2010\Account\ValidationRequestList $validationRequests * @method \Twilio\Rest\Api\V2010\Account\AddressContext addresses(string $sid) * @method \Twilio\Rest\Api\V2010\Account\ApplicationContext applications(string $sid) * @method \Twilio\Rest\Api\V2010\Account\AuthorizedConnectAppContext authorizedConnectApps(string $connectAppSid) * @method \Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountryContext availablePhoneNumbers(string $countryCode) * @method \Twilio\Rest\Api\V2010\Account\CallContext calls(string $sid) * @method \Twilio\Rest\Api\V2010\Account\ConferenceContext conferences(string $sid) * @method \Twilio\Rest\Api\V2010\Account\ConnectAppContext connectApps(string $sid) * @method \Twilio\Rest\Api\V2010\Account\IncomingPhoneNumberContext incomingPhoneNumbers(string $sid) * @method \Twilio\Rest\Api\V2010\Account\KeyContext keys(string $sid) * @method \Twilio\Rest\Api\V2010\Account\MessageContext messages(string $sid) * @method \Twilio\Rest\Api\V2010\Account\NotificationContext notifications(string $sid) * @method \Twilio\Rest\Api\V2010\Account\OutgoingCallerIdContext outgoingCallerIds(string $sid) * @method \Twilio\Rest\Api\V2010\Account\QueueContext queues(string $sid) * @method \Twilio\Rest\Api\V2010\Account\RecordingContext recordings(string $sid) * @method \Twilio\Rest\Api\V2010\Account\SigningKeyContext signingKeys(string $sid) * @method \Twilio\Rest\Api\V2010\Account\ShortCodeContext shortCodes(string $sid) * @method \Twilio\Rest\Api\V2010\Account\TranscriptionContext transcriptions(string $sid) * @method \Twilio\Rest\Api\V2010\AccountContext accounts(string $sid) */ class Api extends Domain { protected $_v2010 = null; /** * Construct the Api Domain * * @param \Twilio\Rest\Client $client Twilio\Rest\Client to communicate with * Twilio * @return \Twilio\Rest\Api Domain for Api */ public function __construct(Client $client) { parent::__construct($client); $this->baseUrl = 'https://api.twilio.com'; } /** * @return \Twilio\Rest\Api\V2010 Version v2010 of api */ protected function getV2010() { if (!$this->_v2010) { $this->_v2010 = new V2010($this); } return $this->_v2010; } /** * Magic getter to lazy load version * * @param string $name Version to return * @return \Twilio\Version The requested version * @throws TwilioException For unknown versions */ public function __get($name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown version ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $method = 'context' . \ucfirst($name); if (\method_exists($this, $method)) { return \call_user_func_array(array($this, $method), $arguments); } throw new TwilioException('Unknown context ' . $name); } /** * @return \Twilio\Rest\Api\V2010\AccountContext Account provided as the * authenticating account */ protected function getAccount() { return $this->v2010->account; } /** * @return \Twilio\Rest\Api\V2010\AccountList */ protected function getAccounts() { return $this->v2010->accounts; } /** * @param string $sid Fetch by unique Account Sid * @return \Twilio\Rest\Api\V2010\AccountContext */ protected function contextAccounts($sid) { return $this->v2010->accounts($sid); } /** * @return \Twilio\Rest\Api\V2010\Account\AddressList */ protected function getAddresses() { return $this->v2010->account->addresses; } /** * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Api\V2010\Account\AddressContext */ protected function contextAddresses($sid) { return $this->v2010->account->addresses($sid); } /** * @return \Twilio\Rest\Api\V2010\Account\ApplicationList */ protected function getApplications() { return $this->v2010->account->applications; } /** * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Api\V2010\Account\ApplicationContext */ protected function contextApplications($sid) { return $this->v2010->account->applications($sid); } /** * @return \Twilio\Rest\Api\V2010\Account\AuthorizedConnectAppList */ protected function getAuthorizedConnectApps() { return $this->v2010->account->authorizedConnectApps; } /** * @param string $connectAppSid The SID of the Connect App to fetch * @return \Twilio\Rest\Api\V2010\Account\AuthorizedConnectAppContext */ protected function contextAuthorizedConnectApps($connectAppSid) { return $this->v2010->account->authorizedConnectApps($connectAppSid); } /** * @return \Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountryList */ protected function getAvailablePhoneNumbers() { return $this->v2010->account->availablePhoneNumbers; } /** * @param string $countryCode The ISO country code of the country to fetch * available phone number information about * @return \Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountryContext */ protected function contextAvailablePhoneNumbers($countryCode) { return $this->v2010->account->availablePhoneNumbers($countryCode); } /** * @return \Twilio\Rest\Api\V2010\Account\BalanceList */ protected function getBalance() { return $this->v2010->account->balance; } /** * @return \Twilio\Rest\Api\V2010\Account\CallList */ protected function getCalls() { return $this->v2010->account->calls; } /** * @param string $sid The SID of the Call resource to fetch * @return \Twilio\Rest\Api\V2010\Account\CallContext */ protected function contextCalls($sid) { return $this->v2010->account->calls($sid); } /** * @return \Twilio\Rest\Api\V2010\Account\ConferenceList */ protected function getConferences() { return $this->v2010->account->conferences; } /** * @param string $sid The unique string that identifies this resource * @return \Twilio\Rest\Api\V2010\Account\ConferenceContext */ protected function contextConferences($sid) { return $this->v2010->account->conferences($sid); } /** * @return \Twilio\Rest\Api\V2010\Account\ConnectAppList */ protected function getConnectApps() { return $this->v2010->account->connectApps; } /** * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Api\V2010\Account\ConnectAppContext */ protected function contextConnectApps($sid) { return $this->v2010->account->connectApps($sid); } /** * @return \Twilio\Rest\Api\V2010\Account\IncomingPhoneNumberList */ protected function getIncomingPhoneNumbers() { return $this->v2010->account->incomingPhoneNumbers; } /** * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Api\V2010\Account\IncomingPhoneNumberContext */ protected function contextIncomingPhoneNumbers($sid) { return $this->v2010->account->incomingPhoneNumbers($sid); } /** * @return \Twilio\Rest\Api\V2010\Account\KeyList */ protected function getKeys() { return $this->v2010->account->keys; } /** * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Api\V2010\Account\KeyContext */ protected function contextKeys($sid) { return $this->v2010->account->keys($sid); } /** * @return \Twilio\Rest\Api\V2010\Account\MessageList */ protected function getMessages() { return $this->v2010->account->messages; } /** * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Api\V2010\Account\MessageContext */ protected function contextMessages($sid) { return $this->v2010->account->messages($sid); } /** * @return \Twilio\Rest\Api\V2010\Account\NewKeyList */ protected function getNewKeys() { return $this->v2010->account->newKeys; } /** * @return \Twilio\Rest\Api\V2010\Account\NewSigningKeyList */ protected function getNewSigningKeys() { return $this->v2010->account->newSigningKeys; } /** * @return \Twilio\Rest\Api\V2010\Account\NotificationList */ protected function getNotifications() { return $this->v2010->account->notifications; } /** * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Api\V2010\Account\NotificationContext */ protected function contextNotifications($sid) { return $this->v2010->account->notifications($sid); } /** * @return \Twilio\Rest\Api\V2010\Account\OutgoingCallerIdList */ protected function getOutgoingCallerIds() { return $this->v2010->account->outgoingCallerIds; } /** * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Api\V2010\Account\OutgoingCallerIdContext */ protected function contextOutgoingCallerIds($sid) { return $this->v2010->account->outgoingCallerIds($sid); } /** * @return \Twilio\Rest\Api\V2010\Account\QueueList */ protected function getQueues() { return $this->v2010->account->queues; } /** * @param string $sid The unique string that identifies this resource * @return \Twilio\Rest\Api\V2010\Account\QueueContext */ protected function contextQueues($sid) { return $this->v2010->account->queues($sid); } /** * @return \Twilio\Rest\Api\V2010\Account\RecordingList */ protected function getRecordings() { return $this->v2010->account->recordings; } /** * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Api\V2010\Account\RecordingContext */ protected function contextRecordings($sid) { return $this->v2010->account->recordings($sid); } /** * @return \Twilio\Rest\Api\V2010\Account\SigningKeyList */ protected function getSigningKeys() { return $this->v2010->account->signingKeys; } /** * @param string $sid The sid * @return \Twilio\Rest\Api\V2010\Account\SigningKeyContext */ protected function contextSigningKeys($sid) { return $this->v2010->account->signingKeys($sid); } /** * @return \Twilio\Rest\Api\V2010\Account\SipList */ protected function getSip() { return $this->v2010->account->sip; } /** * @return \Twilio\Rest\Api\V2010\Account\ShortCodeList */ protected function getShortCodes() { return $this->v2010->account->shortCodes; } /** * @param string $sid The unique string that identifies this resource * @return \Twilio\Rest\Api\V2010\Account\ShortCodeContext */ protected function contextShortCodes($sid) { return $this->v2010->account->shortCodes($sid); } /** * @return \Twilio\Rest\Api\V2010\Account\TokenList */ protected function getTokens() { return $this->v2010->account->tokens; } /** * @return \Twilio\Rest\Api\V2010\Account\TranscriptionList */ protected function getTranscriptions() { return $this->v2010->account->transcriptions; } /** * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Api\V2010\Account\TranscriptionContext */ protected function contextTranscriptions($sid) { return $this->v2010->account->transcriptions($sid); } /** * @return \Twilio\Rest\Api\V2010\Account\UsageList */ protected function getUsage() { return $this->v2010->account->usage; } /** * @return \Twilio\Rest\Api\V2010\Account\ValidationRequestList */ protected function getValidationRequests() { return $this->v2010->account->validationRequests; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api]'; } } sdk/src/Twilio/Rest/Pricing.php 0000644 00000006107 15002236443 0012407 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\Rest\Pricing\V1; use Twilio\Rest\Pricing\V2; /** * @property \Twilio\Rest\Pricing\V1 $v1 * @property \Twilio\Rest\Pricing\V2 $v2 * @property \Twilio\Rest\Pricing\V1\MessagingList $messaging * @property \Twilio\Rest\Pricing\V1\PhoneNumberList $phoneNumbers * @property \Twilio\Rest\Pricing\V2\VoiceList $voice */ class Pricing extends Domain { protected $_v1 = null; protected $_v2 = null; /** * Construct the Pricing Domain * * @param \Twilio\Rest\Client $client Twilio\Rest\Client to communicate with * Twilio * @return \Twilio\Rest\Pricing Domain for Pricing */ public function __construct(Client $client) { parent::__construct($client); $this->baseUrl = 'https://pricing.twilio.com'; } /** * @return \Twilio\Rest\Pricing\V1 Version v1 of pricing */ protected function getV1() { if (!$this->_v1) { $this->_v1 = new V1($this); } return $this->_v1; } /** * @return \Twilio\Rest\Pricing\V2 Version v2 of pricing */ protected function getV2() { if (!$this->_v2) { $this->_v2 = new V2($this); } return $this->_v2; } /** * Magic getter to lazy load version * * @param string $name Version to return * @return \Twilio\Version The requested version * @throws TwilioException For unknown versions */ public function __get($name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown version ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $method = 'context' . \ucfirst($name); if (\method_exists($this, $method)) { return \call_user_func_array(array($this, $method), $arguments); } throw new TwilioException('Unknown context ' . $name); } /** * @return \Twilio\Rest\Pricing\V1\MessagingList */ protected function getMessaging() { return $this->v1->messaging; } /** * @return \Twilio\Rest\Pricing\V1\PhoneNumberList */ protected function getPhoneNumbers() { return $this->v1->phoneNumbers; } /** * @return \Twilio\Rest\Pricing\V2\VoiceList */ protected function getVoice() { return $this->v2->voice; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Pricing]'; } } sdk/src/Twilio/Rest/Accounts.php 0000644 00000004567 15002236443 0012603 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\Rest\Accounts\V1; /** * @property \Twilio\Rest\Accounts\V1 $v1 * @property \Twilio\Rest\Accounts\V1\CredentialList $credentials */ class Accounts extends Domain { protected $_v1 = null; /** * Construct the Accounts Domain * * @param \Twilio\Rest\Client $client Twilio\Rest\Client to communicate with * Twilio * @return \Twilio\Rest\Accounts Domain for Accounts */ public function __construct(Client $client) { parent::__construct($client); $this->baseUrl = 'https://accounts.twilio.com'; } /** * @return \Twilio\Rest\Accounts\V1 Version v1 of accounts */ protected function getV1() { if (!$this->_v1) { $this->_v1 = new V1($this); } return $this->_v1; } /** * Magic getter to lazy load version * * @param string $name Version to return * @return \Twilio\Version The requested version * @throws TwilioException For unknown versions */ public function __get($name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown version ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $method = 'context' . \ucfirst($name); if (\method_exists($this, $method)) { return \call_user_func_array(array($this, $method), $arguments); } throw new TwilioException('Unknown context ' . $name); } /** * @return \Twilio\Rest\Accounts\V1\CredentialList */ protected function getCredentials() { return $this->v1->credentials; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Accounts]'; } } sdk/src/Twilio/Rest/Sync/V1.php 0000644 00000004343 15002236443 0012216 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Sync; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\Rest\Sync\V1\ServiceList; use Twilio\Version; /** * @property \Twilio\Rest\Sync\V1\ServiceList $services * @method \Twilio\Rest\Sync\V1\ServiceContext services(string $sid) */ class V1 extends Version { protected $_services = null; /** * Construct the V1 version of Sync * * @param \Twilio\Domain $domain Domain that contains the version * @return \Twilio\Rest\Sync\V1 V1 version of Sync */ public function __construct(Domain $domain) { parent::__construct($domain); $this->version = 'v1'; } /** * @return \Twilio\Rest\Sync\V1\ServiceList */ protected function getServices() { if (!$this->_services) { $this->_services = new ServiceList($this); } return $this->_services; } /** * Magic getter to lazy load root resources * * @param string $name Resource to return * @return \Twilio\ListResource The requested resource * @throws TwilioException For unknown resource */ public function __get($name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown resource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Sync.V1]'; } } sdk/src/Twilio/Rest/Sync/V1/ServiceOptions.php 0000644 00000041770 15002236443 0015177 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Sync\V1; 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 ServiceOptions { /** * @param string $friendlyName A string that you assign to describe the resource * @param string $webhookUrl The URL we should call when Sync objects are * manipulated * @param bool $reachabilityWebhooksEnabled Whether the service instance should * call webhook_url when client * endpoints connect to Sync * @param bool $aclEnabled Whether token identities in the Service must be * granted access to Sync objects by using the * Permissions resource * @param bool $reachabilityDebouncingEnabled Whether every * endpoint_disconnected event * occurs after a configurable delay * @param int $reachabilityDebouncingWindow The reachability event delay in * milliseconds * @param bool $webhooksFromRestEnabled Whether the Service instance should * call webhook_url when the REST API is * used to update Sync objects * @return CreateServiceOptions Options builder */ public static function create($friendlyName = Values::NONE, $webhookUrl = Values::NONE, $reachabilityWebhooksEnabled = Values::NONE, $aclEnabled = Values::NONE, $reachabilityDebouncingEnabled = Values::NONE, $reachabilityDebouncingWindow = Values::NONE, $webhooksFromRestEnabled = Values::NONE) { return new CreateServiceOptions($friendlyName, $webhookUrl, $reachabilityWebhooksEnabled, $aclEnabled, $reachabilityDebouncingEnabled, $reachabilityDebouncingWindow, $webhooksFromRestEnabled); } /** * @param string $webhookUrl The URL we should call when Sync objects are * manipulated * @param string $friendlyName A string that you assign to describe the resource * @param bool $reachabilityWebhooksEnabled Whether the service instance should * call webhook_url when client * endpoints connect to Sync * @param bool $aclEnabled Whether token identities in the Service must be * granted access to Sync objects by using the * Permissions resource * @param bool $reachabilityDebouncingEnabled Whether every * endpoint_disconnected event * occurs after a configurable delay * @param int $reachabilityDebouncingWindow The reachability event delay in * milliseconds * @param bool $webhooksFromRestEnabled Whether the Service instance should * call webhook_url when the REST API is * used to update Sync objects * @return UpdateServiceOptions Options builder */ public static function update($webhookUrl = Values::NONE, $friendlyName = Values::NONE, $reachabilityWebhooksEnabled = Values::NONE, $aclEnabled = Values::NONE, $reachabilityDebouncingEnabled = Values::NONE, $reachabilityDebouncingWindow = Values::NONE, $webhooksFromRestEnabled = Values::NONE) { return new UpdateServiceOptions($webhookUrl, $friendlyName, $reachabilityWebhooksEnabled, $aclEnabled, $reachabilityDebouncingEnabled, $reachabilityDebouncingWindow, $webhooksFromRestEnabled); } } class CreateServiceOptions extends Options { /** * @param string $friendlyName A string that you assign to describe the resource * @param string $webhookUrl The URL we should call when Sync objects are * manipulated * @param bool $reachabilityWebhooksEnabled Whether the service instance should * call webhook_url when client * endpoints connect to Sync * @param bool $aclEnabled Whether token identities in the Service must be * granted access to Sync objects by using the * Permissions resource * @param bool $reachabilityDebouncingEnabled Whether every * endpoint_disconnected event * occurs after a configurable delay * @param int $reachabilityDebouncingWindow The reachability event delay in * milliseconds * @param bool $webhooksFromRestEnabled Whether the Service instance should * call webhook_url when the REST API is * used to update Sync objects */ public function __construct($friendlyName = Values::NONE, $webhookUrl = Values::NONE, $reachabilityWebhooksEnabled = Values::NONE, $aclEnabled = Values::NONE, $reachabilityDebouncingEnabled = Values::NONE, $reachabilityDebouncingWindow = Values::NONE, $webhooksFromRestEnabled = Values::NONE) { $this->options['friendlyName'] = $friendlyName; $this->options['webhookUrl'] = $webhookUrl; $this->options['reachabilityWebhooksEnabled'] = $reachabilityWebhooksEnabled; $this->options['aclEnabled'] = $aclEnabled; $this->options['reachabilityDebouncingEnabled'] = $reachabilityDebouncingEnabled; $this->options['reachabilityDebouncingWindow'] = $reachabilityDebouncingWindow; $this->options['webhooksFromRestEnabled'] = $webhooksFromRestEnabled; } /** * A string that you assign to describe the resource. * * @param string $friendlyName A string that you assign to describe the resource * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The URL we should call when Sync objects are manipulated. * * @param string $webhookUrl The URL we should call when Sync objects are * manipulated * @return $this Fluent Builder */ public function setWebhookUrl($webhookUrl) { $this->options['webhookUrl'] = $webhookUrl; return $this; } /** * Whether the service instance should call `webhook_url` when client endpoints connect to Sync. The default is `false`. * * @param bool $reachabilityWebhooksEnabled Whether the service instance should * call webhook_url when client * endpoints connect to Sync * @return $this Fluent Builder */ public function setReachabilityWebhooksEnabled($reachabilityWebhooksEnabled) { $this->options['reachabilityWebhooksEnabled'] = $reachabilityWebhooksEnabled; return $this; } /** * Whether token identities in the Service must be granted access to Sync objects by using the [Permissions](https://www.twilio.com/docs/sync/api/sync-permissions) resource. * * @param bool $aclEnabled Whether token identities in the Service must be * granted access to Sync objects by using the * Permissions resource * @return $this Fluent Builder */ public function setAclEnabled($aclEnabled) { $this->options['aclEnabled'] = $aclEnabled; return $this; } /** * Whether every `endpoint_disconnected` event should occur after a configurable delay. The default is `false`, where the `endpoint_disconnected` event occurs immediately after disconnection. When `true`, intervening reconnections can prevent the `endpoint_disconnected` event. * * @param bool $reachabilityDebouncingEnabled Whether every * endpoint_disconnected event * occurs after a configurable delay * @return $this Fluent Builder */ public function setReachabilityDebouncingEnabled($reachabilityDebouncingEnabled) { $this->options['reachabilityDebouncingEnabled'] = $reachabilityDebouncingEnabled; return $this; } /** * The reachability event delay in milliseconds if `reachability_debouncing_enabled` = `true`. Must be between 1,000 and 30,000 and defaults to 5,000. This is the number of milliseconds after the last running client disconnects, and a Sync identity is declared offline, before the `webhook_url` is called if all endpoints remain offline. A reconnection from the same identity by any endpoint during this interval prevents the call to `webhook_url`. * * @param int $reachabilityDebouncingWindow The reachability event delay in * milliseconds * @return $this Fluent Builder */ public function setReachabilityDebouncingWindow($reachabilityDebouncingWindow) { $this->options['reachabilityDebouncingWindow'] = $reachabilityDebouncingWindow; return $this; } /** * Whether the Service instance should call `webhook_url` when the REST API is used to update Sync objects. The default is `false`. * * @param bool $webhooksFromRestEnabled Whether the Service instance should * call webhook_url when the REST API is * used to update Sync objects * @return $this Fluent Builder */ public function setWebhooksFromRestEnabled($webhooksFromRestEnabled) { $this->options['webhooksFromRestEnabled'] = $webhooksFromRestEnabled; 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.Sync.V1.CreateServiceOptions ' . \implode(' ', $options) . ']'; } } class UpdateServiceOptions extends Options { /** * @param string $webhookUrl The URL we should call when Sync objects are * manipulated * @param string $friendlyName A string that you assign to describe the resource * @param bool $reachabilityWebhooksEnabled Whether the service instance should * call webhook_url when client * endpoints connect to Sync * @param bool $aclEnabled Whether token identities in the Service must be * granted access to Sync objects by using the * Permissions resource * @param bool $reachabilityDebouncingEnabled Whether every * endpoint_disconnected event * occurs after a configurable delay * @param int $reachabilityDebouncingWindow The reachability event delay in * milliseconds * @param bool $webhooksFromRestEnabled Whether the Service instance should * call webhook_url when the REST API is * used to update Sync objects */ public function __construct($webhookUrl = Values::NONE, $friendlyName = Values::NONE, $reachabilityWebhooksEnabled = Values::NONE, $aclEnabled = Values::NONE, $reachabilityDebouncingEnabled = Values::NONE, $reachabilityDebouncingWindow = Values::NONE, $webhooksFromRestEnabled = Values::NONE) { $this->options['webhookUrl'] = $webhookUrl; $this->options['friendlyName'] = $friendlyName; $this->options['reachabilityWebhooksEnabled'] = $reachabilityWebhooksEnabled; $this->options['aclEnabled'] = $aclEnabled; $this->options['reachabilityDebouncingEnabled'] = $reachabilityDebouncingEnabled; $this->options['reachabilityDebouncingWindow'] = $reachabilityDebouncingWindow; $this->options['webhooksFromRestEnabled'] = $webhooksFromRestEnabled; } /** * The URL we should call when Sync objects are manipulated. * * @param string $webhookUrl The URL we should call when Sync objects are * manipulated * @return $this Fluent Builder */ public function setWebhookUrl($webhookUrl) { $this->options['webhookUrl'] = $webhookUrl; return $this; } /** * A string that you assign to describe the resource. * * @param string $friendlyName A string that you assign to describe the resource * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * Whether the service instance should call `webhook_url` when client endpoints connect to Sync. The default is `false`. * * @param bool $reachabilityWebhooksEnabled Whether the service instance should * call webhook_url when client * endpoints connect to Sync * @return $this Fluent Builder */ public function setReachabilityWebhooksEnabled($reachabilityWebhooksEnabled) { $this->options['reachabilityWebhooksEnabled'] = $reachabilityWebhooksEnabled; return $this; } /** * Whether token identities in the Service must be granted access to Sync objects by using the [Permissions](https://www.twilio.com/docs/sync/api/sync-permissions) resource. * * @param bool $aclEnabled Whether token identities in the Service must be * granted access to Sync objects by using the * Permissions resource * @return $this Fluent Builder */ public function setAclEnabled($aclEnabled) { $this->options['aclEnabled'] = $aclEnabled; return $this; } /** * Whether every `endpoint_disconnected` event should occur after a configurable delay. The default is `false`, where the `endpoint_disconnected` event occurs immediately after disconnection. When `true`, intervening reconnections can prevent the `endpoint_disconnected` event. * * @param bool $reachabilityDebouncingEnabled Whether every * endpoint_disconnected event * occurs after a configurable delay * @return $this Fluent Builder */ public function setReachabilityDebouncingEnabled($reachabilityDebouncingEnabled) { $this->options['reachabilityDebouncingEnabled'] = $reachabilityDebouncingEnabled; return $this; } /** * The reachability event delay in milliseconds if `reachability_debouncing_enabled` = `true`. Must be between 1,000 and 30,000 and defaults to 5,000. This is the number of milliseconds after the last running client disconnects, and a Sync identity is declared offline, before the webhook is called if all endpoints remain offline. A reconnection from the same identity by any endpoint during this interval prevents the webhook from being called. * * @param int $reachabilityDebouncingWindow The reachability event delay in * milliseconds * @return $this Fluent Builder */ public function setReachabilityDebouncingWindow($reachabilityDebouncingWindow) { $this->options['reachabilityDebouncingWindow'] = $reachabilityDebouncingWindow; return $this; } /** * Whether the Service instance should call `webhook_url` when the REST API is used to update Sync objects. The default is `false`. * * @param bool $webhooksFromRestEnabled Whether the Service instance should * call webhook_url when the REST API is * used to update Sync objects * @return $this Fluent Builder */ public function setWebhooksFromRestEnabled($webhooksFromRestEnabled) { $this->options['webhooksFromRestEnabled'] = $webhooksFromRestEnabled; 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.Sync.V1.UpdateServiceOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Sync/V1/ServiceList.php 0000644 00000013676 15002236443 0014463 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Sync\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class ServiceList extends ListResource { /** * Construct the ServiceList * * @param Version $version Version that contains the resource * @return \Twilio\Rest\Sync\V1\ServiceList */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = array(); $this->uri = '/Services'; } /** * Create a new ServiceInstance * * @param array|Options $options Optional Arguments * @return ServiceInstance Newly created ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function create($options = array()) { $options = new Values($options); $data = Values::of(array( 'FriendlyName' => $options['friendlyName'], 'WebhookUrl' => $options['webhookUrl'], 'ReachabilityWebhooksEnabled' => Serialize::booleanToString($options['reachabilityWebhooksEnabled']), 'AclEnabled' => Serialize::booleanToString($options['aclEnabled']), 'ReachabilityDebouncingEnabled' => Serialize::booleanToString($options['reachabilityDebouncingEnabled']), 'ReachabilityDebouncingWindow' => $options['reachabilityDebouncingWindow'], 'WebhooksFromRestEnabled' => Serialize::booleanToString($options['webhooksFromRestEnabled']), )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new ServiceInstance($this->version, $payload); } /** * Streams ServiceInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads ServiceInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return ServiceInstance[] Array of results */ public function read($limit = null, $pageSize = null) { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of ServiceInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of ServiceInstance */ public function page($pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $params = Values::of(array( 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new ServicePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of ServiceInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of ServiceInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new ServicePage($this->version, $response, $this->solution); } /** * Constructs a ServiceContext * * @param string $sid The SID of the Service resource to fetch * @return \Twilio\Rest\Sync\V1\ServiceContext */ public function getContext($sid) { return new ServiceContext($this->version, $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Sync.V1.ServiceList]'; } } sdk/src/Twilio/Rest/Sync/V1/ServicePage.php 0000644 00000001473 15002236443 0014414 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Sync\V1; use Twilio\Page; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class ServicePage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new ServiceInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Sync.V1.ServicePage]'; } } sdk/src/Twilio/Rest/Sync/V1/ServiceInstance.php 0000644 00000013414 15002236443 0015302 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Sync\V1; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * * @property string $sid * @property string $uniqueName * @property string $accountSid * @property string $friendlyName * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $url * @property string $webhookUrl * @property bool $webhooksFromRestEnabled * @property bool $reachabilityWebhooksEnabled * @property bool $aclEnabled * @property bool $reachabilityDebouncingEnabled * @property int $reachabilityDebouncingWindow * @property array $links */ class ServiceInstance extends InstanceResource { protected $_documents = null; protected $_syncLists = null; protected $_syncMaps = null; protected $_syncStreams = null; /** * Initialize the ServiceInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The SID of the Service resource to fetch * @return \Twilio\Rest\Sync\V1\ServiceInstance */ public function __construct(Version $version, array $payload, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'sid' => Values::array_get($payload, 'sid'), 'uniqueName' => Values::array_get($payload, 'unique_name'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), 'webhookUrl' => Values::array_get($payload, 'webhook_url'), 'webhooksFromRestEnabled' => Values::array_get($payload, 'webhooks_from_rest_enabled'), 'reachabilityWebhooksEnabled' => Values::array_get($payload, 'reachability_webhooks_enabled'), 'aclEnabled' => Values::array_get($payload, 'acl_enabled'), 'reachabilityDebouncingEnabled' => Values::array_get($payload, 'reachability_debouncing_enabled'), 'reachabilityDebouncingWindow' => Values::array_get($payload, 'reachability_debouncing_window'), 'links' => Values::array_get($payload, 'links'), ); $this->solution = array('sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Sync\V1\ServiceContext Context for this ServiceInstance */ protected function proxy() { if (!$this->context) { $this->context = new ServiceContext($this->version, $this->solution['sid']); } return $this->context; } /** * Fetch a ServiceInstance * * @return ServiceInstance Fetched ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the ServiceInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Update the ServiceInstance * * @param array|Options $options Optional Arguments * @return ServiceInstance Updated ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Access the documents * * @return \Twilio\Rest\Sync\V1\Service\DocumentList */ protected function getDocuments() { return $this->proxy()->documents; } /** * Access the syncLists * * @return \Twilio\Rest\Sync\V1\Service\SyncListList */ protected function getSyncLists() { return $this->proxy()->syncLists; } /** * Access the syncMaps * * @return \Twilio\Rest\Sync\V1\Service\SyncMapList */ protected function getSyncMaps() { return $this->proxy()->syncMaps; } /** * Access the syncStreams * * @return \Twilio\Rest\Sync\V1\Service\SyncStreamList */ protected function getSyncStreams() { return $this->proxy()->syncStreams; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Sync.V1.ServiceInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Sync/V1/Service/SyncMapPage.php 0000644 00000001542 15002236443 0015763 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Sync\V1\Service; use Twilio\Page; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class SyncMapPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new SyncMapInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Sync.V1.SyncMapPage]'; } } sdk/src/Twilio/Rest/Sync/V1/Service/SyncMapOptions.php 0000644 00000013171 15002236443 0016543 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Sync\V1\Service; 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 SyncMapOptions { /** * @param string $uniqueName An application-defined string that uniquely * identifies the resource * @param int $ttl An alias for collection_ttl * @param int $collectionTtl How long, in seconds, before the Sync Map expires * and is deleted * @return CreateSyncMapOptions Options builder */ public static function create($uniqueName = Values::NONE, $ttl = Values::NONE, $collectionTtl = Values::NONE) { return new CreateSyncMapOptions($uniqueName, $ttl, $collectionTtl); } /** * @param int $ttl An alias for collection_ttl * @param int $collectionTtl How long, in seconds, before the Sync Map expires * and is deleted * @return UpdateSyncMapOptions Options builder */ public static function update($ttl = Values::NONE, $collectionTtl = Values::NONE) { return new UpdateSyncMapOptions($ttl, $collectionTtl); } } class CreateSyncMapOptions extends Options { /** * @param string $uniqueName An application-defined string that uniquely * identifies the resource * @param int $ttl An alias for collection_ttl * @param int $collectionTtl How long, in seconds, before the Sync Map expires * and is deleted */ public function __construct($uniqueName = Values::NONE, $ttl = Values::NONE, $collectionTtl = Values::NONE) { $this->options['uniqueName'] = $uniqueName; $this->options['ttl'] = $ttl; $this->options['collectionTtl'] = $collectionTtl; } /** * An application-defined string that uniquely identifies the resource. It can be used as an alternative to the `sid` in the URL path to address the resource. * * @param string $uniqueName An application-defined string that uniquely * identifies the resource * @return $this Fluent Builder */ public function setUniqueName($uniqueName) { $this->options['uniqueName'] = $uniqueName; return $this; } /** * An alias for `collection_ttl`. If both parameters are provided, this value is ignored. * * @param int $ttl An alias for collection_ttl * @return $this Fluent Builder */ public function setTtl($ttl) { $this->options['ttl'] = $ttl; return $this; } /** * How long, in seconds, before the Sync Map expires (time-to-live) and is deleted. Can be an integer from 0 to 31,536,000 (1 year). The default value is `0`, which means the Sync Map does not expire. The Sync Map will be deleted automatically after it expires, but there can be a delay between the expiration time and the resources's deletion. * * @param int $collectionTtl How long, in seconds, before the Sync Map expires * and is deleted * @return $this Fluent Builder */ public function setCollectionTtl($collectionTtl) { $this->options['collectionTtl'] = $collectionTtl; 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.Sync.V1.CreateSyncMapOptions ' . \implode(' ', $options) . ']'; } } class UpdateSyncMapOptions extends Options { /** * @param int $ttl An alias for collection_ttl * @param int $collectionTtl How long, in seconds, before the Sync Map expires * and is deleted */ public function __construct($ttl = Values::NONE, $collectionTtl = Values::NONE) { $this->options['ttl'] = $ttl; $this->options['collectionTtl'] = $collectionTtl; } /** * An alias for `collection_ttl`. If both parameters are provided, this value is ignored. * * @param int $ttl An alias for collection_ttl * @return $this Fluent Builder */ public function setTtl($ttl) { $this->options['ttl'] = $ttl; return $this; } /** * How long, in seconds, before the Sync Map expires (time-to-live) and is deleted. Can be an integer from 0 to 31,536,000 (1 year). The default value is `0`, which means the Sync Map does not expire. The Sync Map will be deleted automatically after it expires, but there can be a delay between the expiration time and the resources's deletion. * * @param int $collectionTtl How long, in seconds, before the Sync Map expires * and is deleted * @return $this Fluent Builder */ public function setCollectionTtl($collectionTtl) { $this->options['collectionTtl'] = $collectionTtl; 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.Sync.V1.UpdateSyncMapOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Sync/V1/Service/SyncStreamList.php 0000644 00000013344 15002236443 0016543 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Sync\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class SyncStreamList extends ListResource { /** * Construct the SyncStreamList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Sync Service that the resource is * associated with * @return \Twilio\Rest\Sync\V1\Service\SyncStreamList */ public function __construct(Version $version, $serviceSid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Streams'; } /** * Create a new SyncStreamInstance * * @param array|Options $options Optional Arguments * @return SyncStreamInstance Newly created SyncStreamInstance * @throws TwilioException When an HTTP error occurs. */ public function create($options = array()) { $options = new Values($options); $data = Values::of(array('UniqueName' => $options['uniqueName'], 'Ttl' => $options['ttl'], )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new SyncStreamInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Streams SyncStreamInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads SyncStreamInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return SyncStreamInstance[] Array of results */ public function read($limit = null, $pageSize = null) { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of SyncStreamInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of SyncStreamInstance */ public function page($pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $params = Values::of(array( 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new SyncStreamPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of SyncStreamInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of SyncStreamInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new SyncStreamPage($this->version, $response, $this->solution); } /** * Constructs a SyncStreamContext * * @param string $sid The SID of the Stream resource to fetch * @return \Twilio\Rest\Sync\V1\Service\SyncStreamContext */ public function getContext($sid) { return new SyncStreamContext($this->version, $this->solution['serviceSid'], $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Sync.V1.SyncStreamList]'; } } sdk/src/Twilio/Rest/Sync/V1/Service/SyncListOptions.php 0000644 00000013326 15002236443 0016743 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Sync\V1\Service; 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 SyncListOptions { /** * @param string $uniqueName An application-defined string that uniquely * identifies the resource * @param int $ttl Alias for collection_ttl * @param int $collectionTtl How long, in seconds, before the Sync List expires * and is deleted * @return CreateSyncListOptions Options builder */ public static function create($uniqueName = Values::NONE, $ttl = Values::NONE, $collectionTtl = Values::NONE) { return new CreateSyncListOptions($uniqueName, $ttl, $collectionTtl); } /** * @param int $ttl An alias for collection_ttl * @param int $collectionTtl How long, in seconds, before the Sync List expires * and is deleted * @return UpdateSyncListOptions Options builder */ public static function update($ttl = Values::NONE, $collectionTtl = Values::NONE) { return new UpdateSyncListOptions($ttl, $collectionTtl); } } class CreateSyncListOptions extends Options { /** * @param string $uniqueName An application-defined string that uniquely * identifies the resource * @param int $ttl Alias for collection_ttl * @param int $collectionTtl How long, in seconds, before the Sync List expires * and is deleted */ public function __construct($uniqueName = Values::NONE, $ttl = Values::NONE, $collectionTtl = Values::NONE) { $this->options['uniqueName'] = $uniqueName; $this->options['ttl'] = $ttl; $this->options['collectionTtl'] = $collectionTtl; } /** * An application-defined string that uniquely identifies the resource. This value must be unique within its Service and it can be up to 320 characters long. The `unique_name` value can be used as an alternative to the `sid` in the URL path to address the resource. * * @param string $uniqueName An application-defined string that uniquely * identifies the resource * @return $this Fluent Builder */ public function setUniqueName($uniqueName) { $this->options['uniqueName'] = $uniqueName; return $this; } /** * Alias for collection_ttl. If both are provided, this value is ignored. * * @param int $ttl Alias for collection_ttl * @return $this Fluent Builder */ public function setTtl($ttl) { $this->options['ttl'] = $ttl; return $this; } /** * How long, in seconds, before the Sync List expires (time-to-live) and is deleted. Can be an integer from 0 to 31,536,000 (1 year). The default value is `0`, which means the Sync List does not expire. The Sync List will be deleted automatically after it expires, but there can be a delay between the expiration time and the resources's deletion. * * @param int $collectionTtl How long, in seconds, before the Sync List expires * and is deleted * @return $this Fluent Builder */ public function setCollectionTtl($collectionTtl) { $this->options['collectionTtl'] = $collectionTtl; 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.Sync.V1.CreateSyncListOptions ' . \implode(' ', $options) . ']'; } } class UpdateSyncListOptions extends Options { /** * @param int $ttl An alias for collection_ttl * @param int $collectionTtl How long, in seconds, before the Sync List expires * and is deleted */ public function __construct($ttl = Values::NONE, $collectionTtl = Values::NONE) { $this->options['ttl'] = $ttl; $this->options['collectionTtl'] = $collectionTtl; } /** * An alias for `collection_ttl`. If both are provided, this value is ignored. * * @param int $ttl An alias for collection_ttl * @return $this Fluent Builder */ public function setTtl($ttl) { $this->options['ttl'] = $ttl; return $this; } /** * How long, in seconds, before the Sync List expires (time-to-live) and is deleted. Can be an integer from 0 to 31,536,000 (1 year). The default value is `0`, which means the Sync List does not expire. The Sync List will be deleted automatically after it expires, but there can be a delay between the expiration time and the resources's deletion. * * @param int $collectionTtl How long, in seconds, before the Sync List expires * and is deleted * @return $this Fluent Builder */ public function setCollectionTtl($collectionTtl) { $this->options['collectionTtl'] = $collectionTtl; 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.Sync.V1.UpdateSyncListOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Sync/V1/Service/SyncStreamContext.php 0000644 00000011346 15002236443 0017254 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Sync\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Rest\Sync\V1\Service\SyncStream\StreamMessageList; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * * @property \Twilio\Rest\Sync\V1\Service\SyncStream\StreamMessageList $streamMessages */ class SyncStreamContext extends InstanceContext { protected $_streamMessages = null; /** * Initialize the SyncStreamContext * * @param \Twilio\Version $version Version that contains the resource * @param string $serviceSid The SID of the Sync Service with the Sync Stream * resource to fetch * @param string $sid The SID of the Stream resource to fetch * @return \Twilio\Rest\Sync\V1\Service\SyncStreamContext */ public function __construct(Version $version, $serviceSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, 'sid' => $sid, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Streams/' . \rawurlencode($sid) . ''; } /** * Fetch a SyncStreamInstance * * @return SyncStreamInstance Fetched SyncStreamInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new SyncStreamInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Deletes the SyncStreamInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Update the SyncStreamInstance * * @param array|Options $options Optional Arguments * @return SyncStreamInstance Updated SyncStreamInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { $options = new Values($options); $data = Values::of(array('Ttl' => $options['ttl'], )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new SyncStreamInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Access the streamMessages * * @return \Twilio\Rest\Sync\V1\Service\SyncStream\StreamMessageList */ protected function getStreamMessages() { if (!$this->_streamMessages) { $this->_streamMessages = new StreamMessageList( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->_streamMessages; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get($name) { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Sync.V1.SyncStreamContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Sync/V1/Service/SyncListPage.php 0000644 00000001545 15002236443 0016164 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Sync\V1\Service; use Twilio\Page; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class SyncListPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new SyncListInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Sync.V1.SyncListPage]'; } } sdk/src/Twilio/Rest/Sync/V1/Service/SyncMapInstance.php 0000644 00000012365 15002236443 0016660 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Sync\V1\Service; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * * @property string $sid * @property string $uniqueName * @property string $accountSid * @property string $serviceSid * @property string $url * @property array $links * @property string $revision * @property \DateTime $dateExpires * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $createdBy */ class SyncMapInstance extends InstanceResource { protected $_syncMapItems = null; protected $_syncMapPermissions = null; /** * Initialize the SyncMapInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the Sync Service that the resource is * associated with * @param string $sid The SID of the Sync Map resource to fetch * @return \Twilio\Rest\Sync\V1\Service\SyncMapInstance */ public function __construct(Version $version, array $payload, $serviceSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'sid' => Values::array_get($payload, 'sid'), 'uniqueName' => Values::array_get($payload, 'unique_name'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), 'revision' => Values::array_get($payload, 'revision'), 'dateExpires' => Deserialize::dateTime(Values::array_get($payload, 'date_expires')), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'createdBy' => Values::array_get($payload, 'created_by'), ); $this->solution = array('serviceSid' => $serviceSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Sync\V1\Service\SyncMapContext Context for this * SyncMapInstance */ protected function proxy() { if (!$this->context) { $this->context = new SyncMapContext( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch a SyncMapInstance * * @return SyncMapInstance Fetched SyncMapInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the SyncMapInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Update the SyncMapInstance * * @param array|Options $options Optional Arguments * @return SyncMapInstance Updated SyncMapInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Access the syncMapItems * * @return \Twilio\Rest\Sync\V1\Service\SyncMap\SyncMapItemList */ protected function getSyncMapItems() { return $this->proxy()->syncMapItems; } /** * Access the syncMapPermissions * * @return \Twilio\Rest\Sync\V1\Service\SyncMap\SyncMapPermissionList */ protected function getSyncMapPermissions() { return $this->proxy()->syncMapPermissions; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Sync.V1.SyncMapInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Sync/V1/Service/SyncStream/StreamMessageList.php 0000644 00000004272 15002236443 0021303 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Sync\V1\Service\SyncStream; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class StreamMessageList extends ListResource { /** * Construct the StreamMessageList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Sync Service that the resource is * associated with * @param string $streamSid The unique string that identifies the resource * @return \Twilio\Rest\Sync\V1\Service\SyncStream\StreamMessageList */ public function __construct(Version $version, $serviceSid, $streamSid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, 'streamSid' => $streamSid, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Streams/' . \rawurlencode($streamSid) . '/Messages'; } /** * Create a new StreamMessageInstance * * @param array $data A JSON string that represents an arbitrary, schema-less * object that makes up the Stream Message body * @return StreamMessageInstance Newly created StreamMessageInstance * @throws TwilioException When an HTTP error occurs. */ public function create($data) { $data = Values::of(array('Data' => Serialize::jsonObject($data), )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new StreamMessageInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['streamSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Sync.V1.StreamMessageList]'; } } sdk/src/Twilio/Rest/Sync/V1/Service/SyncStream/StreamMessageInstance.php 0000644 00000004225 15002236443 0022132 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Sync\V1\Service\SyncStream; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * * @property string $sid * @property array $data */ class StreamMessageInstance extends InstanceResource { /** * Initialize the StreamMessageInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the Sync Service that the resource is * associated with * @param string $streamSid The unique string that identifies the resource * @return \Twilio\Rest\Sync\V1\Service\SyncStream\StreamMessageInstance */ public function __construct(Version $version, array $payload, $serviceSid, $streamSid) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'sid' => Values::array_get($payload, 'sid'), 'data' => Values::array_get($payload, 'data'), ); $this->solution = array('serviceSid' => $serviceSid, 'streamSid' => $streamSid, ); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Sync.V1.StreamMessageInstance]'; } } sdk/src/Twilio/Rest/Sync/V1/Service/SyncStream/StreamMessagePage.php 0000644 00000001727 15002236443 0021246 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Sync\V1\Service\SyncStream; use Twilio\Page; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class StreamMessagePage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new StreamMessageInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['streamSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Sync.V1.StreamMessagePage]'; } } sdk/src/Twilio/Rest/Sync/V1/Service/SyncList/SyncListItemContext.php 0000644 00000007077 15002236443 0021331 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Sync\V1\Service\SyncList; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class SyncListItemContext extends InstanceContext { /** * Initialize the SyncListItemContext * * @param \Twilio\Version $version Version that contains the resource * @param string $serviceSid The SID of the Sync Service with the Sync List * Item resource to fetch * @param string $listSid The SID of the Sync List with the Sync List Item * resource to fetch * @param int $index The index of the Sync List Item resource to fetch * @return \Twilio\Rest\Sync\V1\Service\SyncList\SyncListItemContext */ public function __construct(Version $version, $serviceSid, $listSid, $index) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, 'listSid' => $listSid, 'index' => $index, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Lists/' . \rawurlencode($listSid) . '/Items/' . \rawurlencode($index) . ''; } /** * Fetch a SyncListItemInstance * * @return SyncListItemInstance Fetched SyncListItemInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new SyncListItemInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['listSid'], $this->solution['index'] ); } /** * Deletes the SyncListItemInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Update the SyncListItemInstance * * @param array|Options $options Optional Arguments * @return SyncListItemInstance Updated SyncListItemInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { $options = new Values($options); $data = Values::of(array( 'Data' => Serialize::jsonObject($options['data']), 'Ttl' => $options['ttl'], 'ItemTtl' => $options['itemTtl'], 'CollectionTtl' => $options['collectionTtl'], )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new SyncListItemInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['listSid'], $this->solution['index'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Sync.V1.SyncListItemContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Sync/V1/Service/SyncList/SyncListPermissionList.php 0000644 00000013111 15002236443 0022034 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Sync\V1\Service\SyncList; use Twilio\ListResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class SyncListPermissionList extends ListResource { /** * Construct the SyncListPermissionList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Sync Service that the resource is * associated with * @param string $listSid The SID of the Sync List to which the Permission * applies * @return \Twilio\Rest\Sync\V1\Service\SyncList\SyncListPermissionList */ public function __construct(Version $version, $serviceSid, $listSid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, 'listSid' => $listSid, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Lists/' . \rawurlencode($listSid) . '/Permissions'; } /** * Streams SyncListPermissionInstance records from the API as a generator * stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads SyncListPermissionInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return SyncListPermissionInstance[] Array of results */ public function read($limit = null, $pageSize = null) { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of SyncListPermissionInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of SyncListPermissionInstance */ public function page($pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $params = Values::of(array( 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new SyncListPermissionPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of SyncListPermissionInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of SyncListPermissionInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new SyncListPermissionPage($this->version, $response, $this->solution); } /** * Constructs a SyncListPermissionContext * * @param string $identity The application-defined string that uniquely * identifies the User's Sync List Permission resource * to fetch * @return \Twilio\Rest\Sync\V1\Service\SyncList\SyncListPermissionContext */ public function getContext($identity) { return new SyncListPermissionContext( $this->version, $this->solution['serviceSid'], $this->solution['listSid'], $identity ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Sync.V1.SyncListPermissionList]'; } } sdk/src/Twilio/Rest/Sync/V1/Service/SyncList/SyncListPermissionPage.php 0000644 00000001742 15002236443 0022004 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Sync\V1\Service\SyncList; use Twilio\Page; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class SyncListPermissionPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new SyncListPermissionInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['listSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Sync.V1.SyncListPermissionPage]'; } } sdk/src/Twilio/Rest/Sync/V1/Service/SyncList/SyncListItemPage.php 0000644 00000001720 15002236443 0020546 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Sync\V1\Service\SyncList; use Twilio\Page; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class SyncListItemPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new SyncListItemInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['listSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Sync.V1.SyncListItemPage]'; } } sdk/src/Twilio/Rest/Sync/V1/Service/SyncList/SyncListItemList.php 0000644 00000015512 15002236443 0020611 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Sync\V1\Service\SyncList; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class SyncListItemList extends ListResource { /** * Construct the SyncListItemList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Sync Service that the resource is * associated with * @param string $listSid The SID of the Sync List that contains the List Item * @return \Twilio\Rest\Sync\V1\Service\SyncList\SyncListItemList */ public function __construct(Version $version, $serviceSid, $listSid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, 'listSid' => $listSid, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Lists/' . \rawurlencode($listSid) . '/Items'; } /** * Create a new SyncListItemInstance * * @param array $data A JSON string that represents an arbitrary, schema-less * object that the List Item stores * @param array|Options $options Optional Arguments * @return SyncListItemInstance Newly created SyncListItemInstance * @throws TwilioException When an HTTP error occurs. */ public function create($data, $options = array()) { $options = new Values($options); $data = Values::of(array( 'Data' => Serialize::jsonObject($data), 'Ttl' => $options['ttl'], 'ItemTtl' => $options['itemTtl'], 'CollectionTtl' => $options['collectionTtl'], )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new SyncListItemInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['listSid'] ); } /** * Streams SyncListItemInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($options = array(), $limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads SyncListItemInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return SyncListItemInstance[] Array of results */ public function read($options = array(), $limit = null, $pageSize = null) { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Retrieve a single page of SyncListItemInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of SyncListItemInstance */ public function page($options = array(), $pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $options = new Values($options); $params = Values::of(array( 'Order' => $options['order'], 'From' => $options['from'], 'Bounds' => $options['bounds'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new SyncListItemPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of SyncListItemInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of SyncListItemInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new SyncListItemPage($this->version, $response, $this->solution); } /** * Constructs a SyncListItemContext * * @param int $index The index of the Sync List Item resource to fetch * @return \Twilio\Rest\Sync\V1\Service\SyncList\SyncListItemContext */ public function getContext($index) { return new SyncListItemContext( $this->version, $this->solution['serviceSid'], $this->solution['listSid'], $index ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Sync.V1.SyncListItemList]'; } } sdk/src/Twilio/Rest/Sync/V1/Service/SyncList/SyncListItemOptions.php 0000644 00000024070 15002236443 0021330 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Sync\V1\Service\SyncList; 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 SyncListItemOptions { /** * @param int $ttl An alias for item_ttl * @param int $itemTtl How long, in seconds, before the List Item expires * @param int $collectionTtl How long, in seconds, before the List Item's * parent Sync List expires * @return CreateSyncListItemOptions Options builder */ public static function create($ttl = Values::NONE, $itemTtl = Values::NONE, $collectionTtl = Values::NONE) { return new CreateSyncListItemOptions($ttl, $itemTtl, $collectionTtl); } /** * @param string $order The order to return the List Items * @param string $from The index of the first Sync List Item resource to read * @param string $bounds Whether to include the List Item referenced by the * from parameter * @return ReadSyncListItemOptions Options builder */ public static function read($order = Values::NONE, $from = Values::NONE, $bounds = Values::NONE) { return new ReadSyncListItemOptions($order, $from, $bounds); } /** * @param array $data A JSON string that represents an arbitrary, schema-less * object that the List Item stores * @param int $ttl An alias for item_ttl * @param int $itemTtl How long, in seconds, before the List Item expires * @param int $collectionTtl How long, in seconds, before the List Item's * parent Sync List expires * @return UpdateSyncListItemOptions Options builder */ public static function update($data = Values::NONE, $ttl = Values::NONE, $itemTtl = Values::NONE, $collectionTtl = Values::NONE) { return new UpdateSyncListItemOptions($data, $ttl, $itemTtl, $collectionTtl); } } class CreateSyncListItemOptions extends Options { /** * @param int $ttl An alias for item_ttl * @param int $itemTtl How long, in seconds, before the List Item expires * @param int $collectionTtl How long, in seconds, before the List Item's * parent Sync List expires */ public function __construct($ttl = Values::NONE, $itemTtl = Values::NONE, $collectionTtl = Values::NONE) { $this->options['ttl'] = $ttl; $this->options['itemTtl'] = $itemTtl; $this->options['collectionTtl'] = $collectionTtl; } /** * An alias for `item_ttl`. If both parameters are provided, this value is ignored. * * @param int $ttl An alias for item_ttl * @return $this Fluent Builder */ public function setTtl($ttl) { $this->options['ttl'] = $ttl; return $this; } /** * How long, in seconds, before the List Item expires (time-to-live) and is deleted. Can be an integer from 0 to 31,536,000 (1 year). The default value is `0`, which means the List Item does not expire. The List Item will be deleted automatically after it expires, but there can be a delay between the expiration time and the resources's deletion. * * @param int $itemTtl How long, in seconds, before the List Item expires * @return $this Fluent Builder */ public function setItemTtl($itemTtl) { $this->options['itemTtl'] = $itemTtl; return $this; } /** * How long, in seconds, before the List Item's parent Sync List expires (time-to-live) and is deleted. Can be an integer from 0 to 31,536,000 (1 year). The default value is `0`, which means the parent Sync List does not expire. The Sync List will be deleted automatically after it expires, but there can be a delay between the expiration time and the resources's deletion. * * @param int $collectionTtl How long, in seconds, before the List Item's * parent Sync List expires * @return $this Fluent Builder */ public function setCollectionTtl($collectionTtl) { $this->options['collectionTtl'] = $collectionTtl; 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.Sync.V1.CreateSyncListItemOptions ' . \implode(' ', $options) . ']'; } } class ReadSyncListItemOptions extends Options { /** * @param string $order The order to return the List Items * @param string $from The index of the first Sync List Item resource to read * @param string $bounds Whether to include the List Item referenced by the * from parameter */ public function __construct($order = Values::NONE, $from = Values::NONE, $bounds = Values::NONE) { $this->options['order'] = $order; $this->options['from'] = $from; $this->options['bounds'] = $bounds; } /** * How to order the List Items returned by their `index` value. Can be: `asc` (ascending) or `desc` (descending) and the default is ascending. * * @param string $order The order to return the List Items * @return $this Fluent Builder */ public function setOrder($order) { $this->options['order'] = $order; return $this; } /** * The `index` of the first Sync List Item resource to read. See also `bounds`. * * @param string $from The index of the first Sync List Item resource to read * @return $this Fluent Builder */ public function setFrom($from) { $this->options['from'] = $from; return $this; } /** * Whether to include the List Item referenced by the `from` parameter. Can be: `inclusive` to include the List Item referenced by the `from` parameter or `exclusive` to start with the next List Item. The default value is `inclusive`. * * @param string $bounds Whether to include the List Item referenced by the * from parameter * @return $this Fluent Builder */ public function setBounds($bounds) { $this->options['bounds'] = $bounds; 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.Sync.V1.ReadSyncListItemOptions ' . \implode(' ', $options) . ']'; } } class UpdateSyncListItemOptions extends Options { /** * @param array $data A JSON string that represents an arbitrary, schema-less * object that the List Item stores * @param int $ttl An alias for item_ttl * @param int $itemTtl How long, in seconds, before the List Item expires * @param int $collectionTtl How long, in seconds, before the List Item's * parent Sync List expires */ public function __construct($data = Values::NONE, $ttl = Values::NONE, $itemTtl = Values::NONE, $collectionTtl = Values::NONE) { $this->options['data'] = $data; $this->options['ttl'] = $ttl; $this->options['itemTtl'] = $itemTtl; $this->options['collectionTtl'] = $collectionTtl; } /** * A JSON string that represents an arbitrary, schema-less object that the List Item stores. Can be up to 16KB in length. * * @param array $data A JSON string that represents an arbitrary, schema-less * object that the List Item stores * @return $this Fluent Builder */ public function setData($data) { $this->options['data'] = $data; return $this; } /** * An alias for `item_ttl`. If both parameters are provided, this value is ignored. * * @param int $ttl An alias for item_ttl * @return $this Fluent Builder */ public function setTtl($ttl) { $this->options['ttl'] = $ttl; return $this; } /** * How long, in seconds, before the List Item expires (time-to-live) and is deleted. Can be an integer from 0 to 31,536,000 (1 year). The default value is `0`, which means the List Item does not expire. The List Item will be deleted automatically after it expires, but there can be a delay between the expiration time and the resources's deletion. * * @param int $itemTtl How long, in seconds, before the List Item expires * @return $this Fluent Builder */ public function setItemTtl($itemTtl) { $this->options['itemTtl'] = $itemTtl; return $this; } /** * How long, in seconds, before the List Item's parent Sync List expires (time-to-live) and is deleted. Can be an integer from 0 to 31,536,000 (1 year). The default value is `0`, which means the parent Sync List does not expire. The Sync List will be deleted automatically after it expires, but there can be a delay between the expiration time and the resources's deletion. * * @param int $collectionTtl How long, in seconds, before the List Item's * parent Sync List expires * @return $this Fluent Builder */ public function setCollectionTtl($collectionTtl) { $this->options['collectionTtl'] = $collectionTtl; 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.Sync.V1.UpdateSyncListItemOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Sync/V1/Service/SyncList/SyncListPermissionContext.php 0000644 00000007501 15002236443 0022553 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Sync\V1\Service\SyncList; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class SyncListPermissionContext extends InstanceContext { /** * Initialize the SyncListPermissionContext * * @param \Twilio\Version $version Version that contains the resource * @param string $serviceSid The SID of the Sync Service with the Sync List * Permission resource to fetch * @param string $listSid The SID of the Sync List with the Sync List * Permission resource to fetch * @param string $identity The application-defined string that uniquely * identifies the User's Sync List Permission resource * to fetch * @return \Twilio\Rest\Sync\V1\Service\SyncList\SyncListPermissionContext */ public function __construct(Version $version, $serviceSid, $listSid, $identity) { parent::__construct($version); // Path Solution $this->solution = array( 'serviceSid' => $serviceSid, 'listSid' => $listSid, 'identity' => $identity, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Lists/' . \rawurlencode($listSid) . '/Permissions/' . \rawurlencode($identity) . ''; } /** * Fetch a SyncListPermissionInstance * * @return SyncListPermissionInstance Fetched SyncListPermissionInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new SyncListPermissionInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['listSid'], $this->solution['identity'] ); } /** * Deletes the SyncListPermissionInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Update the SyncListPermissionInstance * * @param bool $read Read access * @param bool $write Write access * @param bool $manage Manage access * @return SyncListPermissionInstance Updated SyncListPermissionInstance * @throws TwilioException When an HTTP error occurs. */ public function update($read, $write, $manage) { $data = Values::of(array( 'Read' => Serialize::booleanToString($read), 'Write' => Serialize::booleanToString($write), 'Manage' => Serialize::booleanToString($manage), )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new SyncListPermissionInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['listSid'], $this->solution['identity'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Sync.V1.SyncListPermissionContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Sync/V1/Service/SyncList/SyncListPermissionInstance.php 0000644 00000011536 15002236443 0022676 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Sync\V1\Service\SyncList; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * * @property string $accountSid * @property string $serviceSid * @property string $listSid * @property string $identity * @property bool $read * @property bool $write * @property bool $manage * @property string $url */ class SyncListPermissionInstance extends InstanceResource { /** * Initialize the SyncListPermissionInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the Sync Service that the resource is * associated with * @param string $listSid The SID of the Sync List to which the Permission * applies * @param string $identity The application-defined string that uniquely * identifies the User's Sync List Permission resource * to fetch * @return \Twilio\Rest\Sync\V1\Service\SyncList\SyncListPermissionInstance */ public function __construct(Version $version, array $payload, $serviceSid, $listSid, $identity = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'listSid' => Values::array_get($payload, 'list_sid'), 'identity' => Values::array_get($payload, 'identity'), 'read' => Values::array_get($payload, 'read'), 'write' => Values::array_get($payload, 'write'), 'manage' => Values::array_get($payload, 'manage'), 'url' => Values::array_get($payload, 'url'), ); $this->solution = array( 'serviceSid' => $serviceSid, 'listSid' => $listSid, 'identity' => $identity ?: $this->properties['identity'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Sync\V1\Service\SyncList\SyncListPermissionContext Context for this SyncListPermissionInstance */ protected function proxy() { if (!$this->context) { $this->context = new SyncListPermissionContext( $this->version, $this->solution['serviceSid'], $this->solution['listSid'], $this->solution['identity'] ); } return $this->context; } /** * Fetch a SyncListPermissionInstance * * @return SyncListPermissionInstance Fetched SyncListPermissionInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the SyncListPermissionInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Update the SyncListPermissionInstance * * @param bool $read Read access * @param bool $write Write access * @param bool $manage Manage access * @return SyncListPermissionInstance Updated SyncListPermissionInstance * @throws TwilioException When an HTTP error occurs. */ public function update($read, $write, $manage) { return $this->proxy()->update($read, $write, $manage); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Sync.V1.SyncListPermissionInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Sync/V1/Service/SyncList/SyncListItemInstance.php 0000644 00000012147 15002236443 0021443 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Sync\V1\Service\SyncList; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * * @property int $index * @property string $accountSid * @property string $serviceSid * @property string $listSid * @property string $url * @property string $revision * @property array $data * @property \DateTime $dateExpires * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $createdBy */ class SyncListItemInstance extends InstanceResource { /** * Initialize the SyncListItemInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the Sync Service that the resource is * associated with * @param string $listSid The SID of the Sync List that contains the List Item * @param int $index The index of the Sync List Item resource to fetch * @return \Twilio\Rest\Sync\V1\Service\SyncList\SyncListItemInstance */ public function __construct(Version $version, array $payload, $serviceSid, $listSid, $index = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'index' => Values::array_get($payload, 'index'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'listSid' => Values::array_get($payload, 'list_sid'), 'url' => Values::array_get($payload, 'url'), 'revision' => Values::array_get($payload, 'revision'), 'data' => Values::array_get($payload, 'data'), 'dateExpires' => Deserialize::dateTime(Values::array_get($payload, 'date_expires')), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'createdBy' => Values::array_get($payload, 'created_by'), ); $this->solution = array( 'serviceSid' => $serviceSid, 'listSid' => $listSid, 'index' => $index ?: $this->properties['index'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Sync\V1\Service\SyncList\SyncListItemContext Context * for this * SyncListItemInstance */ protected function proxy() { if (!$this->context) { $this->context = new SyncListItemContext( $this->version, $this->solution['serviceSid'], $this->solution['listSid'], $this->solution['index'] ); } return $this->context; } /** * Fetch a SyncListItemInstance * * @return SyncListItemInstance Fetched SyncListItemInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the SyncListItemInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Update the SyncListItemInstance * * @param array|Options $options Optional Arguments * @return SyncListItemInstance Updated SyncListItemInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Sync.V1.SyncListItemInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Sync/V1/Service/SyncMapContext.php 0000644 00000013103 15002236443 0016527 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Sync\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Rest\Sync\V1\Service\SyncMap\SyncMapItemList; use Twilio\Rest\Sync\V1\Service\SyncMap\SyncMapPermissionList; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * * @property \Twilio\Rest\Sync\V1\Service\SyncMap\SyncMapItemList $syncMapItems * @property \Twilio\Rest\Sync\V1\Service\SyncMap\SyncMapPermissionList $syncMapPermissions * @method \Twilio\Rest\Sync\V1\Service\SyncMap\SyncMapItemContext syncMapItems(string $key) * @method \Twilio\Rest\Sync\V1\Service\SyncMap\SyncMapPermissionContext syncMapPermissions(string $identity) */ class SyncMapContext extends InstanceContext { protected $_syncMapItems = null; protected $_syncMapPermissions = null; /** * Initialize the SyncMapContext * * @param \Twilio\Version $version Version that contains the resource * @param string $serviceSid The SID of the Sync Service with the Sync Map * resource to fetch * @param string $sid The SID of the Sync Map resource to fetch * @return \Twilio\Rest\Sync\V1\Service\SyncMapContext */ public function __construct(Version $version, $serviceSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, 'sid' => $sid, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Maps/' . \rawurlencode($sid) . ''; } /** * Fetch a SyncMapInstance * * @return SyncMapInstance Fetched SyncMapInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new SyncMapInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Deletes the SyncMapInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Update the SyncMapInstance * * @param array|Options $options Optional Arguments * @return SyncMapInstance Updated SyncMapInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { $options = new Values($options); $data = Values::of(array('Ttl' => $options['ttl'], 'CollectionTtl' => $options['collectionTtl'], )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new SyncMapInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Access the syncMapItems * * @return \Twilio\Rest\Sync\V1\Service\SyncMap\SyncMapItemList */ protected function getSyncMapItems() { if (!$this->_syncMapItems) { $this->_syncMapItems = new SyncMapItemList( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->_syncMapItems; } /** * Access the syncMapPermissions * * @return \Twilio\Rest\Sync\V1\Service\SyncMap\SyncMapPermissionList */ protected function getSyncMapPermissions() { if (!$this->_syncMapPermissions) { $this->_syncMapPermissions = new SyncMapPermissionList( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->_syncMapPermissions; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get($name) { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Sync.V1.SyncMapContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Sync/V1/Service/SyncStreamInstance.php 0000644 00000011660 15002236443 0017373 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Sync\V1\Service; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * * @property string $sid * @property string $uniqueName * @property string $accountSid * @property string $serviceSid * @property string $url * @property array $links * @property \DateTime $dateExpires * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $createdBy */ class SyncStreamInstance extends InstanceResource { protected $_streamMessages = null; /** * Initialize the SyncStreamInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the Sync Service that the resource is * associated with * @param string $sid The SID of the Stream resource to fetch * @return \Twilio\Rest\Sync\V1\Service\SyncStreamInstance */ public function __construct(Version $version, array $payload, $serviceSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'sid' => Values::array_get($payload, 'sid'), 'uniqueName' => Values::array_get($payload, 'unique_name'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), 'dateExpires' => Deserialize::dateTime(Values::array_get($payload, 'date_expires')), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'createdBy' => Values::array_get($payload, 'created_by'), ); $this->solution = array('serviceSid' => $serviceSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Sync\V1\Service\SyncStreamContext Context for this * SyncStreamInstance */ protected function proxy() { if (!$this->context) { $this->context = new SyncStreamContext( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch a SyncStreamInstance * * @return SyncStreamInstance Fetched SyncStreamInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the SyncStreamInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Update the SyncStreamInstance * * @param array|Options $options Optional Arguments * @return SyncStreamInstance Updated SyncStreamInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Access the streamMessages * * @return \Twilio\Rest\Sync\V1\Service\SyncStream\StreamMessageList */ protected function getStreamMessages() { return $this->proxy()->streamMessages; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Sync.V1.SyncStreamInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Sync/V1/Service/SyncMapList.php 0000644 00000013402 15002236443 0016020 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Sync\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class SyncMapList extends ListResource { /** * Construct the SyncMapList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Sync Service that the resource is * associated with * @return \Twilio\Rest\Sync\V1\Service\SyncMapList */ public function __construct(Version $version, $serviceSid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Maps'; } /** * Create a new SyncMapInstance * * @param array|Options $options Optional Arguments * @return SyncMapInstance Newly created SyncMapInstance * @throws TwilioException When an HTTP error occurs. */ public function create($options = array()) { $options = new Values($options); $data = Values::of(array( 'UniqueName' => $options['uniqueName'], 'Ttl' => $options['ttl'], 'CollectionTtl' => $options['collectionTtl'], )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new SyncMapInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Streams SyncMapInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads SyncMapInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return SyncMapInstance[] Array of results */ public function read($limit = null, $pageSize = null) { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of SyncMapInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of SyncMapInstance */ public function page($pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $params = Values::of(array( 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new SyncMapPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of SyncMapInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of SyncMapInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new SyncMapPage($this->version, $response, $this->solution); } /** * Constructs a SyncMapContext * * @param string $sid The SID of the Sync Map resource to fetch * @return \Twilio\Rest\Sync\V1\Service\SyncMapContext */ public function getContext($sid) { return new SyncMapContext($this->version, $this->solution['serviceSid'], $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Sync.V1.SyncMapList]'; } } sdk/src/Twilio/Rest/Sync/V1/Service/SyncStreamOptions.php 0000644 00000010737 15002236443 0017266 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Sync\V1\Service; 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 SyncStreamOptions { /** * @param string $uniqueName An application-defined string that uniquely * identifies the resource * @param int $ttl How long, in seconds, before the Stream expires and is * deleted * @return CreateSyncStreamOptions Options builder */ public static function create($uniqueName = Values::NONE, $ttl = Values::NONE) { return new CreateSyncStreamOptions($uniqueName, $ttl); } /** * @param int $ttl How long, in seconds, before the Stream expires and is * deleted * @return UpdateSyncStreamOptions Options builder */ public static function update($ttl = Values::NONE) { return new UpdateSyncStreamOptions($ttl); } } class CreateSyncStreamOptions extends Options { /** * @param string $uniqueName An application-defined string that uniquely * identifies the resource * @param int $ttl How long, in seconds, before the Stream expires and is * deleted */ public function __construct($uniqueName = Values::NONE, $ttl = Values::NONE) { $this->options['uniqueName'] = $uniqueName; $this->options['ttl'] = $ttl; } /** * An application-defined string that uniquely identifies the resource. This value must be unique within its Service and it can be up to 320 characters long. The `unique_name` value can be used as an alternative to the `sid` in the URL path to address the resource. * * @param string $uniqueName An application-defined string that uniquely * identifies the resource * @return $this Fluent Builder */ public function setUniqueName($uniqueName) { $this->options['uniqueName'] = $uniqueName; return $this; } /** * How long, in seconds, before the Stream expires and is deleted (time-to-live). Can be an integer from 0 to 31,536,000 (1 year). The default value is `0`, which means the Stream does not expire. The Stream will be deleted automatically after it expires, but there can be a delay between the expiration time and the resources's deletion. * * @param int $ttl How long, in seconds, before the Stream expires and is * deleted * @return $this Fluent Builder */ public function setTtl($ttl) { $this->options['ttl'] = $ttl; 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.Sync.V1.CreateSyncStreamOptions ' . \implode(' ', $options) . ']'; } } class UpdateSyncStreamOptions extends Options { /** * @param int $ttl How long, in seconds, before the Stream expires and is * deleted */ public function __construct($ttl = Values::NONE) { $this->options['ttl'] = $ttl; } /** * How long, in seconds, before the Stream expires and is deleted (time-to-live). Can be an integer from 0 to 31,536,000 (1 year). The default value is `0`, which means the Stream does not expire. The Stream will be deleted automatically after it expires, but there can be a delay between the expiration time and the resources's deletion. * * @param int $ttl How long, in seconds, before the Stream expires and is * deleted * @return $this Fluent Builder */ public function setTtl($ttl) { $this->options['ttl'] = $ttl; 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.Sync.V1.UpdateSyncStreamOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Sync/V1/Service/SyncListContext.php 0000644 00000013164 15002236443 0016734 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Sync\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Rest\Sync\V1\Service\SyncList\SyncListItemList; use Twilio\Rest\Sync\V1\Service\SyncList\SyncListPermissionList; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * * @property \Twilio\Rest\Sync\V1\Service\SyncList\SyncListItemList $syncListItems * @property \Twilio\Rest\Sync\V1\Service\SyncList\SyncListPermissionList $syncListPermissions * @method \Twilio\Rest\Sync\V1\Service\SyncList\SyncListItemContext syncListItems(int $index) * @method \Twilio\Rest\Sync\V1\Service\SyncList\SyncListPermissionContext syncListPermissions(string $identity) */ class SyncListContext extends InstanceContext { protected $_syncListItems = null; protected $_syncListPermissions = null; /** * Initialize the SyncListContext * * @param \Twilio\Version $version Version that contains the resource * @param string $serviceSid The SID of the Sync Service with the Sync List * resource to fetch * @param string $sid The SID of the Sync List resource to fetch * @return \Twilio\Rest\Sync\V1\Service\SyncListContext */ public function __construct(Version $version, $serviceSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, 'sid' => $sid, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Lists/' . \rawurlencode($sid) . ''; } /** * Fetch a SyncListInstance * * @return SyncListInstance Fetched SyncListInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new SyncListInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Deletes the SyncListInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Update the SyncListInstance * * @param array|Options $options Optional Arguments * @return SyncListInstance Updated SyncListInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { $options = new Values($options); $data = Values::of(array('Ttl' => $options['ttl'], 'CollectionTtl' => $options['collectionTtl'], )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new SyncListInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Access the syncListItems * * @return \Twilio\Rest\Sync\V1\Service\SyncList\SyncListItemList */ protected function getSyncListItems() { if (!$this->_syncListItems) { $this->_syncListItems = new SyncListItemList( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->_syncListItems; } /** * Access the syncListPermissions * * @return \Twilio\Rest\Sync\V1\Service\SyncList\SyncListPermissionList */ protected function getSyncListPermissions() { if (!$this->_syncListPermissions) { $this->_syncListPermissions = new SyncListPermissionList( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->_syncListPermissions; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get($name) { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Sync.V1.SyncListContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Sync/V1/Service/SyncListList.php 0000644 00000013430 15002236443 0016217 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Sync\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class SyncListList extends ListResource { /** * Construct the SyncListList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Sync Service that the resource is * associated with * @return \Twilio\Rest\Sync\V1\Service\SyncListList */ public function __construct(Version $version, $serviceSid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Lists'; } /** * Create a new SyncListInstance * * @param array|Options $options Optional Arguments * @return SyncListInstance Newly created SyncListInstance * @throws TwilioException When an HTTP error occurs. */ public function create($options = array()) { $options = new Values($options); $data = Values::of(array( 'UniqueName' => $options['uniqueName'], 'Ttl' => $options['ttl'], 'CollectionTtl' => $options['collectionTtl'], )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new SyncListInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Streams SyncListInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads SyncListInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return SyncListInstance[] Array of results */ public function read($limit = null, $pageSize = null) { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of SyncListInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of SyncListInstance */ public function page($pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $params = Values::of(array( 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new SyncListPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of SyncListInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of SyncListInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new SyncListPage($this->version, $response, $this->solution); } /** * Constructs a SyncListContext * * @param string $sid The SID of the Sync List resource to fetch * @return \Twilio\Rest\Sync\V1\Service\SyncListContext */ public function getContext($sid) { return new SyncListContext($this->version, $this->solution['serviceSid'], $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Sync.V1.SyncListList]'; } } sdk/src/Twilio/Rest/Sync/V1/Service/DocumentInstance.php 0000644 00000012140 15002236443 0017053 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Sync\V1\Service; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * * @property string $sid * @property string $uniqueName * @property string $accountSid * @property string $serviceSid * @property string $url * @property array $links * @property string $revision * @property array $data * @property \DateTime $dateExpires * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $createdBy */ class DocumentInstance extends InstanceResource { protected $_documentPermissions = null; /** * Initialize the DocumentInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the Sync Service that the resource is * associated with * @param string $sid The SID of the Document resource to fetch * @return \Twilio\Rest\Sync\V1\Service\DocumentInstance */ public function __construct(Version $version, array $payload, $serviceSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'sid' => Values::array_get($payload, 'sid'), 'uniqueName' => Values::array_get($payload, 'unique_name'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), 'revision' => Values::array_get($payload, 'revision'), 'data' => Values::array_get($payload, 'data'), 'dateExpires' => Deserialize::dateTime(Values::array_get($payload, 'date_expires')), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'createdBy' => Values::array_get($payload, 'created_by'), ); $this->solution = array('serviceSid' => $serviceSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Sync\V1\Service\DocumentContext Context for this * DocumentInstance */ protected function proxy() { if (!$this->context) { $this->context = new DocumentContext( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch a DocumentInstance * * @return DocumentInstance Fetched DocumentInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the DocumentInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Update the DocumentInstance * * @param array|Options $options Optional Arguments * @return DocumentInstance Updated DocumentInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Access the documentPermissions * * @return \Twilio\Rest\Sync\V1\Service\Document\DocumentPermissionList */ protected function getDocumentPermissions() { return $this->proxy()->documentPermissions; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Sync.V1.DocumentInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Sync/V1/Service/SyncStreamPage.php 0000644 00000001553 15002236443 0016503 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Sync\V1\Service; use Twilio\Page; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class SyncStreamPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new SyncStreamInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Sync.V1.SyncStreamPage]'; } } sdk/src/Twilio/Rest/Sync/V1/Service/DocumentContext.php 0000644 00000011731 15002236443 0016740 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Sync\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Rest\Sync\V1\Service\Document\DocumentPermissionList; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * * @property \Twilio\Rest\Sync\V1\Service\Document\DocumentPermissionList $documentPermissions * @method \Twilio\Rest\Sync\V1\Service\Document\DocumentPermissionContext documentPermissions(string $identity) */ class DocumentContext extends InstanceContext { protected $_documentPermissions = null; /** * Initialize the DocumentContext * * @param \Twilio\Version $version Version that contains the resource * @param string $serviceSid The SID of the Sync Service with the Document * resource to fetch * @param string $sid The SID of the Document resource to fetch * @return \Twilio\Rest\Sync\V1\Service\DocumentContext */ public function __construct(Version $version, $serviceSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, 'sid' => $sid, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Documents/' . \rawurlencode($sid) . ''; } /** * Fetch a DocumentInstance * * @return DocumentInstance Fetched DocumentInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new DocumentInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Deletes the DocumentInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Update the DocumentInstance * * @param array|Options $options Optional Arguments * @return DocumentInstance Updated DocumentInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { $options = new Values($options); $data = Values::of(array( 'Data' => Serialize::jsonObject($options['data']), 'Ttl' => $options['ttl'], )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new DocumentInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Access the documentPermissions * * @return \Twilio\Rest\Sync\V1\Service\Document\DocumentPermissionList */ protected function getDocumentPermissions() { if (!$this->_documentPermissions) { $this->_documentPermissions = new DocumentPermissionList( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->_documentPermissions; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get($name) { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Sync.V1.DocumentContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Sync/V1/Service/DocumentList.php 0000644 00000013466 15002236443 0016236 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Sync\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class DocumentList extends ListResource { /** * Construct the DocumentList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Sync Service that the resource is * associated with * @return \Twilio\Rest\Sync\V1\Service\DocumentList */ public function __construct(Version $version, $serviceSid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Documents'; } /** * Create a new DocumentInstance * * @param array|Options $options Optional Arguments * @return DocumentInstance Newly created DocumentInstance * @throws TwilioException When an HTTP error occurs. */ public function create($options = array()) { $options = new Values($options); $data = Values::of(array( 'UniqueName' => $options['uniqueName'], 'Data' => Serialize::jsonObject($options['data']), 'Ttl' => $options['ttl'], )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new DocumentInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Streams DocumentInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads DocumentInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return DocumentInstance[] Array of results */ public function read($limit = null, $pageSize = null) { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of DocumentInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of DocumentInstance */ public function page($pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $params = Values::of(array( 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new DocumentPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of DocumentInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of DocumentInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new DocumentPage($this->version, $response, $this->solution); } /** * Constructs a DocumentContext * * @param string $sid The SID of the Document resource to fetch * @return \Twilio\Rest\Sync\V1\Service\DocumentContext */ public function getContext($sid) { return new DocumentContext($this->version, $this->solution['serviceSid'], $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Sync.V1.DocumentList]'; } } sdk/src/Twilio/Rest/Sync/V1/Service/SyncListInstance.php 0000644 00000012421 15002236443 0017047 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Sync\V1\Service; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * * @property string $sid * @property string $uniqueName * @property string $accountSid * @property string $serviceSid * @property string $url * @property array $links * @property string $revision * @property \DateTime $dateExpires * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $createdBy */ class SyncListInstance extends InstanceResource { protected $_syncListItems = null; protected $_syncListPermissions = null; /** * Initialize the SyncListInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the Sync Service that the resource is * associated with * @param string $sid The SID of the Sync List resource to fetch * @return \Twilio\Rest\Sync\V1\Service\SyncListInstance */ public function __construct(Version $version, array $payload, $serviceSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'sid' => Values::array_get($payload, 'sid'), 'uniqueName' => Values::array_get($payload, 'unique_name'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), 'revision' => Values::array_get($payload, 'revision'), 'dateExpires' => Deserialize::dateTime(Values::array_get($payload, 'date_expires')), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'createdBy' => Values::array_get($payload, 'created_by'), ); $this->solution = array('serviceSid' => $serviceSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Sync\V1\Service\SyncListContext Context for this * SyncListInstance */ protected function proxy() { if (!$this->context) { $this->context = new SyncListContext( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch a SyncListInstance * * @return SyncListInstance Fetched SyncListInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the SyncListInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Update the SyncListInstance * * @param array|Options $options Optional Arguments * @return SyncListInstance Updated SyncListInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Access the syncListItems * * @return \Twilio\Rest\Sync\V1\Service\SyncList\SyncListItemList */ protected function getSyncListItems() { return $this->proxy()->syncListItems; } /** * Access the syncListPermissions * * @return \Twilio\Rest\Sync\V1\Service\SyncList\SyncListPermissionList */ protected function getSyncListPermissions() { return $this->proxy()->syncListPermissions; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Sync.V1.SyncListInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Sync/V1/Service/DocumentPage.php 0000644 00000001545 15002236443 0016172 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Sync\V1\Service; use Twilio\Page; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class DocumentPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new DocumentInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Sync.V1.DocumentPage]'; } } sdk/src/Twilio/Rest/Sync/V1/Service/SyncMap/SyncMapItemOptions.php 0000644 00000024536 15002236443 0020743 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Sync\V1\Service\SyncMap; 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 SyncMapItemOptions { /** * @param int $ttl An alias for item_ttl * @param int $itemTtl How long, in seconds, before the Map Item expires * @param int $collectionTtl How long, in seconds, before the Map Item's parent * Sync Map expires and is deleted * @return CreateSyncMapItemOptions Options builder */ public static function create($ttl = Values::NONE, $itemTtl = Values::NONE, $collectionTtl = Values::NONE) { return new CreateSyncMapItemOptions($ttl, $itemTtl, $collectionTtl); } /** * @param string $order How to order the Map Items returned by their key value * @param string $from The index of the first Sync Map Item resource to read * @param string $bounds Whether to include the Map Item referenced by the from * parameter * @return ReadSyncMapItemOptions Options builder */ public static function read($order = Values::NONE, $from = Values::NONE, $bounds = Values::NONE) { return new ReadSyncMapItemOptions($order, $from, $bounds); } /** * @param array $data A JSON string that represents an arbitrary, schema-less * object that the Map Item stores * @param int $ttl An alias for item_ttl * @param int $itemTtl How long, in seconds, before the Map Item expires * @param int $collectionTtl How long, in seconds, before the Map Item's parent * Sync Map expires and is deleted * @return UpdateSyncMapItemOptions Options builder */ public static function update($data = Values::NONE, $ttl = Values::NONE, $itemTtl = Values::NONE, $collectionTtl = Values::NONE) { return new UpdateSyncMapItemOptions($data, $ttl, $itemTtl, $collectionTtl); } } class CreateSyncMapItemOptions extends Options { /** * @param int $ttl An alias for item_ttl * @param int $itemTtl How long, in seconds, before the Map Item expires * @param int $collectionTtl How long, in seconds, before the Map Item's parent * Sync Map expires and is deleted */ public function __construct($ttl = Values::NONE, $itemTtl = Values::NONE, $collectionTtl = Values::NONE) { $this->options['ttl'] = $ttl; $this->options['itemTtl'] = $itemTtl; $this->options['collectionTtl'] = $collectionTtl; } /** * An alias for `item_ttl`. If both parameters are provided, this value is ignored. * * @param int $ttl An alias for item_ttl * @return $this Fluent Builder */ public function setTtl($ttl) { $this->options['ttl'] = $ttl; return $this; } /** * How long, in seconds, before the Map Item expires (time-to-live) and is deleted. Can be an integer from 0 to 31,536,000 (1 year). The default value is `0`, which means the Map Item does not expire. The Map Item will be deleted automatically after it expires, but there can be a delay between the expiration time and the resources's deletion. * * @param int $itemTtl How long, in seconds, before the Map Item expires * @return $this Fluent Builder */ public function setItemTtl($itemTtl) { $this->options['itemTtl'] = $itemTtl; return $this; } /** * How long, in seconds, before the Map Item's parent Sync Map expires (time-to-live) and is deleted. Can be an integer from 0 to 31,536,000 (1 year). The default value is `0`, which means the parent Sync Map does not expire. The Sync Map will be deleted automatically after it expires, but there can be a delay between the expiration time and the resources's deletion. * * @param int $collectionTtl How long, in seconds, before the Map Item's parent * Sync Map expires and is deleted * @return $this Fluent Builder */ public function setCollectionTtl($collectionTtl) { $this->options['collectionTtl'] = $collectionTtl; 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.Sync.V1.CreateSyncMapItemOptions ' . \implode(' ', $options) . ']'; } } class ReadSyncMapItemOptions extends Options { /** * @param string $order How to order the Map Items returned by their key value * @param string $from The index of the first Sync Map Item resource to read * @param string $bounds Whether to include the Map Item referenced by the from * parameter */ public function __construct($order = Values::NONE, $from = Values::NONE, $bounds = Values::NONE) { $this->options['order'] = $order; $this->options['from'] = $from; $this->options['bounds'] = $bounds; } /** * How to order the Map Items returned by their `key` value. Can be: `asc` (ascending) or `desc` (descending) and the default is ascending. Map Items are [ordered lexicographically](https://en.wikipedia.org/wiki/Lexicographical_order) by Item key. * * @param string $order How to order the Map Items returned by their key value * @return $this Fluent Builder */ public function setOrder($order) { $this->options['order'] = $order; return $this; } /** * The `key` of the first Sync Map Item resource to read. See also `bounds`. * * @param string $from The index of the first Sync Map Item resource to read * @return $this Fluent Builder */ public function setFrom($from) { $this->options['from'] = $from; return $this; } /** * Whether to include the Map Item referenced by the `from` parameter. Can be: `inclusive` to include the Map Item referenced by the `from` parameter or `exclusive` to start with the next Map Item. The default value is `inclusive`. * * @param string $bounds Whether to include the Map Item referenced by the from * parameter * @return $this Fluent Builder */ public function setBounds($bounds) { $this->options['bounds'] = $bounds; 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.Sync.V1.ReadSyncMapItemOptions ' . \implode(' ', $options) . ']'; } } class UpdateSyncMapItemOptions extends Options { /** * @param array $data A JSON string that represents an arbitrary, schema-less * object that the Map Item stores * @param int $ttl An alias for item_ttl * @param int $itemTtl How long, in seconds, before the Map Item expires * @param int $collectionTtl How long, in seconds, before the Map Item's parent * Sync Map expires and is deleted */ public function __construct($data = Values::NONE, $ttl = Values::NONE, $itemTtl = Values::NONE, $collectionTtl = Values::NONE) { $this->options['data'] = $data; $this->options['ttl'] = $ttl; $this->options['itemTtl'] = $itemTtl; $this->options['collectionTtl'] = $collectionTtl; } /** * A JSON string that represents an arbitrary, schema-less object that the Map Item stores. Can be up to 16KB in length. * * @param array $data A JSON string that represents an arbitrary, schema-less * object that the Map Item stores * @return $this Fluent Builder */ public function setData($data) { $this->options['data'] = $data; return $this; } /** * An alias for `item_ttl`. If both parameters are provided, this value is ignored. * * @param int $ttl An alias for item_ttl * @return $this Fluent Builder */ public function setTtl($ttl) { $this->options['ttl'] = $ttl; return $this; } /** * How long, in seconds, before the Map Item expires (time-to-live) and is deleted. Can be an integer from 0 to 31,536,000 (1 year). The default value is `0`, which means the Map Item does not expire. The Map Item will be deleted automatically after it expires, but there can be a delay between the expiration time and the resources's deletion. * * @param int $itemTtl How long, in seconds, before the Map Item expires * @return $this Fluent Builder */ public function setItemTtl($itemTtl) { $this->options['itemTtl'] = $itemTtl; return $this; } /** * How long, in seconds, before the Map Item's parent Sync Map expires (time-to-live) and is deleted. Can be an integer from 0 to 31,536,000 (1 year). The default value is `0`, which means the parent Sync Map does not expire. This parameter can only be used when the Map Item's `data` or `ttl` is updated in the same request. The Sync Map will be deleted automatically after it expires, but there can be a delay between the expiration time and the resources's deletion. * * @param int $collectionTtl How long, in seconds, before the Map Item's parent * Sync Map expires and is deleted * @return $this Fluent Builder */ public function setCollectionTtl($collectionTtl) { $this->options['collectionTtl'] = $collectionTtl; 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.Sync.V1.UpdateSyncMapItemOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Sync/V1/Service/SyncMap/SyncMapItemPage.php 0000644 00000001713 15002236443 0020154 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Sync\V1\Service\SyncMap; use Twilio\Page; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class SyncMapItemPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new SyncMapItemInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['mapSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Sync.V1.SyncMapItemPage]'; } } sdk/src/Twilio/Rest/Sync/V1/Service/SyncMap/SyncMapPermissionPage.php 0000644 00000001735 15002236443 0021412 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Sync\V1\Service\SyncMap; use Twilio\Page; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class SyncMapPermissionPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new SyncMapPermissionInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['mapSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Sync.V1.SyncMapPermissionPage]'; } } sdk/src/Twilio/Rest/Sync/V1/Service/SyncMap/SyncMapItemList.php 0000644 00000015621 15002236443 0020216 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Sync\V1\Service\SyncMap; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class SyncMapItemList extends ListResource { /** * Construct the SyncMapItemList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Sync Service that the resource is * associated with * @param string $mapSid The SID of the Sync Map that contains the Map Item * @return \Twilio\Rest\Sync\V1\Service\SyncMap\SyncMapItemList */ public function __construct(Version $version, $serviceSid, $mapSid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, 'mapSid' => $mapSid, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Maps/' . \rawurlencode($mapSid) . '/Items'; } /** * Create a new SyncMapItemInstance * * @param string $key The unique, user-defined key for the Map Item * @param array $data A JSON string that represents an arbitrary, schema-less * object that the Map Item stores * @param array|Options $options Optional Arguments * @return SyncMapItemInstance Newly created SyncMapItemInstance * @throws TwilioException When an HTTP error occurs. */ public function create($key, $data, $options = array()) { $options = new Values($options); $data = Values::of(array( 'Key' => $key, 'Data' => Serialize::jsonObject($data), 'Ttl' => $options['ttl'], 'ItemTtl' => $options['itemTtl'], 'CollectionTtl' => $options['collectionTtl'], )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new SyncMapItemInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['mapSid'] ); } /** * Streams SyncMapItemInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($options = array(), $limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads SyncMapItemInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return SyncMapItemInstance[] Array of results */ public function read($options = array(), $limit = null, $pageSize = null) { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Retrieve a single page of SyncMapItemInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of SyncMapItemInstance */ public function page($options = array(), $pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $options = new Values($options); $params = Values::of(array( 'Order' => $options['order'], 'From' => $options['from'], 'Bounds' => $options['bounds'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new SyncMapItemPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of SyncMapItemInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of SyncMapItemInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new SyncMapItemPage($this->version, $response, $this->solution); } /** * Constructs a SyncMapItemContext * * @param string $key The key value of the Sync Map Item resource to fetch * @return \Twilio\Rest\Sync\V1\Service\SyncMap\SyncMapItemContext */ public function getContext($key) { return new SyncMapItemContext( $this->version, $this->solution['serviceSid'], $this->solution['mapSid'], $key ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Sync.V1.SyncMapItemList]'; } } sdk/src/Twilio/Rest/Sync/V1/Service/SyncMap/SyncMapPermissionList.php 0000644 00000012735 15002236443 0021453 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Sync\V1\Service\SyncMap; use Twilio\ListResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class SyncMapPermissionList extends ListResource { /** * Construct the SyncMapPermissionList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Sync Service that the resource is * associated with * @param string $mapSid Sync Map SID * @return \Twilio\Rest\Sync\V1\Service\SyncMap\SyncMapPermissionList */ public function __construct(Version $version, $serviceSid, $mapSid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, 'mapSid' => $mapSid, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Maps/' . \rawurlencode($mapSid) . '/Permissions'; } /** * Streams SyncMapPermissionInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads SyncMapPermissionInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return SyncMapPermissionInstance[] Array of results */ public function read($limit = null, $pageSize = null) { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of SyncMapPermissionInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of SyncMapPermissionInstance */ public function page($pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $params = Values::of(array( 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new SyncMapPermissionPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of SyncMapPermissionInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of SyncMapPermissionInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new SyncMapPermissionPage($this->version, $response, $this->solution); } /** * Constructs a SyncMapPermissionContext * * @param string $identity The application-defined string that uniquely * identifies the User's Sync Map Permission resource * to fetch * @return \Twilio\Rest\Sync\V1\Service\SyncMap\SyncMapPermissionContext */ public function getContext($identity) { return new SyncMapPermissionContext( $this->version, $this->solution['serviceSid'], $this->solution['mapSid'], $identity ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Sync.V1.SyncMapPermissionList]'; } } sdk/src/Twilio/Rest/Sync/V1/Service/SyncMap/SyncMapItemInstance.php 0000644 00000012077 15002236443 0021051 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Sync\V1\Service\SyncMap; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * * @property string $key * @property string $accountSid * @property string $serviceSid * @property string $mapSid * @property string $url * @property string $revision * @property array $data * @property \DateTime $dateExpires * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $createdBy */ class SyncMapItemInstance extends InstanceResource { /** * Initialize the SyncMapItemInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the Sync Service that the resource is * associated with * @param string $mapSid The SID of the Sync Map that contains the Map Item * @param string $key The key value of the Sync Map Item resource to fetch * @return \Twilio\Rest\Sync\V1\Service\SyncMap\SyncMapItemInstance */ public function __construct(Version $version, array $payload, $serviceSid, $mapSid, $key = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'key' => Values::array_get($payload, 'key'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'mapSid' => Values::array_get($payload, 'map_sid'), 'url' => Values::array_get($payload, 'url'), 'revision' => Values::array_get($payload, 'revision'), 'data' => Values::array_get($payload, 'data'), 'dateExpires' => Deserialize::dateTime(Values::array_get($payload, 'date_expires')), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'createdBy' => Values::array_get($payload, 'created_by'), ); $this->solution = array( 'serviceSid' => $serviceSid, 'mapSid' => $mapSid, 'key' => $key ?: $this->properties['key'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Sync\V1\Service\SyncMap\SyncMapItemContext Context for * this * SyncMapItemInstance */ protected function proxy() { if (!$this->context) { $this->context = new SyncMapItemContext( $this->version, $this->solution['serviceSid'], $this->solution['mapSid'], $this->solution['key'] ); } return $this->context; } /** * Fetch a SyncMapItemInstance * * @return SyncMapItemInstance Fetched SyncMapItemInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the SyncMapItemInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Update the SyncMapItemInstance * * @param array|Options $options Optional Arguments * @return SyncMapItemInstance Updated SyncMapItemInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Sync.V1.SyncMapItemInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Sync/V1/Service/SyncMap/SyncMapItemContext.php 0000644 00000007034 15002236443 0020726 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Sync\V1\Service\SyncMap; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class SyncMapItemContext extends InstanceContext { /** * Initialize the SyncMapItemContext * * @param \Twilio\Version $version Version that contains the resource * @param string $serviceSid The SID of the Sync Service with the Sync Map Item * resource to fetch * @param string $mapSid The SID of the Sync Map with the Sync Map Item * resource to fetch * @param string $key The key value of the Sync Map Item resource to fetch * @return \Twilio\Rest\Sync\V1\Service\SyncMap\SyncMapItemContext */ public function __construct(Version $version, $serviceSid, $mapSid, $key) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, 'mapSid' => $mapSid, 'key' => $key, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Maps/' . \rawurlencode($mapSid) . '/Items/' . \rawurlencode($key) . ''; } /** * Fetch a SyncMapItemInstance * * @return SyncMapItemInstance Fetched SyncMapItemInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new SyncMapItemInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['mapSid'], $this->solution['key'] ); } /** * Deletes the SyncMapItemInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Update the SyncMapItemInstance * * @param array|Options $options Optional Arguments * @return SyncMapItemInstance Updated SyncMapItemInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { $options = new Values($options); $data = Values::of(array( 'Data' => Serialize::jsonObject($options['data']), 'Ttl' => $options['ttl'], 'ItemTtl' => $options['itemTtl'], 'CollectionTtl' => $options['collectionTtl'], )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new SyncMapItemInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['mapSid'], $this->solution['key'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Sync.V1.SyncMapItemContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Sync/V1/Service/SyncMap/SyncMapPermissionContext.php 0000644 00000007370 15002236443 0022163 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Sync\V1\Service\SyncMap; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class SyncMapPermissionContext extends InstanceContext { /** * Initialize the SyncMapPermissionContext * * @param \Twilio\Version $version Version that contains the resource * @param string $serviceSid The SID of the Sync Service with the Sync Map * Permission resource to fetch * @param string $mapSid The SID of the Sync Map with the Sync Map Permission * resource to fetch * @param string $identity The application-defined string that uniquely * identifies the User's Sync Map Permission resource * to fetch * @return \Twilio\Rest\Sync\V1\Service\SyncMap\SyncMapPermissionContext */ public function __construct(Version $version, $serviceSid, $mapSid, $identity) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, 'mapSid' => $mapSid, 'identity' => $identity, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Maps/' . \rawurlencode($mapSid) . '/Permissions/' . \rawurlencode($identity) . ''; } /** * Fetch a SyncMapPermissionInstance * * @return SyncMapPermissionInstance Fetched SyncMapPermissionInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new SyncMapPermissionInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['mapSid'], $this->solution['identity'] ); } /** * Deletes the SyncMapPermissionInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Update the SyncMapPermissionInstance * * @param bool $read Read access * @param bool $write Write access * @param bool $manage Manage access * @return SyncMapPermissionInstance Updated SyncMapPermissionInstance * @throws TwilioException When an HTTP error occurs. */ public function update($read, $write, $manage) { $data = Values::of(array( 'Read' => Serialize::booleanToString($read), 'Write' => Serialize::booleanToString($write), 'Manage' => Serialize::booleanToString($manage), )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new SyncMapPermissionInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['mapSid'], $this->solution['identity'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Sync.V1.SyncMapPermissionContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Sync/V1/Service/SyncMap/SyncMapPermissionInstance.php 0000644 00000011372 15002236443 0022300 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Sync\V1\Service\SyncMap; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * * @property string $accountSid * @property string $serviceSid * @property string $mapSid * @property string $identity * @property bool $read * @property bool $write * @property bool $manage * @property string $url */ class SyncMapPermissionInstance extends InstanceResource { /** * Initialize the SyncMapPermissionInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the Sync Service that the resource is * associated with * @param string $mapSid Sync Map SID * @param string $identity The application-defined string that uniquely * identifies the User's Sync Map Permission resource * to fetch * @return \Twilio\Rest\Sync\V1\Service\SyncMap\SyncMapPermissionInstance */ public function __construct(Version $version, array $payload, $serviceSid, $mapSid, $identity = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'mapSid' => Values::array_get($payload, 'map_sid'), 'identity' => Values::array_get($payload, 'identity'), 'read' => Values::array_get($payload, 'read'), 'write' => Values::array_get($payload, 'write'), 'manage' => Values::array_get($payload, 'manage'), 'url' => Values::array_get($payload, 'url'), ); $this->solution = array( 'serviceSid' => $serviceSid, 'mapSid' => $mapSid, 'identity' => $identity ?: $this->properties['identity'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Sync\V1\Service\SyncMap\SyncMapPermissionContext Context for this SyncMapPermissionInstance */ protected function proxy() { if (!$this->context) { $this->context = new SyncMapPermissionContext( $this->version, $this->solution['serviceSid'], $this->solution['mapSid'], $this->solution['identity'] ); } return $this->context; } /** * Fetch a SyncMapPermissionInstance * * @return SyncMapPermissionInstance Fetched SyncMapPermissionInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the SyncMapPermissionInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Update the SyncMapPermissionInstance * * @param bool $read Read access * @param bool $write Write access * @param bool $manage Manage access * @return SyncMapPermissionInstance Updated SyncMapPermissionInstance * @throws TwilioException When an HTTP error occurs. */ public function update($read, $write, $manage) { return $this->proxy()->update($read, $write, $manage); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Sync.V1.SyncMapPermissionInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Sync/V1/Service/DocumentOptions.php 0000644 00000014004 15002236443 0016743 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Sync\V1\Service; 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 DocumentOptions { /** * @param string $uniqueName An application-defined string that uniquely * identifies the Sync Document * @param array $data A JSON string that represents an arbitrary, schema-less * object that the Sync Document stores * @param int $ttl How long, in seconds, before the Sync Document expires and * is deleted * @return CreateDocumentOptions Options builder */ public static function create($uniqueName = Values::NONE, $data = Values::NONE, $ttl = Values::NONE) { return new CreateDocumentOptions($uniqueName, $data, $ttl); } /** * @param array $data A JSON string that represents an arbitrary, schema-less * object that the Sync Document stores * @param int $ttl How long, in seconds, before the Document resource expires * and is deleted * @return UpdateDocumentOptions Options builder */ public static function update($data = Values::NONE, $ttl = Values::NONE) { return new UpdateDocumentOptions($data, $ttl); } } class CreateDocumentOptions extends Options { /** * @param string $uniqueName An application-defined string that uniquely * identifies the Sync Document * @param array $data A JSON string that represents an arbitrary, schema-less * object that the Sync Document stores * @param int $ttl How long, in seconds, before the Sync Document expires and * is deleted */ public function __construct($uniqueName = Values::NONE, $data = Values::NONE, $ttl = Values::NONE) { $this->options['uniqueName'] = $uniqueName; $this->options['data'] = $data; $this->options['ttl'] = $ttl; } /** * An application-defined string that uniquely identifies the Sync Document * * @param string $uniqueName An application-defined string that uniquely * identifies the Sync Document * @return $this Fluent Builder */ public function setUniqueName($uniqueName) { $this->options['uniqueName'] = $uniqueName; return $this; } /** * A JSON string that represents an arbitrary, schema-less object that the Sync Document stores. Can be up to 16KB in length. * * @param array $data A JSON string that represents an arbitrary, schema-less * object that the Sync Document stores * @return $this Fluent Builder */ public function setData($data) { $this->options['data'] = $data; return $this; } /** * How long, in seconds, before the Sync Document expires and is deleted (the Sync Document's time-to-live). Can be an integer from 0 to 31,536,000 (1 year). The default value is `0`, which means the Sync Document does not expire. The Sync Document will be deleted automatically after it expires, but there can be a delay between the expiration time and the resources's deletion. * * @param int $ttl How long, in seconds, before the Sync Document expires and * is deleted * @return $this Fluent Builder */ public function setTtl($ttl) { $this->options['ttl'] = $ttl; 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.Sync.V1.CreateDocumentOptions ' . \implode(' ', $options) . ']'; } } class UpdateDocumentOptions extends Options { /** * @param array $data A JSON string that represents an arbitrary, schema-less * object that the Sync Document stores * @param int $ttl How long, in seconds, before the Document resource expires * and is deleted */ public function __construct($data = Values::NONE, $ttl = Values::NONE) { $this->options['data'] = $data; $this->options['ttl'] = $ttl; } /** * A JSON string that represents an arbitrary, schema-less object that the Sync Document stores. Can be up to 16KB in length. * * @param array $data A JSON string that represents an arbitrary, schema-less * object that the Sync Document stores * @return $this Fluent Builder */ public function setData($data) { $this->options['data'] = $data; return $this; } /** * How long, in seconds, before the Sync Document expires and is deleted (time-to-live). Can be an integer from 0 to 31,536,000 (1 year). The default value is `0`, which means the Document resource does not expire. The Document resource will be deleted automatically after it expires, but there can be a delay between the expiration time and the resources's deletion. * * @param int $ttl How long, in seconds, before the Document resource expires * and is deleted * @return $this Fluent Builder */ public function setTtl($ttl) { $this->options['ttl'] = $ttl; 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.Sync.V1.UpdateDocumentOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Sync/V1/Service/Document/DocumentPermissionPage.php 0000644 00000001746 15002236443 0022024 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Sync\V1\Service\Document; use Twilio\Page; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class DocumentPermissionPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new DocumentPermissionInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['documentSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Sync.V1.DocumentPermissionPage]'; } } sdk/src/Twilio/Rest/Sync/V1/Service/Document/DocumentPermissionInstance.php 0000644 00000011474 15002236443 0022713 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Sync\V1\Service\Document; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * * @property string $accountSid * @property string $serviceSid * @property string $documentSid * @property string $identity * @property bool $read * @property bool $write * @property bool $manage * @property string $url */ class DocumentPermissionInstance extends InstanceResource { /** * Initialize the DocumentPermissionInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the Sync Service that the resource is * associated with * @param string $documentSid The Sync Document SID * @param string $identity The application-defined string that uniquely * identifies the User's Document Permission resource * to fetch * @return \Twilio\Rest\Sync\V1\Service\Document\DocumentPermissionInstance */ public function __construct(Version $version, array $payload, $serviceSid, $documentSid, $identity = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'documentSid' => Values::array_get($payload, 'document_sid'), 'identity' => Values::array_get($payload, 'identity'), 'read' => Values::array_get($payload, 'read'), 'write' => Values::array_get($payload, 'write'), 'manage' => Values::array_get($payload, 'manage'), 'url' => Values::array_get($payload, 'url'), ); $this->solution = array( 'serviceSid' => $serviceSid, 'documentSid' => $documentSid, 'identity' => $identity ?: $this->properties['identity'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Sync\V1\Service\Document\DocumentPermissionContext Context for this DocumentPermissionInstance */ protected function proxy() { if (!$this->context) { $this->context = new DocumentPermissionContext( $this->version, $this->solution['serviceSid'], $this->solution['documentSid'], $this->solution['identity'] ); } return $this->context; } /** * Fetch a DocumentPermissionInstance * * @return DocumentPermissionInstance Fetched DocumentPermissionInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the DocumentPermissionInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Update the DocumentPermissionInstance * * @param bool $read Read access * @param bool $write Write access * @param bool $manage Manage access * @return DocumentPermissionInstance Updated DocumentPermissionInstance * @throws TwilioException When an HTTP error occurs. */ public function update($read, $write, $manage) { return $this->proxy()->update($read, $write, $manage); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Sync.V1.DocumentPermissionInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Sync/V1/Service/Document/DocumentPermissionList.php 0000644 00000013043 15002236443 0022054 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Sync\V1\Service\Document; use Twilio\ListResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class DocumentPermissionList extends ListResource { /** * Construct the DocumentPermissionList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Sync Service that the resource is * associated with * @param string $documentSid The Sync Document SID * @return \Twilio\Rest\Sync\V1\Service\Document\DocumentPermissionList */ public function __construct(Version $version, $serviceSid, $documentSid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, 'documentSid' => $documentSid, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Documents/' . \rawurlencode($documentSid) . '/Permissions'; } /** * Streams DocumentPermissionInstance records from the API as a generator * stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads DocumentPermissionInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return DocumentPermissionInstance[] Array of results */ public function read($limit = null, $pageSize = null) { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of DocumentPermissionInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of DocumentPermissionInstance */ public function page($pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $params = Values::of(array( 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new DocumentPermissionPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of DocumentPermissionInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of DocumentPermissionInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new DocumentPermissionPage($this->version, $response, $this->solution); } /** * Constructs a DocumentPermissionContext * * @param string $identity The application-defined string that uniquely * identifies the User's Document Permission resource * to fetch * @return \Twilio\Rest\Sync\V1\Service\Document\DocumentPermissionContext */ public function getContext($identity) { return new DocumentPermissionContext( $this->version, $this->solution['serviceSid'], $this->solution['documentSid'], $identity ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Sync.V1.DocumentPermissionList]'; } } sdk/src/Twilio/Rest/Sync/V1/Service/Document/DocumentPermissionContext.php 0000644 00000007546 15002236443 0022600 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Sync\V1\Service\Document; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class DocumentPermissionContext extends InstanceContext { /** * Initialize the DocumentPermissionContext * * @param \Twilio\Version $version Version that contains the resource * @param string $serviceSid The SID of the Sync Service with the Document * Permission resource to fetch * @param string $documentSid The SID of the Sync Document with the Document * Permission resource to fetch * @param string $identity The application-defined string that uniquely * identifies the User's Document Permission resource * to fetch * @return \Twilio\Rest\Sync\V1\Service\Document\DocumentPermissionContext */ public function __construct(Version $version, $serviceSid, $documentSid, $identity) { parent::__construct($version); // Path Solution $this->solution = array( 'serviceSid' => $serviceSid, 'documentSid' => $documentSid, 'identity' => $identity, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Documents/' . \rawurlencode($documentSid) . '/Permissions/' . \rawurlencode($identity) . ''; } /** * Fetch a DocumentPermissionInstance * * @return DocumentPermissionInstance Fetched DocumentPermissionInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new DocumentPermissionInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['documentSid'], $this->solution['identity'] ); } /** * Deletes the DocumentPermissionInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Update the DocumentPermissionInstance * * @param bool $read Read access * @param bool $write Write access * @param bool $manage Manage access * @return DocumentPermissionInstance Updated DocumentPermissionInstance * @throws TwilioException When an HTTP error occurs. */ public function update($read, $write, $manage) { $data = Values::of(array( 'Read' => Serialize::booleanToString($read), 'Write' => Serialize::booleanToString($write), 'Manage' => Serialize::booleanToString($manage), )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new DocumentPermissionInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['documentSid'], $this->solution['identity'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Sync.V1.DocumentPermissionContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Sync/V1/ServiceContext.php 0000644 00000014645 15002236443 0015171 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Sync\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Rest\Sync\V1\Service\DocumentList; use Twilio\Rest\Sync\V1\Service\SyncListList; use Twilio\Rest\Sync\V1\Service\SyncMapList; use Twilio\Rest\Sync\V1\Service\SyncStreamList; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * * @property \Twilio\Rest\Sync\V1\Service\DocumentList $documents * @property \Twilio\Rest\Sync\V1\Service\SyncListList $syncLists * @property \Twilio\Rest\Sync\V1\Service\SyncMapList $syncMaps * @property \Twilio\Rest\Sync\V1\Service\SyncStreamList $syncStreams * @method \Twilio\Rest\Sync\V1\Service\DocumentContext documents(string $sid) * @method \Twilio\Rest\Sync\V1\Service\SyncListContext syncLists(string $sid) * @method \Twilio\Rest\Sync\V1\Service\SyncMapContext syncMaps(string $sid) * @method \Twilio\Rest\Sync\V1\Service\SyncStreamContext syncStreams(string $sid) */ class ServiceContext extends InstanceContext { protected $_documents = null; protected $_syncLists = null; protected $_syncMaps = null; protected $_syncStreams = null; /** * Initialize the ServiceContext * * @param \Twilio\Version $version Version that contains the resource * @param string $sid The SID of the Service resource to fetch * @return \Twilio\Rest\Sync\V1\ServiceContext */ public function __construct(Version $version, $sid) { parent::__construct($version); // Path Solution $this->solution = array('sid' => $sid, ); $this->uri = '/Services/' . \rawurlencode($sid) . ''; } /** * Fetch a ServiceInstance * * @return ServiceInstance Fetched ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new ServiceInstance($this->version, $payload, $this->solution['sid']); } /** * Deletes the ServiceInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Update the ServiceInstance * * @param array|Options $options Optional Arguments * @return ServiceInstance Updated ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { $options = new Values($options); $data = Values::of(array( 'WebhookUrl' => $options['webhookUrl'], 'FriendlyName' => $options['friendlyName'], 'ReachabilityWebhooksEnabled' => Serialize::booleanToString($options['reachabilityWebhooksEnabled']), 'AclEnabled' => Serialize::booleanToString($options['aclEnabled']), 'ReachabilityDebouncingEnabled' => Serialize::booleanToString($options['reachabilityDebouncingEnabled']), 'ReachabilityDebouncingWindow' => $options['reachabilityDebouncingWindow'], 'WebhooksFromRestEnabled' => Serialize::booleanToString($options['webhooksFromRestEnabled']), )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new ServiceInstance($this->version, $payload, $this->solution['sid']); } /** * Access the documents * * @return \Twilio\Rest\Sync\V1\Service\DocumentList */ protected function getDocuments() { if (!$this->_documents) { $this->_documents = new DocumentList($this->version, $this->solution['sid']); } return $this->_documents; } /** * Access the syncLists * * @return \Twilio\Rest\Sync\V1\Service\SyncListList */ protected function getSyncLists() { if (!$this->_syncLists) { $this->_syncLists = new SyncListList($this->version, $this->solution['sid']); } return $this->_syncLists; } /** * Access the syncMaps * * @return \Twilio\Rest\Sync\V1\Service\SyncMapList */ protected function getSyncMaps() { if (!$this->_syncMaps) { $this->_syncMaps = new SyncMapList($this->version, $this->solution['sid']); } return $this->_syncMaps; } /** * Access the syncStreams * * @return \Twilio\Rest\Sync\V1\Service\SyncStreamList */ protected function getSyncStreams() { if (!$this->_syncStreams) { $this->_syncStreams = new SyncStreamList($this->version, $this->solution['sid']); } return $this->_syncStreams; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get($name) { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Sync.V1.ServiceContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/AccountPage.php 0000644 00000001316 15002236443 0014423 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010; use Twilio\Page; class AccountPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new AccountInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.AccountPage]'; } } sdk/src/Twilio/Rest/Api/V2010/AccountOptions.php 0000644 00000012271 15002236443 0015204 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010; use Twilio\Options; use Twilio\Values; abstract class AccountOptions { /** * @param string $friendlyName A human readable description of the account * @return CreateAccountOptions Options builder */ public static function create($friendlyName = Values::NONE) { return new CreateAccountOptions($friendlyName); } /** * @param string $friendlyName FriendlyName to filter on * @param string $status Status to filter on * @return ReadAccountOptions Options builder */ public static function read($friendlyName = Values::NONE, $status = Values::NONE) { return new ReadAccountOptions($friendlyName, $status); } /** * @param string $friendlyName FriendlyName to update * @param string $status Status to update the Account with * @return UpdateAccountOptions Options builder */ public static function update($friendlyName = Values::NONE, $status = Values::NONE) { return new UpdateAccountOptions($friendlyName, $status); } } class CreateAccountOptions extends Options { /** * @param string $friendlyName A human readable description of the account */ public function __construct($friendlyName = Values::NONE) { $this->options['friendlyName'] = $friendlyName; } /** * A human readable description of the account to create, defaults to `SubAccount Created at {YYYY-MM-DD HH:MM meridian}` * * @param string $friendlyName A human readable description of the account * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; 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.CreateAccountOptions ' . \implode(' ', $options) . ']'; } } class ReadAccountOptions extends Options { /** * @param string $friendlyName FriendlyName to filter on * @param string $status Status to filter on */ public function __construct($friendlyName = Values::NONE, $status = Values::NONE) { $this->options['friendlyName'] = $friendlyName; $this->options['status'] = $status; } /** * Only return the Account resources with friendly names that exactly match this name. * * @param string $friendlyName FriendlyName to filter on * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * Only return Account resources with the given status. Can be `closed`, `suspended` or `active`. * * @param string $status Status to filter on * @return $this Fluent Builder */ public function setStatus($status) { $this->options['status'] = $status; 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.ReadAccountOptions ' . \implode(' ', $options) . ']'; } } class UpdateAccountOptions extends Options { /** * @param string $friendlyName FriendlyName to update * @param string $status Status to update the Account with */ public function __construct($friendlyName = Values::NONE, $status = Values::NONE) { $this->options['friendlyName'] = $friendlyName; $this->options['status'] = $status; } /** * Update the human-readable description of this Account * * @param string $friendlyName FriendlyName to update * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * Alter the status of this account: use `closed` to irreversibly close this account, `suspended` to temporarily suspend it, or `active` to reactivate it. * * @param string $status Status to update the Account with * @return $this Fluent Builder */ public function setStatus($status) { $this->options['status'] = $status; 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.UpdateAccountOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/AccountInstance.php 0000644 00000023241 15002236443 0015314 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $authToken * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $friendlyName * @property string $ownerAccountSid * @property string $sid * @property string $status * @property array $subresourceUris * @property string $type * @property string $uri */ class AccountInstance extends InstanceResource { protected $_addresses = null; protected $_applications = null; protected $_authorizedConnectApps = null; protected $_availablePhoneNumbers = null; protected $_balance = null; protected $_calls = null; protected $_conferences = null; protected $_connectApps = null; protected $_incomingPhoneNumbers = null; protected $_keys = null; protected $_messages = null; protected $_newKeys = null; protected $_newSigningKeys = null; protected $_notifications = null; protected $_outgoingCallerIds = null; protected $_queues = null; protected $_recordings = null; protected $_signingKeys = null; protected $_sip = null; protected $_shortCodes = null; protected $_tokens = null; protected $_transcriptions = null; protected $_usage = null; protected $_validationRequests = null; /** * Initialize the AccountInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid Fetch by unique Account Sid * @return \Twilio\Rest\Api\V2010\AccountInstance */ public function __construct(Version $version, array $payload, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'authToken' => Values::array_get($payload, 'auth_token'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'ownerAccountSid' => Values::array_get($payload, 'owner_account_sid'), 'sid' => Values::array_get($payload, 'sid'), 'status' => Values::array_get($payload, 'status'), 'subresourceUris' => Values::array_get($payload, 'subresource_uris'), 'type' => Values::array_get($payload, 'type'), 'uri' => Values::array_get($payload, 'uri'), ); $this->solution = array('sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Api\V2010\AccountContext Context for this * AccountInstance */ protected function proxy() { if (!$this->context) { $this->context = new AccountContext($this->version, $this->solution['sid']); } return $this->context; } /** * Fetch a AccountInstance * * @return AccountInstance Fetched AccountInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Update the AccountInstance * * @param array|Options $options Optional Arguments * @return AccountInstance Updated AccountInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Access the addresses * * @return \Twilio\Rest\Api\V2010\Account\AddressList */ protected function getAddresses() { return $this->proxy()->addresses; } /** * Access the applications * * @return \Twilio\Rest\Api\V2010\Account\ApplicationList */ protected function getApplications() { return $this->proxy()->applications; } /** * Access the authorizedConnectApps * * @return \Twilio\Rest\Api\V2010\Account\AuthorizedConnectAppList */ protected function getAuthorizedConnectApps() { return $this->proxy()->authorizedConnectApps; } /** * Access the availablePhoneNumbers * * @return \Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountryList */ protected function getAvailablePhoneNumbers() { return $this->proxy()->availablePhoneNumbers; } /** * Access the balance * * @return \Twilio\Rest\Api\V2010\Account\BalanceList */ protected function getBalance() { return $this->proxy()->balance; } /** * Access the calls * * @return \Twilio\Rest\Api\V2010\Account\CallList */ protected function getCalls() { return $this->proxy()->calls; } /** * Access the conferences * * @return \Twilio\Rest\Api\V2010\Account\ConferenceList */ protected function getConferences() { return $this->proxy()->conferences; } /** * Access the connectApps * * @return \Twilio\Rest\Api\V2010\Account\ConnectAppList */ protected function getConnectApps() { return $this->proxy()->connectApps; } /** * Access the incomingPhoneNumbers * * @return \Twilio\Rest\Api\V2010\Account\IncomingPhoneNumberList */ protected function getIncomingPhoneNumbers() { return $this->proxy()->incomingPhoneNumbers; } /** * Access the keys * * @return \Twilio\Rest\Api\V2010\Account\KeyList */ protected function getKeys() { return $this->proxy()->keys; } /** * Access the messages * * @return \Twilio\Rest\Api\V2010\Account\MessageList */ protected function getMessages() { return $this->proxy()->messages; } /** * Access the newKeys * * @return \Twilio\Rest\Api\V2010\Account\NewKeyList */ protected function getNewKeys() { return $this->proxy()->newKeys; } /** * Access the newSigningKeys * * @return \Twilio\Rest\Api\V2010\Account\NewSigningKeyList */ protected function getNewSigningKeys() { return $this->proxy()->newSigningKeys; } /** * Access the notifications * * @return \Twilio\Rest\Api\V2010\Account\NotificationList */ protected function getNotifications() { return $this->proxy()->notifications; } /** * Access the outgoingCallerIds * * @return \Twilio\Rest\Api\V2010\Account\OutgoingCallerIdList */ protected function getOutgoingCallerIds() { return $this->proxy()->outgoingCallerIds; } /** * Access the queues * * @return \Twilio\Rest\Api\V2010\Account\QueueList */ protected function getQueues() { return $this->proxy()->queues; } /** * Access the recordings * * @return \Twilio\Rest\Api\V2010\Account\RecordingList */ protected function getRecordings() { return $this->proxy()->recordings; } /** * Access the signingKeys * * @return \Twilio\Rest\Api\V2010\Account\SigningKeyList */ protected function getSigningKeys() { return $this->proxy()->signingKeys; } /** * Access the sip * * @return \Twilio\Rest\Api\V2010\Account\SipList */ protected function getSip() { return $this->proxy()->sip; } /** * Access the shortCodes * * @return \Twilio\Rest\Api\V2010\Account\ShortCodeList */ protected function getShortCodes() { return $this->proxy()->shortCodes; } /** * Access the tokens * * @return \Twilio\Rest\Api\V2010\Account\TokenList */ protected function getTokens() { return $this->proxy()->tokens; } /** * Access the transcriptions * * @return \Twilio\Rest\Api\V2010\Account\TranscriptionList */ protected function getTranscriptions() { return $this->proxy()->transcriptions; } /** * Access the usage * * @return \Twilio\Rest\Api\V2010\Account\UsageList */ protected function getUsage() { return $this->proxy()->usage; } /** * Access the validationRequests * * @return \Twilio\Rest\Api\V2010\Account\ValidationRequestList */ protected function getValidationRequests() { return $this->proxy()->validationRequests; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.AccountInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/AccountContext.php 0000644 00000041151 15002236443 0015174 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Rest\Api\V2010\Account\AddressList; use Twilio\Rest\Api\V2010\Account\ApplicationList; use Twilio\Rest\Api\V2010\Account\AuthorizedConnectAppList; use Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountryList; use Twilio\Rest\Api\V2010\Account\BalanceList; use Twilio\Rest\Api\V2010\Account\CallList; use Twilio\Rest\Api\V2010\Account\ConferenceList; use Twilio\Rest\Api\V2010\Account\ConnectAppList; use Twilio\Rest\Api\V2010\Account\IncomingPhoneNumberList; use Twilio\Rest\Api\V2010\Account\KeyList; use Twilio\Rest\Api\V2010\Account\MessageList; use Twilio\Rest\Api\V2010\Account\NewKeyList; use Twilio\Rest\Api\V2010\Account\NewSigningKeyList; use Twilio\Rest\Api\V2010\Account\NotificationList; use Twilio\Rest\Api\V2010\Account\OutgoingCallerIdList; use Twilio\Rest\Api\V2010\Account\QueueList; use Twilio\Rest\Api\V2010\Account\RecordingList; use Twilio\Rest\Api\V2010\Account\ShortCodeList; use Twilio\Rest\Api\V2010\Account\SigningKeyList; use Twilio\Rest\Api\V2010\Account\SipList; use Twilio\Rest\Api\V2010\Account\TokenList; use Twilio\Rest\Api\V2010\Account\TranscriptionList; use Twilio\Rest\Api\V2010\Account\UsageList; use Twilio\Rest\Api\V2010\Account\ValidationRequestList; use Twilio\Values; use Twilio\Version; /** * @property \Twilio\Rest\Api\V2010\Account\AddressList $addresses * @property \Twilio\Rest\Api\V2010\Account\ApplicationList $applications * @property \Twilio\Rest\Api\V2010\Account\AuthorizedConnectAppList $authorizedConnectApps * @property \Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountryList $availablePhoneNumbers * @property \Twilio\Rest\Api\V2010\Account\BalanceList $balance * @property \Twilio\Rest\Api\V2010\Account\CallList $calls * @property \Twilio\Rest\Api\V2010\Account\ConferenceList $conferences * @property \Twilio\Rest\Api\V2010\Account\ConnectAppList $connectApps * @property \Twilio\Rest\Api\V2010\Account\IncomingPhoneNumberList $incomingPhoneNumbers * @property \Twilio\Rest\Api\V2010\Account\KeyList $keys * @property \Twilio\Rest\Api\V2010\Account\MessageList $messages * @property \Twilio\Rest\Api\V2010\Account\NewKeyList $newKeys * @property \Twilio\Rest\Api\V2010\Account\NewSigningKeyList $newSigningKeys * @property \Twilio\Rest\Api\V2010\Account\NotificationList $notifications * @property \Twilio\Rest\Api\V2010\Account\OutgoingCallerIdList $outgoingCallerIds * @property \Twilio\Rest\Api\V2010\Account\QueueList $queues * @property \Twilio\Rest\Api\V2010\Account\RecordingList $recordings * @property \Twilio\Rest\Api\V2010\Account\SigningKeyList $signingKeys * @property \Twilio\Rest\Api\V2010\Account\SipList $sip * @property \Twilio\Rest\Api\V2010\Account\ShortCodeList $shortCodes * @property \Twilio\Rest\Api\V2010\Account\TokenList $tokens * @property \Twilio\Rest\Api\V2010\Account\TranscriptionList $transcriptions * @property \Twilio\Rest\Api\V2010\Account\UsageList $usage * @property \Twilio\Rest\Api\V2010\Account\ValidationRequestList $validationRequests * @method \Twilio\Rest\Api\V2010\Account\AddressContext addresses(string $sid) * @method \Twilio\Rest\Api\V2010\Account\ApplicationContext applications(string $sid) * @method \Twilio\Rest\Api\V2010\Account\AuthorizedConnectAppContext authorizedConnectApps(string $connectAppSid) * @method \Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountryContext availablePhoneNumbers(string $countryCode) * @method \Twilio\Rest\Api\V2010\Account\CallContext calls(string $sid) * @method \Twilio\Rest\Api\V2010\Account\ConferenceContext conferences(string $sid) * @method \Twilio\Rest\Api\V2010\Account\ConnectAppContext connectApps(string $sid) * @method \Twilio\Rest\Api\V2010\Account\IncomingPhoneNumberContext incomingPhoneNumbers(string $sid) * @method \Twilio\Rest\Api\V2010\Account\KeyContext keys(string $sid) * @method \Twilio\Rest\Api\V2010\Account\MessageContext messages(string $sid) * @method \Twilio\Rest\Api\V2010\Account\NotificationContext notifications(string $sid) * @method \Twilio\Rest\Api\V2010\Account\OutgoingCallerIdContext outgoingCallerIds(string $sid) * @method \Twilio\Rest\Api\V2010\Account\QueueContext queues(string $sid) * @method \Twilio\Rest\Api\V2010\Account\RecordingContext recordings(string $sid) * @method \Twilio\Rest\Api\V2010\Account\SigningKeyContext signingKeys(string $sid) * @method \Twilio\Rest\Api\V2010\Account\ShortCodeContext shortCodes(string $sid) * @method \Twilio\Rest\Api\V2010\Account\TranscriptionContext transcriptions(string $sid) */ class AccountContext extends InstanceContext { protected $_addresses = null; protected $_applications = null; protected $_authorizedConnectApps = null; protected $_availablePhoneNumbers = null; protected $_balance = null; protected $_calls = null; protected $_conferences = null; protected $_connectApps = null; protected $_incomingPhoneNumbers = null; protected $_keys = null; protected $_messages = null; protected $_newKeys = null; protected $_newSigningKeys = null; protected $_notifications = null; protected $_outgoingCallerIds = null; protected $_queues = null; protected $_recordings = null; protected $_signingKeys = null; protected $_sip = null; protected $_shortCodes = null; protected $_tokens = null; protected $_transcriptions = null; protected $_usage = null; protected $_validationRequests = null; /** * Initialize the AccountContext * * @param \Twilio\Version $version Version that contains the resource * @param string $sid Fetch by unique Account Sid * @return \Twilio\Rest\Api\V2010\AccountContext */ public function __construct(Version $version, $sid) { parent::__construct($version); // Path Solution $this->solution = array('sid' => $sid, ); $this->uri = '/Accounts/' . \rawurlencode($sid) . '.json'; } /** * Fetch a AccountInstance * * @return AccountInstance Fetched AccountInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new AccountInstance($this->version, $payload, $this->solution['sid']); } /** * Update the AccountInstance * * @param array|Options $options Optional Arguments * @return AccountInstance Updated AccountInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { $options = new Values($options); $data = Values::of(array( 'FriendlyName' => $options['friendlyName'], 'Status' => $options['status'], )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new AccountInstance($this->version, $payload, $this->solution['sid']); } /** * Access the addresses * * @return \Twilio\Rest\Api\V2010\Account\AddressList */ protected function getAddresses() { if (!$this->_addresses) { $this->_addresses = new AddressList($this->version, $this->solution['sid']); } return $this->_addresses; } /** * Access the applications * * @return \Twilio\Rest\Api\V2010\Account\ApplicationList */ protected function getApplications() { if (!$this->_applications) { $this->_applications = new ApplicationList($this->version, $this->solution['sid']); } return $this->_applications; } /** * Access the authorizedConnectApps * * @return \Twilio\Rest\Api\V2010\Account\AuthorizedConnectAppList */ protected function getAuthorizedConnectApps() { if (!$this->_authorizedConnectApps) { $this->_authorizedConnectApps = new AuthorizedConnectAppList( $this->version, $this->solution['sid'] ); } return $this->_authorizedConnectApps; } /** * Access the availablePhoneNumbers * * @return \Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountryList */ protected function getAvailablePhoneNumbers() { if (!$this->_availablePhoneNumbers) { $this->_availablePhoneNumbers = new AvailablePhoneNumberCountryList( $this->version, $this->solution['sid'] ); } return $this->_availablePhoneNumbers; } /** * Access the balance * * @return \Twilio\Rest\Api\V2010\Account\BalanceList */ protected function getBalance() { if (!$this->_balance) { $this->_balance = new BalanceList($this->version, $this->solution['sid']); } return $this->_balance; } /** * Access the calls * * @return \Twilio\Rest\Api\V2010\Account\CallList */ protected function getCalls() { if (!$this->_calls) { $this->_calls = new CallList($this->version, $this->solution['sid']); } return $this->_calls; } /** * Access the conferences * * @return \Twilio\Rest\Api\V2010\Account\ConferenceList */ protected function getConferences() { if (!$this->_conferences) { $this->_conferences = new ConferenceList($this->version, $this->solution['sid']); } return $this->_conferences; } /** * Access the connectApps * * @return \Twilio\Rest\Api\V2010\Account\ConnectAppList */ protected function getConnectApps() { if (!$this->_connectApps) { $this->_connectApps = new ConnectAppList($this->version, $this->solution['sid']); } return $this->_connectApps; } /** * Access the incomingPhoneNumbers * * @return \Twilio\Rest\Api\V2010\Account\IncomingPhoneNumberList */ protected function getIncomingPhoneNumbers() { if (!$this->_incomingPhoneNumbers) { $this->_incomingPhoneNumbers = new IncomingPhoneNumberList($this->version, $this->solution['sid']); } return $this->_incomingPhoneNumbers; } /** * Access the keys * * @return \Twilio\Rest\Api\V2010\Account\KeyList */ protected function getKeys() { if (!$this->_keys) { $this->_keys = new KeyList($this->version, $this->solution['sid']); } return $this->_keys; } /** * Access the messages * * @return \Twilio\Rest\Api\V2010\Account\MessageList */ protected function getMessages() { if (!$this->_messages) { $this->_messages = new MessageList($this->version, $this->solution['sid']); } return $this->_messages; } /** * Access the newKeys * * @return \Twilio\Rest\Api\V2010\Account\NewKeyList */ protected function getNewKeys() { if (!$this->_newKeys) { $this->_newKeys = new NewKeyList($this->version, $this->solution['sid']); } return $this->_newKeys; } /** * Access the newSigningKeys * * @return \Twilio\Rest\Api\V2010\Account\NewSigningKeyList */ protected function getNewSigningKeys() { if (!$this->_newSigningKeys) { $this->_newSigningKeys = new NewSigningKeyList($this->version, $this->solution['sid']); } return $this->_newSigningKeys; } /** * Access the notifications * * @return \Twilio\Rest\Api\V2010\Account\NotificationList */ protected function getNotifications() { if (!$this->_notifications) { $this->_notifications = new NotificationList($this->version, $this->solution['sid']); } return $this->_notifications; } /** * Access the outgoingCallerIds * * @return \Twilio\Rest\Api\V2010\Account\OutgoingCallerIdList */ protected function getOutgoingCallerIds() { if (!$this->_outgoingCallerIds) { $this->_outgoingCallerIds = new OutgoingCallerIdList($this->version, $this->solution['sid']); } return $this->_outgoingCallerIds; } /** * Access the queues * * @return \Twilio\Rest\Api\V2010\Account\QueueList */ protected function getQueues() { if (!$this->_queues) { $this->_queues = new QueueList($this->version, $this->solution['sid']); } return $this->_queues; } /** * Access the recordings * * @return \Twilio\Rest\Api\V2010\Account\RecordingList */ protected function getRecordings() { if (!$this->_recordings) { $this->_recordings = new RecordingList($this->version, $this->solution['sid']); } return $this->_recordings; } /** * Access the signingKeys * * @return \Twilio\Rest\Api\V2010\Account\SigningKeyList */ protected function getSigningKeys() { if (!$this->_signingKeys) { $this->_signingKeys = new SigningKeyList($this->version, $this->solution['sid']); } return $this->_signingKeys; } /** * Access the sip * * @return \Twilio\Rest\Api\V2010\Account\SipList */ protected function getSip() { if (!$this->_sip) { $this->_sip = new SipList($this->version, $this->solution['sid']); } return $this->_sip; } /** * Access the shortCodes * * @return \Twilio\Rest\Api\V2010\Account\ShortCodeList */ protected function getShortCodes() { if (!$this->_shortCodes) { $this->_shortCodes = new ShortCodeList($this->version, $this->solution['sid']); } return $this->_shortCodes; } /** * Access the tokens * * @return \Twilio\Rest\Api\V2010\Account\TokenList */ protected function getTokens() { if (!$this->_tokens) { $this->_tokens = new TokenList($this->version, $this->solution['sid']); } return $this->_tokens; } /** * Access the transcriptions * * @return \Twilio\Rest\Api\V2010\Account\TranscriptionList */ protected function getTranscriptions() { if (!$this->_transcriptions) { $this->_transcriptions = new TranscriptionList($this->version, $this->solution['sid']); } return $this->_transcriptions; } /** * Access the usage * * @return \Twilio\Rest\Api\V2010\Account\UsageList */ protected function getUsage() { if (!$this->_usage) { $this->_usage = new UsageList($this->version, $this->solution['sid']); } return $this->_usage; } /** * Access the validationRequests * * @return \Twilio\Rest\Api\V2010\Account\ValidationRequestList */ protected function getValidationRequests() { if (!$this->_validationRequests) { $this->_validationRequests = new ValidationRequestList($this->version, $this->solution['sid']); } return $this->_validationRequests; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get($name) { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.AccountContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/AccountList.php 0000644 00000013171 15002236443 0014464 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; class AccountList extends ListResource { /** * Construct the AccountList * * @param Version $version Version that contains the resource * @return \Twilio\Rest\Api\V2010\AccountList */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = array(); $this->uri = '/Accounts.json'; } /** * Create a new AccountInstance * * @param array|Options $options Optional Arguments * @return AccountInstance Newly created AccountInstance * @throws TwilioException When an HTTP error occurs. */ public function create($options = array()) { $options = new Values($options); $data = Values::of(array('FriendlyName' => $options['friendlyName'], )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new AccountInstance($this->version, $payload); } /** * Streams AccountInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($options = array(), $limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads AccountInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return AccountInstance[] Array of results */ public function read($options = array(), $limit = null, $pageSize = null) { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Retrieve a single page of AccountInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of AccountInstance */ public function page($options = array(), $pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $options = new Values($options); $params = Values::of(array( 'FriendlyName' => $options['friendlyName'], 'Status' => $options['status'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new AccountPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of AccountInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of AccountInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new AccountPage($this->version, $response, $this->solution); } /** * Constructs a AccountContext * * @param string $sid Fetch by unique Account Sid * @return \Twilio\Rest\Api\V2010\AccountContext */ public function getContext($sid) { return new AccountContext($this->version, $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.AccountList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/CallInstance.php 0000644 00000015251 15002236443 0016171 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property string $annotation * @property string $answeredBy * @property string $apiVersion * @property string $callerName * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $direction * @property string $duration * @property \DateTime $endTime * @property string $forwardedFrom * @property string $from * @property string $fromFormatted * @property string $groupSid * @property string $parentCallSid * @property string $phoneNumberSid * @property string $price * @property string $priceUnit * @property string $sid * @property \DateTime $startTime * @property string $status * @property array $subresourceUris * @property string $to * @property string $toFormatted * @property string $uri */ class CallInstance extends InstanceResource { protected $_recordings = null; protected $_notifications = null; protected $_feedback = null; /** * Initialize the CallInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the Account that created this resource * @param string $sid The SID of the Call resource to fetch * @return \Twilio\Rest\Api\V2010\Account\CallInstance */ public function __construct(Version $version, array $payload, $accountSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'accountSid' => Values::array_get($payload, 'account_sid'), 'annotation' => Values::array_get($payload, 'annotation'), 'answeredBy' => Values::array_get($payload, 'answered_by'), 'apiVersion' => Values::array_get($payload, 'api_version'), 'callerName' => Values::array_get($payload, 'caller_name'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'direction' => Values::array_get($payload, 'direction'), 'duration' => Values::array_get($payload, 'duration'), 'endTime' => Deserialize::dateTime(Values::array_get($payload, 'end_time')), 'forwardedFrom' => Values::array_get($payload, 'forwarded_from'), 'from' => Values::array_get($payload, 'from'), 'fromFormatted' => Values::array_get($payload, 'from_formatted'), 'groupSid' => Values::array_get($payload, 'group_sid'), 'parentCallSid' => Values::array_get($payload, 'parent_call_sid'), 'phoneNumberSid' => Values::array_get($payload, 'phone_number_sid'), 'price' => Values::array_get($payload, 'price'), 'priceUnit' => Values::array_get($payload, 'price_unit'), 'sid' => Values::array_get($payload, 'sid'), 'startTime' => Deserialize::dateTime(Values::array_get($payload, 'start_time')), 'status' => Values::array_get($payload, 'status'), 'subresourceUris' => Values::array_get($payload, 'subresource_uris'), 'to' => Values::array_get($payload, 'to'), 'toFormatted' => Values::array_get($payload, 'to_formatted'), 'uri' => Values::array_get($payload, 'uri'), ); $this->solution = array('accountSid' => $accountSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Api\V2010\Account\CallContext Context for this * CallInstance */ protected function proxy() { if (!$this->context) { $this->context = new CallContext( $this->version, $this->solution['accountSid'], $this->solution['sid'] ); } return $this->context; } /** * Deletes the CallInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Fetch a CallInstance * * @return CallInstance Fetched CallInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Update the CallInstance * * @param array|Options $options Optional Arguments * @return CallInstance Updated CallInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Access the recordings * * @return \Twilio\Rest\Api\V2010\Account\Call\RecordingList */ protected function getRecordings() { return $this->proxy()->recordings; } /** * Access the notifications * * @return \Twilio\Rest\Api\V2010\Account\Call\NotificationList */ protected function getNotifications() { return $this->proxy()->notifications; } /** * Access the feedback * * @return \Twilio\Rest\Api\V2010\Account\Call\FeedbackList */ protected function getFeedback() { return $this->proxy()->feedback; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.CallInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/ValidationRequestInstance.php 0000644 00000004355 15002236443 0020764 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property string $phoneNumber * @property string $friendlyName * @property int $validationCode * @property string $callSid */ class ValidationRequestInstance extends InstanceResource { /** * Initialize the ValidationRequestInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the Account that created the resource * @return \Twilio\Rest\Api\V2010\Account\ValidationRequestInstance */ public function __construct(Version $version, array $payload, $accountSid) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'accountSid' => Values::array_get($payload, 'account_sid'), 'phoneNumber' => Values::array_get($payload, 'phone_number'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'validationCode' => Values::array_get($payload, 'validation_code'), 'callSid' => Values::array_get($payload, 'call_sid'), ); $this->solution = array('accountSid' => $accountSid, ); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.ValidationRequestInstance]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/TranscriptionInstance.php 0000644 00000010744 15002236443 0020157 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property string $apiVersion * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $duration * @property string $price * @property string $priceUnit * @property string $recordingSid * @property string $sid * @property string $status * @property string $transcriptionText * @property string $type * @property string $uri */ class TranscriptionInstance extends InstanceResource { /** * Initialize the TranscriptionInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the Account that created the resource * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Api\V2010\Account\TranscriptionInstance */ public function __construct(Version $version, array $payload, $accountSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'accountSid' => Values::array_get($payload, 'account_sid'), 'apiVersion' => Values::array_get($payload, 'api_version'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'duration' => Values::array_get($payload, 'duration'), 'price' => Values::array_get($payload, 'price'), 'priceUnit' => Values::array_get($payload, 'price_unit'), 'recordingSid' => Values::array_get($payload, 'recording_sid'), 'sid' => Values::array_get($payload, 'sid'), 'status' => Values::array_get($payload, 'status'), 'transcriptionText' => Values::array_get($payload, 'transcription_text'), 'type' => Values::array_get($payload, 'type'), 'uri' => Values::array_get($payload, 'uri'), ); $this->solution = array('accountSid' => $accountSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Api\V2010\Account\TranscriptionContext Context for this * TranscriptionInstance */ protected function proxy() { if (!$this->context) { $this->context = new TranscriptionContext( $this->version, $this->solution['accountSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch a TranscriptionInstance * * @return TranscriptionInstance Fetched TranscriptionInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the TranscriptionInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.TranscriptionInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/BalanceList.php 0000644 00000002705 15002236443 0016012 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Values; use Twilio\Version; class BalanceList extends ListResource { /** * Construct the BalanceList * * @param Version $version Version that contains the resource * @param string $accountSid Account Sid. * @return \Twilio\Rest\Api\V2010\Account\BalanceList */ public function __construct(Version $version, $accountSid) { parent::__construct($version); // Path Solution $this->solution = array('accountSid' => $accountSid, ); $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/Balance.json'; } /** * Fetch a BalanceInstance * * @return BalanceInstance Fetched BalanceInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new BalanceInstance($this->version, $payload, $this->solution['accountSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.BalanceList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/TollFreeOptions.php 0000644 00000054623 15002236443 0022635 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\IncomingPhoneNumber; use Twilio\Options; use Twilio\Values; abstract class TollFreeOptions { /** * @param bool $beta Whether to include new phone numbers * @param string $friendlyName A string that identifies the resources to read * @param string $phoneNumber The phone numbers of the resources to read * @param string $origin Include phone numbers based on their origin. By * default, phone numbers of all origin are included. * @return ReadTollFreeOptions Options builder */ public static function read($beta = Values::NONE, $friendlyName = Values::NONE, $phoneNumber = Values::NONE, $origin = Values::NONE) { return new ReadTollFreeOptions($beta, $friendlyName, $phoneNumber, $origin); } /** * @param string $apiVersion The API version to use for incoming calls made to * the new phone number * @param string $friendlyName A string to describe the new phone number * @param string $smsApplicationSid The SID of the application to handle SMS * messages * @param string $smsFallbackMethod HTTP method used with sms_fallback_url * @param string $smsFallbackUrl The URL we call when an error occurs while * executing TwiML * @param string $smsMethod The HTTP method to use with sms_url * @param string $smsUrl The URL we should call when the new phone number * receives an incoming SMS message * @param string $statusCallback The URL to send status information to your * application * @param string $statusCallbackMethod The HTTP method we should use to call * status_callback * @param string $voiceApplicationSid The SID of the application to handle the * new phone number * @param bool $voiceCallerIdLookup Whether to lookup the caller's name * @param string $voiceFallbackMethod The HTTP method used with * voice_fallback_url * @param string $voiceFallbackUrl The URL we will call when an error occurs in * TwiML * @param string $voiceMethod The HTTP method used with the voice_url * @param string $voiceUrl The URL we should call when the phone number * receives a call * @param string $identitySid The SID of the Identity resource to associate * with the new phone number * @param string $addressSid The SID of the Address resource associated with * the phone number * @param string $emergencyStatus Status determining whether the new phone * number is enabled for emergency calling * @param string $emergencyAddressSid The emergency address configuration to * use for emergency calling * @param string $trunkSid SID of the trunk to handle calls to the new phone * number * @param string $voiceReceiveMode Incoming call type: fax or voice * @param string $bundleSid The SID of the Bundle resource associated with * number * @return CreateTollFreeOptions Options builder */ public static function create($apiVersion = Values::NONE, $friendlyName = Values::NONE, $smsApplicationSid = Values::NONE, $smsFallbackMethod = Values::NONE, $smsFallbackUrl = Values::NONE, $smsMethod = Values::NONE, $smsUrl = Values::NONE, $statusCallback = Values::NONE, $statusCallbackMethod = Values::NONE, $voiceApplicationSid = Values::NONE, $voiceCallerIdLookup = Values::NONE, $voiceFallbackMethod = Values::NONE, $voiceFallbackUrl = Values::NONE, $voiceMethod = Values::NONE, $voiceUrl = Values::NONE, $identitySid = Values::NONE, $addressSid = Values::NONE, $emergencyStatus = Values::NONE, $emergencyAddressSid = Values::NONE, $trunkSid = Values::NONE, $voiceReceiveMode = Values::NONE, $bundleSid = Values::NONE) { return new CreateTollFreeOptions($apiVersion, $friendlyName, $smsApplicationSid, $smsFallbackMethod, $smsFallbackUrl, $smsMethod, $smsUrl, $statusCallback, $statusCallbackMethod, $voiceApplicationSid, $voiceCallerIdLookup, $voiceFallbackMethod, $voiceFallbackUrl, $voiceMethod, $voiceUrl, $identitySid, $addressSid, $emergencyStatus, $emergencyAddressSid, $trunkSid, $voiceReceiveMode, $bundleSid); } } class ReadTollFreeOptions extends Options { /** * @param bool $beta Whether to include new phone numbers * @param string $friendlyName A string that identifies the resources to read * @param string $phoneNumber The phone numbers of the resources to read * @param string $origin Include phone numbers based on their origin. By * default, phone numbers of all origin are included. */ public function __construct($beta = Values::NONE, $friendlyName = Values::NONE, $phoneNumber = Values::NONE, $origin = Values::NONE) { $this->options['beta'] = $beta; $this->options['friendlyName'] = $friendlyName; $this->options['phoneNumber'] = $phoneNumber; $this->options['origin'] = $origin; } /** * Whether to include phone numbers new to the Twilio platform. Can be: `true` or `false` and the default is `true`. * * @param bool $beta Whether to include new phone numbers * @return $this Fluent Builder */ public function setBeta($beta) { $this->options['beta'] = $beta; return $this; } /** * A string that identifies the resources to read. * * @param string $friendlyName A string that identifies the resources to read * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The phone numbers of the IncomingPhoneNumber resources to read. You can specify partial numbers and use '*' as a wildcard for any digit. * * @param string $phoneNumber The phone numbers of the resources to read * @return $this Fluent Builder */ public function setPhoneNumber($phoneNumber) { $this->options['phoneNumber'] = $phoneNumber; return $this; } /** * Whether to include phone numbers based on their origin. Can be: `twilio` or `hosted`. By default, phone numbers of all origin are included. * * @param string $origin Include phone numbers based on their origin. By * default, phone numbers of all origin are included. * @return $this Fluent Builder */ public function setOrigin($origin) { $this->options['origin'] = $origin; 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.ReadTollFreeOptions ' . \implode(' ', $options) . ']'; } } class CreateTollFreeOptions extends Options { /** * @param string $apiVersion The API version to use for incoming calls made to * the new phone number * @param string $friendlyName A string to describe the new phone number * @param string $smsApplicationSid The SID of the application to handle SMS * messages * @param string $smsFallbackMethod HTTP method used with sms_fallback_url * @param string $smsFallbackUrl The URL we call when an error occurs while * executing TwiML * @param string $smsMethod The HTTP method to use with sms_url * @param string $smsUrl The URL we should call when the new phone number * receives an incoming SMS message * @param string $statusCallback The URL to send status information to your * application * @param string $statusCallbackMethod The HTTP method we should use to call * status_callback * @param string $voiceApplicationSid The SID of the application to handle the * new phone number * @param bool $voiceCallerIdLookup Whether to lookup the caller's name * @param string $voiceFallbackMethod The HTTP method used with * voice_fallback_url * @param string $voiceFallbackUrl The URL we will call when an error occurs in * TwiML * @param string $voiceMethod The HTTP method used with the voice_url * @param string $voiceUrl The URL we should call when the phone number * receives a call * @param string $identitySid The SID of the Identity resource to associate * with the new phone number * @param string $addressSid The SID of the Address resource associated with * the phone number * @param string $emergencyStatus Status determining whether the new phone * number is enabled for emergency calling * @param string $emergencyAddressSid The emergency address configuration to * use for emergency calling * @param string $trunkSid SID of the trunk to handle calls to the new phone * number * @param string $voiceReceiveMode Incoming call type: fax or voice * @param string $bundleSid The SID of the Bundle resource associated with * number */ public function __construct($apiVersion = Values::NONE, $friendlyName = Values::NONE, $smsApplicationSid = Values::NONE, $smsFallbackMethod = Values::NONE, $smsFallbackUrl = Values::NONE, $smsMethod = Values::NONE, $smsUrl = Values::NONE, $statusCallback = Values::NONE, $statusCallbackMethod = Values::NONE, $voiceApplicationSid = Values::NONE, $voiceCallerIdLookup = Values::NONE, $voiceFallbackMethod = Values::NONE, $voiceFallbackUrl = Values::NONE, $voiceMethod = Values::NONE, $voiceUrl = Values::NONE, $identitySid = Values::NONE, $addressSid = Values::NONE, $emergencyStatus = Values::NONE, $emergencyAddressSid = Values::NONE, $trunkSid = Values::NONE, $voiceReceiveMode = Values::NONE, $bundleSid = Values::NONE) { $this->options['apiVersion'] = $apiVersion; $this->options['friendlyName'] = $friendlyName; $this->options['smsApplicationSid'] = $smsApplicationSid; $this->options['smsFallbackMethod'] = $smsFallbackMethod; $this->options['smsFallbackUrl'] = $smsFallbackUrl; $this->options['smsMethod'] = $smsMethod; $this->options['smsUrl'] = $smsUrl; $this->options['statusCallback'] = $statusCallback; $this->options['statusCallbackMethod'] = $statusCallbackMethod; $this->options['voiceApplicationSid'] = $voiceApplicationSid; $this->options['voiceCallerIdLookup'] = $voiceCallerIdLookup; $this->options['voiceFallbackMethod'] = $voiceFallbackMethod; $this->options['voiceFallbackUrl'] = $voiceFallbackUrl; $this->options['voiceMethod'] = $voiceMethod; $this->options['voiceUrl'] = $voiceUrl; $this->options['identitySid'] = $identitySid; $this->options['addressSid'] = $addressSid; $this->options['emergencyStatus'] = $emergencyStatus; $this->options['emergencyAddressSid'] = $emergencyAddressSid; $this->options['trunkSid'] = $trunkSid; $this->options['voiceReceiveMode'] = $voiceReceiveMode; $this->options['bundleSid'] = $bundleSid; } /** * The API version to use for incoming calls made to the new phone number. The default is `2010-04-01`. * * @param string $apiVersion The API version to use for incoming calls made to * the new phone number * @return $this Fluent Builder */ public function setApiVersion($apiVersion) { $this->options['apiVersion'] = $apiVersion; return $this; } /** * A descriptive string that you created to describe the new phone number. It can be up to 64 characters long. By default, this is a formatted version of the phone number. * * @param string $friendlyName A string to describe the new phone number * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The SID of the application that should handle SMS messages sent to the new phone number. If an `sms_application_sid` is present, we ignore all `sms_*_url` values and use those of the application. * * @param string $smsApplicationSid The SID of the application to handle SMS * messages * @return $this Fluent Builder */ public function setSmsApplicationSid($smsApplicationSid) { $this->options['smsApplicationSid'] = $smsApplicationSid; return $this; } /** * The HTTP method that we should use to call `sms_fallback_url`. Can be: `GET` or `POST` and defaults to `POST`. * * @param string $smsFallbackMethod HTTP method used with sms_fallback_url * @return $this Fluent Builder */ public function setSmsFallbackMethod($smsFallbackMethod) { $this->options['smsFallbackMethod'] = $smsFallbackMethod; return $this; } /** * The URL that we should call when an error occurs while requesting or executing the TwiML defined by `sms_url`. * * @param string $smsFallbackUrl The URL we call when an error occurs while * executing TwiML * @return $this Fluent Builder */ public function setSmsFallbackUrl($smsFallbackUrl) { $this->options['smsFallbackUrl'] = $smsFallbackUrl; return $this; } /** * The HTTP method that we should use to call `sms_url`. Can be: `GET` or `POST` and defaults to `POST`. * * @param string $smsMethod The HTTP method to use with sms_url * @return $this Fluent Builder */ public function setSmsMethod($smsMethod) { $this->options['smsMethod'] = $smsMethod; return $this; } /** * The URL we should call when the new phone number receives an incoming SMS message. * * @param string $smsUrl The URL we should call when the new phone number * receives an incoming SMS message * @return $this Fluent Builder */ public function setSmsUrl($smsUrl) { $this->options['smsUrl'] = $smsUrl; return $this; } /** * The URL we should call using the `status_callback_method` to send status information to your application. * * @param string $statusCallback The URL to send status information to your * application * @return $this Fluent Builder */ public function setStatusCallback($statusCallback) { $this->options['statusCallback'] = $statusCallback; return $this; } /** * The HTTP method we should use to call `status_callback`. Can be: `GET` or `POST` and defaults to `POST`. * * @param string $statusCallbackMethod The HTTP method we should use to call * status_callback * @return $this Fluent Builder */ public function setStatusCallbackMethod($statusCallbackMethod) { $this->options['statusCallbackMethod'] = $statusCallbackMethod; return $this; } /** * The SID of the application we should use to handle calls to the new phone number. If a `voice_application_sid` is present, we ignore all of the voice urls and use those set on the application. Setting a `voice_application_sid` will automatically delete your `trunk_sid` and vice versa. * * @param string $voiceApplicationSid The SID of the application to handle the * new phone number * @return $this Fluent Builder */ public function setVoiceApplicationSid($voiceApplicationSid) { $this->options['voiceApplicationSid'] = $voiceApplicationSid; return $this; } /** * Whether to lookup the caller's name from the CNAM database and post it to your app. Can be: `true` or `false` and defaults to `false`. * * @param bool $voiceCallerIdLookup Whether to lookup the caller's name * @return $this Fluent Builder */ public function setVoiceCallerIdLookup($voiceCallerIdLookup) { $this->options['voiceCallerIdLookup'] = $voiceCallerIdLookup; return $this; } /** * The HTTP method that we should use to call `voice_fallback_url`. Can be: `GET` or `POST` and defaults to `POST`. * * @param string $voiceFallbackMethod The HTTP method used with * voice_fallback_url * @return $this Fluent Builder */ public function setVoiceFallbackMethod($voiceFallbackMethod) { $this->options['voiceFallbackMethod'] = $voiceFallbackMethod; return $this; } /** * The URL that we should call when an error occurs retrieving or executing the TwiML requested by `url`. * * @param string $voiceFallbackUrl The URL we will call when an error occurs in * TwiML * @return $this Fluent Builder */ public function setVoiceFallbackUrl($voiceFallbackUrl) { $this->options['voiceFallbackUrl'] = $voiceFallbackUrl; return $this; } /** * The HTTP method that we should use to call `voice_url`. Can be: `GET` or `POST` and defaults to `POST`. * * @param string $voiceMethod The HTTP method used with the voice_url * @return $this Fluent Builder */ public function setVoiceMethod($voiceMethod) { $this->options['voiceMethod'] = $voiceMethod; return $this; } /** * The URL that we should call to answer a call to the new phone number. The `voice_url` will not be called if a `voice_application_sid` or a `trunk_sid` is set. * * @param string $voiceUrl The URL we should call when the phone number * receives a call * @return $this Fluent Builder */ public function setVoiceUrl($voiceUrl) { $this->options['voiceUrl'] = $voiceUrl; return $this; } /** * The SID of the Identity resource that we should associate with the new phone number. Some regions require an Identity to meet local regulations. * * @param string $identitySid The SID of the Identity resource to associate * with the new phone number * @return $this Fluent Builder */ public function setIdentitySid($identitySid) { $this->options['identitySid'] = $identitySid; return $this; } /** * The SID of the Address resource we should associate with the new phone number. Some regions require addresses to meet local regulations. * * @param string $addressSid The SID of the Address resource associated with * the phone number * @return $this Fluent Builder */ public function setAddressSid($addressSid) { $this->options['addressSid'] = $addressSid; return $this; } /** * The configuration status parameter that determines whether the new phone number is enabled for emergency calling. * * @param string $emergencyStatus Status determining whether the new phone * number is enabled for emergency calling * @return $this Fluent Builder */ public function setEmergencyStatus($emergencyStatus) { $this->options['emergencyStatus'] = $emergencyStatus; return $this; } /** * The SID of the emergency address configuration to use for emergency calling from the new phone number. * * @param string $emergencyAddressSid The emergency address configuration to * use for emergency calling * @return $this Fluent Builder */ public function setEmergencyAddressSid($emergencyAddressSid) { $this->options['emergencyAddressSid'] = $emergencyAddressSid; return $this; } /** * The SID of the Trunk we should use to handle calls to the new phone number. If a `trunk_sid` is present, we ignore all of the voice urls and voice applications and use only those set on the Trunk. Setting a `trunk_sid` will automatically delete your `voice_application_sid` and vice versa. * * @param string $trunkSid SID of the trunk to handle calls to the new phone * number * @return $this Fluent Builder */ public function setTrunkSid($trunkSid) { $this->options['trunkSid'] = $trunkSid; return $this; } /** * The configuration parameter for the new phone number to receive incoming voice calls or faxes. Can be: `fax` or `voice` and defaults to `voice`. * * @param string $voiceReceiveMode Incoming call type: fax or voice * @return $this Fluent Builder */ public function setVoiceReceiveMode($voiceReceiveMode) { $this->options['voiceReceiveMode'] = $voiceReceiveMode; return $this; } /** * The SID of the Bundle resource that you associate with the phone number. Some regions require a Bundle to meet local Regulations. * * @param string $bundleSid The SID of the Bundle resource associated with * number * @return $this Fluent Builder */ public function setBundleSid($bundleSid) { $this->options['bundleSid'] = $bundleSid; 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.CreateTollFreeOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/LocalOptions.php 0000644 00000055067 15002236443 0022156 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\IncomingPhoneNumber; use Twilio\Options; use Twilio\Values; abstract class LocalOptions { /** * @param bool $beta Whether to include new phone numbers * @param string $friendlyName A string that identifies the resources to read * @param string $phoneNumber The phone numbers of the resources to read * @param string $origin Include phone numbers based on their origin. By * default, phone numbers of all origin are included. * @return ReadLocalOptions Options builder */ public static function read($beta = Values::NONE, $friendlyName = Values::NONE, $phoneNumber = Values::NONE, $origin = Values::NONE) { return new ReadLocalOptions($beta, $friendlyName, $phoneNumber, $origin); } /** * @param string $apiVersion The API version to use for incoming calls made to * the new phone number * @param string $friendlyName A string to describe the new phone number * @param string $smsApplicationSid The SID of the application to handle SMS * messages * @param string $smsFallbackMethod The HTTP method we use to call * status_callback * @param string $smsFallbackUrl The URL we call when an error occurs while * executing TwiML * @param string $smsMethod The HTTP method to use with sms url * @param string $smsUrl The URL we should call when the new phone number * receives an incoming SMS message * @param string $statusCallback The URL we should call to send status * information to your application * @param string $statusCallbackMethod HTTP method we should use to call * status_callback * @param string $voiceApplicationSid The SID of the application to handle the * new phone number * @param bool $voiceCallerIdLookup Whether to lookup the caller's name * @param string $voiceFallbackMethod The HTTP method used with * voice_fallback_url * @param string $voiceFallbackUrl The URL we will call when an error occurs in * TwiML * @param string $voiceMethod The HTTP method used with the voice_url * @param string $voiceUrl The URL we should call when the phone number * receives a call * @param string $identitySid The SID of the Identity resource to associate * with the new phone number * @param string $addressSid The SID of the Address resource associated with * the phone number * @param string $emergencyStatus Status determining whether the new phone * number is enabled for emergency calling * @param string $emergencyAddressSid The emergency address configuration to * use for emergency calling * @param string $trunkSid SID of the trunk to handle calls to the new phone * number * @param string $voiceReceiveMode Incoming call type: fax or voice * @param string $bundleSid The SID of the Bundle resource associated with * number * @return CreateLocalOptions Options builder */ public static function create($apiVersion = Values::NONE, $friendlyName = Values::NONE, $smsApplicationSid = Values::NONE, $smsFallbackMethod = Values::NONE, $smsFallbackUrl = Values::NONE, $smsMethod = Values::NONE, $smsUrl = Values::NONE, $statusCallback = Values::NONE, $statusCallbackMethod = Values::NONE, $voiceApplicationSid = Values::NONE, $voiceCallerIdLookup = Values::NONE, $voiceFallbackMethod = Values::NONE, $voiceFallbackUrl = Values::NONE, $voiceMethod = Values::NONE, $voiceUrl = Values::NONE, $identitySid = Values::NONE, $addressSid = Values::NONE, $emergencyStatus = Values::NONE, $emergencyAddressSid = Values::NONE, $trunkSid = Values::NONE, $voiceReceiveMode = Values::NONE, $bundleSid = Values::NONE) { return new CreateLocalOptions($apiVersion, $friendlyName, $smsApplicationSid, $smsFallbackMethod, $smsFallbackUrl, $smsMethod, $smsUrl, $statusCallback, $statusCallbackMethod, $voiceApplicationSid, $voiceCallerIdLookup, $voiceFallbackMethod, $voiceFallbackUrl, $voiceMethod, $voiceUrl, $identitySid, $addressSid, $emergencyStatus, $emergencyAddressSid, $trunkSid, $voiceReceiveMode, $bundleSid); } } class ReadLocalOptions extends Options { /** * @param bool $beta Whether to include new phone numbers * @param string $friendlyName A string that identifies the resources to read * @param string $phoneNumber The phone numbers of the resources to read * @param string $origin Include phone numbers based on their origin. By * default, phone numbers of all origin are included. */ public function __construct($beta = Values::NONE, $friendlyName = Values::NONE, $phoneNumber = Values::NONE, $origin = Values::NONE) { $this->options['beta'] = $beta; $this->options['friendlyName'] = $friendlyName; $this->options['phoneNumber'] = $phoneNumber; $this->options['origin'] = $origin; } /** * Whether to include phone numbers new to the Twilio platform. Can be: `true` or `false` and the default is `true`. * * @param bool $beta Whether to include new phone numbers * @return $this Fluent Builder */ public function setBeta($beta) { $this->options['beta'] = $beta; return $this; } /** * A string that identifies the resources to read. * * @param string $friendlyName A string that identifies the resources to read * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The phone numbers of the IncomingPhoneNumber resources to read. You can specify partial numbers and use '*' as a wildcard for any digit. * * @param string $phoneNumber The phone numbers of the resources to read * @return $this Fluent Builder */ public function setPhoneNumber($phoneNumber) { $this->options['phoneNumber'] = $phoneNumber; return $this; } /** * Whether to include phone numbers based on their origin. Can be: `twilio` or `hosted`. By default, phone numbers of all origin are included. * * @param string $origin Include phone numbers based on their origin. By * default, phone numbers of all origin are included. * @return $this Fluent Builder */ public function setOrigin($origin) { $this->options['origin'] = $origin; 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.ReadLocalOptions ' . \implode(' ', $options) . ']'; } } class CreateLocalOptions extends Options { /** * @param string $apiVersion The API version to use for incoming calls made to * the new phone number * @param string $friendlyName A string to describe the new phone number * @param string $smsApplicationSid The SID of the application to handle SMS * messages * @param string $smsFallbackMethod The HTTP method we use to call * status_callback * @param string $smsFallbackUrl The URL we call when an error occurs while * executing TwiML * @param string $smsMethod The HTTP method to use with sms url * @param string $smsUrl The URL we should call when the new phone number * receives an incoming SMS message * @param string $statusCallback The URL we should call to send status * information to your application * @param string $statusCallbackMethod HTTP method we should use to call * status_callback * @param string $voiceApplicationSid The SID of the application to handle the * new phone number * @param bool $voiceCallerIdLookup Whether to lookup the caller's name * @param string $voiceFallbackMethod The HTTP method used with * voice_fallback_url * @param string $voiceFallbackUrl The URL we will call when an error occurs in * TwiML * @param string $voiceMethod The HTTP method used with the voice_url * @param string $voiceUrl The URL we should call when the phone number * receives a call * @param string $identitySid The SID of the Identity resource to associate * with the new phone number * @param string $addressSid The SID of the Address resource associated with * the phone number * @param string $emergencyStatus Status determining whether the new phone * number is enabled for emergency calling * @param string $emergencyAddressSid The emergency address configuration to * use for emergency calling * @param string $trunkSid SID of the trunk to handle calls to the new phone * number * @param string $voiceReceiveMode Incoming call type: fax or voice * @param string $bundleSid The SID of the Bundle resource associated with * number */ public function __construct($apiVersion = Values::NONE, $friendlyName = Values::NONE, $smsApplicationSid = Values::NONE, $smsFallbackMethod = Values::NONE, $smsFallbackUrl = Values::NONE, $smsMethod = Values::NONE, $smsUrl = Values::NONE, $statusCallback = Values::NONE, $statusCallbackMethod = Values::NONE, $voiceApplicationSid = Values::NONE, $voiceCallerIdLookup = Values::NONE, $voiceFallbackMethod = Values::NONE, $voiceFallbackUrl = Values::NONE, $voiceMethod = Values::NONE, $voiceUrl = Values::NONE, $identitySid = Values::NONE, $addressSid = Values::NONE, $emergencyStatus = Values::NONE, $emergencyAddressSid = Values::NONE, $trunkSid = Values::NONE, $voiceReceiveMode = Values::NONE, $bundleSid = Values::NONE) { $this->options['apiVersion'] = $apiVersion; $this->options['friendlyName'] = $friendlyName; $this->options['smsApplicationSid'] = $smsApplicationSid; $this->options['smsFallbackMethod'] = $smsFallbackMethod; $this->options['smsFallbackUrl'] = $smsFallbackUrl; $this->options['smsMethod'] = $smsMethod; $this->options['smsUrl'] = $smsUrl; $this->options['statusCallback'] = $statusCallback; $this->options['statusCallbackMethod'] = $statusCallbackMethod; $this->options['voiceApplicationSid'] = $voiceApplicationSid; $this->options['voiceCallerIdLookup'] = $voiceCallerIdLookup; $this->options['voiceFallbackMethod'] = $voiceFallbackMethod; $this->options['voiceFallbackUrl'] = $voiceFallbackUrl; $this->options['voiceMethod'] = $voiceMethod; $this->options['voiceUrl'] = $voiceUrl; $this->options['identitySid'] = $identitySid; $this->options['addressSid'] = $addressSid; $this->options['emergencyStatus'] = $emergencyStatus; $this->options['emergencyAddressSid'] = $emergencyAddressSid; $this->options['trunkSid'] = $trunkSid; $this->options['voiceReceiveMode'] = $voiceReceiveMode; $this->options['bundleSid'] = $bundleSid; } /** * The API version to use for incoming calls made to the new phone number. The default is `2010-04-01`. * * @param string $apiVersion The API version to use for incoming calls made to * the new phone number * @return $this Fluent Builder */ public function setApiVersion($apiVersion) { $this->options['apiVersion'] = $apiVersion; return $this; } /** * A descriptive string that you created to describe the new phone number. It can be up to 64 characters long. By default, this is a formatted version of the phone number. * * @param string $friendlyName A string to describe the new phone number * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The SID of the application that should handle SMS messages sent to the new phone number. If an `sms_application_sid` is present, we ignore all of the `sms_*_url` urls and use those set on the application. * * @param string $smsApplicationSid The SID of the application to handle SMS * messages * @return $this Fluent Builder */ public function setSmsApplicationSid($smsApplicationSid) { $this->options['smsApplicationSid'] = $smsApplicationSid; return $this; } /** * The HTTP method that we should use to call `sms_fallback_url`. Can be: `GET` or `POST` and defaults to `POST`. * * @param string $smsFallbackMethod The HTTP method we use to call * status_callback * @return $this Fluent Builder */ public function setSmsFallbackMethod($smsFallbackMethod) { $this->options['smsFallbackMethod'] = $smsFallbackMethod; return $this; } /** * The URL that we should call when an error occurs while requesting or executing the TwiML defined by `sms_url`. * * @param string $smsFallbackUrl The URL we call when an error occurs while * executing TwiML * @return $this Fluent Builder */ public function setSmsFallbackUrl($smsFallbackUrl) { $this->options['smsFallbackUrl'] = $smsFallbackUrl; return $this; } /** * The HTTP method that we should use to call `sms_url`. Can be: `GET` or `POST` and defaults to `POST`. * * @param string $smsMethod The HTTP method to use with sms url * @return $this Fluent Builder */ public function setSmsMethod($smsMethod) { $this->options['smsMethod'] = $smsMethod; return $this; } /** * The URL we should call when the new phone number receives an incoming SMS message. * * @param string $smsUrl The URL we should call when the new phone number * receives an incoming SMS message * @return $this Fluent Builder */ public function setSmsUrl($smsUrl) { $this->options['smsUrl'] = $smsUrl; return $this; } /** * The URL we should call using the `status_callback_method` to send status information to your application. * * @param string $statusCallback The URL we should call to send status * information to your application * @return $this Fluent Builder */ public function setStatusCallback($statusCallback) { $this->options['statusCallback'] = $statusCallback; return $this; } /** * The HTTP method we should use to call `status_callback`. Can be: `GET` or `POST` and defaults to `POST`. * * @param string $statusCallbackMethod HTTP method we should use to call * status_callback * @return $this Fluent Builder */ public function setStatusCallbackMethod($statusCallbackMethod) { $this->options['statusCallbackMethod'] = $statusCallbackMethod; return $this; } /** * The SID of the application we should use to handle calls to the new phone number. If a `voice_application_sid` is present, we ignore all of the voice urls and use only those set on the application. Setting a `voice_application_sid` will automatically delete your `trunk_sid` and vice versa. * * @param string $voiceApplicationSid The SID of the application to handle the * new phone number * @return $this Fluent Builder */ public function setVoiceApplicationSid($voiceApplicationSid) { $this->options['voiceApplicationSid'] = $voiceApplicationSid; return $this; } /** * Whether to lookup the caller's name from the CNAM database and post it to your app. Can be: `true` or `false` and defaults to `false`. * * @param bool $voiceCallerIdLookup Whether to lookup the caller's name * @return $this Fluent Builder */ public function setVoiceCallerIdLookup($voiceCallerIdLookup) { $this->options['voiceCallerIdLookup'] = $voiceCallerIdLookup; return $this; } /** * The HTTP method that we should use to call `voice_fallback_url`. Can be: `GET` or `POST` and defaults to `POST`. * * @param string $voiceFallbackMethod The HTTP method used with * voice_fallback_url * @return $this Fluent Builder */ public function setVoiceFallbackMethod($voiceFallbackMethod) { $this->options['voiceFallbackMethod'] = $voiceFallbackMethod; return $this; } /** * The URL that we should call when an error occurs retrieving or executing the TwiML requested by `url`. * * @param string $voiceFallbackUrl The URL we will call when an error occurs in * TwiML * @return $this Fluent Builder */ public function setVoiceFallbackUrl($voiceFallbackUrl) { $this->options['voiceFallbackUrl'] = $voiceFallbackUrl; return $this; } /** * The HTTP method that we should use to call `voice_url`. Can be: `GET` or `POST` and defaults to `POST`. * * @param string $voiceMethod The HTTP method used with the voice_url * @return $this Fluent Builder */ public function setVoiceMethod($voiceMethod) { $this->options['voiceMethod'] = $voiceMethod; return $this; } /** * The URL that we should call to answer a call to the new phone number. The `voice_url` will not be called if a `voice_application_sid` or a `trunk_sid` is set. * * @param string $voiceUrl The URL we should call when the phone number * receives a call * @return $this Fluent Builder */ public function setVoiceUrl($voiceUrl) { $this->options['voiceUrl'] = $voiceUrl; return $this; } /** * The SID of the Identity resource that we should associate with the new phone number. Some regions require an identity to meet local regulations. * * @param string $identitySid The SID of the Identity resource to associate * with the new phone number * @return $this Fluent Builder */ public function setIdentitySid($identitySid) { $this->options['identitySid'] = $identitySid; return $this; } /** * The SID of the Address resource we should associate with the new phone number. Some regions require addresses to meet local regulations. * * @param string $addressSid The SID of the Address resource associated with * the phone number * @return $this Fluent Builder */ public function setAddressSid($addressSid) { $this->options['addressSid'] = $addressSid; return $this; } /** * The configuration status parameter that determines whether the new phone number is enabled for emergency calling. * * @param string $emergencyStatus Status determining whether the new phone * number is enabled for emergency calling * @return $this Fluent Builder */ public function setEmergencyStatus($emergencyStatus) { $this->options['emergencyStatus'] = $emergencyStatus; return $this; } /** * The SID of the emergency address configuration to use for emergency calling from the new phone number. * * @param string $emergencyAddressSid The emergency address configuration to * use for emergency calling * @return $this Fluent Builder */ public function setEmergencyAddressSid($emergencyAddressSid) { $this->options['emergencyAddressSid'] = $emergencyAddressSid; return $this; } /** * The SID of the Trunk we should use to handle calls to the new phone number. If a `trunk_sid` is present, we ignore all of the voice urls and voice applications and use only those set on the Trunk. Setting a `trunk_sid` will automatically delete your `voice_application_sid` and vice versa. * * @param string $trunkSid SID of the trunk to handle calls to the new phone * number * @return $this Fluent Builder */ public function setTrunkSid($trunkSid) { $this->options['trunkSid'] = $trunkSid; return $this; } /** * The configuration parameter for the new phone number to receive incoming voice calls or faxes. Can be: `fax` or `voice` and defaults to `voice`. * * @param string $voiceReceiveMode Incoming call type: fax or voice * @return $this Fluent Builder */ public function setVoiceReceiveMode($voiceReceiveMode) { $this->options['voiceReceiveMode'] = $voiceReceiveMode; return $this; } /** * The SID of the Bundle resource that you associate with the phone number. Some regions require a Bundle to meet local Regulations. * * @param string $bundleSid The SID of the Bundle resource associated with * number * @return $this Fluent Builder */ public function setBundleSid($bundleSid) { $this->options['bundleSid'] = $bundleSid; 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.CreateLocalOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/MobileOptions.php 0000644 00000054667 15002236443 0022340 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\IncomingPhoneNumber; use Twilio\Options; use Twilio\Values; abstract class MobileOptions { /** * @param bool $beta Whether to include new phone numbers * @param string $friendlyName A string that identifies the resources to read * @param string $phoneNumber The phone numbers of the resources to read * @param string $origin Include phone numbers based on their origin. By * default, phone numbers of all origin are included. * @return ReadMobileOptions Options builder */ public static function read($beta = Values::NONE, $friendlyName = Values::NONE, $phoneNumber = Values::NONE, $origin = Values::NONE) { return new ReadMobileOptions($beta, $friendlyName, $phoneNumber, $origin); } /** * @param string $apiVersion The API version to use for incoming calls made to * the new phone number * @param string $friendlyName A string to describe the new phone number * @param string $smsApplicationSid The SID of the application to handle SMS * messages * @param string $smsFallbackMethod HTTP method used with sms_fallback_url * @param string $smsFallbackUrl The URL we call when an error occurs while * executing TwiML * @param string $smsMethod The HTTP method to use with sms url * @param string $smsUrl The URL we should call when the new phone number * receives an incoming SMS message * @param string $statusCallback The URL we should call to send status * information to your application * @param string $statusCallbackMethod The HTTP method we should use to call * status_callback * @param string $voiceApplicationSid The SID of the application to handle the * new phone number * @param bool $voiceCallerIdLookup Whether to lookup the caller's name * @param string $voiceFallbackMethod The HTTP method used with * voice_fallback_url * @param string $voiceFallbackUrl The URL we will call when an error occurs in * TwiML * @param string $voiceMethod The HTTP method used with the voice_url * @param string $voiceUrl The URL we should call when the phone number * receives a call * @param string $identitySid The SID of the Identity resource to associate * with the new phone number * @param string $addressSid The SID of the Address resource associated with * the phone number * @param string $emergencyStatus Status determining whether the new phone * number is enabled for emergency calling * @param string $emergencyAddressSid The emergency address configuration to * use for emergency calling * @param string $trunkSid SID of the trunk to handle calls to the new phone * number * @param string $voiceReceiveMode Incoming call type: fax or voice * @param string $bundleSid The SID of the Bundle resource associated with * number * @return CreateMobileOptions Options builder */ public static function create($apiVersion = Values::NONE, $friendlyName = Values::NONE, $smsApplicationSid = Values::NONE, $smsFallbackMethod = Values::NONE, $smsFallbackUrl = Values::NONE, $smsMethod = Values::NONE, $smsUrl = Values::NONE, $statusCallback = Values::NONE, $statusCallbackMethod = Values::NONE, $voiceApplicationSid = Values::NONE, $voiceCallerIdLookup = Values::NONE, $voiceFallbackMethod = Values::NONE, $voiceFallbackUrl = Values::NONE, $voiceMethod = Values::NONE, $voiceUrl = Values::NONE, $identitySid = Values::NONE, $addressSid = Values::NONE, $emergencyStatus = Values::NONE, $emergencyAddressSid = Values::NONE, $trunkSid = Values::NONE, $voiceReceiveMode = Values::NONE, $bundleSid = Values::NONE) { return new CreateMobileOptions($apiVersion, $friendlyName, $smsApplicationSid, $smsFallbackMethod, $smsFallbackUrl, $smsMethod, $smsUrl, $statusCallback, $statusCallbackMethod, $voiceApplicationSid, $voiceCallerIdLookup, $voiceFallbackMethod, $voiceFallbackUrl, $voiceMethod, $voiceUrl, $identitySid, $addressSid, $emergencyStatus, $emergencyAddressSid, $trunkSid, $voiceReceiveMode, $bundleSid); } } class ReadMobileOptions extends Options { /** * @param bool $beta Whether to include new phone numbers * @param string $friendlyName A string that identifies the resources to read * @param string $phoneNumber The phone numbers of the resources to read * @param string $origin Include phone numbers based on their origin. By * default, phone numbers of all origin are included. */ public function __construct($beta = Values::NONE, $friendlyName = Values::NONE, $phoneNumber = Values::NONE, $origin = Values::NONE) { $this->options['beta'] = $beta; $this->options['friendlyName'] = $friendlyName; $this->options['phoneNumber'] = $phoneNumber; $this->options['origin'] = $origin; } /** * Whether to include phone numbers new to the Twilio platform. Can be: `true` or `false` and the default is `true`. * * @param bool $beta Whether to include new phone numbers * @return $this Fluent Builder */ public function setBeta($beta) { $this->options['beta'] = $beta; return $this; } /** * A string that identifies the resources to read. * * @param string $friendlyName A string that identifies the resources to read * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The phone numbers of the IncomingPhoneNumber resources to read. You can specify partial numbers and use '*' as a wildcard for any digit. * * @param string $phoneNumber The phone numbers of the resources to read * @return $this Fluent Builder */ public function setPhoneNumber($phoneNumber) { $this->options['phoneNumber'] = $phoneNumber; return $this; } /** * Whether to include phone numbers based on their origin. Can be: `twilio` or `hosted`. By default, phone numbers of all origin are included. * * @param string $origin Include phone numbers based on their origin. By * default, phone numbers of all origin are included. * @return $this Fluent Builder */ public function setOrigin($origin) { $this->options['origin'] = $origin; 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.ReadMobileOptions ' . \implode(' ', $options) . ']'; } } class CreateMobileOptions extends Options { /** * @param string $apiVersion The API version to use for incoming calls made to * the new phone number * @param string $friendlyName A string to describe the new phone number * @param string $smsApplicationSid The SID of the application to handle SMS * messages * @param string $smsFallbackMethod HTTP method used with sms_fallback_url * @param string $smsFallbackUrl The URL we call when an error occurs while * executing TwiML * @param string $smsMethod The HTTP method to use with sms url * @param string $smsUrl The URL we should call when the new phone number * receives an incoming SMS message * @param string $statusCallback The URL we should call to send status * information to your application * @param string $statusCallbackMethod The HTTP method we should use to call * status_callback * @param string $voiceApplicationSid The SID of the application to handle the * new phone number * @param bool $voiceCallerIdLookup Whether to lookup the caller's name * @param string $voiceFallbackMethod The HTTP method used with * voice_fallback_url * @param string $voiceFallbackUrl The URL we will call when an error occurs in * TwiML * @param string $voiceMethod The HTTP method used with the voice_url * @param string $voiceUrl The URL we should call when the phone number * receives a call * @param string $identitySid The SID of the Identity resource to associate * with the new phone number * @param string $addressSid The SID of the Address resource associated with * the phone number * @param string $emergencyStatus Status determining whether the new phone * number is enabled for emergency calling * @param string $emergencyAddressSid The emergency address configuration to * use for emergency calling * @param string $trunkSid SID of the trunk to handle calls to the new phone * number * @param string $voiceReceiveMode Incoming call type: fax or voice * @param string $bundleSid The SID of the Bundle resource associated with * number */ public function __construct($apiVersion = Values::NONE, $friendlyName = Values::NONE, $smsApplicationSid = Values::NONE, $smsFallbackMethod = Values::NONE, $smsFallbackUrl = Values::NONE, $smsMethod = Values::NONE, $smsUrl = Values::NONE, $statusCallback = Values::NONE, $statusCallbackMethod = Values::NONE, $voiceApplicationSid = Values::NONE, $voiceCallerIdLookup = Values::NONE, $voiceFallbackMethod = Values::NONE, $voiceFallbackUrl = Values::NONE, $voiceMethod = Values::NONE, $voiceUrl = Values::NONE, $identitySid = Values::NONE, $addressSid = Values::NONE, $emergencyStatus = Values::NONE, $emergencyAddressSid = Values::NONE, $trunkSid = Values::NONE, $voiceReceiveMode = Values::NONE, $bundleSid = Values::NONE) { $this->options['apiVersion'] = $apiVersion; $this->options['friendlyName'] = $friendlyName; $this->options['smsApplicationSid'] = $smsApplicationSid; $this->options['smsFallbackMethod'] = $smsFallbackMethod; $this->options['smsFallbackUrl'] = $smsFallbackUrl; $this->options['smsMethod'] = $smsMethod; $this->options['smsUrl'] = $smsUrl; $this->options['statusCallback'] = $statusCallback; $this->options['statusCallbackMethod'] = $statusCallbackMethod; $this->options['voiceApplicationSid'] = $voiceApplicationSid; $this->options['voiceCallerIdLookup'] = $voiceCallerIdLookup; $this->options['voiceFallbackMethod'] = $voiceFallbackMethod; $this->options['voiceFallbackUrl'] = $voiceFallbackUrl; $this->options['voiceMethod'] = $voiceMethod; $this->options['voiceUrl'] = $voiceUrl; $this->options['identitySid'] = $identitySid; $this->options['addressSid'] = $addressSid; $this->options['emergencyStatus'] = $emergencyStatus; $this->options['emergencyAddressSid'] = $emergencyAddressSid; $this->options['trunkSid'] = $trunkSid; $this->options['voiceReceiveMode'] = $voiceReceiveMode; $this->options['bundleSid'] = $bundleSid; } /** * The API version to use for incoming calls made to the new phone number. The default is `2010-04-01`. * * @param string $apiVersion The API version to use for incoming calls made to * the new phone number * @return $this Fluent Builder */ public function setApiVersion($apiVersion) { $this->options['apiVersion'] = $apiVersion; return $this; } /** * A descriptive string that you created to describe the new phone number. It can be up to 64 characters long. By default, the is a formatted version of the phone number. * * @param string $friendlyName A string to describe the new phone number * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The SID of the application that should handle SMS messages sent to the new phone number. If an `sms_application_sid` is present, we ignore all of the `sms_*_url` urls and use those of the application. * * @param string $smsApplicationSid The SID of the application to handle SMS * messages * @return $this Fluent Builder */ public function setSmsApplicationSid($smsApplicationSid) { $this->options['smsApplicationSid'] = $smsApplicationSid; return $this; } /** * The HTTP method that we should use to call `sms_fallback_url`. Can be: `GET` or `POST` and defaults to `POST`. * * @param string $smsFallbackMethod HTTP method used with sms_fallback_url * @return $this Fluent Builder */ public function setSmsFallbackMethod($smsFallbackMethod) { $this->options['smsFallbackMethod'] = $smsFallbackMethod; return $this; } /** * The URL that we should call when an error occurs while requesting or executing the TwiML defined by `sms_url`. * * @param string $smsFallbackUrl The URL we call when an error occurs while * executing TwiML * @return $this Fluent Builder */ public function setSmsFallbackUrl($smsFallbackUrl) { $this->options['smsFallbackUrl'] = $smsFallbackUrl; return $this; } /** * The HTTP method that we should use to call `sms_url`. Can be: `GET` or `POST` and defaults to `POST`. * * @param string $smsMethod The HTTP method to use with sms url * @return $this Fluent Builder */ public function setSmsMethod($smsMethod) { $this->options['smsMethod'] = $smsMethod; return $this; } /** * The URL we should call when the new phone number receives an incoming SMS message. * * @param string $smsUrl The URL we should call when the new phone number * receives an incoming SMS message * @return $this Fluent Builder */ public function setSmsUrl($smsUrl) { $this->options['smsUrl'] = $smsUrl; return $this; } /** * The URL we should call using the `status_callback_method` to send status information to your application. * * @param string $statusCallback The URL we should call to send status * information to your application * @return $this Fluent Builder */ public function setStatusCallback($statusCallback) { $this->options['statusCallback'] = $statusCallback; return $this; } /** * The HTTP method we should use to call `status_callback`. Can be: `GET` or `POST` and defaults to `POST`. * * @param string $statusCallbackMethod The HTTP method we should use to call * status_callback * @return $this Fluent Builder */ public function setStatusCallbackMethod($statusCallbackMethod) { $this->options['statusCallbackMethod'] = $statusCallbackMethod; return $this; } /** * The SID of the application we should use to handle calls to the new phone number. If a `voice_application_sid` is present, we ignore all of the voice urls and use only those set on the application. Setting a `voice_application_sid` will automatically delete your `trunk_sid` and vice versa. * * @param string $voiceApplicationSid The SID of the application to handle the * new phone number * @return $this Fluent Builder */ public function setVoiceApplicationSid($voiceApplicationSid) { $this->options['voiceApplicationSid'] = $voiceApplicationSid; return $this; } /** * Whether to lookup the caller's name from the CNAM database and post it to your app. Can be: `true` or `false` and defaults to `false`. * * @param bool $voiceCallerIdLookup Whether to lookup the caller's name * @return $this Fluent Builder */ public function setVoiceCallerIdLookup($voiceCallerIdLookup) { $this->options['voiceCallerIdLookup'] = $voiceCallerIdLookup; return $this; } /** * The HTTP method that we should use to call `voice_fallback_url`. Can be: `GET` or `POST` and defaults to `POST`. * * @param string $voiceFallbackMethod The HTTP method used with * voice_fallback_url * @return $this Fluent Builder */ public function setVoiceFallbackMethod($voiceFallbackMethod) { $this->options['voiceFallbackMethod'] = $voiceFallbackMethod; return $this; } /** * The URL that we should call when an error occurs retrieving or executing the TwiML requested by `url`. * * @param string $voiceFallbackUrl The URL we will call when an error occurs in * TwiML * @return $this Fluent Builder */ public function setVoiceFallbackUrl($voiceFallbackUrl) { $this->options['voiceFallbackUrl'] = $voiceFallbackUrl; return $this; } /** * The HTTP method that we should use to call `voice_url`. Can be: `GET` or `POST` and defaults to `POST`. * * @param string $voiceMethod The HTTP method used with the voice_url * @return $this Fluent Builder */ public function setVoiceMethod($voiceMethod) { $this->options['voiceMethod'] = $voiceMethod; return $this; } /** * The URL that we should call to answer a call to the new phone number. The `voice_url` will not be called if a `voice_application_sid` or a `trunk_sid` is set. * * @param string $voiceUrl The URL we should call when the phone number * receives a call * @return $this Fluent Builder */ public function setVoiceUrl($voiceUrl) { $this->options['voiceUrl'] = $voiceUrl; return $this; } /** * The SID of the Identity resource that we should associate with the new phone number. Some regions require an identity to meet local regulations. * * @param string $identitySid The SID of the Identity resource to associate * with the new phone number * @return $this Fluent Builder */ public function setIdentitySid($identitySid) { $this->options['identitySid'] = $identitySid; return $this; } /** * The SID of the Address resource we should associate with the new phone number. Some regions require addresses to meet local regulations. * * @param string $addressSid The SID of the Address resource associated with * the phone number * @return $this Fluent Builder */ public function setAddressSid($addressSid) { $this->options['addressSid'] = $addressSid; return $this; } /** * The configuration status parameter that determines whether the new phone number is enabled for emergency calling. * * @param string $emergencyStatus Status determining whether the new phone * number is enabled for emergency calling * @return $this Fluent Builder */ public function setEmergencyStatus($emergencyStatus) { $this->options['emergencyStatus'] = $emergencyStatus; return $this; } /** * The SID of the emergency address configuration to use for emergency calling from the new phone number. * * @param string $emergencyAddressSid The emergency address configuration to * use for emergency calling * @return $this Fluent Builder */ public function setEmergencyAddressSid($emergencyAddressSid) { $this->options['emergencyAddressSid'] = $emergencyAddressSid; return $this; } /** * The SID of the Trunk we should use to handle calls to the new phone number. If a `trunk_sid` is present, we ignore all of the voice urls and voice applications and use only those set on the Trunk. Setting a `trunk_sid` will automatically delete your `voice_application_sid` and vice versa. * * @param string $trunkSid SID of the trunk to handle calls to the new phone * number * @return $this Fluent Builder */ public function setTrunkSid($trunkSid) { $this->options['trunkSid'] = $trunkSid; return $this; } /** * The configuration parameter for the new phone number to receive incoming voice calls or faxes. Can be: `fax` or `voice` and defaults to `voice`. * * @param string $voiceReceiveMode Incoming call type: fax or voice * @return $this Fluent Builder */ public function setVoiceReceiveMode($voiceReceiveMode) { $this->options['voiceReceiveMode'] = $voiceReceiveMode; return $this; } /** * The SID of the Bundle resource that you associate with the phone number. Some regions require a Bundle to meet local Regulations. * * @param string $bundleSid The SID of the Bundle resource associated with * number * @return $this Fluent Builder */ public function setBundleSid($bundleSid) { $this->options['bundleSid'] = $bundleSid; 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.CreateMobileOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/LocalInstance.php 0000644 00000012166 15002236443 0022260 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\IncomingPhoneNumber; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property string $addressSid * @property string $addressRequirements * @property string $apiVersion * @property bool $beta * @property string $capabilities * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $friendlyName * @property string $identitySid * @property string $phoneNumber * @property string $origin * @property string $sid * @property string $smsApplicationSid * @property string $smsFallbackMethod * @property string $smsFallbackUrl * @property string $smsMethod * @property string $smsUrl * @property string $statusCallback * @property string $statusCallbackMethod * @property string $trunkSid * @property string $uri * @property string $voiceApplicationSid * @property bool $voiceCallerIdLookup * @property string $voiceFallbackMethod * @property string $voiceFallbackUrl * @property string $voiceMethod * @property string $voiceUrl * @property string $emergencyStatus * @property string $emergencyAddressSid * @property string $bundleSid */ class LocalInstance extends InstanceResource { /** * Initialize the LocalInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the Account that created the resource * @return \Twilio\Rest\Api\V2010\Account\IncomingPhoneNumber\LocalInstance */ public function __construct(Version $version, array $payload, $accountSid) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'accountSid' => Values::array_get($payload, 'account_sid'), 'addressSid' => Values::array_get($payload, 'address_sid'), 'addressRequirements' => Values::array_get($payload, 'address_requirements'), 'apiVersion' => Values::array_get($payload, 'api_version'), 'beta' => Values::array_get($payload, 'beta'), 'capabilities' => Values::array_get($payload, 'capabilities'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'identitySid' => Values::array_get($payload, 'identity_sid'), 'phoneNumber' => Values::array_get($payload, 'phone_number'), 'origin' => Values::array_get($payload, 'origin'), 'sid' => Values::array_get($payload, 'sid'), 'smsApplicationSid' => Values::array_get($payload, 'sms_application_sid'), 'smsFallbackMethod' => Values::array_get($payload, 'sms_fallback_method'), 'smsFallbackUrl' => Values::array_get($payload, 'sms_fallback_url'), 'smsMethod' => Values::array_get($payload, 'sms_method'), 'smsUrl' => Values::array_get($payload, 'sms_url'), 'statusCallback' => Values::array_get($payload, 'status_callback'), 'statusCallbackMethod' => Values::array_get($payload, 'status_callback_method'), 'trunkSid' => Values::array_get($payload, 'trunk_sid'), 'uri' => Values::array_get($payload, 'uri'), 'voiceApplicationSid' => Values::array_get($payload, 'voice_application_sid'), 'voiceCallerIdLookup' => Values::array_get($payload, 'voice_caller_id_lookup'), 'voiceFallbackMethod' => Values::array_get($payload, 'voice_fallback_method'), 'voiceFallbackUrl' => Values::array_get($payload, 'voice_fallback_url'), 'voiceMethod' => Values::array_get($payload, 'voice_method'), 'voiceUrl' => Values::array_get($payload, 'voice_url'), 'emergencyStatus' => Values::array_get($payload, 'emergency_status'), 'emergencyAddressSid' => Values::array_get($payload, 'emergency_address_sid'), 'bundleSid' => Values::array_get($payload, 'bundle_sid'), ); $this->solution = array('accountSid' => $accountSid, ); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.LocalInstance]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/TollFreeList.php 0000644 00000016271 15002236443 0022112 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\IncomingPhoneNumber; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class TollFreeList extends ListResource { /** * Construct the TollFreeList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the Account that created the resource * @return \Twilio\Rest\Api\V2010\Account\IncomingPhoneNumber\TollFreeList */ public function __construct(Version $version, $accountSid) { parent::__construct($version); // Path Solution $this->solution = array('accountSid' => $accountSid, ); $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/IncomingPhoneNumbers/TollFree.json'; } /** * Streams TollFreeInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($options = array(), $limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads TollFreeInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return TollFreeInstance[] Array of results */ public function read($options = array(), $limit = null, $pageSize = null) { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Retrieve a single page of TollFreeInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of TollFreeInstance */ public function page($options = array(), $pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $options = new Values($options); $params = Values::of(array( 'Beta' => Serialize::booleanToString($options['beta']), 'FriendlyName' => $options['friendlyName'], 'PhoneNumber' => $options['phoneNumber'], 'Origin' => $options['origin'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new TollFreePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of TollFreeInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of TollFreeInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new TollFreePage($this->version, $response, $this->solution); } /** * Create a new TollFreeInstance * * @param string $phoneNumber The phone number to purchase in E.164 format * @param array|Options $options Optional Arguments * @return TollFreeInstance Newly created TollFreeInstance * @throws TwilioException When an HTTP error occurs. */ public function create($phoneNumber, $options = array()) { $options = new Values($options); $data = Values::of(array( 'PhoneNumber' => $phoneNumber, 'ApiVersion' => $options['apiVersion'], 'FriendlyName' => $options['friendlyName'], 'SmsApplicationSid' => $options['smsApplicationSid'], 'SmsFallbackMethod' => $options['smsFallbackMethod'], 'SmsFallbackUrl' => $options['smsFallbackUrl'], 'SmsMethod' => $options['smsMethod'], 'SmsUrl' => $options['smsUrl'], 'StatusCallback' => $options['statusCallback'], 'StatusCallbackMethod' => $options['statusCallbackMethod'], 'VoiceApplicationSid' => $options['voiceApplicationSid'], 'VoiceCallerIdLookup' => Serialize::booleanToString($options['voiceCallerIdLookup']), 'VoiceFallbackMethod' => $options['voiceFallbackMethod'], 'VoiceFallbackUrl' => $options['voiceFallbackUrl'], 'VoiceMethod' => $options['voiceMethod'], 'VoiceUrl' => $options['voiceUrl'], 'IdentitySid' => $options['identitySid'], 'AddressSid' => $options['addressSid'], 'EmergencyStatus' => $options['emergencyStatus'], 'EmergencyAddressSid' => $options['emergencyAddressSid'], 'TrunkSid' => $options['trunkSid'], 'VoiceReceiveMode' => $options['voiceReceiveMode'], 'BundleSid' => $options['bundleSid'], )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new TollFreeInstance($this->version, $payload, $this->solution['accountSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.TollFreeList]'; } } src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/AssignedAddOn/AssignedAddOnExtensionList.php 0000644 00000013705 15002236443 0027321 0 ustar 00 sdk <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\IncomingPhoneNumber\AssignedAddOn; use Twilio\ListResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class AssignedAddOnExtensionList extends ListResource { /** * Construct the AssignedAddOnExtensionList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the Account that created the resource * @param string $resourceSid The SID of the Phone Number to which the Add-on * is assigned * @param string $assignedAddOnSid The SID that uniquely identifies the * assigned Add-on installation * @return \Twilio\Rest\Api\V2010\Account\IncomingPhoneNumber\AssignedAddOn\AssignedAddOnExtensionList */ public function __construct(Version $version, $accountSid, $resourceSid, $assignedAddOnSid) { parent::__construct($version); // Path Solution $this->solution = array( 'accountSid' => $accountSid, 'resourceSid' => $resourceSid, 'assignedAddOnSid' => $assignedAddOnSid, ); $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/IncomingPhoneNumbers/' . \rawurlencode($resourceSid) . '/AssignedAddOns/' . \rawurlencode($assignedAddOnSid) . '/Extensions.json'; } /** * Streams AssignedAddOnExtensionInstance records from the API as a generator * stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads AssignedAddOnExtensionInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return AssignedAddOnExtensionInstance[] Array of results */ public function read($limit = null, $pageSize = null) { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of AssignedAddOnExtensionInstance records from the * API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of AssignedAddOnExtensionInstance */ public function page($pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $params = Values::of(array( 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new AssignedAddOnExtensionPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of AssignedAddOnExtensionInstance records from the * API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of AssignedAddOnExtensionInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new AssignedAddOnExtensionPage($this->version, $response, $this->solution); } /** * Constructs a AssignedAddOnExtensionContext * * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Api\V2010\Account\IncomingPhoneNumber\AssignedAddOn\AssignedAddOnExtensionContext */ public function getContext($sid) { return new AssignedAddOnExtensionContext( $this->version, $this->solution['accountSid'], $this->solution['resourceSid'], $this->solution['assignedAddOnSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.AssignedAddOnExtensionList]'; } } Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/AssignedAddOn/AssignedAddOnExtensionInstance.php 0000644 00000011212 15002236443 0030141 0 ustar 00 sdk/src <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\IncomingPhoneNumber\AssignedAddOn; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * * @property string $sid * @property string $accountSid * @property string $resourceSid * @property string $assignedAddOnSid * @property string $friendlyName * @property string $productName * @property string $uniqueName * @property string $uri * @property bool $enabled */ class AssignedAddOnExtensionInstance extends InstanceResource { /** * Initialize the AssignedAddOnExtensionInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the Account that created the resource * @param string $resourceSid The SID of the Phone Number to which the Add-on * is assigned * @param string $assignedAddOnSid The SID that uniquely identifies the * assigned Add-on installation * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Api\V2010\Account\IncomingPhoneNumber\AssignedAddOn\AssignedAddOnExtensionInstance */ public function __construct(Version $version, array $payload, $accountSid, $resourceSid, $assignedAddOnSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'resourceSid' => Values::array_get($payload, 'resource_sid'), 'assignedAddOnSid' => Values::array_get($payload, 'assigned_add_on_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'productName' => Values::array_get($payload, 'product_name'), 'uniqueName' => Values::array_get($payload, 'unique_name'), 'uri' => Values::array_get($payload, 'uri'), 'enabled' => Values::array_get($payload, 'enabled'), ); $this->solution = array( 'accountSid' => $accountSid, 'resourceSid' => $resourceSid, 'assignedAddOnSid' => $assignedAddOnSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Api\V2010\Account\IncomingPhoneNumber\AssignedAddOn\AssignedAddOnExtensionContext Context for this * AssignedAddOnExtensionInstance */ protected function proxy() { if (!$this->context) { $this->context = new AssignedAddOnExtensionContext( $this->version, $this->solution['accountSid'], $this->solution['resourceSid'], $this->solution['assignedAddOnSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch a AssignedAddOnExtensionInstance * * @return AssignedAddOnExtensionInstance Fetched AssignedAddOnExtensionInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.AssignedAddOnExtensionInstance ' . \implode(' ', $context) . ']'; } } src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/AssignedAddOn/AssignedAddOnExtensionPage.php 0000644 00000002100 15002236443 0027245 0 ustar 00 sdk <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\IncomingPhoneNumber\AssignedAddOn; use Twilio\Page; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class AssignedAddOnExtensionPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new AssignedAddOnExtensionInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['resourceSid'], $this->solution['assignedAddOnSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.AssignedAddOnExtensionPage]'; } } Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/AssignedAddOn/AssignedAddOnExtensionContext.php 0000644 00000005516 15002236443 0030033 0 ustar 00 sdk/src <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\IncomingPhoneNumber\AssignedAddOn; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class AssignedAddOnExtensionContext extends InstanceContext { /** * Initialize the AssignedAddOnExtensionContext * * @param \Twilio\Version $version Version that contains the resource * @param string $accountSid The SID of the Account that created the resource * to fetch * @param string $resourceSid The SID of the Phone Number to which the Add-on * is assigned * @param string $assignedAddOnSid The SID that uniquely identifies the * assigned Add-on installation * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Api\V2010\Account\IncomingPhoneNumber\AssignedAddOn\AssignedAddOnExtensionContext */ public function __construct(Version $version, $accountSid, $resourceSid, $assignedAddOnSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array( 'accountSid' => $accountSid, 'resourceSid' => $resourceSid, 'assignedAddOnSid' => $assignedAddOnSid, 'sid' => $sid, ); $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/IncomingPhoneNumbers/' . \rawurlencode($resourceSid) . '/AssignedAddOns/' . \rawurlencode($assignedAddOnSid) . '/Extensions/' . \rawurlencode($sid) . '.json'; } /** * Fetch a AssignedAddOnExtensionInstance * * @return AssignedAddOnExtensionInstance Fetched AssignedAddOnExtensionInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new AssignedAddOnExtensionInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['resourceSid'], $this->solution['assignedAddOnSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.AssignedAddOnExtensionContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/TollFreeInstance.php 0000644 00000012202 15002236443 0022731 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\IncomingPhoneNumber; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property string $addressSid * @property string $addressRequirements * @property string $apiVersion * @property bool $beta * @property string $capabilities * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $friendlyName * @property string $identitySid * @property string $phoneNumber * @property string $origin * @property string $sid * @property string $smsApplicationSid * @property string $smsFallbackMethod * @property string $smsFallbackUrl * @property string $smsMethod * @property string $smsUrl * @property string $statusCallback * @property string $statusCallbackMethod * @property string $trunkSid * @property string $uri * @property string $voiceApplicationSid * @property bool $voiceCallerIdLookup * @property string $voiceFallbackMethod * @property string $voiceFallbackUrl * @property string $voiceMethod * @property string $voiceUrl * @property string $emergencyStatus * @property string $emergencyAddressSid * @property string $bundleSid */ class TollFreeInstance extends InstanceResource { /** * Initialize the TollFreeInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the Account that created the resource * @return \Twilio\Rest\Api\V2010\Account\IncomingPhoneNumber\TollFreeInstance */ public function __construct(Version $version, array $payload, $accountSid) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'accountSid' => Values::array_get($payload, 'account_sid'), 'addressSid' => Values::array_get($payload, 'address_sid'), 'addressRequirements' => Values::array_get($payload, 'address_requirements'), 'apiVersion' => Values::array_get($payload, 'api_version'), 'beta' => Values::array_get($payload, 'beta'), 'capabilities' => Values::array_get($payload, 'capabilities'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'identitySid' => Values::array_get($payload, 'identity_sid'), 'phoneNumber' => Values::array_get($payload, 'phone_number'), 'origin' => Values::array_get($payload, 'origin'), 'sid' => Values::array_get($payload, 'sid'), 'smsApplicationSid' => Values::array_get($payload, 'sms_application_sid'), 'smsFallbackMethod' => Values::array_get($payload, 'sms_fallback_method'), 'smsFallbackUrl' => Values::array_get($payload, 'sms_fallback_url'), 'smsMethod' => Values::array_get($payload, 'sms_method'), 'smsUrl' => Values::array_get($payload, 'sms_url'), 'statusCallback' => Values::array_get($payload, 'status_callback'), 'statusCallbackMethod' => Values::array_get($payload, 'status_callback_method'), 'trunkSid' => Values::array_get($payload, 'trunk_sid'), 'uri' => Values::array_get($payload, 'uri'), 'voiceApplicationSid' => Values::array_get($payload, 'voice_application_sid'), 'voiceCallerIdLookup' => Values::array_get($payload, 'voice_caller_id_lookup'), 'voiceFallbackMethod' => Values::array_get($payload, 'voice_fallback_method'), 'voiceFallbackUrl' => Values::array_get($payload, 'voice_fallback_url'), 'voiceMethod' => Values::array_get($payload, 'voice_method'), 'voiceUrl' => Values::array_get($payload, 'voice_url'), 'emergencyStatus' => Values::array_get($payload, 'emergency_status'), 'emergencyAddressSid' => Values::array_get($payload, 'emergency_address_sid'), 'bundleSid' => Values::array_get($payload, 'bundle_sid'), ); $this->solution = array('accountSid' => $accountSid, ); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.TollFreeInstance]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/AssignedAddOnInstance.php 0000644 00000012062 15002236443 0023664 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\IncomingPhoneNumber; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * * @property string $sid * @property string $accountSid * @property string $resourceSid * @property string $friendlyName * @property string $description * @property array $configuration * @property string $uniqueName * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $uri * @property array $subresourceUris */ class AssignedAddOnInstance extends InstanceResource { protected $_extensions = null; /** * Initialize the AssignedAddOnInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the Account that created the resource * @param string $resourceSid The SID of the Phone Number that installed this * Add-on * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Api\V2010\Account\IncomingPhoneNumber\AssignedAddOnInstance */ public function __construct(Version $version, array $payload, $accountSid, $resourceSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'resourceSid' => Values::array_get($payload, 'resource_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'description' => Values::array_get($payload, 'description'), 'configuration' => Values::array_get($payload, 'configuration'), 'uniqueName' => Values::array_get($payload, 'unique_name'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'uri' => Values::array_get($payload, 'uri'), 'subresourceUris' => Values::array_get($payload, 'subresource_uris'), ); $this->solution = array( 'accountSid' => $accountSid, 'resourceSid' => $resourceSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Api\V2010\Account\IncomingPhoneNumber\AssignedAddOnContext Context for this * AssignedAddOnInstance */ protected function proxy() { if (!$this->context) { $this->context = new AssignedAddOnContext( $this->version, $this->solution['accountSid'], $this->solution['resourceSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch a AssignedAddOnInstance * * @return AssignedAddOnInstance Fetched AssignedAddOnInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the AssignedAddOnInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Access the extensions * * @return \Twilio\Rest\Api\V2010\Account\IncomingPhoneNumber\AssignedAddOn\AssignedAddOnExtensionList */ protected function getExtensions() { return $this->proxy()->extensions; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.AssignedAddOnInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/AssignedAddOnPage.php 0000644 00000001746 15002236443 0023003 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\IncomingPhoneNumber; use Twilio\Page; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class AssignedAddOnPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new AssignedAddOnInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['resourceSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.AssignedAddOnPage]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/MobilePage.php 0000644 00000001406 15002236443 0021540 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\IncomingPhoneNumber; use Twilio\Page; class MobilePage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new MobileInstance($this->version, $payload, $this->solution['accountSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.MobilePage]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/MobileInstance.php 0000644 00000012172 15002236443 0022432 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\IncomingPhoneNumber; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property string $addressSid * @property string $addressRequirements * @property string $apiVersion * @property bool $beta * @property string $capabilities * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $friendlyName * @property string $identitySid * @property string $phoneNumber * @property string $origin * @property string $sid * @property string $smsApplicationSid * @property string $smsFallbackMethod * @property string $smsFallbackUrl * @property string $smsMethod * @property string $smsUrl * @property string $statusCallback * @property string $statusCallbackMethod * @property string $trunkSid * @property string $uri * @property string $voiceApplicationSid * @property bool $voiceCallerIdLookup * @property string $voiceFallbackMethod * @property string $voiceFallbackUrl * @property string $voiceMethod * @property string $voiceUrl * @property string $emergencyStatus * @property string $emergencyAddressSid * @property string $bundleSid */ class MobileInstance extends InstanceResource { /** * Initialize the MobileInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the Account that created the resource * @return \Twilio\Rest\Api\V2010\Account\IncomingPhoneNumber\MobileInstance */ public function __construct(Version $version, array $payload, $accountSid) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'accountSid' => Values::array_get($payload, 'account_sid'), 'addressSid' => Values::array_get($payload, 'address_sid'), 'addressRequirements' => Values::array_get($payload, 'address_requirements'), 'apiVersion' => Values::array_get($payload, 'api_version'), 'beta' => Values::array_get($payload, 'beta'), 'capabilities' => Values::array_get($payload, 'capabilities'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'identitySid' => Values::array_get($payload, 'identity_sid'), 'phoneNumber' => Values::array_get($payload, 'phone_number'), 'origin' => Values::array_get($payload, 'origin'), 'sid' => Values::array_get($payload, 'sid'), 'smsApplicationSid' => Values::array_get($payload, 'sms_application_sid'), 'smsFallbackMethod' => Values::array_get($payload, 'sms_fallback_method'), 'smsFallbackUrl' => Values::array_get($payload, 'sms_fallback_url'), 'smsMethod' => Values::array_get($payload, 'sms_method'), 'smsUrl' => Values::array_get($payload, 'sms_url'), 'statusCallback' => Values::array_get($payload, 'status_callback'), 'statusCallbackMethod' => Values::array_get($payload, 'status_callback_method'), 'trunkSid' => Values::array_get($payload, 'trunk_sid'), 'uri' => Values::array_get($payload, 'uri'), 'voiceApplicationSid' => Values::array_get($payload, 'voice_application_sid'), 'voiceCallerIdLookup' => Values::array_get($payload, 'voice_caller_id_lookup'), 'voiceFallbackMethod' => Values::array_get($payload, 'voice_fallback_method'), 'voiceFallbackUrl' => Values::array_get($payload, 'voice_fallback_url'), 'voiceMethod' => Values::array_get($payload, 'voice_method'), 'voiceUrl' => Values::array_get($payload, 'voice_url'), 'emergencyStatus' => Values::array_get($payload, 'emergency_status'), 'emergencyAddressSid' => Values::array_get($payload, 'emergency_address_sid'), 'bundleSid' => Values::array_get($payload, 'bundle_sid'), ); $this->solution = array('accountSid' => $accountSid, ); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.MobileInstance]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/LocalPage.php 0000644 00000001403 15002236443 0021360 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\IncomingPhoneNumber; use Twilio\Page; class LocalPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new LocalInstance($this->version, $payload, $this->solution['accountSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.LocalPage]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/AssignedAddOnContext.php 0000644 00000011156 15002236443 0023547 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\IncomingPhoneNumber; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Rest\Api\V2010\Account\IncomingPhoneNumber\AssignedAddOn\AssignedAddOnExtensionList; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * * @property \Twilio\Rest\Api\V2010\Account\IncomingPhoneNumber\AssignedAddOn\AssignedAddOnExtensionList $extensions * @method \Twilio\Rest\Api\V2010\Account\IncomingPhoneNumber\AssignedAddOn\AssignedAddOnExtensionContext extensions(string $sid) */ class AssignedAddOnContext extends InstanceContext { protected $_extensions = null; /** * Initialize the AssignedAddOnContext * * @param \Twilio\Version $version Version that contains the resource * @param string $accountSid The SID of the Account that created the resource * to fetch * @param string $resourceSid The SID of the Phone Number that installed this * Add-on * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Api\V2010\Account\IncomingPhoneNumber\AssignedAddOnContext */ public function __construct(Version $version, $accountSid, $resourceSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array('accountSid' => $accountSid, 'resourceSid' => $resourceSid, 'sid' => $sid, ); $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/IncomingPhoneNumbers/' . \rawurlencode($resourceSid) . '/AssignedAddOns/' . \rawurlencode($sid) . '.json'; } /** * Fetch a AssignedAddOnInstance * * @return AssignedAddOnInstance Fetched AssignedAddOnInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new AssignedAddOnInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['resourceSid'], $this->solution['sid'] ); } /** * Deletes the AssignedAddOnInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Access the extensions * * @return \Twilio\Rest\Api\V2010\Account\IncomingPhoneNumber\AssignedAddOn\AssignedAddOnExtensionList */ protected function getExtensions() { if (!$this->_extensions) { $this->_extensions = new AssignedAddOnExtensionList( $this->version, $this->solution['accountSid'], $this->solution['resourceSid'], $this->solution['sid'] ); } return $this->_extensions; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get($name) { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.AssignedAddOnContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/MobileList.php 0000644 00000016225 15002236443 0021604 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\IncomingPhoneNumber; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class MobileList extends ListResource { /** * Construct the MobileList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the Account that created the resource * @return \Twilio\Rest\Api\V2010\Account\IncomingPhoneNumber\MobileList */ public function __construct(Version $version, $accountSid) { parent::__construct($version); // Path Solution $this->solution = array('accountSid' => $accountSid, ); $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/IncomingPhoneNumbers/Mobile.json'; } /** * Streams MobileInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($options = array(), $limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads MobileInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return MobileInstance[] Array of results */ public function read($options = array(), $limit = null, $pageSize = null) { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Retrieve a single page of MobileInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of MobileInstance */ public function page($options = array(), $pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $options = new Values($options); $params = Values::of(array( 'Beta' => Serialize::booleanToString($options['beta']), 'FriendlyName' => $options['friendlyName'], 'PhoneNumber' => $options['phoneNumber'], 'Origin' => $options['origin'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new MobilePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of MobileInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of MobileInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new MobilePage($this->version, $response, $this->solution); } /** * Create a new MobileInstance * * @param string $phoneNumber The phone number to purchase in E.164 format * @param array|Options $options Optional Arguments * @return MobileInstance Newly created MobileInstance * @throws TwilioException When an HTTP error occurs. */ public function create($phoneNumber, $options = array()) { $options = new Values($options); $data = Values::of(array( 'PhoneNumber' => $phoneNumber, 'ApiVersion' => $options['apiVersion'], 'FriendlyName' => $options['friendlyName'], 'SmsApplicationSid' => $options['smsApplicationSid'], 'SmsFallbackMethod' => $options['smsFallbackMethod'], 'SmsFallbackUrl' => $options['smsFallbackUrl'], 'SmsMethod' => $options['smsMethod'], 'SmsUrl' => $options['smsUrl'], 'StatusCallback' => $options['statusCallback'], 'StatusCallbackMethod' => $options['statusCallbackMethod'], 'VoiceApplicationSid' => $options['voiceApplicationSid'], 'VoiceCallerIdLookup' => Serialize::booleanToString($options['voiceCallerIdLookup']), 'VoiceFallbackMethod' => $options['voiceFallbackMethod'], 'VoiceFallbackUrl' => $options['voiceFallbackUrl'], 'VoiceMethod' => $options['voiceMethod'], 'VoiceUrl' => $options['voiceUrl'], 'IdentitySid' => $options['identitySid'], 'AddressSid' => $options['addressSid'], 'EmergencyStatus' => $options['emergencyStatus'], 'EmergencyAddressSid' => $options['emergencyAddressSid'], 'TrunkSid' => $options['trunkSid'], 'VoiceReceiveMode' => $options['voiceReceiveMode'], 'BundleSid' => $options['bundleSid'], )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new MobileInstance($this->version, $payload, $this->solution['accountSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.MobileList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/LocalList.php 0000644 00000016203 15002236443 0021423 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\IncomingPhoneNumber; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class LocalList extends ListResource { /** * Construct the LocalList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the Account that created the resource * @return \Twilio\Rest\Api\V2010\Account\IncomingPhoneNumber\LocalList */ public function __construct(Version $version, $accountSid) { parent::__construct($version); // Path Solution $this->solution = array('accountSid' => $accountSid, ); $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/IncomingPhoneNumbers/Local.json'; } /** * Streams LocalInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($options = array(), $limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads LocalInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return LocalInstance[] Array of results */ public function read($options = array(), $limit = null, $pageSize = null) { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Retrieve a single page of LocalInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of LocalInstance */ public function page($options = array(), $pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $options = new Values($options); $params = Values::of(array( 'Beta' => Serialize::booleanToString($options['beta']), 'FriendlyName' => $options['friendlyName'], 'PhoneNumber' => $options['phoneNumber'], 'Origin' => $options['origin'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new LocalPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of LocalInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of LocalInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new LocalPage($this->version, $response, $this->solution); } /** * Create a new LocalInstance * * @param string $phoneNumber The phone number to purchase in E.164 format * @param array|Options $options Optional Arguments * @return LocalInstance Newly created LocalInstance * @throws TwilioException When an HTTP error occurs. */ public function create($phoneNumber, $options = array()) { $options = new Values($options); $data = Values::of(array( 'PhoneNumber' => $phoneNumber, 'ApiVersion' => $options['apiVersion'], 'FriendlyName' => $options['friendlyName'], 'SmsApplicationSid' => $options['smsApplicationSid'], 'SmsFallbackMethod' => $options['smsFallbackMethod'], 'SmsFallbackUrl' => $options['smsFallbackUrl'], 'SmsMethod' => $options['smsMethod'], 'SmsUrl' => $options['smsUrl'], 'StatusCallback' => $options['statusCallback'], 'StatusCallbackMethod' => $options['statusCallbackMethod'], 'VoiceApplicationSid' => $options['voiceApplicationSid'], 'VoiceCallerIdLookup' => Serialize::booleanToString($options['voiceCallerIdLookup']), 'VoiceFallbackMethod' => $options['voiceFallbackMethod'], 'VoiceFallbackUrl' => $options['voiceFallbackUrl'], 'VoiceMethod' => $options['voiceMethod'], 'VoiceUrl' => $options['voiceUrl'], 'IdentitySid' => $options['identitySid'], 'AddressSid' => $options['addressSid'], 'EmergencyStatus' => $options['emergencyStatus'], 'EmergencyAddressSid' => $options['emergencyAddressSid'], 'TrunkSid' => $options['trunkSid'], 'VoiceReceiveMode' => $options['voiceReceiveMode'], 'BundleSid' => $options['bundleSid'], )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new LocalInstance($this->version, $payload, $this->solution['accountSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.LocalList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/AssignedAddOnList.php 0000644 00000014316 15002236443 0023037 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\IncomingPhoneNumber; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class AssignedAddOnList extends ListResource { /** * Construct the AssignedAddOnList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the Account that created the resource * @param string $resourceSid The SID of the Phone Number that installed this * Add-on * @return \Twilio\Rest\Api\V2010\Account\IncomingPhoneNumber\AssignedAddOnList */ public function __construct(Version $version, $accountSid, $resourceSid) { parent::__construct($version); // Path Solution $this->solution = array('accountSid' => $accountSid, 'resourceSid' => $resourceSid, ); $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/IncomingPhoneNumbers/' . \rawurlencode($resourceSid) . '/AssignedAddOns.json'; } /** * Streams AssignedAddOnInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads AssignedAddOnInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return AssignedAddOnInstance[] Array of results */ public function read($limit = null, $pageSize = null) { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of AssignedAddOnInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of AssignedAddOnInstance */ public function page($pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $params = Values::of(array( 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new AssignedAddOnPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of AssignedAddOnInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of AssignedAddOnInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new AssignedAddOnPage($this->version, $response, $this->solution); } /** * Create a new AssignedAddOnInstance * * @param string $installedAddOnSid The SID that identifies the Add-on * installation * @return AssignedAddOnInstance Newly created AssignedAddOnInstance * @throws TwilioException When an HTTP error occurs. */ public function create($installedAddOnSid) { $data = Values::of(array('InstalledAddOnSid' => $installedAddOnSid, )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new AssignedAddOnInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['resourceSid'] ); } /** * Constructs a AssignedAddOnContext * * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Api\V2010\Account\IncomingPhoneNumber\AssignedAddOnContext */ public function getContext($sid) { return new AssignedAddOnContext( $this->version, $this->solution['accountSid'], $this->solution['resourceSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.AssignedAddOnList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/TollFreePage.php 0000644 00000001414 15002236443 0022044 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\IncomingPhoneNumber; use Twilio\Page; class TollFreePage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new TollFreeInstance($this->version, $payload, $this->solution['accountSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.TollFreePage]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/QueueOptions.php 0000644 00000006603 15002236443 0016272 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Options; use Twilio\Values; abstract class QueueOptions { /** * @param string $friendlyName A string to describe this resource * @param int $maxSize The max number of calls allowed in the queue * @return UpdateQueueOptions Options builder */ public static function update($friendlyName = Values::NONE, $maxSize = Values::NONE) { return new UpdateQueueOptions($friendlyName, $maxSize); } /** * @param int $maxSize The max number of calls allowed in the queue * @return CreateQueueOptions Options builder */ public static function create($maxSize = Values::NONE) { return new CreateQueueOptions($maxSize); } } class UpdateQueueOptions extends Options { /** * @param string $friendlyName A string to describe this resource * @param int $maxSize The max number of calls allowed in the queue */ public function __construct($friendlyName = Values::NONE, $maxSize = Values::NONE) { $this->options['friendlyName'] = $friendlyName; $this->options['maxSize'] = $maxSize; } /** * A descriptive string that you created to describe this resource. It can be up to 64 characters long. * * @param string $friendlyName A string to describe this resource * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The maximum number of calls allowed to be in the queue. The default is 100. The maximum is 5000. * * @param int $maxSize The max number of calls allowed in the queue * @return $this Fluent Builder */ public function setMaxSize($maxSize) { $this->options['maxSize'] = $maxSize; 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.UpdateQueueOptions ' . \implode(' ', $options) . ']'; } } class CreateQueueOptions extends Options { /** * @param int $maxSize The max number of calls allowed in the queue */ public function __construct($maxSize = Values::NONE) { $this->options['maxSize'] = $maxSize; } /** * The maximum number of calls allowed to be in the queue. The default is 100. The maximum is 5000. * * @param int $maxSize The max number of calls allowed in the queue * @return $this Fluent Builder */ public function setMaxSize($maxSize) { $this->options['maxSize'] = $maxSize; 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.CreateQueueOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/ShortCodeContext.php 0000644 00000005711 15002236443 0017070 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Values; use Twilio\Version; class ShortCodeContext extends InstanceContext { /** * Initialize the ShortCodeContext * * @param \Twilio\Version $version Version that contains the resource * @param string $accountSid The SID of the Account that created the * resource(s) to fetch * @param string $sid The unique string that identifies this resource * @return \Twilio\Rest\Api\V2010\Account\ShortCodeContext */ public function __construct(Version $version, $accountSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array('accountSid' => $accountSid, 'sid' => $sid, ); $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/SMS/ShortCodes/' . \rawurlencode($sid) . '.json'; } /** * Fetch a ShortCodeInstance * * @return ShortCodeInstance Fetched ShortCodeInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new ShortCodeInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['sid'] ); } /** * Update the ShortCodeInstance * * @param array|Options $options Optional Arguments * @return ShortCodeInstance Updated ShortCodeInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { $options = new Values($options); $data = Values::of(array( 'FriendlyName' => $options['friendlyName'], 'ApiVersion' => $options['apiVersion'], 'SmsUrl' => $options['smsUrl'], 'SmsMethod' => $options['smsMethod'], 'SmsFallbackUrl' => $options['smsFallbackUrl'], 'SmsFallbackMethod' => $options['smsFallbackMethod'], )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new ShortCodeInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.ShortCodeContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/TranscriptionList.php 0000644 00000011653 15002236443 0017326 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\ListResource; use Twilio\Values; use Twilio\Version; class TranscriptionList extends ListResource { /** * Construct the TranscriptionList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the Account that created the resource * @return \Twilio\Rest\Api\V2010\Account\TranscriptionList */ public function __construct(Version $version, $accountSid) { parent::__construct($version); // Path Solution $this->solution = array('accountSid' => $accountSid, ); $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/Transcriptions.json'; } /** * Streams TranscriptionInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads TranscriptionInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return TranscriptionInstance[] Array of results */ public function read($limit = null, $pageSize = null) { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of TranscriptionInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of TranscriptionInstance */ public function page($pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $params = Values::of(array( 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new TranscriptionPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of TranscriptionInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of TranscriptionInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new TranscriptionPage($this->version, $response, $this->solution); } /** * Constructs a TranscriptionContext * * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Api\V2010\Account\TranscriptionContext */ public function getContext($sid) { return new TranscriptionContext($this->version, $this->solution['accountSid'], $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.TranscriptionList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/UsageInstance.php 0000644 00000003203 15002236443 0016354 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; class UsageInstance extends InstanceResource { /** * Initialize the UsageInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid A 34 character string that uniquely identifies * this resource. * @return \Twilio\Rest\Api\V2010\Account\UsageInstance */ public function __construct(Version $version, array $payload, $accountSid) { parent::__construct($version); $this->solution = array('accountSid' => $accountSid, ); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.UsageInstance]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/CallList.php 0000644 00000023645 15002236443 0015346 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Rest\Api\V2010\Account\Call\FeedbackSummaryList; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * @property \Twilio\Rest\Api\V2010\Account\Call\FeedbackSummaryList $feedbackSummaries * @method \Twilio\Rest\Api\V2010\Account\Call\FeedbackSummaryContext feedbackSummaries(string $sid) */ class CallList extends ListResource { protected $_feedbackSummaries = null; /** * Construct the CallList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the Account that created this resource * @return \Twilio\Rest\Api\V2010\Account\CallList */ public function __construct(Version $version, $accountSid) { parent::__construct($version); // Path Solution $this->solution = array('accountSid' => $accountSid, ); $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/Calls.json'; } /** * Create a new CallInstance * * @param string $to Phone number, SIP address, or client identifier to call * @param string $from Twilio number from which to originate the call * @param array|Options $options Optional Arguments * @return CallInstance Newly created CallInstance * @throws TwilioException When an HTTP error occurs. */ public function create($to, $from, $options = array()) { $options = new Values($options); $data = Values::of(array( 'To' => $to, 'From' => $from, 'Url' => $options['url'], 'Twiml' => $options['twiml'], 'ApplicationSid' => $options['applicationSid'], 'Method' => $options['method'], 'FallbackUrl' => $options['fallbackUrl'], 'FallbackMethod' => $options['fallbackMethod'], 'StatusCallback' => $options['statusCallback'], 'StatusCallbackEvent' => Serialize::map($options['statusCallbackEvent'], function($e) { return $e; }), 'StatusCallbackMethod' => $options['statusCallbackMethod'], 'SendDigits' => $options['sendDigits'], 'Timeout' => $options['timeout'], 'Record' => Serialize::booleanToString($options['record']), 'RecordingChannels' => $options['recordingChannels'], 'RecordingStatusCallback' => $options['recordingStatusCallback'], 'RecordingStatusCallbackMethod' => $options['recordingStatusCallbackMethod'], 'SipAuthUsername' => $options['sipAuthUsername'], 'SipAuthPassword' => $options['sipAuthPassword'], 'MachineDetection' => $options['machineDetection'], 'MachineDetectionTimeout' => $options['machineDetectionTimeout'], 'RecordingStatusCallbackEvent' => Serialize::map($options['recordingStatusCallbackEvent'], function($e) { return $e; }), 'Trim' => $options['trim'], 'CallerId' => $options['callerId'], 'MachineDetectionSpeechThreshold' => $options['machineDetectionSpeechThreshold'], 'MachineDetectionSpeechEndThreshold' => $options['machineDetectionSpeechEndThreshold'], 'MachineDetectionSilenceTimeout' => $options['machineDetectionSilenceTimeout'], )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new CallInstance($this->version, $payload, $this->solution['accountSid']); } /** * Streams CallInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($options = array(), $limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads CallInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return CallInstance[] Array of results */ public function read($options = array(), $limit = null, $pageSize = null) { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Retrieve a single page of CallInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of CallInstance */ public function page($options = array(), $pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $options = new Values($options); $params = Values::of(array( 'To' => $options['to'], 'From' => $options['from'], 'ParentCallSid' => $options['parentCallSid'], 'Status' => $options['status'], 'StartTime<' => Serialize::iso8601DateTime($options['startTimeBefore']), 'StartTime' => Serialize::iso8601DateTime($options['startTime']), 'StartTime>' => Serialize::iso8601DateTime($options['startTimeAfter']), 'EndTime<' => Serialize::iso8601DateTime($options['endTimeBefore']), 'EndTime' => Serialize::iso8601DateTime($options['endTime']), 'EndTime>' => Serialize::iso8601DateTime($options['endTimeAfter']), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new CallPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of CallInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of CallInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new CallPage($this->version, $response, $this->solution); } /** * Access the feedbackSummaries */ protected function getFeedbackSummaries() { if (!$this->_feedbackSummaries) { $this->_feedbackSummaries = new FeedbackSummaryList($this->version, $this->solution['accountSid']); } return $this->_feedbackSummaries; } /** * Constructs a CallContext * * @param string $sid The SID of the Call resource to fetch * @return \Twilio\Rest\Api\V2010\Account\CallContext */ public function getContext($sid) { return new CallContext($this->version, $this->solution['accountSid'], $sid); } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get($name) { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.CallList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountryContext.php 0000644 00000017504 15002236443 0022610 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry\LocalList; use Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry\MachineToMachineList; use Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry\MobileList; use Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry\NationalList; use Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry\SharedCostList; use Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry\TollFreeList; use Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry\VoipList; use Twilio\Values; use Twilio\Version; /** * @property \Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry\LocalList $local * @property \Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry\TollFreeList $tollFree * @property \Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry\MobileList $mobile * @property \Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry\NationalList $national * @property \Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry\VoipList $voip * @property \Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry\SharedCostList $sharedCost * @property \Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry\MachineToMachineList $machineToMachine */ class AvailablePhoneNumberCountryContext extends InstanceContext { protected $_local = null; protected $_tollFree = null; protected $_mobile = null; protected $_national = null; protected $_voip = null; protected $_sharedCost = null; protected $_machineToMachine = null; /** * Initialize the AvailablePhoneNumberCountryContext * * @param \Twilio\Version $version Version that contains the resource * @param string $accountSid The SID of the Account requesting the available * phone number Country resource * @param string $countryCode The ISO country code of the country to fetch * available phone number information about * @return \Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountryContext */ public function __construct(Version $version, $accountSid, $countryCode) { parent::__construct($version); // Path Solution $this->solution = array('accountSid' => $accountSid, 'countryCode' => $countryCode, ); $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/AvailablePhoneNumbers/' . \rawurlencode($countryCode) . '.json'; } /** * Fetch a AvailablePhoneNumberCountryInstance * * @return AvailablePhoneNumberCountryInstance Fetched * AvailablePhoneNumberCountryInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new AvailablePhoneNumberCountryInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['countryCode'] ); } /** * Access the local * * @return \Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry\LocalList */ protected function getLocal() { if (!$this->_local) { $this->_local = new LocalList( $this->version, $this->solution['accountSid'], $this->solution['countryCode'] ); } return $this->_local; } /** * Access the tollFree * * @return \Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry\TollFreeList */ protected function getTollFree() { if (!$this->_tollFree) { $this->_tollFree = new TollFreeList( $this->version, $this->solution['accountSid'], $this->solution['countryCode'] ); } return $this->_tollFree; } /** * Access the mobile * * @return \Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry\MobileList */ protected function getMobile() { if (!$this->_mobile) { $this->_mobile = new MobileList( $this->version, $this->solution['accountSid'], $this->solution['countryCode'] ); } return $this->_mobile; } /** * Access the national * * @return \Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry\NationalList */ protected function getNational() { if (!$this->_national) { $this->_national = new NationalList( $this->version, $this->solution['accountSid'], $this->solution['countryCode'] ); } return $this->_national; } /** * Access the voip * * @return \Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry\VoipList */ protected function getVoip() { if (!$this->_voip) { $this->_voip = new VoipList( $this->version, $this->solution['accountSid'], $this->solution['countryCode'] ); } return $this->_voip; } /** * Access the sharedCost * * @return \Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry\SharedCostList */ protected function getSharedCost() { if (!$this->_sharedCost) { $this->_sharedCost = new SharedCostList( $this->version, $this->solution['accountSid'], $this->solution['countryCode'] ); } return $this->_sharedCost; } /** * Access the machineToMachine * * @return \Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry\MachineToMachineList */ protected function getMachineToMachine() { if (!$this->_machineToMachine) { $this->_machineToMachine = new MachineToMachineList( $this->version, $this->solution['accountSid'], $this->solution['countryCode'] ); } return $this->_machineToMachine; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get($name) { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.AvailablePhoneNumberCountryContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Sip/CredentialListContext.php 0000644 00000011376 15002236443 0020643 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Sip; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Rest\Api\V2010\Account\Sip\CredentialList\CredentialList; use Twilio\Values; use Twilio\Version; /** * @property \Twilio\Rest\Api\V2010\Account\Sip\CredentialList\CredentialList $credentials * @method \Twilio\Rest\Api\V2010\Account\Sip\CredentialList\CredentialContext credentials(string $sid) */ class CredentialListContext extends InstanceContext { protected $_credentials = null; /** * Initialize the CredentialListContext * * @param \Twilio\Version $version Version that contains the resource * @param string $accountSid The unique id of the Account that is responsible * for this resource. * @param string $sid Fetch by unique credential list Sid * @return \Twilio\Rest\Api\V2010\Account\Sip\CredentialListContext */ public function __construct(Version $version, $accountSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array('accountSid' => $accountSid, 'sid' => $sid, ); $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/SIP/CredentialLists/' . \rawurlencode($sid) . '.json'; } /** * Fetch a CredentialListInstance * * @return CredentialListInstance Fetched CredentialListInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new CredentialListInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['sid'] ); } /** * Update the CredentialListInstance * * @param string $friendlyName Human readable descriptive text * @return CredentialListInstance Updated CredentialListInstance * @throws TwilioException When an HTTP error occurs. */ public function update($friendlyName) { $data = Values::of(array('FriendlyName' => $friendlyName, )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new CredentialListInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['sid'] ); } /** * Deletes the CredentialListInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Access the credentials * * @return \Twilio\Rest\Api\V2010\Account\Sip\CredentialList\CredentialList */ protected function getCredentials() { if (!$this->_credentials) { $this->_credentials = new CredentialList( $this->version, $this->solution['accountSid'], $this->solution['sid'] ); } return $this->_credentials; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get($name) { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.CredentialListContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Sip/IpAccessControlListContext.php 0000644 00000011463 15002236443 0021621 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Sip; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Rest\Api\V2010\Account\Sip\IpAccessControlList\IpAddressList; use Twilio\Values; use Twilio\Version; /** * @property \Twilio\Rest\Api\V2010\Account\Sip\IpAccessControlList\IpAddressList $ipAddresses * @method \Twilio\Rest\Api\V2010\Account\Sip\IpAccessControlList\IpAddressContext ipAddresses(string $sid) */ class IpAccessControlListContext extends InstanceContext { protected $_ipAddresses = null; /** * Initialize the IpAccessControlListContext * * @param \Twilio\Version $version Version that contains the resource * @param string $accountSid The unique sid that identifies this account * @param string $sid A string that identifies the resource to fetch * @return \Twilio\Rest\Api\V2010\Account\Sip\IpAccessControlListContext */ public function __construct(Version $version, $accountSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array('accountSid' => $accountSid, 'sid' => $sid, ); $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/SIP/IpAccessControlLists/' . \rawurlencode($sid) . '.json'; } /** * Fetch a IpAccessControlListInstance * * @return IpAccessControlListInstance Fetched IpAccessControlListInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new IpAccessControlListInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['sid'] ); } /** * Update the IpAccessControlListInstance * * @param string $friendlyName A human readable description of this resource * @return IpAccessControlListInstance Updated IpAccessControlListInstance * @throws TwilioException When an HTTP error occurs. */ public function update($friendlyName) { $data = Values::of(array('FriendlyName' => $friendlyName, )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new IpAccessControlListInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['sid'] ); } /** * Deletes the IpAccessControlListInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Access the ipAddresses * * @return \Twilio\Rest\Api\V2010\Account\Sip\IpAccessControlList\IpAddressList */ protected function getIpAddresses() { if (!$this->_ipAddresses) { $this->_ipAddresses = new IpAddressList( $this->version, $this->solution['accountSid'], $this->solution['sid'] ); } return $this->_ipAddresses; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get($name) { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.IpAccessControlListContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Sip/CredentialListInstance.php 0000644 00000011240 15002236443 0020751 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Sip; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $friendlyName * @property string $sid * @property array $subresourceUris * @property string $uri */ class CredentialListInstance extends InstanceResource { protected $_credentials = null; /** * Initialize the CredentialListInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid A 34 character string that uniquely identifies * this resource. * @param string $sid Fetch by unique credential list Sid * @return \Twilio\Rest\Api\V2010\Account\Sip\CredentialListInstance */ public function __construct(Version $version, array $payload, $accountSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'accountSid' => Values::array_get($payload, 'account_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'sid' => Values::array_get($payload, 'sid'), 'subresourceUris' => Values::array_get($payload, 'subresource_uris'), 'uri' => Values::array_get($payload, 'uri'), ); $this->solution = array('accountSid' => $accountSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Api\V2010\Account\Sip\CredentialListContext Context for * this * CredentialListInstance */ protected function proxy() { if (!$this->context) { $this->context = new CredentialListContext( $this->version, $this->solution['accountSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch a CredentialListInstance * * @return CredentialListInstance Fetched CredentialListInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Update the CredentialListInstance * * @param string $friendlyName Human readable descriptive text * @return CredentialListInstance Updated CredentialListInstance * @throws TwilioException When an HTTP error occurs. */ public function update($friendlyName) { return $this->proxy()->update($friendlyName); } /** * Deletes the CredentialListInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Access the credentials * * @return \Twilio\Rest\Api\V2010\Account\Sip\CredentialList\CredentialList */ protected function getCredentials() { return $this->proxy()->credentials; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.CredentialListInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Sip/IpAccessControlList/IpAddressInstance.php 0000644 00000011774 15002236443 0023624 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Sip\IpAccessControlList; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $accountSid * @property string $friendlyName * @property string $ipAddress * @property int $cidrPrefixLength * @property string $ipAccessControlListSid * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $uri */ class IpAddressInstance extends InstanceResource { /** * Initialize the IpAddressInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The unique id of the Account that is responsible * for this resource. * @param string $ipAccessControlListSid The unique id of the * IpAccessControlList resource that * includes this resource. * @param string $sid A string that identifies the IpAddress resource to fetch * @return \Twilio\Rest\Api\V2010\Account\Sip\IpAccessControlList\IpAddressInstance */ public function __construct(Version $version, array $payload, $accountSid, $ipAccessControlListSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'ipAddress' => Values::array_get($payload, 'ip_address'), 'cidrPrefixLength' => Values::array_get($payload, 'cidr_prefix_length'), 'ipAccessControlListSid' => Values::array_get($payload, 'ip_access_control_list_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'uri' => Values::array_get($payload, 'uri'), ); $this->solution = array( 'accountSid' => $accountSid, 'ipAccessControlListSid' => $ipAccessControlListSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Api\V2010\Account\Sip\IpAccessControlList\IpAddressContext Context for this * IpAddressInstance */ protected function proxy() { if (!$this->context) { $this->context = new IpAddressContext( $this->version, $this->solution['accountSid'], $this->solution['ipAccessControlListSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch a IpAddressInstance * * @return IpAddressInstance Fetched IpAddressInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Update the IpAddressInstance * * @param array|Options $options Optional Arguments * @return IpAddressInstance Updated IpAddressInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Deletes the IpAddressInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.IpAddressInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Sip/IpAccessControlList/IpAddressPage.php 0000644 00000001570 15002236443 0022725 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Sip\IpAccessControlList; use Twilio\Page; class IpAddressPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new IpAddressInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['ipAccessControlListSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.IpAddressPage]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Sip/IpAccessControlList/IpAddressContext.php 0000644 00000007115 15002236443 0023476 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Sip\IpAccessControlList; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Values; use Twilio\Version; class IpAddressContext extends InstanceContext { /** * Initialize the IpAddressContext * * @param \Twilio\Version $version Version that contains the resource * @param string $accountSid The unique sid that identifies this account * @param string $ipAccessControlListSid The IpAccessControlList Sid that * identifies the IpAddress resources to * fetch * @param string $sid A string that identifies the IpAddress resource to fetch * @return \Twilio\Rest\Api\V2010\Account\Sip\IpAccessControlList\IpAddressContext */ public function __construct(Version $version, $accountSid, $ipAccessControlListSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array( 'accountSid' => $accountSid, 'ipAccessControlListSid' => $ipAccessControlListSid, 'sid' => $sid, ); $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/SIP/IpAccessControlLists/' . \rawurlencode($ipAccessControlListSid) . '/IpAddresses/' . \rawurlencode($sid) . '.json'; } /** * Fetch a IpAddressInstance * * @return IpAddressInstance Fetched IpAddressInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new IpAddressInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['ipAccessControlListSid'], $this->solution['sid'] ); } /** * Update the IpAddressInstance * * @param array|Options $options Optional Arguments * @return IpAddressInstance Updated IpAddressInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { $options = new Values($options); $data = Values::of(array( 'IpAddress' => $options['ipAddress'], 'FriendlyName' => $options['friendlyName'], 'CidrPrefixLength' => $options['cidrPrefixLength'], )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new IpAddressInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['ipAccessControlListSid'], $this->solution['sid'] ); } /** * Deletes the IpAddressInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.IpAddressContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Sip/IpAccessControlList/IpAddressOptions.php 0000644 00000015052 15002236443 0023504 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Sip\IpAccessControlList; use Twilio\Options; use Twilio\Values; abstract class IpAddressOptions { /** * @param int $cidrPrefixLength An integer representing the length of the CIDR * prefix to use with this IP address when * accepting traffic. By default the entire IP * address is used. * @return CreateIpAddressOptions Options builder */ public static function create($cidrPrefixLength = Values::NONE) { return new CreateIpAddressOptions($cidrPrefixLength); } /** * @param string $ipAddress An IP address in dotted decimal notation from which * you want to accept traffic. Any SIP requests from * this IP address will be allowed by Twilio. IPv4 * only supported today. * @param string $friendlyName A human readable descriptive text for this * resource, up to 64 characters long. * @param int $cidrPrefixLength An integer representing the length of the CIDR * prefix to use with this IP address when * accepting traffic. By default the entire IP * address is used. * @return UpdateIpAddressOptions Options builder */ public static function update($ipAddress = Values::NONE, $friendlyName = Values::NONE, $cidrPrefixLength = Values::NONE) { return new UpdateIpAddressOptions($ipAddress, $friendlyName, $cidrPrefixLength); } } class CreateIpAddressOptions extends Options { /** * @param int $cidrPrefixLength An integer representing the length of the CIDR * prefix to use with this IP address when * accepting traffic. By default the entire IP * address is used. */ public function __construct($cidrPrefixLength = Values::NONE) { $this->options['cidrPrefixLength'] = $cidrPrefixLength; } /** * An integer representing the length of the CIDR prefix to use with this IP address when accepting traffic. By default the entire IP address is used. * * @param int $cidrPrefixLength An integer representing the length of the CIDR * prefix to use with this IP address when * accepting traffic. By default the entire IP * address is used. * @return $this Fluent Builder */ public function setCidrPrefixLength($cidrPrefixLength) { $this->options['cidrPrefixLength'] = $cidrPrefixLength; 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.CreateIpAddressOptions ' . \implode(' ', $options) . ']'; } } class UpdateIpAddressOptions extends Options { /** * @param string $ipAddress An IP address in dotted decimal notation from which * you want to accept traffic. Any SIP requests from * this IP address will be allowed by Twilio. IPv4 * only supported today. * @param string $friendlyName A human readable descriptive text for this * resource, up to 64 characters long. * @param int $cidrPrefixLength An integer representing the length of the CIDR * prefix to use with this IP address when * accepting traffic. By default the entire IP * address is used. */ public function __construct($ipAddress = Values::NONE, $friendlyName = Values::NONE, $cidrPrefixLength = Values::NONE) { $this->options['ipAddress'] = $ipAddress; $this->options['friendlyName'] = $friendlyName; $this->options['cidrPrefixLength'] = $cidrPrefixLength; } /** * An IP address in dotted decimal notation from which you want to accept traffic. Any SIP requests from this IP address will be allowed by Twilio. IPv4 only supported today. * * @param string $ipAddress An IP address in dotted decimal notation from which * you want to accept traffic. Any SIP requests from * this IP address will be allowed by Twilio. IPv4 * only supported today. * @return $this Fluent Builder */ public function setIpAddress($ipAddress) { $this->options['ipAddress'] = $ipAddress; return $this; } /** * A human readable descriptive text for this resource, up to 64 characters long. * * @param string $friendlyName A human readable descriptive text for this * resource, up to 64 characters long. * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * An integer representing the length of the CIDR prefix to use with this IP address when accepting traffic. By default the entire IP address is used. * * @param int $cidrPrefixLength An integer representing the length of the CIDR * prefix to use with this IP address when * accepting traffic. By default the entire IP * address is used. * @return $this Fluent Builder */ public function setCidrPrefixLength($cidrPrefixLength) { $this->options['cidrPrefixLength'] = $cidrPrefixLength; 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.UpdateIpAddressOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Sip/IpAccessControlList/IpAddressList.php 0000644 00000015532 15002236443 0022767 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Sip\IpAccessControlList; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; class IpAddressList extends ListResource { /** * Construct the IpAddressList * * @param Version $version Version that contains the resource * @param string $accountSid The unique id of the Account that is responsible * for this resource. * @param string $ipAccessControlListSid The unique id of the * IpAccessControlList resource that * includes this resource. * @return \Twilio\Rest\Api\V2010\Account\Sip\IpAccessControlList\IpAddressList */ public function __construct(Version $version, $accountSid, $ipAccessControlListSid) { parent::__construct($version); // Path Solution $this->solution = array( 'accountSid' => $accountSid, 'ipAccessControlListSid' => $ipAccessControlListSid, ); $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/SIP/IpAccessControlLists/' . \rawurlencode($ipAccessControlListSid) . '/IpAddresses.json'; } /** * Streams IpAddressInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads IpAddressInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return IpAddressInstance[] Array of results */ public function read($limit = null, $pageSize = null) { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of IpAddressInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of IpAddressInstance */ public function page($pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $params = Values::of(array( 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new IpAddressPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of IpAddressInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of IpAddressInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new IpAddressPage($this->version, $response, $this->solution); } /** * Create a new IpAddressInstance * * @param string $friendlyName A human readable descriptive text for this * resource, up to 64 characters long. * @param string $ipAddress An IP address in dotted decimal notation from which * you want to accept traffic. Any SIP requests from * this IP address will be allowed by Twilio. IPv4 * only supported today. * @param array|Options $options Optional Arguments * @return IpAddressInstance Newly created IpAddressInstance * @throws TwilioException When an HTTP error occurs. */ public function create($friendlyName, $ipAddress, $options = array()) { $options = new Values($options); $data = Values::of(array( 'FriendlyName' => $friendlyName, 'IpAddress' => $ipAddress, 'CidrPrefixLength' => $options['cidrPrefixLength'], )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new IpAddressInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['ipAccessControlListSid'] ); } /** * Constructs a IpAddressContext * * @param string $sid A string that identifies the IpAddress resource to fetch * @return \Twilio\Rest\Api\V2010\Account\Sip\IpAccessControlList\IpAddressContext */ public function getContext($sid) { return new IpAddressContext( $this->version, $this->solution['accountSid'], $this->solution['ipAccessControlListSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.IpAddressList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Sip/IpAccessControlListPage.php 0000644 00000001435 15002236443 0021047 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Sip; use Twilio\Page; class IpAccessControlListPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new IpAccessControlListInstance($this->version, $payload, $this->solution['accountSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.IpAccessControlListPage]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Sip/DomainContext.php 0000644 00000015537 15002236443 0017147 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Sip; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Rest\Api\V2010\Account\Sip\Domain\AuthTypesList; use Twilio\Rest\Api\V2010\Account\Sip\Domain\CredentialListMappingList; use Twilio\Rest\Api\V2010\Account\Sip\Domain\IpAccessControlListMappingList; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * @property \Twilio\Rest\Api\V2010\Account\Sip\Domain\IpAccessControlListMappingList $ipAccessControlListMappings * @property \Twilio\Rest\Api\V2010\Account\Sip\Domain\CredentialListMappingList $credentialListMappings * @property \Twilio\Rest\Api\V2010\Account\Sip\Domain\AuthTypesList $auth * @method \Twilio\Rest\Api\V2010\Account\Sip\Domain\IpAccessControlListMappingContext ipAccessControlListMappings(string $sid) * @method \Twilio\Rest\Api\V2010\Account\Sip\Domain\CredentialListMappingContext credentialListMappings(string $sid) */ class DomainContext extends InstanceContext { protected $_ipAccessControlListMappings = null; protected $_credentialListMappings = null; protected $_auth = null; /** * Initialize the DomainContext * * @param \Twilio\Version $version Version that contains the resource * @param string $accountSid The SID of the Account that created the resource * to fetch * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Api\V2010\Account\Sip\DomainContext */ public function __construct(Version $version, $accountSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array('accountSid' => $accountSid, 'sid' => $sid, ); $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/SIP/Domains/' . \rawurlencode($sid) . '.json'; } /** * Fetch a DomainInstance * * @return DomainInstance Fetched DomainInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new DomainInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['sid'] ); } /** * Update the DomainInstance * * @param array|Options $options Optional Arguments * @return DomainInstance Updated DomainInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { $options = new Values($options); $data = Values::of(array( 'FriendlyName' => $options['friendlyName'], 'VoiceFallbackMethod' => $options['voiceFallbackMethod'], 'VoiceFallbackUrl' => $options['voiceFallbackUrl'], 'VoiceMethod' => $options['voiceMethod'], 'VoiceStatusCallbackMethod' => $options['voiceStatusCallbackMethod'], 'VoiceStatusCallbackUrl' => $options['voiceStatusCallbackUrl'], 'VoiceUrl' => $options['voiceUrl'], 'SipRegistration' => Serialize::booleanToString($options['sipRegistration']), 'DomainName' => $options['domainName'], )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new DomainInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['sid'] ); } /** * Deletes the DomainInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Access the ipAccessControlListMappings * * @return \Twilio\Rest\Api\V2010\Account\Sip\Domain\IpAccessControlListMappingList */ protected function getIpAccessControlListMappings() { if (!$this->_ipAccessControlListMappings) { $this->_ipAccessControlListMappings = new IpAccessControlListMappingList( $this->version, $this->solution['accountSid'], $this->solution['sid'] ); } return $this->_ipAccessControlListMappings; } /** * Access the credentialListMappings * * @return \Twilio\Rest\Api\V2010\Account\Sip\Domain\CredentialListMappingList */ protected function getCredentialListMappings() { if (!$this->_credentialListMappings) { $this->_credentialListMappings = new CredentialListMappingList( $this->version, $this->solution['accountSid'], $this->solution['sid'] ); } return $this->_credentialListMappings; } /** * Access the auth * * @return \Twilio\Rest\Api\V2010\Account\Sip\Domain\AuthTypesList */ protected function getAuth() { if (!$this->_auth) { $this->_auth = new AuthTypesList( $this->version, $this->solution['accountSid'], $this->solution['sid'] ); } return $this->_auth; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get($name) { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.DomainContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Sip/DomainList.php 0000644 00000014306 15002236443 0016427 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Sip; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class DomainList extends ListResource { /** * Construct the DomainList * * @param Version $version Version that contains the resource * @param string $accountSid A 34 character string that uniquely identifies * this resource. * @return \Twilio\Rest\Api\V2010\Account\Sip\DomainList */ public function __construct(Version $version, $accountSid) { parent::__construct($version); // Path Solution $this->solution = array('accountSid' => $accountSid, ); $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/SIP/Domains.json'; } /** * Streams DomainInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads DomainInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return DomainInstance[] Array of results */ public function read($limit = null, $pageSize = null) { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of DomainInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of DomainInstance */ public function page($pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $params = Values::of(array( 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new DomainPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of DomainInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of DomainInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new DomainPage($this->version, $response, $this->solution); } /** * Create a new DomainInstance * * @param string $domainName The unique address on Twilio to route SIP traffic * @param array|Options $options Optional Arguments * @return DomainInstance Newly created DomainInstance * @throws TwilioException When an HTTP error occurs. */ public function create($domainName, $options = array()) { $options = new Values($options); $data = Values::of(array( 'DomainName' => $domainName, 'FriendlyName' => $options['friendlyName'], 'VoiceUrl' => $options['voiceUrl'], 'VoiceMethod' => $options['voiceMethod'], 'VoiceFallbackUrl' => $options['voiceFallbackUrl'], 'VoiceFallbackMethod' => $options['voiceFallbackMethod'], 'VoiceStatusCallbackUrl' => $options['voiceStatusCallbackUrl'], 'VoiceStatusCallbackMethod' => $options['voiceStatusCallbackMethod'], 'SipRegistration' => Serialize::booleanToString($options['sipRegistration']), )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new DomainInstance($this->version, $payload, $this->solution['accountSid']); } /** * Constructs a DomainContext * * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Api\V2010\Account\Sip\DomainContext */ public function getContext($sid) { return new DomainContext($this->version, $this->solution['accountSid'], $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.DomainList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Sip/CredentialListList.php 0000644 00000013210 15002236443 0020117 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Sip; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Values; use Twilio\Version; class CredentialListList extends ListResource { /** * Construct the CredentialListList * * @param Version $version Version that contains the resource * @param string $accountSid A 34 character string that uniquely identifies * this resource. * @return \Twilio\Rest\Api\V2010\Account\Sip\CredentialListList */ public function __construct(Version $version, $accountSid) { parent::__construct($version); // Path Solution $this->solution = array('accountSid' => $accountSid, ); $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/SIP/CredentialLists.json'; } /** * Streams CredentialListInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads CredentialListInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return CredentialListInstance[] Array of results */ public function read($limit = null, $pageSize = null) { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of CredentialListInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of CredentialListInstance */ public function page($pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $params = Values::of(array( 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new CredentialListPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of CredentialListInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of CredentialListInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new CredentialListPage($this->version, $response, $this->solution); } /** * Create a new CredentialListInstance * * @param string $friendlyName Human readable descriptive text * @return CredentialListInstance Newly created CredentialListInstance * @throws TwilioException When an HTTP error occurs. */ public function create($friendlyName) { $data = Values::of(array('FriendlyName' => $friendlyName, )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new CredentialListInstance($this->version, $payload, $this->solution['accountSid']); } /** * Constructs a CredentialListContext * * @param string $sid Fetch by unique credential list Sid * @return \Twilio\Rest\Api\V2010\Account\Sip\CredentialListContext */ public function getContext($sid) { return new CredentialListContext($this->version, $this->solution['accountSid'], $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.CredentialListList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Sip/DomainOptions.php 0000644 00000035273 15002236443 0017155 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Sip; use Twilio\Options; use Twilio\Values; abstract class DomainOptions { /** * @param string $friendlyName A string to describe the resource * @param string $voiceUrl The URL we should call when receiving a call * @param string $voiceMethod The HTTP method to use with voice_url * @param string $voiceFallbackUrl The URL we should call when an error occurs * in executing TwiML * @param string $voiceFallbackMethod The HTTP method to use with * voice_fallback_url * @param string $voiceStatusCallbackUrl The URL that we should call to pass * status updates * @param string $voiceStatusCallbackMethod The HTTP method we should use to * call `voice_status_callback_url` * @param bool $sipRegistration Whether SIP registration is allowed * @return CreateDomainOptions Options builder */ public static function create($friendlyName = Values::NONE, $voiceUrl = Values::NONE, $voiceMethod = Values::NONE, $voiceFallbackUrl = Values::NONE, $voiceFallbackMethod = Values::NONE, $voiceStatusCallbackUrl = Values::NONE, $voiceStatusCallbackMethod = Values::NONE, $sipRegistration = Values::NONE) { return new CreateDomainOptions($friendlyName, $voiceUrl, $voiceMethod, $voiceFallbackUrl, $voiceFallbackMethod, $voiceStatusCallbackUrl, $voiceStatusCallbackMethod, $sipRegistration); } /** * @param string $friendlyName A string to describe the resource * @param string $voiceFallbackMethod The HTTP method used with * voice_fallback_url * @param string $voiceFallbackUrl The URL we should call when an error occurs * in executing TwiML * @param string $voiceMethod The HTTP method we should use with voice_url * @param string $voiceStatusCallbackMethod The HTTP method we should use to * call voice_status_callback_url * @param string $voiceStatusCallbackUrl The URL that we should call to pass * status updates * @param string $voiceUrl The URL we should call when receiving a call * @param bool $sipRegistration Whether SIP registration is allowed * @param string $domainName The unique address on Twilio to route SIP traffic * @return UpdateDomainOptions Options builder */ public static function update($friendlyName = Values::NONE, $voiceFallbackMethod = Values::NONE, $voiceFallbackUrl = Values::NONE, $voiceMethod = Values::NONE, $voiceStatusCallbackMethod = Values::NONE, $voiceStatusCallbackUrl = Values::NONE, $voiceUrl = Values::NONE, $sipRegistration = Values::NONE, $domainName = Values::NONE) { return new UpdateDomainOptions($friendlyName, $voiceFallbackMethod, $voiceFallbackUrl, $voiceMethod, $voiceStatusCallbackMethod, $voiceStatusCallbackUrl, $voiceUrl, $sipRegistration, $domainName); } } class CreateDomainOptions extends Options { /** * @param string $friendlyName A string to describe the resource * @param string $voiceUrl The URL we should call when receiving a call * @param string $voiceMethod The HTTP method to use with voice_url * @param string $voiceFallbackUrl The URL we should call when an error occurs * in executing TwiML * @param string $voiceFallbackMethod The HTTP method to use with * voice_fallback_url * @param string $voiceStatusCallbackUrl The URL that we should call to pass * status updates * @param string $voiceStatusCallbackMethod The HTTP method we should use to * call `voice_status_callback_url` * @param bool $sipRegistration Whether SIP registration is allowed */ public function __construct($friendlyName = Values::NONE, $voiceUrl = Values::NONE, $voiceMethod = Values::NONE, $voiceFallbackUrl = Values::NONE, $voiceFallbackMethod = Values::NONE, $voiceStatusCallbackUrl = Values::NONE, $voiceStatusCallbackMethod = Values::NONE, $sipRegistration = Values::NONE) { $this->options['friendlyName'] = $friendlyName; $this->options['voiceUrl'] = $voiceUrl; $this->options['voiceMethod'] = $voiceMethod; $this->options['voiceFallbackUrl'] = $voiceFallbackUrl; $this->options['voiceFallbackMethod'] = $voiceFallbackMethod; $this->options['voiceStatusCallbackUrl'] = $voiceStatusCallbackUrl; $this->options['voiceStatusCallbackMethod'] = $voiceStatusCallbackMethod; $this->options['sipRegistration'] = $sipRegistration; } /** * A descriptive string that you created to describe the resource. It can be up to 64 characters long. * * @param string $friendlyName A string to describe the resource * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The URL we should when the domain receives a call. * * @param string $voiceUrl The URL we should call when receiving a call * @return $this Fluent Builder */ public function setVoiceUrl($voiceUrl) { $this->options['voiceUrl'] = $voiceUrl; return $this; } /** * The HTTP method we should use to call `voice_url`. Can be: `GET` or `POST`. * * @param string $voiceMethod The HTTP method to use with voice_url * @return $this Fluent Builder */ public function setVoiceMethod($voiceMethod) { $this->options['voiceMethod'] = $voiceMethod; return $this; } /** * The URL that we should call when an error occurs while retrieving or executing the TwiML from `voice_url`. * * @param string $voiceFallbackUrl The URL we should call when an error occurs * in executing TwiML * @return $this Fluent Builder */ public function setVoiceFallbackUrl($voiceFallbackUrl) { $this->options['voiceFallbackUrl'] = $voiceFallbackUrl; return $this; } /** * The HTTP method we should use to call `voice_fallback_url`. Can be: `GET` or `POST`. * * @param string $voiceFallbackMethod The HTTP method to use with * voice_fallback_url * @return $this Fluent Builder */ public function setVoiceFallbackMethod($voiceFallbackMethod) { $this->options['voiceFallbackMethod'] = $voiceFallbackMethod; return $this; } /** * The URL that we should call to pass status parameters (such as call ended) to your application. * * @param string $voiceStatusCallbackUrl The URL that we should call to pass * status updates * @return $this Fluent Builder */ public function setVoiceStatusCallbackUrl($voiceStatusCallbackUrl) { $this->options['voiceStatusCallbackUrl'] = $voiceStatusCallbackUrl; return $this; } /** * The HTTP method we should use to call `voice_status_callback_url`. Can be: `GET` or `POST`. * * @param string $voiceStatusCallbackMethod The HTTP method we should use to * call `voice_status_callback_url` * @return $this Fluent Builder */ public function setVoiceStatusCallbackMethod($voiceStatusCallbackMethod) { $this->options['voiceStatusCallbackMethod'] = $voiceStatusCallbackMethod; return $this; } /** * Whether to allow SIP Endpoints to register with the domain to receive calls. Can be `true` or `false`. `true` allows SIP Endpoints to register with the domain to receive calls, `false` does not. * * @param bool $sipRegistration Whether SIP registration is allowed * @return $this Fluent Builder */ public function setSipRegistration($sipRegistration) { $this->options['sipRegistration'] = $sipRegistration; 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.CreateDomainOptions ' . \implode(' ', $options) . ']'; } } class UpdateDomainOptions extends Options { /** * @param string $friendlyName A string to describe the resource * @param string $voiceFallbackMethod The HTTP method used with * voice_fallback_url * @param string $voiceFallbackUrl The URL we should call when an error occurs * in executing TwiML * @param string $voiceMethod The HTTP method we should use with voice_url * @param string $voiceStatusCallbackMethod The HTTP method we should use to * call voice_status_callback_url * @param string $voiceStatusCallbackUrl The URL that we should call to pass * status updates * @param string $voiceUrl The URL we should call when receiving a call * @param bool $sipRegistration Whether SIP registration is allowed * @param string $domainName The unique address on Twilio to route SIP traffic */ public function __construct($friendlyName = Values::NONE, $voiceFallbackMethod = Values::NONE, $voiceFallbackUrl = Values::NONE, $voiceMethod = Values::NONE, $voiceStatusCallbackMethod = Values::NONE, $voiceStatusCallbackUrl = Values::NONE, $voiceUrl = Values::NONE, $sipRegistration = Values::NONE, $domainName = Values::NONE) { $this->options['friendlyName'] = $friendlyName; $this->options['voiceFallbackMethod'] = $voiceFallbackMethod; $this->options['voiceFallbackUrl'] = $voiceFallbackUrl; $this->options['voiceMethod'] = $voiceMethod; $this->options['voiceStatusCallbackMethod'] = $voiceStatusCallbackMethod; $this->options['voiceStatusCallbackUrl'] = $voiceStatusCallbackUrl; $this->options['voiceUrl'] = $voiceUrl; $this->options['sipRegistration'] = $sipRegistration; $this->options['domainName'] = $domainName; } /** * A descriptive string that you created to describe the resource. It can be up to 64 characters long. * * @param string $friendlyName A string to describe the resource * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The HTTP method we should use to call `voice_fallback_url`. Can be: `GET` or `POST`. * * @param string $voiceFallbackMethod The HTTP method used with * voice_fallback_url * @return $this Fluent Builder */ public function setVoiceFallbackMethod($voiceFallbackMethod) { $this->options['voiceFallbackMethod'] = $voiceFallbackMethod; return $this; } /** * The URL that we should call when an error occurs while retrieving or executing the TwiML requested by `voice_url`. * * @param string $voiceFallbackUrl The URL we should call when an error occurs * in executing TwiML * @return $this Fluent Builder */ public function setVoiceFallbackUrl($voiceFallbackUrl) { $this->options['voiceFallbackUrl'] = $voiceFallbackUrl; return $this; } /** * The HTTP method we should use to call `voice_url` * * @param string $voiceMethod The HTTP method we should use with voice_url * @return $this Fluent Builder */ public function setVoiceMethod($voiceMethod) { $this->options['voiceMethod'] = $voiceMethod; return $this; } /** * The HTTP method we should use to call `voice_status_callback_url`. Can be: `GET` or `POST`. * * @param string $voiceStatusCallbackMethod The HTTP method we should use to * call voice_status_callback_url * @return $this Fluent Builder */ public function setVoiceStatusCallbackMethod($voiceStatusCallbackMethod) { $this->options['voiceStatusCallbackMethod'] = $voiceStatusCallbackMethod; return $this; } /** * The URL that we should call to pass status parameters (such as call ended) to your application. * * @param string $voiceStatusCallbackUrl The URL that we should call to pass * status updates * @return $this Fluent Builder */ public function setVoiceStatusCallbackUrl($voiceStatusCallbackUrl) { $this->options['voiceStatusCallbackUrl'] = $voiceStatusCallbackUrl; return $this; } /** * The URL we should call when the domain receives a call. * * @param string $voiceUrl The URL we should call when receiving a call * @return $this Fluent Builder */ public function setVoiceUrl($voiceUrl) { $this->options['voiceUrl'] = $voiceUrl; return $this; } /** * Whether to allow SIP Endpoints to register with the domain to receive calls. Can be `true` or `false`. `true` allows SIP Endpoints to register with the domain to receive calls, `false` does not. * * @param bool $sipRegistration Whether SIP registration is allowed * @return $this Fluent Builder */ public function setSipRegistration($sipRegistration) { $this->options['sipRegistration'] = $sipRegistration; return $this; } /** * The unique address you reserve on Twilio to which you route your SIP traffic. Domain names can contain letters, digits, and "-". * * @param string $domainName The unique address on Twilio to route SIP traffic * @return $this Fluent Builder */ public function setDomainName($domainName) { $this->options['domainName'] = $domainName; 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.UpdateDomainOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Sip/DomainPage.php 0000644 00000001366 15002236443 0016372 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Sip; use Twilio\Page; class DomainPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new DomainInstance($this->version, $payload, $this->solution['accountSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.DomainPage]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Sip/DomainInstance.php 0000644 00000014352 15002236443 0017261 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Sip; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property string $apiVersion * @property string $authType * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $domainName * @property string $friendlyName * @property string $sid * @property string $uri * @property string $voiceFallbackMethod * @property string $voiceFallbackUrl * @property string $voiceMethod * @property string $voiceStatusCallbackMethod * @property string $voiceStatusCallbackUrl * @property string $voiceUrl * @property array $subresourceUris * @property bool $sipRegistration */ class DomainInstance extends InstanceResource { protected $_ipAccessControlListMappings = null; protected $_credentialListMappings = null; protected $_auth = null; /** * Initialize the DomainInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid A 34 character string that uniquely identifies * this resource. * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Api\V2010\Account\Sip\DomainInstance */ public function __construct(Version $version, array $payload, $accountSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'accountSid' => Values::array_get($payload, 'account_sid'), 'apiVersion' => Values::array_get($payload, 'api_version'), 'authType' => Values::array_get($payload, 'auth_type'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'domainName' => Values::array_get($payload, 'domain_name'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'sid' => Values::array_get($payload, 'sid'), 'uri' => Values::array_get($payload, 'uri'), 'voiceFallbackMethod' => Values::array_get($payload, 'voice_fallback_method'), 'voiceFallbackUrl' => Values::array_get($payload, 'voice_fallback_url'), 'voiceMethod' => Values::array_get($payload, 'voice_method'), 'voiceStatusCallbackMethod' => Values::array_get($payload, 'voice_status_callback_method'), 'voiceStatusCallbackUrl' => Values::array_get($payload, 'voice_status_callback_url'), 'voiceUrl' => Values::array_get($payload, 'voice_url'), 'subresourceUris' => Values::array_get($payload, 'subresource_uris'), 'sipRegistration' => Values::array_get($payload, 'sip_registration'), ); $this->solution = array('accountSid' => $accountSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Api\V2010\Account\Sip\DomainContext Context for this * DomainInstance */ protected function proxy() { if (!$this->context) { $this->context = new DomainContext( $this->version, $this->solution['accountSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch a DomainInstance * * @return DomainInstance Fetched DomainInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Update the DomainInstance * * @param array|Options $options Optional Arguments * @return DomainInstance Updated DomainInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Deletes the DomainInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Access the ipAccessControlListMappings * * @return \Twilio\Rest\Api\V2010\Account\Sip\Domain\IpAccessControlListMappingList */ protected function getIpAccessControlListMappings() { return $this->proxy()->ipAccessControlListMappings; } /** * Access the credentialListMappings * * @return \Twilio\Rest\Api\V2010\Account\Sip\Domain\CredentialListMappingList */ protected function getCredentialListMappings() { return $this->proxy()->credentialListMappings; } /** * Access the auth * * @return \Twilio\Rest\Api\V2010\Account\Sip\Domain\AuthTypesList */ protected function getAuth() { return $this->proxy()->auth; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.DomainInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Sip/CredentialListPage.php 0000644 00000001416 15002236443 0020065 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Sip; use Twilio\Page; class CredentialListPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new CredentialListInstance($this->version, $payload, $this->solution['accountSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.CredentialListPage]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Sip/IpAccessControlListInstance.php 0000644 00000011163 15002236443 0021736 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Sip; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $accountSid * @property string $friendlyName * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property array $subresourceUris * @property string $uri */ class IpAccessControlListInstance extends InstanceResource { protected $_ipAddresses = null; /** * Initialize the IpAccessControlListInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid A 34 character string that uniquely identifies * this resource. * @param string $sid A string that identifies the resource to fetch * @return \Twilio\Rest\Api\V2010\Account\Sip\IpAccessControlListInstance */ public function __construct(Version $version, array $payload, $accountSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'subresourceUris' => Values::array_get($payload, 'subresource_uris'), 'uri' => Values::array_get($payload, 'uri'), ); $this->solution = array('accountSid' => $accountSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Api\V2010\Account\Sip\IpAccessControlListContext Context for this IpAccessControlListInstance */ protected function proxy() { if (!$this->context) { $this->context = new IpAccessControlListContext( $this->version, $this->solution['accountSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch a IpAccessControlListInstance * * @return IpAccessControlListInstance Fetched IpAccessControlListInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Update the IpAccessControlListInstance * * @param string $friendlyName A human readable description of this resource * @return IpAccessControlListInstance Updated IpAccessControlListInstance * @throws TwilioException When an HTTP error occurs. */ public function update($friendlyName) { return $this->proxy()->update($friendlyName); } /** * Deletes the IpAccessControlListInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Access the ipAddresses * * @return \Twilio\Rest\Api\V2010\Account\Sip\IpAccessControlList\IpAddressList */ protected function getIpAddresses() { return $this->proxy()->ipAddresses; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.IpAccessControlListInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Sip/CredentialList/CredentialInstance.php 0000644 00000011203 15002236443 0023022 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Sip\CredentialList; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $accountSid * @property string $credentialListSid * @property string $username * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $uri */ class CredentialInstance extends InstanceResource { /** * Initialize the CredentialInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The unique id of the Account that is responsible * for this resource. * @param string $credentialListSid The unique id that identifies the * credential list that includes this * credential * @param string $sid The unique id that identifies the resource to fetch. * @return \Twilio\Rest\Api\V2010\Account\Sip\CredentialList\CredentialInstance */ public function __construct(Version $version, array $payload, $accountSid, $credentialListSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'credentialListSid' => Values::array_get($payload, 'credential_list_sid'), 'username' => Values::array_get($payload, 'username'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'uri' => Values::array_get($payload, 'uri'), ); $this->solution = array( 'accountSid' => $accountSid, 'credentialListSid' => $credentialListSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Api\V2010\Account\Sip\CredentialList\CredentialContext Context for this CredentialInstance */ protected function proxy() { if (!$this->context) { $this->context = new CredentialContext( $this->version, $this->solution['accountSid'], $this->solution['credentialListSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch a CredentialInstance * * @return CredentialInstance Fetched CredentialInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Update the CredentialInstance * * @param array|Options $options Optional Arguments * @return CredentialInstance Updated CredentialInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Deletes the CredentialInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.CredentialInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Sip/CredentialList/CredentialContext.php 0000644 00000006716 15002236443 0022717 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Sip\CredentialList; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Values; use Twilio\Version; class CredentialContext extends InstanceContext { /** * Initialize the CredentialContext * * @param \Twilio\Version $version Version that contains the resource * @param string $accountSid The unique id of the Account that is responsible * for this resource. * @param string $credentialListSid The unique id that identifies the * credential list that contains the desired * credential * @param string $sid The unique id that identifies the resource to fetch. * @return \Twilio\Rest\Api\V2010\Account\Sip\CredentialList\CredentialContext */ public function __construct(Version $version, $accountSid, $credentialListSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array( 'accountSid' => $accountSid, 'credentialListSid' => $credentialListSid, 'sid' => $sid, ); $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/SIP/CredentialLists/' . \rawurlencode($credentialListSid) . '/Credentials/' . \rawurlencode($sid) . '.json'; } /** * Fetch a CredentialInstance * * @return CredentialInstance Fetched CredentialInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new CredentialInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['credentialListSid'], $this->solution['sid'] ); } /** * Update the CredentialInstance * * @param array|Options $options Optional Arguments * @return CredentialInstance Updated CredentialInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { $options = new Values($options); $data = Values::of(array('Password' => $options['password'], )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new CredentialInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['credentialListSid'], $this->solution['sid'] ); } /** * Deletes the CredentialInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.CredentialContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Sip/CredentialList/CredentialOptions.php 0000644 00000003242 15002236443 0022715 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Sip\CredentialList; use Twilio\Options; use Twilio\Values; abstract class CredentialOptions { /** * @param string $password The password will not be returned in the response * @return UpdateCredentialOptions Options builder */ public static function update($password = Values::NONE) { return new UpdateCredentialOptions($password); } } class UpdateCredentialOptions extends Options { /** * @param string $password The password will not be returned in the response */ public function __construct($password = Values::NONE) { $this->options['password'] = $password; } /** * The password that the username will use when authenticating SIP requests. The password must be a minimum of 12 characters, contain at least 1 digit, and have mixed case. (eg `IWasAtSignal2018`) * * @param string $password The password will not be returned in the response * @return $this Fluent Builder */ public function setPassword($password) { $this->options['password'] = $password; 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.UpdateCredentialOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Sip/CredentialList/CredentialList.php 0000644 00000014341 15002236443 0022177 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Sip\CredentialList; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Values; use Twilio\Version; class CredentialList extends ListResource { /** * Construct the CredentialList * * @param Version $version Version that contains the resource * @param string $accountSid The unique id of the Account that is responsible * for this resource. * @param string $credentialListSid The unique id that identifies the * credential list that includes this * credential * @return \Twilio\Rest\Api\V2010\Account\Sip\CredentialList\CredentialList */ public function __construct(Version $version, $accountSid, $credentialListSid) { parent::__construct($version); // Path Solution $this->solution = array('accountSid' => $accountSid, 'credentialListSid' => $credentialListSid, ); $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/SIP/CredentialLists/' . \rawurlencode($credentialListSid) . '/Credentials.json'; } /** * Streams CredentialInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads CredentialInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return CredentialInstance[] Array of results */ public function read($limit = null, $pageSize = null) { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of CredentialInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of CredentialInstance */ public function page($pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $params = Values::of(array( 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new CredentialPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of CredentialInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of CredentialInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new CredentialPage($this->version, $response, $this->solution); } /** * Create a new CredentialInstance * * @param string $username The username for this credential. * @param string $password The password will not be returned in the response. * @return CredentialInstance Newly created CredentialInstance * @throws TwilioException When an HTTP error occurs. */ public function create($username, $password) { $data = Values::of(array('Username' => $username, 'Password' => $password, )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new CredentialInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['credentialListSid'] ); } /** * Constructs a CredentialContext * * @param string $sid The unique id that identifies the resource to fetch. * @return \Twilio\Rest\Api\V2010\Account\Sip\CredentialList\CredentialContext */ public function getContext($sid) { return new CredentialContext( $this->version, $this->solution['accountSid'], $this->solution['credentialListSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.CredentialList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Sip/CredentialList/CredentialPage.php 0000644 00000001561 15002236443 0022140 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Sip\CredentialList; use Twilio\Page; class CredentialPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new CredentialInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['credentialListSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.CredentialPage]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Sip/IpAccessControlListList.php 0000644 00000013421 15002236443 0021104 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Sip; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Values; use Twilio\Version; class IpAccessControlListList extends ListResource { /** * Construct the IpAccessControlListList * * @param Version $version Version that contains the resource * @param string $accountSid A 34 character string that uniquely identifies * this resource. * @return \Twilio\Rest\Api\V2010\Account\Sip\IpAccessControlListList */ public function __construct(Version $version, $accountSid) { parent::__construct($version); // Path Solution $this->solution = array('accountSid' => $accountSid, ); $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/SIP/IpAccessControlLists.json'; } /** * Streams IpAccessControlListInstance records from the API as a generator * stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads IpAccessControlListInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return IpAccessControlListInstance[] Array of results */ public function read($limit = null, $pageSize = null) { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of IpAccessControlListInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of IpAccessControlListInstance */ public function page($pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $params = Values::of(array( 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new IpAccessControlListPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of IpAccessControlListInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of IpAccessControlListInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new IpAccessControlListPage($this->version, $response, $this->solution); } /** * Create a new IpAccessControlListInstance * * @param string $friendlyName A human readable description of this resource * @return IpAccessControlListInstance Newly created IpAccessControlListInstance * @throws TwilioException When an HTTP error occurs. */ public function create($friendlyName) { $data = Values::of(array('FriendlyName' => $friendlyName, )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new IpAccessControlListInstance($this->version, $payload, $this->solution['accountSid']); } /** * Constructs a IpAccessControlListContext * * @param string $sid A string that identifies the resource to fetch * @return \Twilio\Rest\Api\V2010\Account\Sip\IpAccessControlListContext */ public function getContext($sid) { return new IpAccessControlListContext($this->version, $this->solution['accountSid'], $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.IpAccessControlListList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypesList.php 0000644 00000006440 15002236443 0020355 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Sip\Domain; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Rest\Api\V2010\Account\Sip\Domain\AuthTypes\AuthTypeCallsList; use Twilio\Rest\Api\V2010\Account\Sip\Domain\AuthTypes\AuthTypeRegistrationsList; use Twilio\Version; /** * @property \Twilio\Rest\Api\V2010\Account\Sip\Domain\AuthTypes\AuthTypeCallsList $calls * @property \Twilio\Rest\Api\V2010\Account\Sip\Domain\AuthTypes\AuthTypeRegistrationsList $registrations */ class AuthTypesList extends ListResource { protected $_calls = null; protected $_registrations = null; /** * Construct the AuthTypesList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the Account that created the resource * @param string $domainSid The unique string that identifies the resource * @return \Twilio\Rest\Api\V2010\Account\Sip\Domain\AuthTypesList */ public function __construct(Version $version, $accountSid, $domainSid) { parent::__construct($version); // Path Solution $this->solution = array('accountSid' => $accountSid, 'domainSid' => $domainSid, ); } /** * Access the calls */ protected function getCalls() { if (!$this->_calls) { $this->_calls = new AuthTypeCallsList( $this->version, $this->solution['accountSid'], $this->solution['domainSid'] ); } return $this->_calls; } /** * Access the registrations */ protected function getRegistrations() { if (!$this->_registrations) { $this->_registrations = new AuthTypeRegistrationsList( $this->version, $this->solution['accountSid'], $this->solution['domainSid'] ); } return $this->_registrations; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get($name) { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.AuthTypesList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/CredentialListMappingContext.php 0000644 00000005064 15002236443 0023363 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Sip\Domain; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; class CredentialListMappingContext extends InstanceContext { /** * Initialize the CredentialListMappingContext * * @param \Twilio\Version $version Version that contains the resource * @param string $accountSid The unique sid that identifies this account * @param string $domainSid A string that identifies the SIP Domain that * includes the resource to fetch * @param string $sid A string that identifies the resource to fetch * @return \Twilio\Rest\Api\V2010\Account\Sip\Domain\CredentialListMappingContext */ public function __construct(Version $version, $accountSid, $domainSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array('accountSid' => $accountSid, 'domainSid' => $domainSid, 'sid' => $sid, ); $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/SIP/Domains/' . \rawurlencode($domainSid) . '/CredentialListMappings/' . \rawurlencode($sid) . '.json'; } /** * Fetch a CredentialListMappingInstance * * @return CredentialListMappingInstance Fetched CredentialListMappingInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new CredentialListMappingInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['domainSid'], $this->solution['sid'] ); } /** * Deletes the CredentialListMappingInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.CredentialListMappingContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/CredentialListMappingInstance.php 0000644 00000010470 15002236443 0023500 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Sip\Domain; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $friendlyName * @property string $sid * @property string $uri * @property array $subresourceUris */ class CredentialListMappingInstance extends InstanceResource { /** * Initialize the CredentialListMappingInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The unique id of the Account that is responsible * for this resource. * @param string $domainSid The unique string that identifies the resource * @param string $sid A string that identifies the resource to fetch * @return \Twilio\Rest\Api\V2010\Account\Sip\Domain\CredentialListMappingInstance */ public function __construct(Version $version, array $payload, $accountSid, $domainSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'accountSid' => Values::array_get($payload, 'account_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'sid' => Values::array_get($payload, 'sid'), 'uri' => Values::array_get($payload, 'uri'), 'subresourceUris' => Values::array_get($payload, 'subresource_uris'), ); $this->solution = array( 'accountSid' => $accountSid, 'domainSid' => $domainSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Api\V2010\Account\Sip\Domain\CredentialListMappingContext Context for this * CredentialListMappingInstance */ protected function proxy() { if (!$this->context) { $this->context = new CredentialListMappingContext( $this->version, $this->solution['accountSid'], $this->solution['domainSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch a CredentialListMappingInstance * * @return CredentialListMappingInstance Fetched CredentialListMappingInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the CredentialListMappingInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.CredentialListMappingInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/IpAccessControlListMappingContext.php 0000644 00000005307 15002236443 0024344 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Sip\Domain; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; class IpAccessControlListMappingContext extends InstanceContext { /** * Initialize the IpAccessControlListMappingContext * * @param \Twilio\Version $version Version that contains the resource * @param string $accountSid The unique id of the Account that is responsible * for this resource. * @param string $domainSid A string that uniquely identifies the SIP Domain * @param string $sid A 34 character string that uniquely identifies the * resource to fetch. * @return \Twilio\Rest\Api\V2010\Account\Sip\Domain\IpAccessControlListMappingContext */ public function __construct(Version $version, $accountSid, $domainSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array('accountSid' => $accountSid, 'domainSid' => $domainSid, 'sid' => $sid, ); $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/SIP/Domains/' . \rawurlencode($domainSid) . '/IpAccessControlListMappings/' . \rawurlencode($sid) . '.json'; } /** * Fetch a IpAccessControlListMappingInstance * * @return IpAccessControlListMappingInstance Fetched * IpAccessControlListMappingInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new IpAccessControlListMappingInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['domainSid'], $this->solution['sid'] ); } /** * Deletes the IpAccessControlListMappingInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.IpAccessControlListMappingContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/IpAccessControlListMappingList.php 0000644 00000014754 15002236443 0023641 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Sip\Domain; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Values; use Twilio\Version; class IpAccessControlListMappingList extends ListResource { /** * Construct the IpAccessControlListMappingList * * @param Version $version Version that contains the resource * @param string $accountSid The unique id of the Account that is responsible * for this resource. * @param string $domainSid The unique string that identifies the resource * @return \Twilio\Rest\Api\V2010\Account\Sip\Domain\IpAccessControlListMappingList */ public function __construct(Version $version, $accountSid, $domainSid) { parent::__construct($version); // Path Solution $this->solution = array('accountSid' => $accountSid, 'domainSid' => $domainSid, ); $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/SIP/Domains/' . \rawurlencode($domainSid) . '/IpAccessControlListMappings.json'; } /** * Create a new IpAccessControlListMappingInstance * * @param string $ipAccessControlListSid The unique id of the IP access control * list to map to the SIP domain * @return IpAccessControlListMappingInstance Newly created * IpAccessControlListMappingInstance * @throws TwilioException When an HTTP error occurs. */ public function create($ipAccessControlListSid) { $data = Values::of(array('IpAccessControlListSid' => $ipAccessControlListSid, )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new IpAccessControlListMappingInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['domainSid'] ); } /** * Streams IpAccessControlListMappingInstance records from the API as a * generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads IpAccessControlListMappingInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return IpAccessControlListMappingInstance[] Array of results */ public function read($limit = null, $pageSize = null) { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of IpAccessControlListMappingInstance records from * the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of IpAccessControlListMappingInstance */ public function page($pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $params = Values::of(array( 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new IpAccessControlListMappingPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of IpAccessControlListMappingInstance records from * the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of IpAccessControlListMappingInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new IpAccessControlListMappingPage($this->version, $response, $this->solution); } /** * Constructs a IpAccessControlListMappingContext * * @param string $sid A 34 character string that uniquely identifies the * resource to fetch. * @return \Twilio\Rest\Api\V2010\Account\Sip\Domain\IpAccessControlListMappingContext */ public function getContext($sid) { return new IpAccessControlListMappingContext( $this->version, $this->solution['accountSid'], $this->solution['domainSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.IpAccessControlListMappingList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeRegistrationsList.php 0000644 00000006217 15002236443 0024700 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Sip\Domain\AuthTypes; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Rest\Api\V2010\Account\Sip\Domain\AuthTypes\AuthTypeRegistrations\AuthRegistrationsCredentialListMappingList; use Twilio\Version; /** * @property \Twilio\Rest\Api\V2010\Account\Sip\Domain\AuthTypes\AuthTypeRegistrations\AuthRegistrationsCredentialListMappingList $credentialListMappings * @method \Twilio\Rest\Api\V2010\Account\Sip\Domain\AuthTypes\AuthTypeRegistrations\AuthRegistrationsCredentialListMappingContext credentialListMappings(string $sid) */ class AuthTypeRegistrationsList extends ListResource { protected $_credentialListMappings = null; /** * Construct the AuthTypeRegistrationsList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the Account that created the resource * @param string $domainSid The unique string that identifies the resource * @return \Twilio\Rest\Api\V2010\Account\Sip\Domain\AuthTypes\AuthTypeRegistrationsList */ public function __construct(Version $version, $accountSid, $domainSid) { parent::__construct($version); // Path Solution $this->solution = array('accountSid' => $accountSid, 'domainSid' => $domainSid, ); } /** * Access the credentialListMappings */ protected function getCredentialListMappings() { if (!$this->_credentialListMappings) { $this->_credentialListMappings = new AuthRegistrationsCredentialListMappingList( $this->version, $this->solution['accountSid'], $this->solution['domainSid'] ); } return $this->_credentialListMappings; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get($name) { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.AuthTypeRegistrationsList]'; } } Account/Sip/Domain/AuthTypes/AuthTypeRegistrations/AuthRegistrationsCredentialListMappingList.php 0000644 00000015332 15002236443 0034441 0 ustar 00 sdk/src/Twilio/Rest/Api/V2010 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Sip\Domain\AuthTypes\AuthTypeRegistrations; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Values; use Twilio\Version; class AuthRegistrationsCredentialListMappingList extends ListResource { /** * Construct the AuthRegistrationsCredentialListMappingList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the Account that created the resource * @param string $domainSid The unique string that identifies the resource * @return \Twilio\Rest\Api\V2010\Account\Sip\Domain\AuthTypes\AuthTypeRegistrations\AuthRegistrationsCredentialListMappingList */ public function __construct(Version $version, $accountSid, $domainSid) { parent::__construct($version); // Path Solution $this->solution = array('accountSid' => $accountSid, 'domainSid' => $domainSid, ); $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/SIP/Domains/' . \rawurlencode($domainSid) . '/Auth/Registrations/CredentialListMappings.json'; } /** * Create a new AuthRegistrationsCredentialListMappingInstance * * @param string $credentialListSid The SID of the CredentialList resource to * map to the SIP domain * @return AuthRegistrationsCredentialListMappingInstance Newly created * AuthRegistrationsCredentialListMappingInstance * @throws TwilioException When an HTTP error occurs. */ public function create($credentialListSid) { $data = Values::of(array('CredentialListSid' => $credentialListSid, )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new AuthRegistrationsCredentialListMappingInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['domainSid'] ); } /** * Streams AuthRegistrationsCredentialListMappingInstance records from the API * as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads AuthRegistrationsCredentialListMappingInstance records from the API as * a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return AuthRegistrationsCredentialListMappingInstance[] Array of results */ public function read($limit = null, $pageSize = null) { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of AuthRegistrationsCredentialListMappingInstance * records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of AuthRegistrationsCredentialListMappingInstance */ public function page($pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $params = Values::of(array( 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new AuthRegistrationsCredentialListMappingPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of AuthRegistrationsCredentialListMappingInstance * records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of AuthRegistrationsCredentialListMappingInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new AuthRegistrationsCredentialListMappingPage($this->version, $response, $this->solution); } /** * Constructs a AuthRegistrationsCredentialListMappingContext * * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Api\V2010\Account\Sip\Domain\AuthTypes\AuthTypeRegistrations\AuthRegistrationsCredentialListMappingContext */ public function getContext($sid) { return new AuthRegistrationsCredentialListMappingContext( $this->version, $this->solution['accountSid'], $this->solution['domainSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.AuthRegistrationsCredentialListMappingList]'; } } Account/Sip/Domain/AuthTypes/AuthTypeRegistrations/AuthRegistrationsCredentialListMappingPage.php 0000644 00000001725 15002236443 0034403 0 ustar 00 sdk/src/Twilio/Rest/Api/V2010 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Sip\Domain\AuthTypes\AuthTypeRegistrations; use Twilio\Page; class AuthRegistrationsCredentialListMappingPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new AuthRegistrationsCredentialListMappingInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['domainSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.AuthRegistrationsCredentialListMappingPage]'; } } Account/Sip/Domain/AuthTypes/AuthTypeRegistrations/AuthRegistrationsCredentialListMappingContext.php0000644 00000005577 15002236443 0035164 0 ustar 00 sdk/src/Twilio/Rest/Api/V2010 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Sip\Domain\AuthTypes\AuthTypeRegistrations; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; class AuthRegistrationsCredentialListMappingContext extends InstanceContext { /** * Initialize the AuthRegistrationsCredentialListMappingContext * * @param \Twilio\Version $version Version that contains the resource * @param string $accountSid The SID of the Account that created the resource * to fetch * @param string $domainSid The SID of the SIP domain that contains the * resource to fetch * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Api\V2010\Account\Sip\Domain\AuthTypes\AuthTypeRegistrations\AuthRegistrationsCredentialListMappingContext */ public function __construct(Version $version, $accountSid, $domainSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array('accountSid' => $accountSid, 'domainSid' => $domainSid, 'sid' => $sid, ); $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/SIP/Domains/' . \rawurlencode($domainSid) . '/Auth/Registrations/CredentialListMappings/' . \rawurlencode($sid) . '.json'; } /** * Fetch a AuthRegistrationsCredentialListMappingInstance * * @return AuthRegistrationsCredentialListMappingInstance Fetched * AuthRegistrationsCredentialListMappingInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new AuthRegistrationsCredentialListMappingInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['domainSid'], $this->solution['sid'] ); } /** * Deletes the AuthRegistrationsCredentialListMappingInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.AuthRegistrationsCredentialListMappingContext ' . \implode(' ', $context) . ']'; } } Sip/Domain/AuthTypes/AuthTypeRegistrations/AuthRegistrationsCredentialListMappingInstance.php 0000644 00000010706 15002236443 0035272 0 ustar 00 sdk/src/Twilio/Rest/Api/V2010/Account <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Sip\Domain\AuthTypes\AuthTypeRegistrations; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $friendlyName * @property string $sid */ class AuthRegistrationsCredentialListMappingInstance extends InstanceResource { /** * Initialize the AuthRegistrationsCredentialListMappingInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the Account that created the resource * @param string $domainSid The unique string that identifies the resource * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Api\V2010\Account\Sip\Domain\AuthTypes\AuthTypeRegistrations\AuthRegistrationsCredentialListMappingInstance */ public function __construct(Version $version, array $payload, $accountSid, $domainSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'accountSid' => Values::array_get($payload, 'account_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'sid' => Values::array_get($payload, 'sid'), ); $this->solution = array( 'accountSid' => $accountSid, 'domainSid' => $domainSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Api\V2010\Account\Sip\Domain\AuthTypes\AuthTypeRegistrations\AuthRegistrationsCredentialListMappingContext Context for * this AuthRegistrationsCredentialListMappingInstance */ protected function proxy() { if (!$this->context) { $this->context = new AuthRegistrationsCredentialListMappingContext( $this->version, $this->solution['accountSid'], $this->solution['domainSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch a AuthRegistrationsCredentialListMappingInstance * * @return AuthRegistrationsCredentialListMappingInstance Fetched * AuthRegistrationsCredentialListMappingInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the AuthRegistrationsCredentialListMappingInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.AuthRegistrationsCredentialListMappingInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeCallsPage.php 0000644 00000001564 15002236443 0023042 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Sip\Domain\AuthTypes; use Twilio\Page; class AuthTypeCallsPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new AuthTypeCallsInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['domainSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.AuthTypeCallsPage]'; } } Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeCalls/AuthCallsCredentialListMappingList.php 0000644 00000015013 15002236443 0031037 0 ustar 00 sdk/src/Twilio <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Sip\Domain\AuthTypes\AuthTypeCalls; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Values; use Twilio\Version; class AuthCallsCredentialListMappingList extends ListResource { /** * Construct the AuthCallsCredentialListMappingList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the Account that created the resource * @param string $domainSid The unique string that identifies the resource * @return \Twilio\Rest\Api\V2010\Account\Sip\Domain\AuthTypes\AuthTypeCalls\AuthCallsCredentialListMappingList */ public function __construct(Version $version, $accountSid, $domainSid) { parent::__construct($version); // Path Solution $this->solution = array('accountSid' => $accountSid, 'domainSid' => $domainSid, ); $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/SIP/Domains/' . \rawurlencode($domainSid) . '/Auth/Calls/CredentialListMappings.json'; } /** * Create a new AuthCallsCredentialListMappingInstance * * @param string $credentialListSid The SID of the CredentialList resource to * map to the SIP domain * @return AuthCallsCredentialListMappingInstance Newly created * AuthCallsCredentialListMappingInstance * @throws TwilioException When an HTTP error occurs. */ public function create($credentialListSid) { $data = Values::of(array('CredentialListSid' => $credentialListSid, )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new AuthCallsCredentialListMappingInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['domainSid'] ); } /** * Streams AuthCallsCredentialListMappingInstance records from the API as a * generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads AuthCallsCredentialListMappingInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return AuthCallsCredentialListMappingInstance[] Array of results */ public function read($limit = null, $pageSize = null) { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of AuthCallsCredentialListMappingInstance records * from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of AuthCallsCredentialListMappingInstance */ public function page($pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $params = Values::of(array( 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new AuthCallsCredentialListMappingPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of AuthCallsCredentialListMappingInstance records * from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of AuthCallsCredentialListMappingInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new AuthCallsCredentialListMappingPage($this->version, $response, $this->solution); } /** * Constructs a AuthCallsCredentialListMappingContext * * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Api\V2010\Account\Sip\Domain\AuthTypes\AuthTypeCalls\AuthCallsCredentialListMappingContext */ public function getContext($sid) { return new AuthCallsCredentialListMappingContext( $this->version, $this->solution['accountSid'], $this->solution['domainSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.AuthCallsCredentialListMappingList]'; } } Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeCalls/AuthCallsIpAccessControlListMappingPage.php 0000644 00000001704 15002236443 0031763 0 ustar 00 sdk/src/Twilio/Rest <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Sip\Domain\AuthTypes\AuthTypeCalls; use Twilio\Page; class AuthCallsIpAccessControlListMappingPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new AuthCallsIpAccessControlListMappingInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['domainSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.AuthCallsIpAccessControlListMappingPage]'; } } Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeCalls/AuthCallsCredentialListMappingInstance.php0000644 00000010476 15002236443 0031700 0 ustar 00 sdk/src/Twilio <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Sip\Domain\AuthTypes\AuthTypeCalls; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $friendlyName * @property string $sid */ class AuthCallsCredentialListMappingInstance extends InstanceResource { /** * Initialize the AuthCallsCredentialListMappingInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the Account that created the resource * @param string $domainSid The unique string that identifies the resource * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Api\V2010\Account\Sip\Domain\AuthTypes\AuthTypeCalls\AuthCallsCredentialListMappingInstance */ public function __construct(Version $version, array $payload, $accountSid, $domainSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'accountSid' => Values::array_get($payload, 'account_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'sid' => Values::array_get($payload, 'sid'), ); $this->solution = array( 'accountSid' => $accountSid, 'domainSid' => $domainSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Api\V2010\Account\Sip\Domain\AuthTypes\AuthTypeCalls\AuthCallsCredentialListMappingContext Context for this * AuthCallsCredentialListMappingInstance */ protected function proxy() { if (!$this->context) { $this->context = new AuthCallsCredentialListMappingContext( $this->version, $this->solution['accountSid'], $this->solution['domainSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch a AuthCallsCredentialListMappingInstance * * @return AuthCallsCredentialListMappingInstance Fetched * AuthCallsCredentialListMappingInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the AuthCallsCredentialListMappingInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.AuthCallsCredentialListMappingInstance ' . \implode(' ', $context) . ']'; } } Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeCalls/AuthCallsIpAccessControlListMappingContext.php 0000644 00000005516 15002236443 0032540 0 ustar 00 sdk/src/Twilio/Rest <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Sip\Domain\AuthTypes\AuthTypeCalls; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; class AuthCallsIpAccessControlListMappingContext extends InstanceContext { /** * Initialize the AuthCallsIpAccessControlListMappingContext * * @param \Twilio\Version $version Version that contains the resource * @param string $accountSid The SID of the Account that created the resource * to fetch * @param string $domainSid The SID of the SIP domain that contains the * resource to fetch * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Api\V2010\Account\Sip\Domain\AuthTypes\AuthTypeCalls\AuthCallsIpAccessControlListMappingContext */ public function __construct(Version $version, $accountSid, $domainSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array('accountSid' => $accountSid, 'domainSid' => $domainSid, 'sid' => $sid, ); $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/SIP/Domains/' . \rawurlencode($domainSid) . '/Auth/Calls/IpAccessControlListMappings/' . \rawurlencode($sid) . '.json'; } /** * Fetch a AuthCallsIpAccessControlListMappingInstance * * @return AuthCallsIpAccessControlListMappingInstance Fetched * AuthCallsIpAccessControlListMappingInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new AuthCallsIpAccessControlListMappingInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['domainSid'], $this->solution['sid'] ); } /** * Deletes the AuthCallsIpAccessControlListMappingInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.AuthCallsIpAccessControlListMappingContext ' . \implode(' ', $context) . ']'; } } Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeCalls/AuthCallsCredentialListMappingPage.php 0000644 00000001665 15002236443 0031010 0 ustar 00 sdk/src/Twilio <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Sip\Domain\AuthTypes\AuthTypeCalls; use Twilio\Page; class AuthCallsCredentialListMappingPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new AuthCallsCredentialListMappingInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['domainSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.AuthCallsCredentialListMappingPage]'; } } Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeCalls/AuthCallsIpAccessControlListMappingList.php 0000644 00000015236 15002236443 0032027 0 ustar 00 sdk/src/Twilio/Rest <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Sip\Domain\AuthTypes\AuthTypeCalls; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Values; use Twilio\Version; class AuthCallsIpAccessControlListMappingList extends ListResource { /** * Construct the AuthCallsIpAccessControlListMappingList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the Account that created the resource * @param string $domainSid The unique string that identifies the resource * @return \Twilio\Rest\Api\V2010\Account\Sip\Domain\AuthTypes\AuthTypeCalls\AuthCallsIpAccessControlListMappingList */ public function __construct(Version $version, $accountSid, $domainSid) { parent::__construct($version); // Path Solution $this->solution = array('accountSid' => $accountSid, 'domainSid' => $domainSid, ); $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/SIP/Domains/' . \rawurlencode($domainSid) . '/Auth/Calls/IpAccessControlListMappings.json'; } /** * Create a new AuthCallsIpAccessControlListMappingInstance * * @param string $ipAccessControlListSid The SID of the IpAccessControlList * resource to map to the SIP domain * @return AuthCallsIpAccessControlListMappingInstance Newly created * AuthCallsIpAccessControlListMappingInstance * @throws TwilioException When an HTTP error occurs. */ public function create($ipAccessControlListSid) { $data = Values::of(array('IpAccessControlListSid' => $ipAccessControlListSid, )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new AuthCallsIpAccessControlListMappingInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['domainSid'] ); } /** * Streams AuthCallsIpAccessControlListMappingInstance records from the API as * a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads AuthCallsIpAccessControlListMappingInstance records from the API as a * list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return AuthCallsIpAccessControlListMappingInstance[] Array of results */ public function read($limit = null, $pageSize = null) { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of AuthCallsIpAccessControlListMappingInstance * records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of AuthCallsIpAccessControlListMappingInstance */ public function page($pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $params = Values::of(array( 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new AuthCallsIpAccessControlListMappingPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of AuthCallsIpAccessControlListMappingInstance * records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of AuthCallsIpAccessControlListMappingInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new AuthCallsIpAccessControlListMappingPage($this->version, $response, $this->solution); } /** * Constructs a AuthCallsIpAccessControlListMappingContext * * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Api\V2010\Account\Sip\Domain\AuthTypes\AuthTypeCalls\AuthCallsIpAccessControlListMappingContext */ public function getContext($sid) { return new AuthCallsIpAccessControlListMappingContext( $this->version, $this->solution['accountSid'], $this->solution['domainSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.AuthCallsIpAccessControlListMappingList]'; } } Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeCalls/AuthCallsIpAccessControlListMappingInstance.php0000644 00000010577 15002236443 0032663 0 ustar 00 sdk/src/Twilio/Rest <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Sip\Domain\AuthTypes\AuthTypeCalls; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $friendlyName * @property string $sid */ class AuthCallsIpAccessControlListMappingInstance extends InstanceResource { /** * Initialize the AuthCallsIpAccessControlListMappingInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the Account that created the resource * @param string $domainSid The unique string that identifies the resource * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Api\V2010\Account\Sip\Domain\AuthTypes\AuthTypeCalls\AuthCallsIpAccessControlListMappingInstance */ public function __construct(Version $version, array $payload, $accountSid, $domainSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'accountSid' => Values::array_get($payload, 'account_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'sid' => Values::array_get($payload, 'sid'), ); $this->solution = array( 'accountSid' => $accountSid, 'domainSid' => $domainSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Api\V2010\Account\Sip\Domain\AuthTypes\AuthTypeCalls\AuthCallsIpAccessControlListMappingContext Context for this * AuthCallsIpAccessControlListMappingInstance */ protected function proxy() { if (!$this->context) { $this->context = new AuthCallsIpAccessControlListMappingContext( $this->version, $this->solution['accountSid'], $this->solution['domainSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch a AuthCallsIpAccessControlListMappingInstance * * @return AuthCallsIpAccessControlListMappingInstance Fetched * AuthCallsIpAccessControlListMappingInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the AuthCallsIpAccessControlListMappingInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.AuthCallsIpAccessControlListMappingInstance ' . \implode(' ', $context) . ']'; } } Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeCalls/AuthCallsCredentialListMappingContext.php 0000644 00000005427 15002236443 0031560 0 ustar 00 sdk/src/Twilio <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Sip\Domain\AuthTypes\AuthTypeCalls; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; class AuthCallsCredentialListMappingContext extends InstanceContext { /** * Initialize the AuthCallsCredentialListMappingContext * * @param \Twilio\Version $version Version that contains the resource * @param string $accountSid The SID of the Account that created the resource * to fetch * @param string $domainSid The SID of the SIP domain that contains the * resource to fetch * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Api\V2010\Account\Sip\Domain\AuthTypes\AuthTypeCalls\AuthCallsCredentialListMappingContext */ public function __construct(Version $version, $accountSid, $domainSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array('accountSid' => $accountSid, 'domainSid' => $domainSid, 'sid' => $sid, ); $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/SIP/Domains/' . \rawurlencode($domainSid) . '/Auth/Calls/CredentialListMappings/' . \rawurlencode($sid) . '.json'; } /** * Fetch a AuthCallsCredentialListMappingInstance * * @return AuthCallsCredentialListMappingInstance Fetched * AuthCallsCredentialListMappingInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new AuthCallsCredentialListMappingInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['domainSid'], $this->solution['sid'] ); } /** * Deletes the AuthCallsCredentialListMappingInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.AuthCallsCredentialListMappingContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeRegistrationsPage.php 0000644 00000001614 15002236443 0024635 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Sip\Domain\AuthTypes; use Twilio\Page; class AuthTypeRegistrationsPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new AuthTypeRegistrationsInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['domainSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.AuthTypeRegistrationsPage]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeRegistrationsInstance.php 0000644 00000003465 15002236443 0025533 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Sip\Domain\AuthTypes; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; class AuthTypeRegistrationsInstance extends InstanceResource { /** * Initialize the AuthTypeRegistrationsInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the Account that created the resource * @param string $domainSid The unique string that identifies the resource * @return \Twilio\Rest\Api\V2010\Account\Sip\Domain\AuthTypes\AuthTypeRegistrationsInstance */ public function __construct(Version $version, array $payload, $accountSid, $domainSid) { parent::__construct($version); $this->solution = array('accountSid' => $accountSid, 'domainSid' => $domainSid, ); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.AuthTypeRegistrationsInstance]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeCallsInstance.php 0000644 00000003425 15002236443 0023730 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Sip\Domain\AuthTypes; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; class AuthTypeCallsInstance extends InstanceResource { /** * Initialize the AuthTypeCallsInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the Account that created the resource * @param string $domainSid The unique string that identifies the resource * @return \Twilio\Rest\Api\V2010\Account\Sip\Domain\AuthTypes\AuthTypeCallsInstance */ public function __construct(Version $version, array $payload, $accountSid, $domainSid) { parent::__construct($version); $this->solution = array('accountSid' => $accountSid, 'domainSid' => $domainSid, ); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.AuthTypeCallsInstance]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeCallsList.php 0000644 00000007752 15002236443 0023106 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Sip\Domain\AuthTypes; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Rest\Api\V2010\Account\Sip\Domain\AuthTypes\AuthTypeCalls\AuthCallsCredentialListMappingList; use Twilio\Rest\Api\V2010\Account\Sip\Domain\AuthTypes\AuthTypeCalls\AuthCallsIpAccessControlListMappingList; use Twilio\Version; /** * @property \Twilio\Rest\Api\V2010\Account\Sip\Domain\AuthTypes\AuthTypeCalls\AuthCallsCredentialListMappingList $credentialListMappings * @property \Twilio\Rest\Api\V2010\Account\Sip\Domain\AuthTypes\AuthTypeCalls\AuthCallsIpAccessControlListMappingList $ipAccessControlListMappings * @method \Twilio\Rest\Api\V2010\Account\Sip\Domain\AuthTypes\AuthTypeCalls\AuthCallsCredentialListMappingContext credentialListMappings(string $sid) * @method \Twilio\Rest\Api\V2010\Account\Sip\Domain\AuthTypes\AuthTypeCalls\AuthCallsIpAccessControlListMappingContext ipAccessControlListMappings(string $sid) */ class AuthTypeCallsList extends ListResource { protected $_credentialListMappings = null; protected $_ipAccessControlListMappings = null; /** * Construct the AuthTypeCallsList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the Account that created the resource * @param string $domainSid The unique string that identifies the resource * @return \Twilio\Rest\Api\V2010\Account\Sip\Domain\AuthTypes\AuthTypeCallsList */ public function __construct(Version $version, $accountSid, $domainSid) { parent::__construct($version); // Path Solution $this->solution = array('accountSid' => $accountSid, 'domainSid' => $domainSid, ); } /** * Access the credentialListMappings */ protected function getCredentialListMappings() { if (!$this->_credentialListMappings) { $this->_credentialListMappings = new AuthCallsCredentialListMappingList( $this->version, $this->solution['accountSid'], $this->solution['domainSid'] ); } return $this->_credentialListMappings; } /** * Access the ipAccessControlListMappings */ protected function getIpAccessControlListMappings() { if (!$this->_ipAccessControlListMappings) { $this->_ipAccessControlListMappings = new AuthCallsIpAccessControlListMappingList( $this->version, $this->solution['accountSid'], $this->solution['domainSid'] ); } return $this->_ipAccessControlListMappings; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get($name) { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.AuthTypeCallsList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypesInstance.php 0000644 00000003361 15002236443 0021205 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Sip\Domain; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; class AuthTypesInstance extends InstanceResource { /** * Initialize the AuthTypesInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the Account that created the resource * @param string $domainSid The unique string that identifies the resource * @return \Twilio\Rest\Api\V2010\Account\Sip\Domain\AuthTypesInstance */ public function __construct(Version $version, array $payload, $accountSid, $domainSid) { parent::__construct($version); $this->solution = array('accountSid' => $accountSid, 'domainSid' => $domainSid, ); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.AuthTypesInstance]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/IpAccessControlListMappingInstance.php 0000644 00000010727 15002236443 0024466 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Sip\Domain; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $friendlyName * @property string $sid * @property string $uri * @property array $subresourceUris */ class IpAccessControlListMappingInstance extends InstanceResource { /** * Initialize the IpAccessControlListMappingInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The unique id of the Account that is responsible * for this resource. * @param string $domainSid The unique string that identifies the resource * @param string $sid A 34 character string that uniquely identifies the * resource to fetch. * @return \Twilio\Rest\Api\V2010\Account\Sip\Domain\IpAccessControlListMappingInstance */ public function __construct(Version $version, array $payload, $accountSid, $domainSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'accountSid' => Values::array_get($payload, 'account_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'sid' => Values::array_get($payload, 'sid'), 'uri' => Values::array_get($payload, 'uri'), 'subresourceUris' => Values::array_get($payload, 'subresource_uris'), ); $this->solution = array( 'accountSid' => $accountSid, 'domainSid' => $domainSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Api\V2010\Account\Sip\Domain\IpAccessControlListMappingContext Context for this * IpAccessControlListMappingInstance */ protected function proxy() { if (!$this->context) { $this->context = new IpAccessControlListMappingContext( $this->version, $this->solution['accountSid'], $this->solution['domainSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch a IpAccessControlListMappingInstance * * @return IpAccessControlListMappingInstance Fetched * IpAccessControlListMappingInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the IpAccessControlListMappingInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.IpAccessControlListMappingInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/CredentialListMappingPage.php 0000644 00000001602 15002236443 0022605 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Sip\Domain; use Twilio\Page; class CredentialListMappingPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new CredentialListMappingInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['domainSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.CredentialListMappingPage]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/CredentialListMappingList.php 0000644 00000014466 15002236443 0022660 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Sip\Domain; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Values; use Twilio\Version; class CredentialListMappingList extends ListResource { /** * Construct the CredentialListMappingList * * @param Version $version Version that contains the resource * @param string $accountSid The unique id of the Account that is responsible * for this resource. * @param string $domainSid The unique string that identifies the resource * @return \Twilio\Rest\Api\V2010\Account\Sip\Domain\CredentialListMappingList */ public function __construct(Version $version, $accountSid, $domainSid) { parent::__construct($version); // Path Solution $this->solution = array('accountSid' => $accountSid, 'domainSid' => $domainSid, ); $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/SIP/Domains/' . \rawurlencode($domainSid) . '/CredentialListMappings.json'; } /** * Create a new CredentialListMappingInstance * * @param string $credentialListSid A string that identifies the CredentialList * resource to map to the SIP domain * @return CredentialListMappingInstance Newly created * CredentialListMappingInstance * @throws TwilioException When an HTTP error occurs. */ public function create($credentialListSid) { $data = Values::of(array('CredentialListSid' => $credentialListSid, )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new CredentialListMappingInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['domainSid'] ); } /** * Streams CredentialListMappingInstance records from the API as a generator * stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads CredentialListMappingInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return CredentialListMappingInstance[] Array of results */ public function read($limit = null, $pageSize = null) { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of CredentialListMappingInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of CredentialListMappingInstance */ public function page($pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $params = Values::of(array( 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new CredentialListMappingPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of CredentialListMappingInstance records from the * API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of CredentialListMappingInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new CredentialListMappingPage($this->version, $response, $this->solution); } /** * Constructs a CredentialListMappingContext * * @param string $sid A string that identifies the resource to fetch * @return \Twilio\Rest\Api\V2010\Account\Sip\Domain\CredentialListMappingContext */ public function getContext($sid) { return new CredentialListMappingContext( $this->version, $this->solution['accountSid'], $this->solution['domainSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.CredentialListMappingList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypesPage.php 0000644 00000001536 15002236443 0020317 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Sip\Domain; use Twilio\Page; class AuthTypesPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new AuthTypesInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['domainSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.AuthTypesPage]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Sip/Domain/IpAccessControlListMappingPage.php 0000644 00000001621 15002236443 0023567 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Sip\Domain; use Twilio\Page; class IpAccessControlListMappingPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new IpAccessControlListMappingInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['domainSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.IpAccessControlListMappingPage]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/QueuePage.php 0000644 00000001357 15002236443 0015514 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Page; class QueuePage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new QueueInstance($this->version, $payload, $this->solution['accountSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.QueuePage]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/NotificationContext.php 0000644 00000003714 15002236443 0017625 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; class NotificationContext extends InstanceContext { /** * Initialize the NotificationContext * * @param \Twilio\Version $version Version that contains the resource * @param string $accountSid The SID of the Account that created the resource * to fetch * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Api\V2010\Account\NotificationContext */ public function __construct(Version $version, $accountSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array('accountSid' => $accountSid, 'sid' => $sid, ); $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/Notifications/' . \rawurlencode($sid) . '.json'; } /** * Fetch a NotificationInstance * * @return NotificationInstance Fetched NotificationInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new NotificationInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.NotificationContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/BalanceInstance.php 0000644 00000003667 15002236443 0016653 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property string $balance * @property string $currency */ class BalanceInstance extends InstanceResource { /** * Initialize the BalanceInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid Account Sid. * @return \Twilio\Rest\Api\V2010\Account\BalanceInstance */ public function __construct(Version $version, array $payload, $accountSid) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'accountSid' => Values::array_get($payload, 'account_sid'), 'balance' => Values::array_get($payload, 'balance'), 'currency' => Values::array_get($payload, 'currency'), ); $this->solution = array('accountSid' => $accountSid, ); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.BalanceInstance]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumberPage.php 0000644 00000001431 15002236443 0020327 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Page; class IncomingPhoneNumberPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new IncomingPhoneNumberInstance($this->version, $payload, $this->solution['accountSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.IncomingPhoneNumberPage]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/ShortCodeOptions.php 0000644 00000016220 15002236443 0017074 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Options; use Twilio\Values; abstract class ShortCodeOptions { /** * @param string $friendlyName A string to describe this resource * @param string $apiVersion The API version to use to start a new TwiML session * @param string $smsUrl URL Twilio will request when receiving an SMS * @param string $smsMethod HTTP method to use when requesting the sms url * @param string $smsFallbackUrl URL Twilio will request if an error occurs in * executing TwiML * @param string $smsFallbackMethod HTTP method Twilio will use with * sms_fallback_url * @return UpdateShortCodeOptions Options builder */ public static function update($friendlyName = Values::NONE, $apiVersion = Values::NONE, $smsUrl = Values::NONE, $smsMethod = Values::NONE, $smsFallbackUrl = Values::NONE, $smsFallbackMethod = Values::NONE) { return new UpdateShortCodeOptions($friendlyName, $apiVersion, $smsUrl, $smsMethod, $smsFallbackUrl, $smsFallbackMethod); } /** * @param string $friendlyName The string that identifies the ShortCode * resources to read * @param string $shortCode Filter by ShortCode * @return ReadShortCodeOptions Options builder */ public static function read($friendlyName = Values::NONE, $shortCode = Values::NONE) { return new ReadShortCodeOptions($friendlyName, $shortCode); } } class UpdateShortCodeOptions extends Options { /** * @param string $friendlyName A string to describe this resource * @param string $apiVersion The API version to use to start a new TwiML session * @param string $smsUrl URL Twilio will request when receiving an SMS * @param string $smsMethod HTTP method to use when requesting the sms url * @param string $smsFallbackUrl URL Twilio will request if an error occurs in * executing TwiML * @param string $smsFallbackMethod HTTP method Twilio will use with * sms_fallback_url */ public function __construct($friendlyName = Values::NONE, $apiVersion = Values::NONE, $smsUrl = Values::NONE, $smsMethod = Values::NONE, $smsFallbackUrl = Values::NONE, $smsFallbackMethod = Values::NONE) { $this->options['friendlyName'] = $friendlyName; $this->options['apiVersion'] = $apiVersion; $this->options['smsUrl'] = $smsUrl; $this->options['smsMethod'] = $smsMethod; $this->options['smsFallbackUrl'] = $smsFallbackUrl; $this->options['smsFallbackMethod'] = $smsFallbackMethod; } /** * A descriptive string that you created to describe this resource. It can be up to 64 characters long. By default, the `FriendlyName` is the short code. * * @param string $friendlyName A string to describe this resource * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The API version to use to start a new TwiML session. Can be: `2010-04-01` or `2008-08-01`. * * @param string $apiVersion The API version to use to start a new TwiML session * @return $this Fluent Builder */ public function setApiVersion($apiVersion) { $this->options['apiVersion'] = $apiVersion; return $this; } /** * The URL we should call when receiving an incoming SMS message to this short code. * * @param string $smsUrl URL Twilio will request when receiving an SMS * @return $this Fluent Builder */ public function setSmsUrl($smsUrl) { $this->options['smsUrl'] = $smsUrl; return $this; } /** * The HTTP method we should use when calling the `sms_url`. Can be: `GET` or `POST`. * * @param string $smsMethod HTTP method to use when requesting the sms url * @return $this Fluent Builder */ public function setSmsMethod($smsMethod) { $this->options['smsMethod'] = $smsMethod; return $this; } /** * The URL that we should call if an error occurs while retrieving or executing the TwiML from `sms_url`. * * @param string $smsFallbackUrl URL Twilio will request if an error occurs in * executing TwiML * @return $this Fluent Builder */ public function setSmsFallbackUrl($smsFallbackUrl) { $this->options['smsFallbackUrl'] = $smsFallbackUrl; return $this; } /** * The HTTP method that we should use to call the `sms_fallback_url`. Can be: `GET` or `POST`. * * @param string $smsFallbackMethod HTTP method Twilio will use with * sms_fallback_url * @return $this Fluent Builder */ public function setSmsFallbackMethod($smsFallbackMethod) { $this->options['smsFallbackMethod'] = $smsFallbackMethod; 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.UpdateShortCodeOptions ' . \implode(' ', $options) . ']'; } } class ReadShortCodeOptions extends Options { /** * @param string $friendlyName The string that identifies the ShortCode * resources to read * @param string $shortCode Filter by ShortCode */ public function __construct($friendlyName = Values::NONE, $shortCode = Values::NONE) { $this->options['friendlyName'] = $friendlyName; $this->options['shortCode'] = $shortCode; } /** * The string that identifies the ShortCode resources to read. * * @param string $friendlyName The string that identifies the ShortCode * resources to read * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * Only show the ShortCode resources that match this pattern. You can specify partial numbers and use '*' as a wildcard for any digit. * * @param string $shortCode Filter by ShortCode * @return $this Fluent Builder */ public function setShortCode($shortCode) { $this->options['shortCode'] = $shortCode; 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.ReadShortCodeOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/NewSigningKeyList.php 0000644 00000003436 15002236443 0017210 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; class NewSigningKeyList extends ListResource { /** * Construct the NewSigningKeyList * * @param Version $version Version that contains the resource * @param string $accountSid A 34 character string that uniquely identifies * this resource. * @return \Twilio\Rest\Api\V2010\Account\NewSigningKeyList */ public function __construct(Version $version, $accountSid) { parent::__construct($version); // Path Solution $this->solution = array('accountSid' => $accountSid, ); $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/SigningKeys.json'; } /** * Create a new NewSigningKeyInstance * * @param array|Options $options Optional Arguments * @return NewSigningKeyInstance Newly created NewSigningKeyInstance * @throws TwilioException When an HTTP error occurs. */ public function create($options = array()) { $options = new Values($options); $data = Values::of(array('FriendlyName' => $options['friendlyName'], )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new NewSigningKeyInstance($this->version, $payload, $this->solution['accountSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.NewSigningKeyList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/NewKeyList.php 0000644 00000003337 15002236443 0015671 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; class NewKeyList extends ListResource { /** * Construct the NewKeyList * * @param Version $version Version that contains the resource * @param string $accountSid A 34 character string that uniquely identifies * this resource. * @return \Twilio\Rest\Api\V2010\Account\NewKeyList */ public function __construct(Version $version, $accountSid) { parent::__construct($version); // Path Solution $this->solution = array('accountSid' => $accountSid, ); $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/Keys.json'; } /** * Create a new NewKeyInstance * * @param array|Options $options Optional Arguments * @return NewKeyInstance Newly created NewKeyInstance * @throws TwilioException When an HTTP error occurs. */ public function create($options = array()) { $options = new Values($options); $data = Values::of(array('FriendlyName' => $options['friendlyName'], )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new NewKeyInstance($this->version, $payload, $this->solution['accountSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.NewKeyList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/KeyList.php 0000644 00000011457 15002236443 0015221 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\ListResource; use Twilio\Values; use Twilio\Version; class KeyList extends ListResource { /** * Construct the KeyList * * @param Version $version Version that contains the resource * @param string $accountSid A 34 character string that uniquely identifies * this resource. * @return \Twilio\Rest\Api\V2010\Account\KeyList */ public function __construct(Version $version, $accountSid) { parent::__construct($version); // Path Solution $this->solution = array('accountSid' => $accountSid, ); $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/Keys.json'; } /** * Streams KeyInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads KeyInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return KeyInstance[] Array of results */ public function read($limit = null, $pageSize = null) { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of KeyInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of KeyInstance */ public function page($pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $params = Values::of(array( 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new KeyPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of KeyInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of KeyInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new KeyPage($this->version, $response, $this->solution); } /** * Constructs a KeyContext * * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Api\V2010\Account\KeyContext */ public function getContext($sid) { return new KeyContext($this->version, $this->solution['accountSid'], $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.KeyList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/ShortCodePage.php 0000644 00000001373 15002236443 0016320 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Page; class ShortCodePage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new ShortCodeInstance($this->version, $payload, $this->solution['accountSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.ShortCodePage]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/OutgoingCallerIdInstance.php 0000644 00000010600 15002236443 0020502 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $friendlyName * @property string $accountSid * @property string $phoneNumber * @property string $uri */ class OutgoingCallerIdInstance extends InstanceResource { /** * Initialize the OutgoingCallerIdInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the Account that created the resource * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Api\V2010\Account\OutgoingCallerIdInstance */ public function __construct(Version $version, array $payload, $accountSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'sid' => Values::array_get($payload, 'sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'phoneNumber' => Values::array_get($payload, 'phone_number'), 'uri' => Values::array_get($payload, 'uri'), ); $this->solution = array('accountSid' => $accountSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Api\V2010\Account\OutgoingCallerIdContext Context for * this * OutgoingCallerIdInstance */ protected function proxy() { if (!$this->context) { $this->context = new OutgoingCallerIdContext( $this->version, $this->solution['accountSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch a OutgoingCallerIdInstance * * @return OutgoingCallerIdInstance Fetched OutgoingCallerIdInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Update the OutgoingCallerIdInstance * * @param array|Options $options Optional Arguments * @return OutgoingCallerIdInstance Updated OutgoingCallerIdInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Deletes the OutgoingCallerIdInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.OutgoingCallerIdInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/NotificationInstance.php 0000644 00000011267 15002236443 0017747 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property string $apiVersion * @property string $callSid * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $errorCode * @property string $log * @property \DateTime $messageDate * @property string $messageText * @property string $moreInfo * @property string $requestMethod * @property string $requestUrl * @property string $requestVariables * @property string $responseBody * @property string $responseHeaders * @property string $sid * @property string $uri */ class NotificationInstance extends InstanceResource { /** * Initialize the NotificationInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the Account that created the resource * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Api\V2010\Account\NotificationInstance */ public function __construct(Version $version, array $payload, $accountSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'accountSid' => Values::array_get($payload, 'account_sid'), 'apiVersion' => Values::array_get($payload, 'api_version'), 'callSid' => Values::array_get($payload, 'call_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'errorCode' => Values::array_get($payload, 'error_code'), 'log' => Values::array_get($payload, 'log'), 'messageDate' => Deserialize::dateTime(Values::array_get($payload, 'message_date')), 'messageText' => Values::array_get($payload, 'message_text'), 'moreInfo' => Values::array_get($payload, 'more_info'), 'requestMethod' => Values::array_get($payload, 'request_method'), 'requestUrl' => Values::array_get($payload, 'request_url'), 'requestVariables' => Values::array_get($payload, 'request_variables'), 'responseBody' => Values::array_get($payload, 'response_body'), 'responseHeaders' => Values::array_get($payload, 'response_headers'), 'sid' => Values::array_get($payload, 'sid'), 'uri' => Values::array_get($payload, 'uri'), ); $this->solution = array('accountSid' => $accountSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Api\V2010\Account\NotificationContext Context for this * NotificationInstance */ protected function proxy() { if (!$this->context) { $this->context = new NotificationContext( $this->version, $this->solution['accountSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch a NotificationInstance * * @return NotificationInstance Fetched NotificationInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.NotificationInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/KeyOptions.php 0000644 00000003015 15002236443 0015730 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Options; use Twilio\Values; abstract class KeyOptions { /** * @param string $friendlyName A string to describe the resource * @return UpdateKeyOptions Options builder */ public static function update($friendlyName = Values::NONE) { return new UpdateKeyOptions($friendlyName); } } class UpdateKeyOptions extends Options { /** * @param string $friendlyName A string to describe the resource */ public function __construct($friendlyName = Values::NONE) { $this->options['friendlyName'] = $friendlyName; } /** * A descriptive string that you create to describe the resource. It can be up to 64 characters long. * * @param string $friendlyName A string to describe the resource * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; 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.UpdateKeyOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/ShortCodeInstance.php 0000644 00000010744 15002236443 0017212 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property string $apiVersion * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $friendlyName * @property string $shortCode * @property string $sid * @property string $smsFallbackMethod * @property string $smsFallbackUrl * @property string $smsMethod * @property string $smsUrl * @property string $uri */ class ShortCodeInstance extends InstanceResource { /** * Initialize the ShortCodeInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the Account that created this resource * @param string $sid The unique string that identifies this resource * @return \Twilio\Rest\Api\V2010\Account\ShortCodeInstance */ public function __construct(Version $version, array $payload, $accountSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'accountSid' => Values::array_get($payload, 'account_sid'), 'apiVersion' => Values::array_get($payload, 'api_version'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'shortCode' => Values::array_get($payload, 'short_code'), 'sid' => Values::array_get($payload, 'sid'), 'smsFallbackMethod' => Values::array_get($payload, 'sms_fallback_method'), 'smsFallbackUrl' => Values::array_get($payload, 'sms_fallback_url'), 'smsMethod' => Values::array_get($payload, 'sms_method'), 'smsUrl' => Values::array_get($payload, 'sms_url'), 'uri' => Values::array_get($payload, 'uri'), ); $this->solution = array('accountSid' => $accountSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Api\V2010\Account\ShortCodeContext Context for this * ShortCodeInstance */ protected function proxy() { if (!$this->context) { $this->context = new ShortCodeContext( $this->version, $this->solution['accountSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch a ShortCodeInstance * * @return ShortCodeInstance Fetched ShortCodeInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Update the ShortCodeInstance * * @param array|Options $options Optional Arguments * @return ShortCodeInstance Updated ShortCodeInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.ShortCodeInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/MessageContext.php 0000644 00000012117 15002236443 0016560 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Rest\Api\V2010\Account\Message\FeedbackList; use Twilio\Rest\Api\V2010\Account\Message\MediaList; use Twilio\Values; use Twilio\Version; /** * @property \Twilio\Rest\Api\V2010\Account\Message\MediaList $media * @property \Twilio\Rest\Api\V2010\Account\Message\FeedbackList $feedback * @method \Twilio\Rest\Api\V2010\Account\Message\MediaContext media(string $sid) */ class MessageContext extends InstanceContext { protected $_media = null; protected $_feedback = null; /** * Initialize the MessageContext * * @param \Twilio\Version $version Version that contains the resource * @param string $accountSid The SID of the Account that created the resource * to fetch * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Api\V2010\Account\MessageContext */ public function __construct(Version $version, $accountSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array('accountSid' => $accountSid, 'sid' => $sid, ); $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/Messages/' . \rawurlencode($sid) . '.json'; } /** * Deletes the MessageInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Fetch a MessageInstance * * @return MessageInstance Fetched MessageInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new MessageInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['sid'] ); } /** * Update the MessageInstance * * @param string $body The text of the message you want to send * @return MessageInstance Updated MessageInstance * @throws TwilioException When an HTTP error occurs. */ public function update($body) { $data = Values::of(array('Body' => $body, )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new MessageInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['sid'] ); } /** * Access the media * * @return \Twilio\Rest\Api\V2010\Account\Message\MediaList */ protected function getMedia() { if (!$this->_media) { $this->_media = new MediaList( $this->version, $this->solution['accountSid'], $this->solution['sid'] ); } return $this->_media; } /** * Access the feedback * * @return \Twilio\Rest\Api\V2010\Account\Message\FeedbackList */ protected function getFeedback() { if (!$this->_feedback) { $this->_feedback = new FeedbackList( $this->version, $this->solution['accountSid'], $this->solution['sid'] ); } return $this->_feedback; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get($name) { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.MessageContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/SigningKeyContext.php 0000644 00000005521 15002236443 0017244 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Values; use Twilio\Version; class SigningKeyContext extends InstanceContext { /** * Initialize the SigningKeyContext * * @param \Twilio\Version $version Version that contains the resource * @param string $accountSid The account_sid * @param string $sid The sid * @return \Twilio\Rest\Api\V2010\Account\SigningKeyContext */ public function __construct(Version $version, $accountSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array('accountSid' => $accountSid, 'sid' => $sid, ); $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/SigningKeys/' . \rawurlencode($sid) . '.json'; } /** * Fetch a SigningKeyInstance * * @return SigningKeyInstance Fetched SigningKeyInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new SigningKeyInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['sid'] ); } /** * Update the SigningKeyInstance * * @param array|Options $options Optional Arguments * @return SigningKeyInstance Updated SigningKeyInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { $options = new Values($options); $data = Values::of(array('FriendlyName' => $options['friendlyName'], )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new SigningKeyInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['sid'] ); } /** * Deletes the SigningKeyInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.SigningKeyContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/CallContext.php 0000644 00000014467 15002236443 0016061 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Rest\Api\V2010\Account\Call\FeedbackList; use Twilio\Rest\Api\V2010\Account\Call\NotificationList; use Twilio\Rest\Api\V2010\Account\Call\RecordingList; use Twilio\Values; use Twilio\Version; /** * @property \Twilio\Rest\Api\V2010\Account\Call\RecordingList $recordings * @property \Twilio\Rest\Api\V2010\Account\Call\NotificationList $notifications * @property \Twilio\Rest\Api\V2010\Account\Call\FeedbackList $feedback * @method \Twilio\Rest\Api\V2010\Account\Call\RecordingContext recordings(string $sid) * @method \Twilio\Rest\Api\V2010\Account\Call\NotificationContext notifications(string $sid) * @method \Twilio\Rest\Api\V2010\Account\Call\FeedbackContext feedback() */ class CallContext extends InstanceContext { protected $_recordings = null; protected $_notifications = null; protected $_feedback = null; /** * Initialize the CallContext * * @param \Twilio\Version $version Version that contains the resource * @param string $accountSid The SID of the Account that created the * resource(s) to fetch * @param string $sid The SID of the Call resource to fetch * @return \Twilio\Rest\Api\V2010\Account\CallContext */ public function __construct(Version $version, $accountSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array('accountSid' => $accountSid, 'sid' => $sid, ); $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/Calls/' . \rawurlencode($sid) . '.json'; } /** * Deletes the CallInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Fetch a CallInstance * * @return CallInstance Fetched CallInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new CallInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['sid'] ); } /** * Update the CallInstance * * @param array|Options $options Optional Arguments * @return CallInstance Updated CallInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { $options = new Values($options); $data = Values::of(array( 'Url' => $options['url'], 'Method' => $options['method'], 'Status' => $options['status'], 'FallbackUrl' => $options['fallbackUrl'], 'FallbackMethod' => $options['fallbackMethod'], 'StatusCallback' => $options['statusCallback'], 'StatusCallbackMethod' => $options['statusCallbackMethod'], 'Twiml' => $options['twiml'], )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new CallInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['sid'] ); } /** * Access the recordings * * @return \Twilio\Rest\Api\V2010\Account\Call\RecordingList */ protected function getRecordings() { if (!$this->_recordings) { $this->_recordings = new RecordingList( $this->version, $this->solution['accountSid'], $this->solution['sid'] ); } return $this->_recordings; } /** * Access the notifications * * @return \Twilio\Rest\Api\V2010\Account\Call\NotificationList */ protected function getNotifications() { if (!$this->_notifications) { $this->_notifications = new NotificationList( $this->version, $this->solution['accountSid'], $this->solution['sid'] ); } return $this->_notifications; } /** * Access the feedback * * @return \Twilio\Rest\Api\V2010\Account\Call\FeedbackList */ protected function getFeedback() { if (!$this->_feedback) { $this->_feedback = new FeedbackList( $this->version, $this->solution['accountSid'], $this->solution['sid'] ); } return $this->_feedback; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get($name) { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.CallContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/TranscriptionContext.php 0000644 00000004362 15002236443 0020036 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; class TranscriptionContext extends InstanceContext { /** * Initialize the TranscriptionContext * * @param \Twilio\Version $version Version that contains the resource * @param string $accountSid The SID of the Account that created the resource * to fetch * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Api\V2010\Account\TranscriptionContext */ public function __construct(Version $version, $accountSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array('accountSid' => $accountSid, 'sid' => $sid, ); $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/Transcriptions/' . \rawurlencode($sid) . '.json'; } /** * Fetch a TranscriptionInstance * * @return TranscriptionInstance Fetched TranscriptionInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new TranscriptionInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['sid'] ); } /** * Deletes the TranscriptionInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.TranscriptionContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/QueueContext.php 0000644 00000011233 15002236443 0016256 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Rest\Api\V2010\Account\Queue\MemberList; use Twilio\Values; use Twilio\Version; /** * @property \Twilio\Rest\Api\V2010\Account\Queue\MemberList $members * @method \Twilio\Rest\Api\V2010\Account\Queue\MemberContext members(string $callSid) */ class QueueContext extends InstanceContext { protected $_members = null; /** * Initialize the QueueContext * * @param \Twilio\Version $version Version that contains the resource * @param string $accountSid The SID of the Account that created the * resource(s) to fetch * @param string $sid The unique string that identifies this resource * @return \Twilio\Rest\Api\V2010\Account\QueueContext */ public function __construct(Version $version, $accountSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array('accountSid' => $accountSid, 'sid' => $sid, ); $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/Queues/' . \rawurlencode($sid) . '.json'; } /** * Fetch a QueueInstance * * @return QueueInstance Fetched QueueInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new QueueInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['sid'] ); } /** * Update the QueueInstance * * @param array|Options $options Optional Arguments * @return QueueInstance Updated QueueInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { $options = new Values($options); $data = Values::of(array( 'FriendlyName' => $options['friendlyName'], 'MaxSize' => $options['maxSize'], )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new QueueInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['sid'] ); } /** * Deletes the QueueInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Access the members * * @return \Twilio\Rest\Api\V2010\Account\Queue\MemberList */ protected function getMembers() { if (!$this->_members) { $this->_members = new MemberList( $this->version, $this->solution['accountSid'], $this->solution['sid'] ); } return $this->_members; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get($name) { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.QueueContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/ApplicationContext.php 0000644 00000007552 15002236443 0017446 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class ApplicationContext extends InstanceContext { /** * Initialize the ApplicationContext * * @param \Twilio\Version $version Version that contains the resource * @param string $accountSid The SID of the Account that created the resource * to fetch * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Api\V2010\Account\ApplicationContext */ public function __construct(Version $version, $accountSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array('accountSid' => $accountSid, 'sid' => $sid, ); $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/Applications/' . \rawurlencode($sid) . '.json'; } /** * Deletes the ApplicationInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Fetch a ApplicationInstance * * @return ApplicationInstance Fetched ApplicationInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new ApplicationInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['sid'] ); } /** * Update the ApplicationInstance * * @param array|Options $options Optional Arguments * @return ApplicationInstance Updated ApplicationInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { $options = new Values($options); $data = Values::of(array( 'FriendlyName' => $options['friendlyName'], 'ApiVersion' => $options['apiVersion'], 'VoiceUrl' => $options['voiceUrl'], 'VoiceMethod' => $options['voiceMethod'], 'VoiceFallbackUrl' => $options['voiceFallbackUrl'], 'VoiceFallbackMethod' => $options['voiceFallbackMethod'], 'StatusCallback' => $options['statusCallback'], 'StatusCallbackMethod' => $options['statusCallbackMethod'], 'VoiceCallerIdLookup' => Serialize::booleanToString($options['voiceCallerIdLookup']), 'SmsUrl' => $options['smsUrl'], 'SmsMethod' => $options['smsMethod'], 'SmsFallbackUrl' => $options['smsFallbackUrl'], 'SmsFallbackMethod' => $options['smsFallbackMethod'], 'SmsStatusCallback' => $options['smsStatusCallback'], 'MessageStatusCallback' => $options['messageStatusCallback'], )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new ApplicationInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.ApplicationContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/AddressOptions.php 0000644 00000027645 15002236443 0016604 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Options; use Twilio\Values; abstract class AddressOptions { /** * @param string $friendlyName A string to describe the new resource * @param bool $emergencyEnabled Whether to enable emergency calling on the new * address * @param bool $autoCorrectAddress Whether we should automatically correct the * address * @return CreateAddressOptions Options builder */ public static function create($friendlyName = Values::NONE, $emergencyEnabled = Values::NONE, $autoCorrectAddress = Values::NONE) { return new CreateAddressOptions($friendlyName, $emergencyEnabled, $autoCorrectAddress); } /** * @param string $friendlyName A string to describe the resource * @param string $customerName The name to associate with the address * @param string $street The number and street address of the address * @param string $city The city of the address * @param string $region The state or region of the address * @param string $postalCode The postal code of the address * @param bool $emergencyEnabled Whether to enable emergency calling on the * address * @param bool $autoCorrectAddress Whether we should automatically correct the * address * @return UpdateAddressOptions Options builder */ public static function update($friendlyName = Values::NONE, $customerName = Values::NONE, $street = Values::NONE, $city = Values::NONE, $region = Values::NONE, $postalCode = Values::NONE, $emergencyEnabled = Values::NONE, $autoCorrectAddress = Values::NONE) { return new UpdateAddressOptions($friendlyName, $customerName, $street, $city, $region, $postalCode, $emergencyEnabled, $autoCorrectAddress); } /** * @param string $customerName The `customer_name` of the Address resources to * read * @param string $friendlyName The string that identifies the Address resources * to read * @param string $isoCountry The ISO country code of the Address resources to * read * @return ReadAddressOptions Options builder */ public static function read($customerName = Values::NONE, $friendlyName = Values::NONE, $isoCountry = Values::NONE) { return new ReadAddressOptions($customerName, $friendlyName, $isoCountry); } } class CreateAddressOptions extends Options { /** * @param string $friendlyName A string to describe the new resource * @param bool $emergencyEnabled Whether to enable emergency calling on the new * address * @param bool $autoCorrectAddress Whether we should automatically correct the * address */ public function __construct($friendlyName = Values::NONE, $emergencyEnabled = Values::NONE, $autoCorrectAddress = Values::NONE) { $this->options['friendlyName'] = $friendlyName; $this->options['emergencyEnabled'] = $emergencyEnabled; $this->options['autoCorrectAddress'] = $autoCorrectAddress; } /** * A descriptive string that you create to describe the new address. It can be up to 64 characters long. * * @param string $friendlyName A string to describe the new resource * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * Whether to enable emergency calling on the new address. Can be: `true` or `false`. * * @param bool $emergencyEnabled Whether to enable emergency calling on the new * address * @return $this Fluent Builder */ public function setEmergencyEnabled($emergencyEnabled) { $this->options['emergencyEnabled'] = $emergencyEnabled; return $this; } /** * Whether we should automatically correct the address. Can be: `true` or `false` and the default is `true`. If empty or `true`, we will correct the address you provide if necessary. If `false`, we won't alter the address you provide. * * @param bool $autoCorrectAddress Whether we should automatically correct the * address * @return $this Fluent Builder */ public function setAutoCorrectAddress($autoCorrectAddress) { $this->options['autoCorrectAddress'] = $autoCorrectAddress; 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.CreateAddressOptions ' . \implode(' ', $options) . ']'; } } class UpdateAddressOptions extends Options { /** * @param string $friendlyName A string to describe the resource * @param string $customerName The name to associate with the address * @param string $street The number and street address of the address * @param string $city The city of the address * @param string $region The state or region of the address * @param string $postalCode The postal code of the address * @param bool $emergencyEnabled Whether to enable emergency calling on the * address * @param bool $autoCorrectAddress Whether we should automatically correct the * address */ public function __construct($friendlyName = Values::NONE, $customerName = Values::NONE, $street = Values::NONE, $city = Values::NONE, $region = Values::NONE, $postalCode = Values::NONE, $emergencyEnabled = Values::NONE, $autoCorrectAddress = Values::NONE) { $this->options['friendlyName'] = $friendlyName; $this->options['customerName'] = $customerName; $this->options['street'] = $street; $this->options['city'] = $city; $this->options['region'] = $region; $this->options['postalCode'] = $postalCode; $this->options['emergencyEnabled'] = $emergencyEnabled; $this->options['autoCorrectAddress'] = $autoCorrectAddress; } /** * A descriptive string that you create to describe the address. It can be up to 64 characters long. * * @param string $friendlyName A string to describe the resource * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The name to associate with the address. * * @param string $customerName The name to associate with the address * @return $this Fluent Builder */ public function setCustomerName($customerName) { $this->options['customerName'] = $customerName; return $this; } /** * The number and street address of the address. * * @param string $street The number and street address of the address * @return $this Fluent Builder */ public function setStreet($street) { $this->options['street'] = $street; return $this; } /** * The city of the address. * * @param string $city The city of the address * @return $this Fluent Builder */ public function setCity($city) { $this->options['city'] = $city; return $this; } /** * The state or region of the address. * * @param string $region The state or region of the address * @return $this Fluent Builder */ public function setRegion($region) { $this->options['region'] = $region; return $this; } /** * The postal code of the address. * * @param string $postalCode The postal code of the address * @return $this Fluent Builder */ public function setPostalCode($postalCode) { $this->options['postalCode'] = $postalCode; return $this; } /** * Whether to enable emergency calling on the address. Can be: `true` or `false`. * * @param bool $emergencyEnabled Whether to enable emergency calling on the * address * @return $this Fluent Builder */ public function setEmergencyEnabled($emergencyEnabled) { $this->options['emergencyEnabled'] = $emergencyEnabled; return $this; } /** * Whether we should automatically correct the address. Can be: `true` or `false` and the default is `true`. If empty or `true`, we will correct the address you provide if necessary. If `false`, we won't alter the address you provide. * * @param bool $autoCorrectAddress Whether we should automatically correct the * address * @return $this Fluent Builder */ public function setAutoCorrectAddress($autoCorrectAddress) { $this->options['autoCorrectAddress'] = $autoCorrectAddress; 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.UpdateAddressOptions ' . \implode(' ', $options) . ']'; } } class ReadAddressOptions extends Options { /** * @param string $customerName The `customer_name` of the Address resources to * read * @param string $friendlyName The string that identifies the Address resources * to read * @param string $isoCountry The ISO country code of the Address resources to * read */ public function __construct($customerName = Values::NONE, $friendlyName = Values::NONE, $isoCountry = Values::NONE) { $this->options['customerName'] = $customerName; $this->options['friendlyName'] = $friendlyName; $this->options['isoCountry'] = $isoCountry; } /** * The `customer_name` of the Address resources to read. * * @param string $customerName The `customer_name` of the Address resources to * read * @return $this Fluent Builder */ public function setCustomerName($customerName) { $this->options['customerName'] = $customerName; return $this; } /** * The string that identifies the Address resources to read. * * @param string $friendlyName The string that identifies the Address resources * to read * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The ISO country code of the Address resources to read. * * @param string $isoCountry The ISO country code of the Address resources to * read * @return $this Fluent Builder */ public function setIsoCountry($isoCountry) { $this->options['isoCountry'] = $isoCountry; 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.ReadAddressOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/RecordingInstance.php 0000644 00000012737 15002236443 0017240 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property string $apiVersion * @property string $callSid * @property string $conferenceSid * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property \DateTime $startTime * @property string $duration * @property string $sid * @property string $price * @property string $priceUnit * @property string $status * @property int $channels * @property string $source * @property int $errorCode * @property string $uri * @property array $encryptionDetails * @property array $subresourceUris */ class RecordingInstance extends InstanceResource { protected $_transcriptions = null; protected $_addOnResults = null; /** * Initialize the RecordingInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the Account that created the resource * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Api\V2010\Account\RecordingInstance */ public function __construct(Version $version, array $payload, $accountSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'accountSid' => Values::array_get($payload, 'account_sid'), 'apiVersion' => Values::array_get($payload, 'api_version'), 'callSid' => Values::array_get($payload, 'call_sid'), 'conferenceSid' => Values::array_get($payload, 'conference_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'startTime' => Deserialize::dateTime(Values::array_get($payload, 'start_time')), 'duration' => Values::array_get($payload, 'duration'), 'sid' => Values::array_get($payload, 'sid'), 'price' => Values::array_get($payload, 'price'), 'priceUnit' => Values::array_get($payload, 'price_unit'), 'status' => Values::array_get($payload, 'status'), 'channels' => Values::array_get($payload, 'channels'), 'source' => Values::array_get($payload, 'source'), 'errorCode' => Values::array_get($payload, 'error_code'), 'uri' => Values::array_get($payload, 'uri'), 'encryptionDetails' => Values::array_get($payload, 'encryption_details'), 'subresourceUris' => Values::array_get($payload, 'subresource_uris'), ); $this->solution = array('accountSid' => $accountSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Api\V2010\Account\RecordingContext Context for this * RecordingInstance */ protected function proxy() { if (!$this->context) { $this->context = new RecordingContext( $this->version, $this->solution['accountSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch a RecordingInstance * * @return RecordingInstance Fetched RecordingInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the RecordingInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Access the transcriptions * * @return \Twilio\Rest\Api\V2010\Account\Recording\TranscriptionList */ protected function getTranscriptions() { return $this->proxy()->transcriptions; } /** * Access the addOnResults * * @return \Twilio\Rest\Api\V2010\Account\Recording\AddOnResultList */ protected function getAddOnResults() { return $this->proxy()->addOnResults; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.RecordingInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/ConferenceOptions.php 0000644 00000025322 15002236443 0017254 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Options; use Twilio\Values; abstract class ConferenceOptions { /** * @param string $dateCreatedBefore The `YYYY-MM-DD` value of the resources to * read * @param string $dateCreated The `YYYY-MM-DD` value of the resources to read * @param string $dateCreatedAfter The `YYYY-MM-DD` value of the resources to * read * @param string $dateUpdatedBefore The `YYYY-MM-DD` value of the resources to * read * @param string $dateUpdated The `YYYY-MM-DD` value of the resources to read * @param string $dateUpdatedAfter The `YYYY-MM-DD` value of the resources to * read * @param string $friendlyName The string that identifies the Conference * resources to read * @param string $status The status of the resources to read * @return ReadConferenceOptions Options builder */ public static function read($dateCreatedBefore = Values::NONE, $dateCreated = Values::NONE, $dateCreatedAfter = Values::NONE, $dateUpdatedBefore = Values::NONE, $dateUpdated = Values::NONE, $dateUpdatedAfter = Values::NONE, $friendlyName = Values::NONE, $status = Values::NONE) { return new ReadConferenceOptions($dateCreatedBefore, $dateCreated, $dateCreatedAfter, $dateUpdatedBefore, $dateUpdated, $dateUpdatedAfter, $friendlyName, $status); } /** * @param string $status The new status of the resource * @param string $announceUrl The URL we should call to announce something into * the conference * @param string $announceMethod he HTTP method used to call announce_url * @return UpdateConferenceOptions Options builder */ public static function update($status = Values::NONE, $announceUrl = Values::NONE, $announceMethod = Values::NONE) { return new UpdateConferenceOptions($status, $announceUrl, $announceMethod); } } class ReadConferenceOptions extends Options { /** * @param string $dateCreatedBefore The `YYYY-MM-DD` value of the resources to * read * @param string $dateCreated The `YYYY-MM-DD` value of the resources to read * @param string $dateCreatedAfter The `YYYY-MM-DD` value of the resources to * read * @param string $dateUpdatedBefore The `YYYY-MM-DD` value of the resources to * read * @param string $dateUpdated The `YYYY-MM-DD` value of the resources to read * @param string $dateUpdatedAfter The `YYYY-MM-DD` value of the resources to * read * @param string $friendlyName The string that identifies the Conference * resources to read * @param string $status The status of the resources to read */ public function __construct($dateCreatedBefore = Values::NONE, $dateCreated = Values::NONE, $dateCreatedAfter = Values::NONE, $dateUpdatedBefore = Values::NONE, $dateUpdated = Values::NONE, $dateUpdatedAfter = Values::NONE, $friendlyName = Values::NONE, $status = Values::NONE) { $this->options['dateCreatedBefore'] = $dateCreatedBefore; $this->options['dateCreated'] = $dateCreated; $this->options['dateCreatedAfter'] = $dateCreatedAfter; $this->options['dateUpdatedBefore'] = $dateUpdatedBefore; $this->options['dateUpdated'] = $dateUpdated; $this->options['dateUpdatedAfter'] = $dateUpdatedAfter; $this->options['friendlyName'] = $friendlyName; $this->options['status'] = $status; } /** * The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that started on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that started on or after midnight on a date, use `>=YYYY-MM-DD`. * * @param string $dateCreatedBefore The `YYYY-MM-DD` value of the resources to * read * @return $this Fluent Builder */ public function setDateCreatedBefore($dateCreatedBefore) { $this->options['dateCreatedBefore'] = $dateCreatedBefore; return $this; } /** * The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that started on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that started on or after midnight on a date, use `>=YYYY-MM-DD`. * * @param string $dateCreated The `YYYY-MM-DD` value of the resources to read * @return $this Fluent Builder */ public function setDateCreated($dateCreated) { $this->options['dateCreated'] = $dateCreated; return $this; } /** * The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that started on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that started on or after midnight on a date, use `>=YYYY-MM-DD`. * * @param string $dateCreatedAfter The `YYYY-MM-DD` value of the resources to * read * @return $this Fluent Builder */ public function setDateCreatedAfter($dateCreatedAfter) { $this->options['dateCreatedAfter'] = $dateCreatedAfter; return $this; } /** * The `date_updated` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that were last updated on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that were last updated on or after midnight on a given date, use `>=YYYY-MM-DD`. * * @param string $dateUpdatedBefore The `YYYY-MM-DD` value of the resources to * read * @return $this Fluent Builder */ public function setDateUpdatedBefore($dateUpdatedBefore) { $this->options['dateUpdatedBefore'] = $dateUpdatedBefore; return $this; } /** * The `date_updated` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that were last updated on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that were last updated on or after midnight on a given date, use `>=YYYY-MM-DD`. * * @param string $dateUpdated The `YYYY-MM-DD` value of the resources to read * @return $this Fluent Builder */ public function setDateUpdated($dateUpdated) { $this->options['dateUpdated'] = $dateUpdated; return $this; } /** * The `date_updated` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that were last updated on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that were last updated on or after midnight on a given date, use `>=YYYY-MM-DD`. * * @param string $dateUpdatedAfter The `YYYY-MM-DD` value of the resources to * read * @return $this Fluent Builder */ public function setDateUpdatedAfter($dateUpdatedAfter) { $this->options['dateUpdatedAfter'] = $dateUpdatedAfter; return $this; } /** * The string that identifies the Conference resources to read. * * @param string $friendlyName The string that identifies the Conference * resources to read * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The status of the resources to read. Can be: `init`, `in-progress`, or `completed`. * * @param string $status The status of the resources to read * @return $this Fluent Builder */ public function setStatus($status) { $this->options['status'] = $status; 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.ReadConferenceOptions ' . \implode(' ', $options) . ']'; } } class UpdateConferenceOptions extends Options { /** * @param string $status The new status of the resource * @param string $announceUrl The URL we should call to announce something into * the conference * @param string $announceMethod he HTTP method used to call announce_url */ public function __construct($status = Values::NONE, $announceUrl = Values::NONE, $announceMethod = Values::NONE) { $this->options['status'] = $status; $this->options['announceUrl'] = $announceUrl; $this->options['announceMethod'] = $announceMethod; } /** * The new status of the resource. Can be: Can be: `init`, `in-progress`, or `completed`. Specifying `completed` will end the conference and hang up all participants * * @param string $status The new status of the resource * @return $this Fluent Builder */ public function setStatus($status) { $this->options['status'] = $status; return $this; } /** * The URL we should call to announce something into the conference. The URL can return an MP3, a WAV, or a TwiML document with `<Play>` or `<Say>`. * * @param string $announceUrl The URL we should call to announce something into * the conference * @return $this Fluent Builder */ public function setAnnounceUrl($announceUrl) { $this->options['announceUrl'] = $announceUrl; return $this; } /** * The HTTP method used to call `announce_url`. Can be: `GET` or `POST` and the default is `POST` * * @param string $announceMethod he HTTP method used to call announce_url * @return $this Fluent Builder */ public function setAnnounceMethod($announceMethod) { $this->options['announceMethod'] = $announceMethod; 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.UpdateConferenceOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumberOptions.php 0000644 00000127624 15002236443 0021123 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Options; use Twilio\Values; abstract class IncomingPhoneNumberOptions { /** * @param string $accountSid The SID of the Account that created the resource * to update * @param string $apiVersion The API version to use for incoming calls made to * the phone number * @param string $friendlyName A string to describe the resource * @param string $smsApplicationSid Unique string that identifies the * application * @param string $smsFallbackMethod HTTP method used with sms_fallback_url * @param string $smsFallbackUrl The URL we call when an error occurs while * executing TwiML * @param string $smsMethod The HTTP method to use with sms_url * @param string $smsUrl The URL we should call when the phone number receives * an incoming SMS message * @param string $statusCallback The URL we should call to send status * information to your application * @param string $statusCallbackMethod The HTTP method we should use to call * status_callback * @param string $voiceApplicationSid The SID of the application to handle the * phone number * @param bool $voiceCallerIdLookup Whether to lookup the caller's name * @param string $voiceFallbackMethod The HTTP method used with fallback_url * @param string $voiceFallbackUrl The URL we will call when an error occurs in * TwiML * @param string $voiceMethod The HTTP method used with the voice_url * @param string $voiceUrl The URL we should call when the phone number * receives a call * @param string $emergencyStatus Whether the phone number is enabled for * emergency calling * @param string $emergencyAddressSid The emergency address configuration to * use for emergency calling * @param string $trunkSid SID of the trunk to handle phone calls to the phone * number * @param string $voiceReceiveMode Incoming call type: fax or voice * @param string $identitySid Unique string that identifies the identity * associated with number * @param string $addressSid The SID of the Address resource associated with * the phone number * @param string $bundleSid The SID of the Bundle resource associated with * number * @return UpdateIncomingPhoneNumberOptions Options builder */ public static function update($accountSid = Values::NONE, $apiVersion = Values::NONE, $friendlyName = Values::NONE, $smsApplicationSid = Values::NONE, $smsFallbackMethod = Values::NONE, $smsFallbackUrl = Values::NONE, $smsMethod = Values::NONE, $smsUrl = Values::NONE, $statusCallback = Values::NONE, $statusCallbackMethod = Values::NONE, $voiceApplicationSid = Values::NONE, $voiceCallerIdLookup = Values::NONE, $voiceFallbackMethod = Values::NONE, $voiceFallbackUrl = Values::NONE, $voiceMethod = Values::NONE, $voiceUrl = Values::NONE, $emergencyStatus = Values::NONE, $emergencyAddressSid = Values::NONE, $trunkSid = Values::NONE, $voiceReceiveMode = Values::NONE, $identitySid = Values::NONE, $addressSid = Values::NONE, $bundleSid = Values::NONE) { return new UpdateIncomingPhoneNumberOptions($accountSid, $apiVersion, $friendlyName, $smsApplicationSid, $smsFallbackMethod, $smsFallbackUrl, $smsMethod, $smsUrl, $statusCallback, $statusCallbackMethod, $voiceApplicationSid, $voiceCallerIdLookup, $voiceFallbackMethod, $voiceFallbackUrl, $voiceMethod, $voiceUrl, $emergencyStatus, $emergencyAddressSid, $trunkSid, $voiceReceiveMode, $identitySid, $addressSid, $bundleSid); } /** * @param bool $beta Whether to include new phone numbers * @param string $friendlyName A string that identifies the IncomingPhoneNumber * resources to read * @param string $phoneNumber The phone numbers of the IncomingPhoneNumber * resources to read * @param string $origin Include phone numbers based on their origin. By * default, phone numbers of all origin are included. * @return ReadIncomingPhoneNumberOptions Options builder */ public static function read($beta = Values::NONE, $friendlyName = Values::NONE, $phoneNumber = Values::NONE, $origin = Values::NONE) { return new ReadIncomingPhoneNumberOptions($beta, $friendlyName, $phoneNumber, $origin); } /** * @param string $phoneNumber The phone number to purchase in E.164 format * @param string $areaCode The desired area code for the new phone number * @param string $apiVersion The API version to use for incoming calls made to * the new phone number * @param string $friendlyName A string to describe the new phone number * @param string $smsApplicationSid The SID of the application to handle SMS * messages * @param string $smsFallbackMethod HTTP method used with sms_fallback_url * @param string $smsFallbackUrl The URL we call when an error occurs while * executing TwiML * @param string $smsMethod The HTTP method to use with sms url * @param string $smsUrl The URL we should call when the new phone number * receives an incoming SMS message * @param string $statusCallback The URL we should call to send status * information to your application * @param string $statusCallbackMethod HTTP method we should use to call * status_callback * @param string $voiceApplicationSid The SID of the application to handle the * new phone number * @param bool $voiceCallerIdLookup Whether to lookup the caller's name * @param string $voiceFallbackMethod The HTTP method used with * voice_fallback_url * @param string $voiceFallbackUrl The URL we will call when an error occurs in * TwiML * @param string $voiceMethod The HTTP method used with the voice_url * @param string $voiceUrl The URL we should call when the phone number * receives a call * @param string $emergencyStatus Status determining whether the new phone * number is enabled for emergency calling * @param string $emergencyAddressSid The emergency address configuration to * use for emergency calling * @param string $trunkSid SID of the trunk to handle calls to the new phone * number * @param string $identitySid The SID of the Identity resource to associate * with the new phone number * @param string $addressSid The SID of the Address resource associated with * the phone number * @param string $voiceReceiveMode Incoming call type: fax or voice * @param string $bundleSid The SID of the Bundle resource associated with * number * @return CreateIncomingPhoneNumberOptions Options builder */ public static function create($phoneNumber = Values::NONE, $areaCode = Values::NONE, $apiVersion = Values::NONE, $friendlyName = Values::NONE, $smsApplicationSid = Values::NONE, $smsFallbackMethod = Values::NONE, $smsFallbackUrl = Values::NONE, $smsMethod = Values::NONE, $smsUrl = Values::NONE, $statusCallback = Values::NONE, $statusCallbackMethod = Values::NONE, $voiceApplicationSid = Values::NONE, $voiceCallerIdLookup = Values::NONE, $voiceFallbackMethod = Values::NONE, $voiceFallbackUrl = Values::NONE, $voiceMethod = Values::NONE, $voiceUrl = Values::NONE, $emergencyStatus = Values::NONE, $emergencyAddressSid = Values::NONE, $trunkSid = Values::NONE, $identitySid = Values::NONE, $addressSid = Values::NONE, $voiceReceiveMode = Values::NONE, $bundleSid = Values::NONE) { return new CreateIncomingPhoneNumberOptions($phoneNumber, $areaCode, $apiVersion, $friendlyName, $smsApplicationSid, $smsFallbackMethod, $smsFallbackUrl, $smsMethod, $smsUrl, $statusCallback, $statusCallbackMethod, $voiceApplicationSid, $voiceCallerIdLookup, $voiceFallbackMethod, $voiceFallbackUrl, $voiceMethod, $voiceUrl, $emergencyStatus, $emergencyAddressSid, $trunkSid, $identitySid, $addressSid, $voiceReceiveMode, $bundleSid); } } class UpdateIncomingPhoneNumberOptions extends Options { /** * @param string $accountSid The SID of the Account that created the resource * to update * @param string $apiVersion The API version to use for incoming calls made to * the phone number * @param string $friendlyName A string to describe the resource * @param string $smsApplicationSid Unique string that identifies the * application * @param string $smsFallbackMethod HTTP method used with sms_fallback_url * @param string $smsFallbackUrl The URL we call when an error occurs while * executing TwiML * @param string $smsMethod The HTTP method to use with sms_url * @param string $smsUrl The URL we should call when the phone number receives * an incoming SMS message * @param string $statusCallback The URL we should call to send status * information to your application * @param string $statusCallbackMethod The HTTP method we should use to call * status_callback * @param string $voiceApplicationSid The SID of the application to handle the * phone number * @param bool $voiceCallerIdLookup Whether to lookup the caller's name * @param string $voiceFallbackMethod The HTTP method used with fallback_url * @param string $voiceFallbackUrl The URL we will call when an error occurs in * TwiML * @param string $voiceMethod The HTTP method used with the voice_url * @param string $voiceUrl The URL we should call when the phone number * receives a call * @param string $emergencyStatus Whether the phone number is enabled for * emergency calling * @param string $emergencyAddressSid The emergency address configuration to * use for emergency calling * @param string $trunkSid SID of the trunk to handle phone calls to the phone * number * @param string $voiceReceiveMode Incoming call type: fax or voice * @param string $identitySid Unique string that identifies the identity * associated with number * @param string $addressSid The SID of the Address resource associated with * the phone number * @param string $bundleSid The SID of the Bundle resource associated with * number */ public function __construct($accountSid = Values::NONE, $apiVersion = Values::NONE, $friendlyName = Values::NONE, $smsApplicationSid = Values::NONE, $smsFallbackMethod = Values::NONE, $smsFallbackUrl = Values::NONE, $smsMethod = Values::NONE, $smsUrl = Values::NONE, $statusCallback = Values::NONE, $statusCallbackMethod = Values::NONE, $voiceApplicationSid = Values::NONE, $voiceCallerIdLookup = Values::NONE, $voiceFallbackMethod = Values::NONE, $voiceFallbackUrl = Values::NONE, $voiceMethod = Values::NONE, $voiceUrl = Values::NONE, $emergencyStatus = Values::NONE, $emergencyAddressSid = Values::NONE, $trunkSid = Values::NONE, $voiceReceiveMode = Values::NONE, $identitySid = Values::NONE, $addressSid = Values::NONE, $bundleSid = Values::NONE) { $this->options['accountSid'] = $accountSid; $this->options['apiVersion'] = $apiVersion; $this->options['friendlyName'] = $friendlyName; $this->options['smsApplicationSid'] = $smsApplicationSid; $this->options['smsFallbackMethod'] = $smsFallbackMethod; $this->options['smsFallbackUrl'] = $smsFallbackUrl; $this->options['smsMethod'] = $smsMethod; $this->options['smsUrl'] = $smsUrl; $this->options['statusCallback'] = $statusCallback; $this->options['statusCallbackMethod'] = $statusCallbackMethod; $this->options['voiceApplicationSid'] = $voiceApplicationSid; $this->options['voiceCallerIdLookup'] = $voiceCallerIdLookup; $this->options['voiceFallbackMethod'] = $voiceFallbackMethod; $this->options['voiceFallbackUrl'] = $voiceFallbackUrl; $this->options['voiceMethod'] = $voiceMethod; $this->options['voiceUrl'] = $voiceUrl; $this->options['emergencyStatus'] = $emergencyStatus; $this->options['emergencyAddressSid'] = $emergencyAddressSid; $this->options['trunkSid'] = $trunkSid; $this->options['voiceReceiveMode'] = $voiceReceiveMode; $this->options['identitySid'] = $identitySid; $this->options['addressSid'] = $addressSid; $this->options['bundleSid'] = $bundleSid; } /** * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the IncomingPhoneNumber resource to update. For more information, see [Exchanging Numbers Between Subaccounts](https://www.twilio.com/docs/iam/api/subaccounts#exchanging-numbers). * * @param string $accountSid The SID of the Account that created the resource * to update * @return $this Fluent Builder */ public function setAccountSid($accountSid) { $this->options['accountSid'] = $accountSid; return $this; } /** * The API version to use for incoming calls made to the phone number. The default is `2010-04-01`. * * @param string $apiVersion The API version to use for incoming calls made to * the phone number * @return $this Fluent Builder */ public function setApiVersion($apiVersion) { $this->options['apiVersion'] = $apiVersion; return $this; } /** * A descriptive string that you created to describe this phone number. It can be up to 64 characters long. By default, this is a formatted version of the phone number. * * @param string $friendlyName A string to describe the resource * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The SID of the application that should handle SMS messages sent to the number. If an `sms_application_sid` is present, we ignore all of the `sms_*_url` urls and use those set on the application. * * @param string $smsApplicationSid Unique string that identifies the * application * @return $this Fluent Builder */ public function setSmsApplicationSid($smsApplicationSid) { $this->options['smsApplicationSid'] = $smsApplicationSid; return $this; } /** * The HTTP method that we should use to call `sms_fallback_url`. Can be: `GET` or `POST` and defaults to `POST`. * * @param string $smsFallbackMethod HTTP method used with sms_fallback_url * @return $this Fluent Builder */ public function setSmsFallbackMethod($smsFallbackMethod) { $this->options['smsFallbackMethod'] = $smsFallbackMethod; return $this; } /** * The URL that we should call when an error occurs while requesting or executing the TwiML defined by `sms_url`. * * @param string $smsFallbackUrl The URL we call when an error occurs while * executing TwiML * @return $this Fluent Builder */ public function setSmsFallbackUrl($smsFallbackUrl) { $this->options['smsFallbackUrl'] = $smsFallbackUrl; return $this; } /** * The HTTP method that we should use to call `sms_url`. Can be: `GET` or `POST` and defaults to `POST`. * * @param string $smsMethod The HTTP method to use with sms_url * @return $this Fluent Builder */ public function setSmsMethod($smsMethod) { $this->options['smsMethod'] = $smsMethod; return $this; } /** * The URL we should call when the phone number receives an incoming SMS message. * * @param string $smsUrl The URL we should call when the phone number receives * an incoming SMS message * @return $this Fluent Builder */ public function setSmsUrl($smsUrl) { $this->options['smsUrl'] = $smsUrl; return $this; } /** * The URL we should call using the `status_callback_method` to send status information to your application. * * @param string $statusCallback The URL we should call to send status * information to your application * @return $this Fluent Builder */ public function setStatusCallback($statusCallback) { $this->options['statusCallback'] = $statusCallback; return $this; } /** * The HTTP method we should use to call `status_callback`. Can be: `GET` or `POST` and defaults to `POST`. * * @param string $statusCallbackMethod The HTTP method we should use to call * status_callback * @return $this Fluent Builder */ public function setStatusCallbackMethod($statusCallbackMethod) { $this->options['statusCallbackMethod'] = $statusCallbackMethod; return $this; } /** * The SID of the application we should use to handle phone calls to the phone number. If a `voice_application_sid` is present, we ignore all of the voice urls and use only those set on the application. Setting a `voice_application_sid` will automatically delete your `trunk_sid` and vice versa. * * @param string $voiceApplicationSid The SID of the application to handle the * phone number * @return $this Fluent Builder */ public function setVoiceApplicationSid($voiceApplicationSid) { $this->options['voiceApplicationSid'] = $voiceApplicationSid; return $this; } /** * Whether to lookup the caller's name from the CNAM database and post it to your app. Can be: `true` or `false` and defaults to `false`. * * @param bool $voiceCallerIdLookup Whether to lookup the caller's name * @return $this Fluent Builder */ public function setVoiceCallerIdLookup($voiceCallerIdLookup) { $this->options['voiceCallerIdLookup'] = $voiceCallerIdLookup; return $this; } /** * The HTTP method that we should use to call `voice_fallback_url`. Can be: `GET` or `POST` and defaults to `POST`. * * @param string $voiceFallbackMethod The HTTP method used with fallback_url * @return $this Fluent Builder */ public function setVoiceFallbackMethod($voiceFallbackMethod) { $this->options['voiceFallbackMethod'] = $voiceFallbackMethod; return $this; } /** * The URL that we should call when an error occurs retrieving or executing the TwiML requested by `url`. * * @param string $voiceFallbackUrl The URL we will call when an error occurs in * TwiML * @return $this Fluent Builder */ public function setVoiceFallbackUrl($voiceFallbackUrl) { $this->options['voiceFallbackUrl'] = $voiceFallbackUrl; return $this; } /** * The HTTP method that we should use to call `voice_url`. Can be: `GET` or `POST` and defaults to `POST`. * * @param string $voiceMethod The HTTP method used with the voice_url * @return $this Fluent Builder */ public function setVoiceMethod($voiceMethod) { $this->options['voiceMethod'] = $voiceMethod; return $this; } /** * The URL that we should call to answer a call to the phone number. The `voice_url` will not be called if a `voice_application_sid` or a `trunk_sid` is set. * * @param string $voiceUrl The URL we should call when the phone number * receives a call * @return $this Fluent Builder */ public function setVoiceUrl($voiceUrl) { $this->options['voiceUrl'] = $voiceUrl; return $this; } /** * The configuration status parameter that determines whether the phone number is enabled for emergency calling. * * @param string $emergencyStatus Whether the phone number is enabled for * emergency calling * @return $this Fluent Builder */ public function setEmergencyStatus($emergencyStatus) { $this->options['emergencyStatus'] = $emergencyStatus; return $this; } /** * The SID of the emergency address configuration to use for emergency calling from this phone number. * * @param string $emergencyAddressSid The emergency address configuration to * use for emergency calling * @return $this Fluent Builder */ public function setEmergencyAddressSid($emergencyAddressSid) { $this->options['emergencyAddressSid'] = $emergencyAddressSid; return $this; } /** * The SID of the Trunk we should use to handle phone calls to the phone number. If a `trunk_sid` is present, we ignore all of the voice urls and voice applications and use only those set on the Trunk. Setting a `trunk_sid` will automatically delete your `voice_application_sid` and vice versa. * * @param string $trunkSid SID of the trunk to handle phone calls to the phone * number * @return $this Fluent Builder */ public function setTrunkSid($trunkSid) { $this->options['trunkSid'] = $trunkSid; return $this; } /** * The configuration parameter for the phone number to receive incoming voice calls or faxes. Can be: `fax` or `voice` and defaults to `voice`. * * @param string $voiceReceiveMode Incoming call type: fax or voice * @return $this Fluent Builder */ public function setVoiceReceiveMode($voiceReceiveMode) { $this->options['voiceReceiveMode'] = $voiceReceiveMode; return $this; } /** * The SID of the Identity resource that we should associate with the phone number. Some regions require an identity to meet local regulations. * * @param string $identitySid Unique string that identifies the identity * associated with number * @return $this Fluent Builder */ public function setIdentitySid($identitySid) { $this->options['identitySid'] = $identitySid; return $this; } /** * The SID of the Address resource we should associate with the phone number. Some regions require addresses to meet local regulations. * * @param string $addressSid The SID of the Address resource associated with * the phone number * @return $this Fluent Builder */ public function setAddressSid($addressSid) { $this->options['addressSid'] = $addressSid; return $this; } /** * The SID of the Bundle resource that you associate with the phone number. Some regions require a Bundle to meet local Regulations. * * @param string $bundleSid The SID of the Bundle resource associated with * number * @return $this Fluent Builder */ public function setBundleSid($bundleSid) { $this->options['bundleSid'] = $bundleSid; 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.UpdateIncomingPhoneNumberOptions ' . \implode(' ', $options) . ']'; } } class ReadIncomingPhoneNumberOptions extends Options { /** * @param bool $beta Whether to include new phone numbers * @param string $friendlyName A string that identifies the IncomingPhoneNumber * resources to read * @param string $phoneNumber The phone numbers of the IncomingPhoneNumber * resources to read * @param string $origin Include phone numbers based on their origin. By * default, phone numbers of all origin are included. */ public function __construct($beta = Values::NONE, $friendlyName = Values::NONE, $phoneNumber = Values::NONE, $origin = Values::NONE) { $this->options['beta'] = $beta; $this->options['friendlyName'] = $friendlyName; $this->options['phoneNumber'] = $phoneNumber; $this->options['origin'] = $origin; } /** * Whether to include phone numbers new to the Twilio platform. Can be: `true` or `false` and the default is `true`. * * @param bool $beta Whether to include new phone numbers * @return $this Fluent Builder */ public function setBeta($beta) { $this->options['beta'] = $beta; return $this; } /** * A string that identifies the IncomingPhoneNumber resources to read. * * @param string $friendlyName A string that identifies the IncomingPhoneNumber * resources to read * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The phone numbers of the IncomingPhoneNumber resources to read. You can specify partial numbers and use '*' as a wildcard for any digit. * * @param string $phoneNumber The phone numbers of the IncomingPhoneNumber * resources to read * @return $this Fluent Builder */ public function setPhoneNumber($phoneNumber) { $this->options['phoneNumber'] = $phoneNumber; return $this; } /** * Whether to include phone numbers based on their origin. Can be: `twilio` or `hosted`. By default, phone numbers of all origin are included. * * @param string $origin Include phone numbers based on their origin. By * default, phone numbers of all origin are included. * @return $this Fluent Builder */ public function setOrigin($origin) { $this->options['origin'] = $origin; 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.ReadIncomingPhoneNumberOptions ' . \implode(' ', $options) . ']'; } } class CreateIncomingPhoneNumberOptions extends Options { /** * @param string $phoneNumber The phone number to purchase in E.164 format * @param string $areaCode The desired area code for the new phone number * @param string $apiVersion The API version to use for incoming calls made to * the new phone number * @param string $friendlyName A string to describe the new phone number * @param string $smsApplicationSid The SID of the application to handle SMS * messages * @param string $smsFallbackMethod HTTP method used with sms_fallback_url * @param string $smsFallbackUrl The URL we call when an error occurs while * executing TwiML * @param string $smsMethod The HTTP method to use with sms url * @param string $smsUrl The URL we should call when the new phone number * receives an incoming SMS message * @param string $statusCallback The URL we should call to send status * information to your application * @param string $statusCallbackMethod HTTP method we should use to call * status_callback * @param string $voiceApplicationSid The SID of the application to handle the * new phone number * @param bool $voiceCallerIdLookup Whether to lookup the caller's name * @param string $voiceFallbackMethod The HTTP method used with * voice_fallback_url * @param string $voiceFallbackUrl The URL we will call when an error occurs in * TwiML * @param string $voiceMethod The HTTP method used with the voice_url * @param string $voiceUrl The URL we should call when the phone number * receives a call * @param string $emergencyStatus Status determining whether the new phone * number is enabled for emergency calling * @param string $emergencyAddressSid The emergency address configuration to * use for emergency calling * @param string $trunkSid SID of the trunk to handle calls to the new phone * number * @param string $identitySid The SID of the Identity resource to associate * with the new phone number * @param string $addressSid The SID of the Address resource associated with * the phone number * @param string $voiceReceiveMode Incoming call type: fax or voice * @param string $bundleSid The SID of the Bundle resource associated with * number */ public function __construct($phoneNumber = Values::NONE, $areaCode = Values::NONE, $apiVersion = Values::NONE, $friendlyName = Values::NONE, $smsApplicationSid = Values::NONE, $smsFallbackMethod = Values::NONE, $smsFallbackUrl = Values::NONE, $smsMethod = Values::NONE, $smsUrl = Values::NONE, $statusCallback = Values::NONE, $statusCallbackMethod = Values::NONE, $voiceApplicationSid = Values::NONE, $voiceCallerIdLookup = Values::NONE, $voiceFallbackMethod = Values::NONE, $voiceFallbackUrl = Values::NONE, $voiceMethod = Values::NONE, $voiceUrl = Values::NONE, $emergencyStatus = Values::NONE, $emergencyAddressSid = Values::NONE, $trunkSid = Values::NONE, $identitySid = Values::NONE, $addressSid = Values::NONE, $voiceReceiveMode = Values::NONE, $bundleSid = Values::NONE) { $this->options['phoneNumber'] = $phoneNumber; $this->options['areaCode'] = $areaCode; $this->options['apiVersion'] = $apiVersion; $this->options['friendlyName'] = $friendlyName; $this->options['smsApplicationSid'] = $smsApplicationSid; $this->options['smsFallbackMethod'] = $smsFallbackMethod; $this->options['smsFallbackUrl'] = $smsFallbackUrl; $this->options['smsMethod'] = $smsMethod; $this->options['smsUrl'] = $smsUrl; $this->options['statusCallback'] = $statusCallback; $this->options['statusCallbackMethod'] = $statusCallbackMethod; $this->options['voiceApplicationSid'] = $voiceApplicationSid; $this->options['voiceCallerIdLookup'] = $voiceCallerIdLookup; $this->options['voiceFallbackMethod'] = $voiceFallbackMethod; $this->options['voiceFallbackUrl'] = $voiceFallbackUrl; $this->options['voiceMethod'] = $voiceMethod; $this->options['voiceUrl'] = $voiceUrl; $this->options['emergencyStatus'] = $emergencyStatus; $this->options['emergencyAddressSid'] = $emergencyAddressSid; $this->options['trunkSid'] = $trunkSid; $this->options['identitySid'] = $identitySid; $this->options['addressSid'] = $addressSid; $this->options['voiceReceiveMode'] = $voiceReceiveMode; $this->options['bundleSid'] = $bundleSid; } /** * The phone number to purchase specified in [E.164](https://www.twilio.com/docs/glossary/what-e164) format. E.164 phone numbers consist of a + followed by the country code and subscriber number without punctuation characters. For example, +14155551234. * * @param string $phoneNumber The phone number to purchase in E.164 format * @return $this Fluent Builder */ public function setPhoneNumber($phoneNumber) { $this->options['phoneNumber'] = $phoneNumber; return $this; } /** * The desired area code for your new incoming phone number. Can be any three-digit, US or Canada area code. We will provision an available phone number within this area code for you. **You must provide an `area_code` or a `phone_number`.** (US and Canada only). * * @param string $areaCode The desired area code for the new phone number * @return $this Fluent Builder */ public function setAreaCode($areaCode) { $this->options['areaCode'] = $areaCode; return $this; } /** * The API version to use for incoming calls made to the new phone number. The default is `2010-04-01`. * * @param string $apiVersion The API version to use for incoming calls made to * the new phone number * @return $this Fluent Builder */ public function setApiVersion($apiVersion) { $this->options['apiVersion'] = $apiVersion; return $this; } /** * A descriptive string that you created to describe the new phone number. It can be up to 64 characters long. By default, this is a formatted version of the new phone number. * * @param string $friendlyName A string to describe the new phone number * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The SID of the application that should handle SMS messages sent to the new phone number. If an `sms_application_sid` is present, we ignore all of the `sms_*_url` urls and use those set on the application. * * @param string $smsApplicationSid The SID of the application to handle SMS * messages * @return $this Fluent Builder */ public function setSmsApplicationSid($smsApplicationSid) { $this->options['smsApplicationSid'] = $smsApplicationSid; return $this; } /** * The HTTP method that we should use to call `sms_fallback_url`. Can be: `GET` or `POST` and defaults to `POST`. * * @param string $smsFallbackMethod HTTP method used with sms_fallback_url * @return $this Fluent Builder */ public function setSmsFallbackMethod($smsFallbackMethod) { $this->options['smsFallbackMethod'] = $smsFallbackMethod; return $this; } /** * The URL that we should call when an error occurs while requesting or executing the TwiML defined by `sms_url`. * * @param string $smsFallbackUrl The URL we call when an error occurs while * executing TwiML * @return $this Fluent Builder */ public function setSmsFallbackUrl($smsFallbackUrl) { $this->options['smsFallbackUrl'] = $smsFallbackUrl; return $this; } /** * The HTTP method that we should use to call `sms_url`. Can be: `GET` or `POST` and defaults to `POST`. * * @param string $smsMethod The HTTP method to use with sms url * @return $this Fluent Builder */ public function setSmsMethod($smsMethod) { $this->options['smsMethod'] = $smsMethod; return $this; } /** * The URL we should call when the new phone number receives an incoming SMS message. * * @param string $smsUrl The URL we should call when the new phone number * receives an incoming SMS message * @return $this Fluent Builder */ public function setSmsUrl($smsUrl) { $this->options['smsUrl'] = $smsUrl; return $this; } /** * The URL we should call using the `status_callback_method` to send status information to your application. * * @param string $statusCallback The URL we should call to send status * information to your application * @return $this Fluent Builder */ public function setStatusCallback($statusCallback) { $this->options['statusCallback'] = $statusCallback; return $this; } /** * The HTTP method we should use to call `status_callback`. Can be: `GET` or `POST` and defaults to `POST`. * * @param string $statusCallbackMethod HTTP method we should use to call * status_callback * @return $this Fluent Builder */ public function setStatusCallbackMethod($statusCallbackMethod) { $this->options['statusCallbackMethod'] = $statusCallbackMethod; return $this; } /** * The SID of the application we should use to handle calls to the new phone number. If a `voice_application_sid` is present, we ignore all of the voice urls and use only those set on the application. Setting a `voice_application_sid` will automatically delete your `trunk_sid` and vice versa. * * @param string $voiceApplicationSid The SID of the application to handle the * new phone number * @return $this Fluent Builder */ public function setVoiceApplicationSid($voiceApplicationSid) { $this->options['voiceApplicationSid'] = $voiceApplicationSid; return $this; } /** * Whether to lookup the caller's name from the CNAM database and post it to your app. Can be: `true` or `false` and defaults to `false`. * * @param bool $voiceCallerIdLookup Whether to lookup the caller's name * @return $this Fluent Builder */ public function setVoiceCallerIdLookup($voiceCallerIdLookup) { $this->options['voiceCallerIdLookup'] = $voiceCallerIdLookup; return $this; } /** * The HTTP method that we should use to call `voice_fallback_url`. Can be: `GET` or `POST` and defaults to `POST`. * * @param string $voiceFallbackMethod The HTTP method used with * voice_fallback_url * @return $this Fluent Builder */ public function setVoiceFallbackMethod($voiceFallbackMethod) { $this->options['voiceFallbackMethod'] = $voiceFallbackMethod; return $this; } /** * The URL that we should call when an error occurs retrieving or executing the TwiML requested by `url`. * * @param string $voiceFallbackUrl The URL we will call when an error occurs in * TwiML * @return $this Fluent Builder */ public function setVoiceFallbackUrl($voiceFallbackUrl) { $this->options['voiceFallbackUrl'] = $voiceFallbackUrl; return $this; } /** * The HTTP method that we should use to call `voice_url`. Can be: `GET` or `POST` and defaults to `POST`. * * @param string $voiceMethod The HTTP method used with the voice_url * @return $this Fluent Builder */ public function setVoiceMethod($voiceMethod) { $this->options['voiceMethod'] = $voiceMethod; return $this; } /** * The URL that we should call to answer a call to the new phone number. The `voice_url` will not be called if a `voice_application_sid` or a `trunk_sid` is set. * * @param string $voiceUrl The URL we should call when the phone number * receives a call * @return $this Fluent Builder */ public function setVoiceUrl($voiceUrl) { $this->options['voiceUrl'] = $voiceUrl; return $this; } /** * The configuration status parameter that determines whether the new phone number is enabled for emergency calling. * * @param string $emergencyStatus Status determining whether the new phone * number is enabled for emergency calling * @return $this Fluent Builder */ public function setEmergencyStatus($emergencyStatus) { $this->options['emergencyStatus'] = $emergencyStatus; return $this; } /** * The SID of the emergency address configuration to use for emergency calling from the new phone number. * * @param string $emergencyAddressSid The emergency address configuration to * use for emergency calling * @return $this Fluent Builder */ public function setEmergencyAddressSid($emergencyAddressSid) { $this->options['emergencyAddressSid'] = $emergencyAddressSid; return $this; } /** * The SID of the Trunk we should use to handle calls to the new phone number. If a `trunk_sid` is present, we ignore all of the voice urls and voice applications and use only those set on the Trunk. Setting a `trunk_sid` will automatically delete your `voice_application_sid` and vice versa. * * @param string $trunkSid SID of the trunk to handle calls to the new phone * number * @return $this Fluent Builder */ public function setTrunkSid($trunkSid) { $this->options['trunkSid'] = $trunkSid; return $this; } /** * The SID of the Identity resource that we should associate with the new phone number. Some regions require an identity to meet local regulations. * * @param string $identitySid The SID of the Identity resource to associate * with the new phone number * @return $this Fluent Builder */ public function setIdentitySid($identitySid) { $this->options['identitySid'] = $identitySid; return $this; } /** * The SID of the Address resource we should associate with the new phone number. Some regions require addresses to meet local regulations. * * @param string $addressSid The SID of the Address resource associated with * the phone number * @return $this Fluent Builder */ public function setAddressSid($addressSid) { $this->options['addressSid'] = $addressSid; return $this; } /** * The configuration parameter for the new phone number to receive incoming voice calls or faxes. Can be: `fax` or `voice` and defaults to `voice`. * * @param string $voiceReceiveMode Incoming call type: fax or voice * @return $this Fluent Builder */ public function setVoiceReceiveMode($voiceReceiveMode) { $this->options['voiceReceiveMode'] = $voiceReceiveMode; return $this; } /** * The SID of the Bundle resource that you associate with the phone number. Some regions require a Bundle to meet local Regulations. * * @param string $bundleSid The SID of the Bundle resource associated with * number * @return $this Fluent Builder */ public function setBundleSid($bundleSid) { $this->options['bundleSid'] = $bundleSid; 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.CreateIncomingPhoneNumberOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/NewKeyPage.php 0000644 00000001362 15002236443 0015626 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Page; class NewKeyPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new NewKeyInstance($this->version, $payload, $this->solution['accountSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.NewKeyPage]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/OutgoingCallerIdPage.php 0000644 00000001420 15002236443 0017612 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Page; class OutgoingCallerIdPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new OutgoingCallerIdInstance($this->version, $payload, $this->solution['accountSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.OutgoingCallerIdPage]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/MessageList.php 0000644 00000015762 15002236443 0016060 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class MessageList extends ListResource { /** * Construct the MessageList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the Account that created the resource * @return \Twilio\Rest\Api\V2010\Account\MessageList */ public function __construct(Version $version, $accountSid) { parent::__construct($version); // Path Solution $this->solution = array('accountSid' => $accountSid, ); $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/Messages.json'; } /** * Create a new MessageInstance * * @param string $to The destination phone number * @param array|Options $options Optional Arguments * @return MessageInstance Newly created MessageInstance * @throws TwilioException When an HTTP error occurs. */ public function create($to, $options = array()) { $options = new Values($options); $data = Values::of(array( 'To' => $to, 'From' => $options['from'], 'MessagingServiceSid' => $options['messagingServiceSid'], 'Body' => $options['body'], 'MediaUrl' => Serialize::map($options['mediaUrl'], function($e) { return $e; }), 'StatusCallback' => $options['statusCallback'], 'ApplicationSid' => $options['applicationSid'], 'MaxPrice' => $options['maxPrice'], 'ProvideFeedback' => Serialize::booleanToString($options['provideFeedback']), 'ValidityPeriod' => $options['validityPeriod'], 'ForceDelivery' => Serialize::booleanToString($options['forceDelivery']), 'SmartEncoded' => Serialize::booleanToString($options['smartEncoded']), 'PersistentAction' => Serialize::map($options['persistentAction'], function($e) { return $e; }), )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new MessageInstance($this->version, $payload, $this->solution['accountSid']); } /** * Streams MessageInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($options = array(), $limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads MessageInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return MessageInstance[] Array of results */ public function read($options = array(), $limit = null, $pageSize = null) { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Retrieve a single page of MessageInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of MessageInstance */ public function page($options = array(), $pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $options = new Values($options); $params = Values::of(array( 'To' => $options['to'], 'From' => $options['from'], 'DateSent<' => Serialize::iso8601DateTime($options['dateSentBefore']), 'DateSent' => Serialize::iso8601DateTime($options['dateSent']), 'DateSent>' => Serialize::iso8601DateTime($options['dateSentAfter']), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new MessagePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of MessageInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of MessageInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new MessagePage($this->version, $response, $this->solution); } /** * Constructs a MessageContext * * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Api\V2010\Account\MessageContext */ public function getContext($sid) { return new MessageContext($this->version, $this->solution['accountSid'], $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.MessageList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/MessageInstance.php 0000644 00000013576 15002236443 0016712 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property string $apiVersion * @property string $body * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property \DateTime $dateSent * @property string $direction * @property int $errorCode * @property string $errorMessage * @property string $from * @property string $messagingServiceSid * @property string $numMedia * @property string $numSegments * @property string $price * @property string $priceUnit * @property string $sid * @property string $status * @property array $subresourceUris * @property string $to * @property string $uri */ class MessageInstance extends InstanceResource { protected $_media = null; protected $_feedback = null; /** * Initialize the MessageInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the Account that created the resource * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Api\V2010\Account\MessageInstance */ public function __construct(Version $version, array $payload, $accountSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'accountSid' => Values::array_get($payload, 'account_sid'), 'apiVersion' => Values::array_get($payload, 'api_version'), 'body' => Values::array_get($payload, 'body'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'dateSent' => Deserialize::dateTime(Values::array_get($payload, 'date_sent')), 'direction' => Values::array_get($payload, 'direction'), 'errorCode' => Values::array_get($payload, 'error_code'), 'errorMessage' => Values::array_get($payload, 'error_message'), 'from' => Values::array_get($payload, 'from'), 'messagingServiceSid' => Values::array_get($payload, 'messaging_service_sid'), 'numMedia' => Values::array_get($payload, 'num_media'), 'numSegments' => Values::array_get($payload, 'num_segments'), 'price' => Values::array_get($payload, 'price'), 'priceUnit' => Values::array_get($payload, 'price_unit'), 'sid' => Values::array_get($payload, 'sid'), 'status' => Values::array_get($payload, 'status'), 'subresourceUris' => Values::array_get($payload, 'subresource_uris'), 'to' => Values::array_get($payload, 'to'), 'uri' => Values::array_get($payload, 'uri'), ); $this->solution = array('accountSid' => $accountSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Api\V2010\Account\MessageContext Context for this * MessageInstance */ protected function proxy() { if (!$this->context) { $this->context = new MessageContext( $this->version, $this->solution['accountSid'], $this->solution['sid'] ); } return $this->context; } /** * Deletes the MessageInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Fetch a MessageInstance * * @return MessageInstance Fetched MessageInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Update the MessageInstance * * @param string $body The text of the message you want to send * @return MessageInstance Updated MessageInstance * @throws TwilioException When an HTTP error occurs. */ public function update($body) { return $this->proxy()->update($body); } /** * Access the media * * @return \Twilio\Rest\Api\V2010\Account\Message\MediaList */ protected function getMedia() { return $this->proxy()->media; } /** * Access the feedback * * @return \Twilio\Rest\Api\V2010\Account\Message\FeedbackList */ protected function getFeedback() { return $this->proxy()->feedback; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.MessageInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/ApplicationInstance.php 0000644 00000013362 15002236443 0017562 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property string $apiVersion * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $friendlyName * @property string $messageStatusCallback * @property string $sid * @property string $smsFallbackMethod * @property string $smsFallbackUrl * @property string $smsMethod * @property string $smsStatusCallback * @property string $smsUrl * @property string $statusCallback * @property string $statusCallbackMethod * @property string $uri * @property bool $voiceCallerIdLookup * @property string $voiceFallbackMethod * @property string $voiceFallbackUrl * @property string $voiceMethod * @property string $voiceUrl */ class ApplicationInstance extends InstanceResource { /** * Initialize the ApplicationInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the Account that created the resource * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Api\V2010\Account\ApplicationInstance */ public function __construct(Version $version, array $payload, $accountSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'accountSid' => Values::array_get($payload, 'account_sid'), 'apiVersion' => Values::array_get($payload, 'api_version'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'messageStatusCallback' => Values::array_get($payload, 'message_status_callback'), 'sid' => Values::array_get($payload, 'sid'), 'smsFallbackMethod' => Values::array_get($payload, 'sms_fallback_method'), 'smsFallbackUrl' => Values::array_get($payload, 'sms_fallback_url'), 'smsMethod' => Values::array_get($payload, 'sms_method'), 'smsStatusCallback' => Values::array_get($payload, 'sms_status_callback'), 'smsUrl' => Values::array_get($payload, 'sms_url'), 'statusCallback' => Values::array_get($payload, 'status_callback'), 'statusCallbackMethod' => Values::array_get($payload, 'status_callback_method'), 'uri' => Values::array_get($payload, 'uri'), 'voiceCallerIdLookup' => Values::array_get($payload, 'voice_caller_id_lookup'), 'voiceFallbackMethod' => Values::array_get($payload, 'voice_fallback_method'), 'voiceFallbackUrl' => Values::array_get($payload, 'voice_fallback_url'), 'voiceMethod' => Values::array_get($payload, 'voice_method'), 'voiceUrl' => Values::array_get($payload, 'voice_url'), ); $this->solution = array('accountSid' => $accountSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Api\V2010\Account\ApplicationContext Context for this * ApplicationInstance */ protected function proxy() { if (!$this->context) { $this->context = new ApplicationContext( $this->version, $this->solution['accountSid'], $this->solution['sid'] ); } return $this->context; } /** * Deletes the ApplicationInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Fetch a ApplicationInstance * * @return ApplicationInstance Fetched ApplicationInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Update the ApplicationInstance * * @param array|Options $options Optional Arguments * @return ApplicationInstance Updated ApplicationInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.ApplicationInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/SigningKeyOptions.php 0000644 00000002657 15002236443 0017262 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Options; use Twilio\Values; abstract class SigningKeyOptions { /** * @param string $friendlyName The friendly_name * @return UpdateSigningKeyOptions Options builder */ public static function update($friendlyName = Values::NONE) { return new UpdateSigningKeyOptions($friendlyName); } } class UpdateSigningKeyOptions extends Options { /** * @param string $friendlyName The friendly_name */ public function __construct($friendlyName = Values::NONE) { $this->options['friendlyName'] = $friendlyName; } /** * The friendly_name * * @param string $friendlyName The friendly_name * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; 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.UpdateSigningKeyOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/AddressContext.php 0000644 00000012217 15002236443 0016562 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Rest\Api\V2010\Account\Address\DependentPhoneNumberList; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * @property \Twilio\Rest\Api\V2010\Account\Address\DependentPhoneNumberList $dependentPhoneNumbers */ class AddressContext extends InstanceContext { protected $_dependentPhoneNumbers = null; /** * Initialize the AddressContext * * @param \Twilio\Version $version Version that contains the resource * @param string $accountSid The SID of the Account that is responsible for * this address * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Api\V2010\Account\AddressContext */ public function __construct(Version $version, $accountSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array('accountSid' => $accountSid, 'sid' => $sid, ); $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/Addresses/' . \rawurlencode($sid) . '.json'; } /** * Deletes the AddressInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Fetch a AddressInstance * * @return AddressInstance Fetched AddressInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new AddressInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['sid'] ); } /** * Update the AddressInstance * * @param array|Options $options Optional Arguments * @return AddressInstance Updated AddressInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { $options = new Values($options); $data = Values::of(array( 'FriendlyName' => $options['friendlyName'], 'CustomerName' => $options['customerName'], 'Street' => $options['street'], 'City' => $options['city'], 'Region' => $options['region'], 'PostalCode' => $options['postalCode'], 'EmergencyEnabled' => Serialize::booleanToString($options['emergencyEnabled']), 'AutoCorrectAddress' => Serialize::booleanToString($options['autoCorrectAddress']), )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new AddressInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['sid'] ); } /** * Access the dependentPhoneNumbers * * @return \Twilio\Rest\Api\V2010\Account\Address\DependentPhoneNumberList */ protected function getDependentPhoneNumbers() { if (!$this->_dependentPhoneNumbers) { $this->_dependentPhoneNumbers = new DependentPhoneNumberList( $this->version, $this->solution['accountSid'], $this->solution['sid'] ); } return $this->_dependentPhoneNumbers; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get($name) { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.AddressContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountryPage.php 0000644 00000001537 15002236443 0022037 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Page; class AvailablePhoneNumberCountryPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new AvailablePhoneNumberCountryInstance( $this->version, $payload, $this->solution['accountSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.AvailablePhoneNumberCountryPage]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/TranscriptionPage.php 0000644 00000001407 15002236443 0017263 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Page; class TranscriptionPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new TranscriptionInstance($this->version, $payload, $this->solution['accountSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.TranscriptionPage]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumberContext.php 0000644 00000014400 15002236443 0021077 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Rest\Api\V2010\Account\IncomingPhoneNumber\AssignedAddOnList; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * @property \Twilio\Rest\Api\V2010\Account\IncomingPhoneNumber\AssignedAddOnList $assignedAddOns * @method \Twilio\Rest\Api\V2010\Account\IncomingPhoneNumber\AssignedAddOnContext assignedAddOns(string $sid) */ class IncomingPhoneNumberContext extends InstanceContext { protected $_assignedAddOns = null; /** * Initialize the IncomingPhoneNumberContext * * @param \Twilio\Version $version Version that contains the resource * @param string $accountSid The SID of the Account that created the resource * to fetch * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Api\V2010\Account\IncomingPhoneNumberContext */ public function __construct(Version $version, $accountSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array('accountSid' => $accountSid, 'sid' => $sid, ); $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/IncomingPhoneNumbers/' . \rawurlencode($sid) . '.json'; } /** * Update the IncomingPhoneNumberInstance * * @param array|Options $options Optional Arguments * @return IncomingPhoneNumberInstance Updated IncomingPhoneNumberInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { $options = new Values($options); $data = Values::of(array( 'AccountSid' => $options['accountSid'], 'ApiVersion' => $options['apiVersion'], 'FriendlyName' => $options['friendlyName'], 'SmsApplicationSid' => $options['smsApplicationSid'], 'SmsFallbackMethod' => $options['smsFallbackMethod'], 'SmsFallbackUrl' => $options['smsFallbackUrl'], 'SmsMethod' => $options['smsMethod'], 'SmsUrl' => $options['smsUrl'], 'StatusCallback' => $options['statusCallback'], 'StatusCallbackMethod' => $options['statusCallbackMethod'], 'VoiceApplicationSid' => $options['voiceApplicationSid'], 'VoiceCallerIdLookup' => Serialize::booleanToString($options['voiceCallerIdLookup']), 'VoiceFallbackMethod' => $options['voiceFallbackMethod'], 'VoiceFallbackUrl' => $options['voiceFallbackUrl'], 'VoiceMethod' => $options['voiceMethod'], 'VoiceUrl' => $options['voiceUrl'], 'EmergencyStatus' => $options['emergencyStatus'], 'EmergencyAddressSid' => $options['emergencyAddressSid'], 'TrunkSid' => $options['trunkSid'], 'VoiceReceiveMode' => $options['voiceReceiveMode'], 'IdentitySid' => $options['identitySid'], 'AddressSid' => $options['addressSid'], 'BundleSid' => $options['bundleSid'], )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new IncomingPhoneNumberInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['sid'] ); } /** * Fetch a IncomingPhoneNumberInstance * * @return IncomingPhoneNumberInstance Fetched IncomingPhoneNumberInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new IncomingPhoneNumberInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['sid'] ); } /** * Deletes the IncomingPhoneNumberInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Access the assignedAddOns * * @return \Twilio\Rest\Api\V2010\Account\IncomingPhoneNumber\AssignedAddOnList */ protected function getAssignedAddOns() { if (!$this->_assignedAddOns) { $this->_assignedAddOns = new AssignedAddOnList( $this->version, $this->solution['accountSid'], $this->solution['sid'] ); } return $this->_assignedAddOns; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get($name) { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.IncomingPhoneNumberContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/TokenInstance.php 0000644 00000004662 15002236443 0016402 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $iceServers * @property string $password * @property string $ttl * @property string $username */ class TokenInstance extends InstanceResource { /** * Initialize the TokenInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the Account that created the resource * @return \Twilio\Rest\Api\V2010\Account\TokenInstance */ public function __construct(Version $version, array $payload, $accountSid) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'accountSid' => Values::array_get($payload, 'account_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'iceServers' => Values::array_get($payload, 'ice_servers'), 'password' => Values::array_get($payload, 'password'), 'ttl' => Values::array_get($payload, 'ttl'), 'username' => Values::array_get($payload, 'username'), ); $this->solution = array('accountSid' => $accountSid, ); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.TokenInstance]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/ConferencePage.php 0000644 00000001376 15002236443 0016500 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Page; class ConferencePage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new ConferenceInstance($this->version, $payload, $this->solution['accountSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.ConferencePage]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/UsagePage.php 0000644 00000001357 15002236443 0015474 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Page; class UsagePage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new UsageInstance($this->version, $payload, $this->solution['accountSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.UsagePage]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/SipList.php 0000644 00000007402 15002236443 0015217 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Rest\Api\V2010\Account\Sip\CredentialListList; use Twilio\Rest\Api\V2010\Account\Sip\DomainList; use Twilio\Rest\Api\V2010\Account\Sip\IpAccessControlListList; use Twilio\Version; /** * @property \Twilio\Rest\Api\V2010\Account\Sip\DomainList $domains * @property \Twilio\Rest\Api\V2010\Account\Sip\IpAccessControlListList $ipAccessControlLists * @property \Twilio\Rest\Api\V2010\Account\Sip\CredentialListList $credentialLists * @method \Twilio\Rest\Api\V2010\Account\Sip\DomainContext domains(string $sid) * @method \Twilio\Rest\Api\V2010\Account\Sip\IpAccessControlListContext ipAccessControlLists(string $sid) * @method \Twilio\Rest\Api\V2010\Account\Sip\CredentialListContext credentialLists(string $sid) */ class SipList extends ListResource { protected $_domains = null; protected $_ipAccessControlLists = null; protected $_credentialLists = null; /** * Construct the SipList * * @param Version $version Version that contains the resource * @param string $accountSid A 34 character string that uniquely identifies * this resource. * @return \Twilio\Rest\Api\V2010\Account\SipList */ public function __construct(Version $version, $accountSid) { parent::__construct($version); // Path Solution $this->solution = array('accountSid' => $accountSid, ); } /** * Access the domains */ protected function getDomains() { if (!$this->_domains) { $this->_domains = new DomainList($this->version, $this->solution['accountSid']); } return $this->_domains; } /** * Access the ipAccessControlLists */ protected function getIpAccessControlLists() { if (!$this->_ipAccessControlLists) { $this->_ipAccessControlLists = new IpAccessControlListList( $this->version, $this->solution['accountSid'] ); } return $this->_ipAccessControlLists; } /** * Access the credentialLists */ protected function getCredentialLists() { if (!$this->_credentialLists) { $this->_credentialLists = new CredentialListList($this->version, $this->solution['accountSid']); } return $this->_credentialLists; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get($name) { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.SipList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/AuthorizedConnectAppInstance.php 0000644 00000010533 15002236443 0021405 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property string $connectAppCompanyName * @property string $connectAppDescription * @property string $connectAppFriendlyName * @property string $connectAppHomepageUrl * @property string $connectAppSid * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $permissions * @property string $uri */ class AuthorizedConnectAppInstance extends InstanceResource { /** * Initialize the AuthorizedConnectAppInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the Account that created the resource * @param string $connectAppSid The SID of the Connect App to fetch * @return \Twilio\Rest\Api\V2010\Account\AuthorizedConnectAppInstance */ public function __construct(Version $version, array $payload, $accountSid, $connectAppSid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'accountSid' => Values::array_get($payload, 'account_sid'), 'connectAppCompanyName' => Values::array_get($payload, 'connect_app_company_name'), 'connectAppDescription' => Values::array_get($payload, 'connect_app_description'), 'connectAppFriendlyName' => Values::array_get($payload, 'connect_app_friendly_name'), 'connectAppHomepageUrl' => Values::array_get($payload, 'connect_app_homepage_url'), 'connectAppSid' => Values::array_get($payload, 'connect_app_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'permissions' => Values::array_get($payload, 'permissions'), 'uri' => Values::array_get($payload, 'uri'), ); $this->solution = array( 'accountSid' => $accountSid, 'connectAppSid' => $connectAppSid ?: $this->properties['connectAppSid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Api\V2010\Account\AuthorizedConnectAppContext Context * for this * AuthorizedConnectAppInstance */ protected function proxy() { if (!$this->context) { $this->context = new AuthorizedConnectAppContext( $this->version, $this->solution['accountSid'], $this->solution['connectAppSid'] ); } return $this->context; } /** * Fetch a AuthorizedConnectAppInstance * * @return AuthorizedConnectAppInstance Fetched AuthorizedConnectAppInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.AuthorizedConnectAppInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/ShortCodeList.php 0000644 00000012414 15002236443 0016355 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\ListResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; class ShortCodeList extends ListResource { /** * Construct the ShortCodeList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the Account that created this resource * @return \Twilio\Rest\Api\V2010\Account\ShortCodeList */ public function __construct(Version $version, $accountSid) { parent::__construct($version); // Path Solution $this->solution = array('accountSid' => $accountSid, ); $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/SMS/ShortCodes.json'; } /** * Streams ShortCodeInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($options = array(), $limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads ShortCodeInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return ShortCodeInstance[] Array of results */ public function read($options = array(), $limit = null, $pageSize = null) { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Retrieve a single page of ShortCodeInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of ShortCodeInstance */ public function page($options = array(), $pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $options = new Values($options); $params = Values::of(array( 'FriendlyName' => $options['friendlyName'], 'ShortCode' => $options['shortCode'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new ShortCodePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of ShortCodeInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of ShortCodeInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new ShortCodePage($this->version, $response, $this->solution); } /** * Constructs a ShortCodeContext * * @param string $sid The unique string that identifies this resource * @return \Twilio\Rest\Api\V2010\Account\ShortCodeContext */ public function getContext($sid) { return new ShortCodeContext($this->version, $this->solution['accountSid'], $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.ShortCodeList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/NewKeyOptions.php 0000644 00000003034 15002236443 0016403 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Options; use Twilio\Values; abstract class NewKeyOptions { /** * @param string $friendlyName A string to describe the resource * @return CreateNewKeyOptions Options builder */ public static function create($friendlyName = Values::NONE) { return new CreateNewKeyOptions($friendlyName); } } class CreateNewKeyOptions extends Options { /** * @param string $friendlyName A string to describe the resource */ public function __construct($friendlyName = Values::NONE) { $this->options['friendlyName'] = $friendlyName; } /** * A descriptive string that you create to describe the resource. It can be up to 64 characters long. * * @param string $friendlyName A string to describe the resource * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; 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.CreateNewKeyOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/AuthorizedConnectAppList.php 0000644 00000012161 15002236443 0020553 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\ListResource; use Twilio\Values; use Twilio\Version; class AuthorizedConnectAppList extends ListResource { /** * Construct the AuthorizedConnectAppList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the Account that created the resource * @return \Twilio\Rest\Api\V2010\Account\AuthorizedConnectAppList */ public function __construct(Version $version, $accountSid) { parent::__construct($version); // Path Solution $this->solution = array('accountSid' => $accountSid, ); $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/AuthorizedConnectApps.json'; } /** * Streams AuthorizedConnectAppInstance records from the API as a generator * stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads AuthorizedConnectAppInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return AuthorizedConnectAppInstance[] Array of results */ public function read($limit = null, $pageSize = null) { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of AuthorizedConnectAppInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of AuthorizedConnectAppInstance */ public function page($pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $params = Values::of(array( 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new AuthorizedConnectAppPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of AuthorizedConnectAppInstance records from the * API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of AuthorizedConnectAppInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new AuthorizedConnectAppPage($this->version, $response, $this->solution); } /** * Constructs a AuthorizedConnectAppContext * * @param string $connectAppSid The SID of the Connect App to fetch * @return \Twilio\Rest\Api\V2010\Account\AuthorizedConnectAppContext */ public function getContext($connectAppSid) { return new AuthorizedConnectAppContext( $this->version, $this->solution['accountSid'], $connectAppSid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.AuthorizedConnectAppList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/UsageList.php 0000644 00000005677 15002236443 0015544 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Rest\Api\V2010\Account\Usage\RecordList; use Twilio\Rest\Api\V2010\Account\Usage\TriggerList; use Twilio\Version; /** * @property \Twilio\Rest\Api\V2010\Account\Usage\RecordList $records * @property \Twilio\Rest\Api\V2010\Account\Usage\TriggerList $triggers * @method \Twilio\Rest\Api\V2010\Account\Usage\TriggerContext triggers(string $sid) */ class UsageList extends ListResource { protected $_records = null; protected $_triggers = null; /** * Construct the UsageList * * @param Version $version Version that contains the resource * @param string $accountSid A 34 character string that uniquely identifies * this resource. * @return \Twilio\Rest\Api\V2010\Account\UsageList */ public function __construct(Version $version, $accountSid) { parent::__construct($version); // Path Solution $this->solution = array('accountSid' => $accountSid, ); } /** * Access the records */ protected function getRecords() { if (!$this->_records) { $this->_records = new RecordList($this->version, $this->solution['accountSid']); } return $this->_records; } /** * Access the triggers */ protected function getTriggers() { if (!$this->_triggers) { $this->_triggers = new TriggerList($this->version, $this->solution['accountSid']); } return $this->_triggers; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get($name) { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.UsageList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/ValidationRequestPage.php 0000644 00000001423 15002236443 0020065 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Page; class ValidationRequestPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new ValidationRequestInstance($this->version, $payload, $this->solution['accountSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.ValidationRequestPage]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/RecordingList.php 0000644 00000013035 15002236443 0016377 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class RecordingList extends ListResource { /** * Construct the RecordingList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the Account that created the resource * @return \Twilio\Rest\Api\V2010\Account\RecordingList */ public function __construct(Version $version, $accountSid) { parent::__construct($version); // Path Solution $this->solution = array('accountSid' => $accountSid, ); $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/Recordings.json'; } /** * Streams RecordingInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($options = array(), $limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads RecordingInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return RecordingInstance[] Array of results */ public function read($options = array(), $limit = null, $pageSize = null) { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Retrieve a single page of RecordingInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of RecordingInstance */ public function page($options = array(), $pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $options = new Values($options); $params = Values::of(array( 'DateCreated<' => Serialize::iso8601DateTime($options['dateCreatedBefore']), 'DateCreated' => Serialize::iso8601DateTime($options['dateCreated']), 'DateCreated>' => Serialize::iso8601DateTime($options['dateCreatedAfter']), 'CallSid' => $options['callSid'], 'ConferenceSid' => $options['conferenceSid'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new RecordingPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of RecordingInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of RecordingInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new RecordingPage($this->version, $response, $this->solution); } /** * Constructs a RecordingContext * * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Api\V2010\Account\RecordingContext */ public function getContext($sid) { return new RecordingContext($this->version, $this->solution['accountSid'], $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.RecordingList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/ConnectAppPage.php 0000644 00000001376 15002236443 0016463 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Page; class ConnectAppPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new ConnectAppInstance($this->version, $payload, $this->solution['accountSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.ConnectAppPage]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/NotificationList.php 0000644 00000013002 15002236443 0017103 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class NotificationList extends ListResource { /** * Construct the NotificationList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the Account that created the resource * @return \Twilio\Rest\Api\V2010\Account\NotificationList */ public function __construct(Version $version, $accountSid) { parent::__construct($version); // Path Solution $this->solution = array('accountSid' => $accountSid, ); $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/Notifications.json'; } /** * Streams NotificationInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($options = array(), $limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads NotificationInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return NotificationInstance[] Array of results */ public function read($options = array(), $limit = null, $pageSize = null) { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Retrieve a single page of NotificationInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of NotificationInstance */ public function page($options = array(), $pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $options = new Values($options); $params = Values::of(array( 'Log' => $options['log'], 'MessageDate<' => Serialize::iso8601Date($options['messageDateBefore']), 'MessageDate' => Serialize::iso8601Date($options['messageDate']), 'MessageDate>' => Serialize::iso8601Date($options['messageDateAfter']), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new NotificationPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of NotificationInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of NotificationInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new NotificationPage($this->version, $response, $this->solution); } /** * Constructs a NotificationContext * * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Api\V2010\Account\NotificationContext */ public function getContext($sid) { return new NotificationContext($this->version, $this->solution['accountSid'], $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.NotificationList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/NewKeyInstance.php 0000644 00000004433 15002236443 0016520 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $friendlyName * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $secret */ class NewKeyInstance extends InstanceResource { /** * Initialize the NewKeyInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid A 34 character string that uniquely identifies * this resource. * @return \Twilio\Rest\Api\V2010\Account\NewKeyInstance */ public function __construct(Version $version, array $payload, $accountSid) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'sid' => Values::array_get($payload, 'sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'secret' => Values::array_get($payload, 'secret'), ); $this->solution = array('accountSid' => $accountSid, ); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.NewKeyInstance]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/OutgoingCallerIdList.php 0000644 00000012601 15002236443 0017654 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\ListResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; class OutgoingCallerIdList extends ListResource { /** * Construct the OutgoingCallerIdList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the Account that created the resource * @return \Twilio\Rest\Api\V2010\Account\OutgoingCallerIdList */ public function __construct(Version $version, $accountSid) { parent::__construct($version); // Path Solution $this->solution = array('accountSid' => $accountSid, ); $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/OutgoingCallerIds.json'; } /** * Streams OutgoingCallerIdInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($options = array(), $limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads OutgoingCallerIdInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return OutgoingCallerIdInstance[] Array of results */ public function read($options = array(), $limit = null, $pageSize = null) { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Retrieve a single page of OutgoingCallerIdInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of OutgoingCallerIdInstance */ public function page($options = array(), $pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $options = new Values($options); $params = Values::of(array( 'PhoneNumber' => $options['phoneNumber'], 'FriendlyName' => $options['friendlyName'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new OutgoingCallerIdPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of OutgoingCallerIdInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of OutgoingCallerIdInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new OutgoingCallerIdPage($this->version, $response, $this->solution); } /** * Constructs a OutgoingCallerIdContext * * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Api\V2010\Account\OutgoingCallerIdContext */ public function getContext($sid) { return new OutgoingCallerIdContext($this->version, $this->solution['accountSid'], $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.OutgoingCallerIdList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/OutgoingCallerIdOptions.php 0000644 00000007512 15002236443 0020401 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Options; use Twilio\Values; abstract class OutgoingCallerIdOptions { /** * @param string $friendlyName A string to describe the resource * @return UpdateOutgoingCallerIdOptions Options builder */ public static function update($friendlyName = Values::NONE) { return new UpdateOutgoingCallerIdOptions($friendlyName); } /** * @param string $phoneNumber The phone number of the OutgoingCallerId * resources to read * @param string $friendlyName The string that identifies the OutgoingCallerId * resources to read * @return ReadOutgoingCallerIdOptions Options builder */ public static function read($phoneNumber = Values::NONE, $friendlyName = Values::NONE) { return new ReadOutgoingCallerIdOptions($phoneNumber, $friendlyName); } } class UpdateOutgoingCallerIdOptions extends Options { /** * @param string $friendlyName A string to describe the resource */ public function __construct($friendlyName = Values::NONE) { $this->options['friendlyName'] = $friendlyName; } /** * A descriptive string that you create to describe the resource. It can be up to 64 characters long. * * @param string $friendlyName A string to describe the resource * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; 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.UpdateOutgoingCallerIdOptions ' . \implode(' ', $options) . ']'; } } class ReadOutgoingCallerIdOptions extends Options { /** * @param string $phoneNumber The phone number of the OutgoingCallerId * resources to read * @param string $friendlyName The string that identifies the OutgoingCallerId * resources to read */ public function __construct($phoneNumber = Values::NONE, $friendlyName = Values::NONE) { $this->options['phoneNumber'] = $phoneNumber; $this->options['friendlyName'] = $friendlyName; } /** * The phone number of the OutgoingCallerId resources to read. * * @param string $phoneNumber The phone number of the OutgoingCallerId * resources to read * @return $this Fluent Builder */ public function setPhoneNumber($phoneNumber) { $this->options['phoneNumber'] = $phoneNumber; return $this; } /** * The string that identifies the OutgoingCallerId resources to read. * * @param string $friendlyName The string that identifies the OutgoingCallerId * resources to read * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; 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.ReadOutgoingCallerIdOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountryInstance.php 0000644 00000012701 15002236443 0022722 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $countryCode * @property string $country * @property string $uri * @property bool $beta * @property array $subresourceUris */ class AvailablePhoneNumberCountryInstance extends InstanceResource { protected $_local = null; protected $_tollFree = null; protected $_mobile = null; protected $_national = null; protected $_voip = null; protected $_sharedCost = null; protected $_machineToMachine = null; /** * Initialize the AvailablePhoneNumberCountryInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid A 34 character string that uniquely identifies * this resource. * @param string $countryCode The ISO country code of the country to fetch * available phone number information about * @return \Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountryInstance */ public function __construct(Version $version, array $payload, $accountSid, $countryCode = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'countryCode' => Values::array_get($payload, 'country_code'), 'country' => Values::array_get($payload, 'country'), 'uri' => Values::array_get($payload, 'uri'), 'beta' => Values::array_get($payload, 'beta'), 'subresourceUris' => Values::array_get($payload, 'subresource_uris'), ); $this->solution = array( 'accountSid' => $accountSid, 'countryCode' => $countryCode ?: $this->properties['countryCode'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountryContext Context for this AvailablePhoneNumberCountryInstance */ protected function proxy() { if (!$this->context) { $this->context = new AvailablePhoneNumberCountryContext( $this->version, $this->solution['accountSid'], $this->solution['countryCode'] ); } return $this->context; } /** * Fetch a AvailablePhoneNumberCountryInstance * * @return AvailablePhoneNumberCountryInstance Fetched * AvailablePhoneNumberCountryInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Access the local * * @return \Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry\LocalList */ protected function getLocal() { return $this->proxy()->local; } /** * Access the tollFree * * @return \Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry\TollFreeList */ protected function getTollFree() { return $this->proxy()->tollFree; } /** * Access the mobile * * @return \Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry\MobileList */ protected function getMobile() { return $this->proxy()->mobile; } /** * Access the national * * @return \Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry\NationalList */ protected function getNational() { return $this->proxy()->national; } /** * Access the voip * * @return \Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry\VoipList */ protected function getVoip() { return $this->proxy()->voip; } /** * Access the sharedCost * * @return \Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry\SharedCostList */ protected function getSharedCost() { return $this->proxy()->sharedCost; } /** * Access the machineToMachine * * @return \Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry\MachineToMachineList */ protected function getMachineToMachine() { return $this->proxy()->machineToMachine; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.AvailablePhoneNumberCountryInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/ConnectAppContext.php 0000644 00000006731 15002236443 0017233 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class ConnectAppContext extends InstanceContext { /** * Initialize the ConnectAppContext * * @param \Twilio\Version $version Version that contains the resource * @param string $accountSid The SID of the Account that created the resource * to fetch * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Api\V2010\Account\ConnectAppContext */ public function __construct(Version $version, $accountSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array('accountSid' => $accountSid, 'sid' => $sid, ); $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/ConnectApps/' . \rawurlencode($sid) . '.json'; } /** * Fetch a ConnectAppInstance * * @return ConnectAppInstance Fetched ConnectAppInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new ConnectAppInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['sid'] ); } /** * Update the ConnectAppInstance * * @param array|Options $options Optional Arguments * @return ConnectAppInstance Updated ConnectAppInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { $options = new Values($options); $data = Values::of(array( 'AuthorizeRedirectUrl' => $options['authorizeRedirectUrl'], 'CompanyName' => $options['companyName'], 'DeauthorizeCallbackMethod' => $options['deauthorizeCallbackMethod'], 'DeauthorizeCallbackUrl' => $options['deauthorizeCallbackUrl'], 'Description' => $options['description'], 'FriendlyName' => $options['friendlyName'], 'HomepageUrl' => $options['homepageUrl'], 'Permissions' => Serialize::map($options['permissions'], function($e) { return $e; }), )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new ConnectAppInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['sid'] ); } /** * Deletes the ConnectAppInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.ConnectAppContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/TokenList.php 0000644 00000003231 15002236443 0015540 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; class TokenList extends ListResource { /** * Construct the TokenList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the Account that created the resource * @return \Twilio\Rest\Api\V2010\Account\TokenList */ public function __construct(Version $version, $accountSid) { parent::__construct($version); // Path Solution $this->solution = array('accountSid' => $accountSid, ); $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/Tokens.json'; } /** * Create a new TokenInstance * * @param array|Options $options Optional Arguments * @return TokenInstance Newly created TokenInstance * @throws TwilioException When an HTTP error occurs. */ public function create($options = array()) { $options = new Values($options); $data = Values::of(array('Ttl' => $options['ttl'], )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new TokenInstance($this->version, $payload, $this->solution['accountSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.TokenList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/TokenPage.php 0000644 00000001357 15002236443 0015510 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Page; class TokenPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new TokenInstance($this->version, $payload, $this->solution['accountSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.TokenPage]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/MessagePage.php 0000644 00000001365 15002236443 0016013 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Page; class MessagePage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new MessageInstance($this->version, $payload, $this->solution['accountSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.MessagePage]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/TokenOptions.php 0000644 00000002735 15002236443 0016270 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Options; use Twilio\Values; abstract class TokenOptions { /** * @param int $ttl The duration in seconds the credentials are valid * @return CreateTokenOptions Options builder */ public static function create($ttl = Values::NONE) { return new CreateTokenOptions($ttl); } } class CreateTokenOptions extends Options { /** * @param int $ttl The duration in seconds the credentials are valid */ public function __construct($ttl = Values::NONE) { $this->options['ttl'] = $ttl; } /** * The duration in seconds for which the generated credentials are valid. The default value is 86400 (24 hours). * * @param int $ttl The duration in seconds the credentials are valid * @return $this Fluent Builder */ public function setTtl($ttl) { $this->options['ttl'] = $ttl; 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.CreateTokenOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/CallPage.php 0000644 00000001354 15002236443 0015300 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Page; class CallPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new CallInstance($this->version, $payload, $this->solution['accountSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.CallPage]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/NewSigningKeyInstance.php 0000644 00000004467 15002236443 0020046 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $friendlyName * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $secret */ class NewSigningKeyInstance extends InstanceResource { /** * Initialize the NewSigningKeyInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid A 34 character string that uniquely identifies * this resource. * @return \Twilio\Rest\Api\V2010\Account\NewSigningKeyInstance */ public function __construct(Version $version, array $payload, $accountSid) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'sid' => Values::array_get($payload, 'sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'secret' => Values::array_get($payload, 'secret'), ); $this->solution = array('accountSid' => $accountSid, ); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.NewSigningKeyInstance]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/NewSigningKeyPage.php 0000644 00000001407 15002236443 0017145 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Page; class NewSigningKeyPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new NewSigningKeyInstance($this->version, $payload, $this->solution['accountSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.NewSigningKeyPage]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/RecordingContext.php 0000644 00000011341 15002236443 0017106 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Rest\Api\V2010\Account\Recording\AddOnResultList; use Twilio\Rest\Api\V2010\Account\Recording\TranscriptionList; use Twilio\Values; use Twilio\Version; /** * @property \Twilio\Rest\Api\V2010\Account\Recording\TranscriptionList $transcriptions * @property \Twilio\Rest\Api\V2010\Account\Recording\AddOnResultList $addOnResults * @method \Twilio\Rest\Api\V2010\Account\Recording\TranscriptionContext transcriptions(string $sid) * @method \Twilio\Rest\Api\V2010\Account\Recording\AddOnResultContext addOnResults(string $sid) */ class RecordingContext extends InstanceContext { protected $_transcriptions = null; protected $_addOnResults = null; /** * Initialize the RecordingContext * * @param \Twilio\Version $version Version that contains the resource * @param string $accountSid The SID of the Account that created the resource * to fetch * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Api\V2010\Account\RecordingContext */ public function __construct(Version $version, $accountSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array('accountSid' => $accountSid, 'sid' => $sid, ); $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/Recordings/' . \rawurlencode($sid) . '.json'; } /** * Fetch a RecordingInstance * * @return RecordingInstance Fetched RecordingInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new RecordingInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['sid'] ); } /** * Deletes the RecordingInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Access the transcriptions * * @return \Twilio\Rest\Api\V2010\Account\Recording\TranscriptionList */ protected function getTranscriptions() { if (!$this->_transcriptions) { $this->_transcriptions = new TranscriptionList( $this->version, $this->solution['accountSid'], $this->solution['sid'] ); } return $this->_transcriptions; } /** * Access the addOnResults * * @return \Twilio\Rest\Api\V2010\Account\Recording\AddOnResultList */ protected function getAddOnResults() { if (!$this->_addOnResults) { $this->_addOnResults = new AddOnResultList( $this->version, $this->solution['accountSid'], $this->solution['sid'] ); } return $this->_addOnResults; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get($name) { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.RecordingContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Message/FeedbackInstance.php 0000644 00000005032 15002236443 0020362 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Message; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property string $messageSid * @property string $outcome * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $uri */ class FeedbackInstance extends InstanceResource { /** * Initialize the FeedbackInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the Account that created the resource * @param string $messageSid The SID of the Message resource for which the * feedback was provided * @return \Twilio\Rest\Api\V2010\Account\Message\FeedbackInstance */ public function __construct(Version $version, array $payload, $accountSid, $messageSid) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'accountSid' => Values::array_get($payload, 'account_sid'), 'messageSid' => Values::array_get($payload, 'message_sid'), 'outcome' => Values::array_get($payload, 'outcome'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'uri' => Values::array_get($payload, 'uri'), ); $this->solution = array('accountSid' => $accountSid, 'messageSid' => $messageSid, ); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.FeedbackInstance]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Message/MediaOptions.php 0000644 00000010127 15002236443 0017605 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Message; use Twilio\Options; use Twilio\Values; abstract class MediaOptions { /** * @param string $dateCreatedBefore Only include media that was created on this * date * @param string $dateCreated Only include media that was created on this date * @param string $dateCreatedAfter Only include media that was created on this * date * @return ReadMediaOptions Options builder */ public static function read($dateCreatedBefore = Values::NONE, $dateCreated = Values::NONE, $dateCreatedAfter = Values::NONE) { return new ReadMediaOptions($dateCreatedBefore, $dateCreated, $dateCreatedAfter); } } class ReadMediaOptions extends Options { /** * @param string $dateCreatedBefore Only include media that was created on this * date * @param string $dateCreated Only include media that was created on this date * @param string $dateCreatedAfter Only include media that was created on this * date */ public function __construct($dateCreatedBefore = Values::NONE, $dateCreated = Values::NONE, $dateCreatedAfter = Values::NONE) { $this->options['dateCreatedBefore'] = $dateCreatedBefore; $this->options['dateCreated'] = $dateCreated; $this->options['dateCreatedAfter'] = $dateCreatedAfter; } /** * Only include media that was created on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read media that was created on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read media that was created on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read media that was created on or after midnight of this date. * * @param string $dateCreatedBefore Only include media that was created on this * date * @return $this Fluent Builder */ public function setDateCreatedBefore($dateCreatedBefore) { $this->options['dateCreatedBefore'] = $dateCreatedBefore; return $this; } /** * Only include media that was created on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read media that was created on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read media that was created on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read media that was created on or after midnight of this date. * * @param string $dateCreated Only include media that was created on this date * @return $this Fluent Builder */ public function setDateCreated($dateCreated) { $this->options['dateCreated'] = $dateCreated; return $this; } /** * Only include media that was created on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read media that was created on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read media that was created on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read media that was created on or after midnight of this date. * * @param string $dateCreatedAfter Only include media that was created on this * date * @return $this Fluent Builder */ public function setDateCreatedAfter($dateCreatedAfter) { $this->options['dateCreatedAfter'] = $dateCreatedAfter; 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.ReadMediaOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Message/FeedbackOptions.php 0000644 00000003316 15002236443 0020254 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Message; use Twilio\Options; use Twilio\Values; abstract class FeedbackOptions { /** * @param string $outcome Whether the feedback has arrived * @return CreateFeedbackOptions Options builder */ public static function create($outcome = Values::NONE) { return new CreateFeedbackOptions($outcome); } } class CreateFeedbackOptions extends Options { /** * @param string $outcome Whether the feedback has arrived */ public function __construct($outcome = Values::NONE) { $this->options['outcome'] = $outcome; } /** * Whether the feedback has arrived. Can be: `unconfirmed` or `confirmed`. If `provide_feedback`=`true` in [the initial HTTP POST](https://www.twilio.com/docs/sms/api/message-resource#create-a-message-resource), the initial value of this property is `unconfirmed`. After the message arrives, update the value to `confirmed`. * * @param string $outcome Whether the feedback has arrived * @return $this Fluent Builder */ public function setOutcome($outcome) { $this->options['outcome'] = $outcome; 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.CreateFeedbackOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Message/FeedbackList.php 0000644 00000004000 15002236443 0017523 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Message; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; class FeedbackList extends ListResource { /** * Construct the FeedbackList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the Account that created the resource * @param string $messageSid The SID of the Message resource for which the * feedback was provided * @return \Twilio\Rest\Api\V2010\Account\Message\FeedbackList */ public function __construct(Version $version, $accountSid, $messageSid) { parent::__construct($version); // Path Solution $this->solution = array('accountSid' => $accountSid, 'messageSid' => $messageSid, ); $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/Messages/' . \rawurlencode($messageSid) . '/Feedback.json'; } /** * Create a new FeedbackInstance * * @param array|Options $options Optional Arguments * @return FeedbackInstance Newly created FeedbackInstance * @throws TwilioException When an HTTP error occurs. */ public function create($options = array()) { $options = new Values($options); $data = Values::of(array('Outcome' => $options['outcome'], )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new FeedbackInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['messageSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.FeedbackList]'; } }sdk/src/Twilio/Rest/Api/V2010/Account/Message/FeedbackPage.php 0000644 00000001531 15002236443 0017472 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Message; use Twilio\Page; class FeedbackPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new FeedbackInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['messageSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.FeedbackPage]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Message/MediaInstance.php 0000644 00000010053 15002236443 0017714 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Message; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property string $contentType * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $parentSid * @property string $sid * @property string $uri */ class MediaInstance extends InstanceResource { /** * Initialize the MediaInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the Account that created this resource * @param string $messageSid The unique string that identifies the resource * @param string $sid The unique string that identifies this resource * @return \Twilio\Rest\Api\V2010\Account\Message\MediaInstance */ public function __construct(Version $version, array $payload, $accountSid, $messageSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'accountSid' => Values::array_get($payload, 'account_sid'), 'contentType' => Values::array_get($payload, 'content_type'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'parentSid' => Values::array_get($payload, 'parent_sid'), 'sid' => Values::array_get($payload, 'sid'), 'uri' => Values::array_get($payload, 'uri'), ); $this->solution = array( 'accountSid' => $accountSid, 'messageSid' => $messageSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Api\V2010\Account\Message\MediaContext Context for this * MediaInstance */ protected function proxy() { if (!$this->context) { $this->context = new MediaContext( $this->version, $this->solution['accountSid'], $this->solution['messageSid'], $this->solution['sid'] ); } return $this->context; } /** * Deletes the MediaInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Fetch a MediaInstance * * @return MediaInstance Fetched MediaInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.MediaInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Message/MediaList.php 0000644 00000013211 15002236443 0017062 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Message; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class MediaList extends ListResource { /** * Construct the MediaList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the Account that created this resource * @param string $messageSid The unique string that identifies the resource * @return \Twilio\Rest\Api\V2010\Account\Message\MediaList */ public function __construct(Version $version, $accountSid, $messageSid) { parent::__construct($version); // Path Solution $this->solution = array('accountSid' => $accountSid, 'messageSid' => $messageSid, ); $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/Messages/' . \rawurlencode($messageSid) . '/Media.json'; } /** * Streams MediaInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($options = array(), $limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads MediaInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return MediaInstance[] Array of results */ public function read($options = array(), $limit = null, $pageSize = null) { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Retrieve a single page of MediaInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of MediaInstance */ public function page($options = array(), $pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $options = new Values($options); $params = Values::of(array( 'DateCreated<' => Serialize::iso8601DateTime($options['dateCreatedBefore']), 'DateCreated' => Serialize::iso8601DateTime($options['dateCreated']), 'DateCreated>' => Serialize::iso8601DateTime($options['dateCreatedAfter']), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new MediaPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of MediaInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of MediaInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new MediaPage($this->version, $response, $this->solution); } /** * Constructs a MediaContext * * @param string $sid The unique string that identifies this resource * @return \Twilio\Rest\Api\V2010\Account\Message\MediaContext */ public function getContext($sid) { return new MediaContext( $this->version, $this->solution['accountSid'], $this->solution['messageSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.MediaList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Message/MediaPage.php 0000644 00000001520 15002236443 0017023 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Message; use Twilio\Page; class MediaPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new MediaInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['messageSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.MediaPage]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Message/MediaContext.php 0000644 00000004674 15002236443 0017610 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Message; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; class MediaContext extends InstanceContext { /** * Initialize the MediaContext * * @param \Twilio\Version $version Version that contains the resource * @param string $accountSid The SID of the Account that created the * resource(s) to fetch * @param string $messageSid The SID of the Message resource that this Media * resource belongs to * @param string $sid The unique string that identifies this resource * @return \Twilio\Rest\Api\V2010\Account\Message\MediaContext */ public function __construct(Version $version, $accountSid, $messageSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array('accountSid' => $accountSid, 'messageSid' => $messageSid, 'sid' => $sid, ); $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/Messages/' . \rawurlencode($messageSid) . '/Media/' . \rawurlencode($sid) . '.json'; } /** * Deletes the MediaInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Fetch a MediaInstance * * @return MediaInstance Fetched MediaInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new MediaInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['messageSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.MediaContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/KeyInstance.php 0000644 00000007600 15002236443 0016045 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $friendlyName * @property \DateTime $dateCreated * @property \DateTime $dateUpdated */ class KeyInstance extends InstanceResource { /** * Initialize the KeyInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid A 34 character string that uniquely identifies * this resource. * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Api\V2010\Account\KeyInstance */ public function __construct(Version $version, array $payload, $accountSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'sid' => Values::array_get($payload, 'sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), ); $this->solution = array('accountSid' => $accountSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Api\V2010\Account\KeyContext Context for this * KeyInstance */ protected function proxy() { if (!$this->context) { $this->context = new KeyContext( $this->version, $this->solution['accountSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch a KeyInstance * * @return KeyInstance Fetched KeyInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Update the KeyInstance * * @param array|Options $options Optional Arguments * @return KeyInstance Updated KeyInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Deletes the KeyInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.KeyInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/ValidationRequestList.php 0000644 00000004231 15002236443 0020124 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; class ValidationRequestList extends ListResource { /** * Construct the ValidationRequestList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the Account that created the resource * @return \Twilio\Rest\Api\V2010\Account\ValidationRequestList */ public function __construct(Version $version, $accountSid) { parent::__construct($version); // Path Solution $this->solution = array('accountSid' => $accountSid, ); $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/OutgoingCallerIds.json'; } /** * Create a new ValidationRequestInstance * * @param string $phoneNumber The phone number to verify in E.164 format * @param array|Options $options Optional Arguments * @return ValidationRequestInstance Newly created ValidationRequestInstance * @throws TwilioException When an HTTP error occurs. */ public function create($phoneNumber, $options = array()) { $options = new Values($options); $data = Values::of(array( 'PhoneNumber' => $phoneNumber, 'FriendlyName' => $options['friendlyName'], 'CallDelay' => $options['callDelay'], 'Extension' => $options['extension'], 'StatusCallback' => $options['statusCallback'], 'StatusCallbackMethod' => $options['statusCallbackMethod'], )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new ValidationRequestInstance($this->version, $payload, $this->solution['accountSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.ValidationRequestList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountryList.php 0000644 00000012544 15002236443 0022076 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\ListResource; use Twilio\Values; use Twilio\Version; class AvailablePhoneNumberCountryList extends ListResource { /** * Construct the AvailablePhoneNumberCountryList * * @param Version $version Version that contains the resource * @param string $accountSid A 34 character string that uniquely identifies * this resource. * @return \Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountryList */ public function __construct(Version $version, $accountSid) { parent::__construct($version); // Path Solution $this->solution = array('accountSid' => $accountSid, ); $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/AvailablePhoneNumbers.json'; } /** * Streams AvailablePhoneNumberCountryInstance records from the API as a * generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads AvailablePhoneNumberCountryInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return AvailablePhoneNumberCountryInstance[] Array of results */ public function read($limit = null, $pageSize = null) { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of AvailablePhoneNumberCountryInstance records from * the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of AvailablePhoneNumberCountryInstance */ public function page($pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $params = Values::of(array( 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new AvailablePhoneNumberCountryPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of AvailablePhoneNumberCountryInstance records from * the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of AvailablePhoneNumberCountryInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new AvailablePhoneNumberCountryPage($this->version, $response, $this->solution); } /** * Constructs a AvailablePhoneNumberCountryContext * * @param string $countryCode The ISO country code of the country to fetch * available phone number information about * @return \Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountryContext */ public function getContext($countryCode) { return new AvailablePhoneNumberCountryContext( $this->version, $this->solution['accountSid'], $countryCode ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.AvailablePhoneNumberCountryList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/SipPage.php 0000644 00000001351 15002236443 0015155 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Page; class SipPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new SipInstance($this->version, $payload, $this->solution['accountSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.SipPage]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/BalancePage.php 0000644 00000001365 15002236443 0015754 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Page; class BalancePage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new BalanceInstance($this->version, $payload, $this->solution['accountSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.BalancePage]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Address/DependentPhoneNumberList.php 0000644 00000011572 15002236443 0022125 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Address; use Twilio\ListResource; use Twilio\Values; use Twilio\Version; class DependentPhoneNumberList extends ListResource { /** * Construct the DependentPhoneNumberList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the Account that created the resource * @param string $addressSid The unique string that identifies the resource * @return \Twilio\Rest\Api\V2010\Account\Address\DependentPhoneNumberList */ public function __construct(Version $version, $accountSid, $addressSid) { parent::__construct($version); // Path Solution $this->solution = array('accountSid' => $accountSid, 'addressSid' => $addressSid, ); $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/Addresses/' . \rawurlencode($addressSid) . '/DependentPhoneNumbers.json'; } /** * Streams DependentPhoneNumberInstance records from the API as a generator * stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads DependentPhoneNumberInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return DependentPhoneNumberInstance[] Array of results */ public function read($limit = null, $pageSize = null) { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of DependentPhoneNumberInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of DependentPhoneNumberInstance */ public function page($pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $params = Values::of(array( 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new DependentPhoneNumberPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of DependentPhoneNumberInstance records from the * API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of DependentPhoneNumberInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new DependentPhoneNumberPage($this->version, $response, $this->solution); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.DependentPhoneNumberList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Address/DependentPhoneNumberInstance.php 0000644 00000011455 15002236443 0022756 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Address; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $accountSid * @property string $friendlyName * @property string $phoneNumber * @property string $voiceUrl * @property string $voiceMethod * @property string $voiceFallbackMethod * @property string $voiceFallbackUrl * @property bool $voiceCallerIdLookup * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $smsFallbackMethod * @property string $smsFallbackUrl * @property string $smsMethod * @property string $smsUrl * @property string $addressRequirements * @property array $capabilities * @property string $statusCallback * @property string $statusCallbackMethod * @property string $apiVersion * @property string $smsApplicationSid * @property string $voiceApplicationSid * @property string $trunkSid * @property string $emergencyStatus * @property string $emergencyAddressSid * @property string $uri */ class DependentPhoneNumberInstance extends InstanceResource { /** * Initialize the DependentPhoneNumberInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the Account that created the resource * @param string $addressSid The unique string that identifies the resource * @return \Twilio\Rest\Api\V2010\Account\Address\DependentPhoneNumberInstance */ public function __construct(Version $version, array $payload, $accountSid, $addressSid) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'phoneNumber' => Values::array_get($payload, 'phone_number'), 'voiceUrl' => Values::array_get($payload, 'voice_url'), 'voiceMethod' => Values::array_get($payload, 'voice_method'), 'voiceFallbackMethod' => Values::array_get($payload, 'voice_fallback_method'), 'voiceFallbackUrl' => Values::array_get($payload, 'voice_fallback_url'), 'voiceCallerIdLookup' => Values::array_get($payload, 'voice_caller_id_lookup'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'smsFallbackMethod' => Values::array_get($payload, 'sms_fallback_method'), 'smsFallbackUrl' => Values::array_get($payload, 'sms_fallback_url'), 'smsMethod' => Values::array_get($payload, 'sms_method'), 'smsUrl' => Values::array_get($payload, 'sms_url'), 'addressRequirements' => Values::array_get($payload, 'address_requirements'), 'capabilities' => Values::array_get($payload, 'capabilities'), 'statusCallback' => Values::array_get($payload, 'status_callback'), 'statusCallbackMethod' => Values::array_get($payload, 'status_callback_method'), 'apiVersion' => Values::array_get($payload, 'api_version'), 'smsApplicationSid' => Values::array_get($payload, 'sms_application_sid'), 'voiceApplicationSid' => Values::array_get($payload, 'voice_application_sid'), 'trunkSid' => Values::array_get($payload, 'trunk_sid'), 'emergencyStatus' => Values::array_get($payload, 'emergency_status'), 'emergencyAddressSid' => Values::array_get($payload, 'emergency_address_sid'), 'uri' => Values::array_get($payload, 'uri'), ); $this->solution = array('accountSid' => $accountSid, 'addressSid' => $addressSid, ); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.DependentPhoneNumberInstance]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Address/DependentPhoneNumberPage.php 0000644 00000001575 15002236443 0022070 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Address; use Twilio\Page; class DependentPhoneNumberPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new DependentPhoneNumberInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['addressSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.DependentPhoneNumberPage]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/CallOptions.php 0000644 00000122443 15002236443 0016062 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Options; use Twilio\Values; abstract class CallOptions { /** * @param string $url The absolute URL that returns TwiML for this call * @param string $twiml TwiML instructions for the call * @param string $applicationSid The SID of the Application resource that will * handle the call * @param string $method HTTP method to use to fetch TwiML * @param string $fallbackUrl Fallback URL in case of error * @param string $fallbackMethod HTTP Method to use with fallback_url * @param string $statusCallback The URL we should call to send status * information to your application * @param string $statusCallbackEvent The call progress events that we send to * the `status_callback` URL. * @param string $statusCallbackMethod HTTP Method to use with status_callback * @param string $sendDigits The digits to dial after connecting to the number * @param int $timeout Number of seconds to wait for an answer * @param bool $record Whether to record the call * @param string $recordingChannels The number of channels in the final * recording * @param string $recordingStatusCallback The URL that we call when the * recording is available to be accessed * @param string $recordingStatusCallbackMethod The HTTP method we should use * when calling the * `recording_status_callback` URL * @param string $sipAuthUsername The username used to authenticate the caller * making a SIP call * @param string $sipAuthPassword The password required to authenticate the * user account specified in `sip_auth_username`. * @param string $machineDetection Enable machine detection or end of greeting * detection * @param int $machineDetectionTimeout Number of seconds to wait for machine * detection * @param string $recordingStatusCallbackEvent The recording status events that * will trigger calls to the URL * specified in * `recording_status_callback` * @param string $trim Set this parameter to control trimming of silence on the * recording. * @param string $callerId The phone number, SIP address, or Client identifier * that made this call. Phone numbers are in E.164 * format (e.g., +16175551212). SIP addresses are * formatted as `name@company.com`. * @param int $machineDetectionSpeechThreshold Number of milliseconds for * measuring stick for the length * of the speech activity * @param int $machineDetectionSpeechEndThreshold Number of milliseconds of * silence after speech activity * @param int $machineDetectionSilenceTimeout Number of milliseconds of initial * silence * @return CreateCallOptions Options builder */ public static function create($url = Values::NONE, $twiml = Values::NONE, $applicationSid = Values::NONE, $method = Values::NONE, $fallbackUrl = Values::NONE, $fallbackMethod = Values::NONE, $statusCallback = Values::NONE, $statusCallbackEvent = Values::NONE, $statusCallbackMethod = Values::NONE, $sendDigits = Values::NONE, $timeout = Values::NONE, $record = Values::NONE, $recordingChannels = Values::NONE, $recordingStatusCallback = Values::NONE, $recordingStatusCallbackMethod = Values::NONE, $sipAuthUsername = Values::NONE, $sipAuthPassword = Values::NONE, $machineDetection = Values::NONE, $machineDetectionTimeout = Values::NONE, $recordingStatusCallbackEvent = Values::NONE, $trim = Values::NONE, $callerId = Values::NONE, $machineDetectionSpeechThreshold = Values::NONE, $machineDetectionSpeechEndThreshold = Values::NONE, $machineDetectionSilenceTimeout = Values::NONE) { return new CreateCallOptions($url, $twiml, $applicationSid, $method, $fallbackUrl, $fallbackMethod, $statusCallback, $statusCallbackEvent, $statusCallbackMethod, $sendDigits, $timeout, $record, $recordingChannels, $recordingStatusCallback, $recordingStatusCallbackMethod, $sipAuthUsername, $sipAuthPassword, $machineDetection, $machineDetectionTimeout, $recordingStatusCallbackEvent, $trim, $callerId, $machineDetectionSpeechThreshold, $machineDetectionSpeechEndThreshold, $machineDetectionSilenceTimeout); } /** * @param string $to Phone number or Client identifier of calls to include * @param string $from Phone number or Client identifier to filter `from` on * @param string $parentCallSid Parent call SID to filter on * @param string $status The status of the resources to read * @param string $startTimeBefore Only include calls that started on this date * @param string $startTime Only include calls that started on this date * @param string $startTimeAfter Only include calls that started on this date * @param string $endTimeBefore Only include calls that ended on this date * @param string $endTime Only include calls that ended on this date * @param string $endTimeAfter Only include calls that ended on this date * @return ReadCallOptions Options builder */ public static function read($to = Values::NONE, $from = Values::NONE, $parentCallSid = Values::NONE, $status = Values::NONE, $startTimeBefore = Values::NONE, $startTime = Values::NONE, $startTimeAfter = Values::NONE, $endTimeBefore = Values::NONE, $endTime = Values::NONE, $endTimeAfter = Values::NONE) { return new ReadCallOptions($to, $from, $parentCallSid, $status, $startTimeBefore, $startTime, $startTimeAfter, $endTimeBefore, $endTime, $endTimeAfter); } /** * @param string $url The absolute URL that returns TwiML for this call * @param string $method HTTP method to use to fetch TwiML * @param string $status The new status to update the call with. * @param string $fallbackUrl Fallback URL in case of error * @param string $fallbackMethod HTTP Method to use with fallback_url * @param string $statusCallback The URL we should call to send status * information to your application * @param string $statusCallbackMethod HTTP Method to use to call * status_callback * @param string $twiml TwiML instructions for the call * @return UpdateCallOptions Options builder */ public static function update($url = Values::NONE, $method = Values::NONE, $status = Values::NONE, $fallbackUrl = Values::NONE, $fallbackMethod = Values::NONE, $statusCallback = Values::NONE, $statusCallbackMethod = Values::NONE, $twiml = Values::NONE) { return new UpdateCallOptions($url, $method, $status, $fallbackUrl, $fallbackMethod, $statusCallback, $statusCallbackMethod, $twiml); } } class CreateCallOptions extends Options { /** * @param string $url The absolute URL that returns TwiML for this call * @param string $twiml TwiML instructions for the call * @param string $applicationSid The SID of the Application resource that will * handle the call * @param string $method HTTP method to use to fetch TwiML * @param string $fallbackUrl Fallback URL in case of error * @param string $fallbackMethod HTTP Method to use with fallback_url * @param string $statusCallback The URL we should call to send status * information to your application * @param string $statusCallbackEvent The call progress events that we send to * the `status_callback` URL. * @param string $statusCallbackMethod HTTP Method to use with status_callback * @param string $sendDigits The digits to dial after connecting to the number * @param int $timeout Number of seconds to wait for an answer * @param bool $record Whether to record the call * @param string $recordingChannels The number of channels in the final * recording * @param string $recordingStatusCallback The URL that we call when the * recording is available to be accessed * @param string $recordingStatusCallbackMethod The HTTP method we should use * when calling the * `recording_status_callback` URL * @param string $sipAuthUsername The username used to authenticate the caller * making a SIP call * @param string $sipAuthPassword The password required to authenticate the * user account specified in `sip_auth_username`. * @param string $machineDetection Enable machine detection or end of greeting * detection * @param int $machineDetectionTimeout Number of seconds to wait for machine * detection * @param string $recordingStatusCallbackEvent The recording status events that * will trigger calls to the URL * specified in * `recording_status_callback` * @param string $trim Set this parameter to control trimming of silence on the * recording. * @param string $callerId The phone number, SIP address, or Client identifier * that made this call. Phone numbers are in E.164 * format (e.g., +16175551212). SIP addresses are * formatted as `name@company.com`. * @param int $machineDetectionSpeechThreshold Number of milliseconds for * measuring stick for the length * of the speech activity * @param int $machineDetectionSpeechEndThreshold Number of milliseconds of * silence after speech activity * @param int $machineDetectionSilenceTimeout Number of milliseconds of initial * silence */ public function __construct($url = Values::NONE, $twiml = Values::NONE, $applicationSid = Values::NONE, $method = Values::NONE, $fallbackUrl = Values::NONE, $fallbackMethod = Values::NONE, $statusCallback = Values::NONE, $statusCallbackEvent = Values::NONE, $statusCallbackMethod = Values::NONE, $sendDigits = Values::NONE, $timeout = Values::NONE, $record = Values::NONE, $recordingChannels = Values::NONE, $recordingStatusCallback = Values::NONE, $recordingStatusCallbackMethod = Values::NONE, $sipAuthUsername = Values::NONE, $sipAuthPassword = Values::NONE, $machineDetection = Values::NONE, $machineDetectionTimeout = Values::NONE, $recordingStatusCallbackEvent = Values::NONE, $trim = Values::NONE, $callerId = Values::NONE, $machineDetectionSpeechThreshold = Values::NONE, $machineDetectionSpeechEndThreshold = Values::NONE, $machineDetectionSilenceTimeout = Values::NONE) { $this->options['url'] = $url; $this->options['twiml'] = $twiml; $this->options['applicationSid'] = $applicationSid; $this->options['method'] = $method; $this->options['fallbackUrl'] = $fallbackUrl; $this->options['fallbackMethod'] = $fallbackMethod; $this->options['statusCallback'] = $statusCallback; $this->options['statusCallbackEvent'] = $statusCallbackEvent; $this->options['statusCallbackMethod'] = $statusCallbackMethod; $this->options['sendDigits'] = $sendDigits; $this->options['timeout'] = $timeout; $this->options['record'] = $record; $this->options['recordingChannels'] = $recordingChannels; $this->options['recordingStatusCallback'] = $recordingStatusCallback; $this->options['recordingStatusCallbackMethod'] = $recordingStatusCallbackMethod; $this->options['sipAuthUsername'] = $sipAuthUsername; $this->options['sipAuthPassword'] = $sipAuthPassword; $this->options['machineDetection'] = $machineDetection; $this->options['machineDetectionTimeout'] = $machineDetectionTimeout; $this->options['recordingStatusCallbackEvent'] = $recordingStatusCallbackEvent; $this->options['trim'] = $trim; $this->options['callerId'] = $callerId; $this->options['machineDetectionSpeechThreshold'] = $machineDetectionSpeechThreshold; $this->options['machineDetectionSpeechEndThreshold'] = $machineDetectionSpeechEndThreshold; $this->options['machineDetectionSilenceTimeout'] = $machineDetectionSilenceTimeout; } /** * The absolute URL that returns the TwiML instructions for the call. We will call this URL using the `method` when the call connects. For more information, see the [Url Parameter](https://www.twilio.com/docs/voice/make-calls#specify-a-url-parameter) section in [Making Calls](https://www.twilio.com/docs/voice/make-calls). * * @param string $url The absolute URL that returns TwiML for this call * @return $this Fluent Builder */ public function setUrl($url) { $this->options['url'] = $url; return $this; } /** * TwiML instructions for the call Twilio will use without fetching Twiml from url parameter. If both `twiml` and `url` are provided then `twiml` parameter will be ignored. * * @param string $twiml TwiML instructions for the call * @return $this Fluent Builder */ public function setTwiml($twiml) { $this->options['twiml'] = $twiml; return $this; } /** * The SID of the Application resource that will handle the call, if the call will be handled by an application. * * @param string $applicationSid The SID of the Application resource that will * handle the call * @return $this Fluent Builder */ public function setApplicationSid($applicationSid) { $this->options['applicationSid'] = $applicationSid; return $this; } /** * The HTTP method we should use when calling the `url` parameter's value. Can be: `GET` or `POST` and the default is `POST`. If an `application_sid` parameter is present, this parameter is ignored. * * @param string $method HTTP method to use to fetch TwiML * @return $this Fluent Builder */ public function setMethod($method) { $this->options['method'] = $method; return $this; } /** * The URL that we call using the `fallback_method` if an error occurs when requesting or executing the TwiML at `url`. If an `application_sid` parameter is present, this parameter is ignored. * * @param string $fallbackUrl Fallback URL in case of error * @return $this Fluent Builder */ public function setFallbackUrl($fallbackUrl) { $this->options['fallbackUrl'] = $fallbackUrl; return $this; } /** * The HTTP method that we should use to request the `fallback_url`. Can be: `GET` or `POST` and the default is `POST`. If an `application_sid` parameter is present, this parameter is ignored. * * @param string $fallbackMethod HTTP Method to use with fallback_url * @return $this Fluent Builder */ public function setFallbackMethod($fallbackMethod) { $this->options['fallbackMethod'] = $fallbackMethod; return $this; } /** * The URL we should call using the `status_callback_method` to send status information to your application. If no `status_callback_event` is specified, we will send the `completed` status. If an `application_sid` parameter is present, this parameter is ignored. URLs must contain a valid hostname (underscores are not permitted). * * @param string $statusCallback The URL we should call to send status * information to your application * @return $this Fluent Builder */ public function setStatusCallback($statusCallback) { $this->options['statusCallback'] = $statusCallback; return $this; } /** * The call progress events that we will send to the `status_callback` URL. Can be: `initiated`, `ringing`, `answered`, and `completed`. If no event is specified, we send the `completed` status. If you want to receive multiple events, specify each one in a separate `status_callback_event` parameter. See the code sample for [monitoring call progress](https://www.twilio.com/docs/voice/api/call-resource?code-sample=code-create-a-call-resource-and-specify-a-statuscallbackevent&code-sdk-version=json). If an `application_sid` is present, this parameter is ignored. * * @param string $statusCallbackEvent The call progress events that we send to * the `status_callback` URL. * @return $this Fluent Builder */ public function setStatusCallbackEvent($statusCallbackEvent) { $this->options['statusCallbackEvent'] = $statusCallbackEvent; return $this; } /** * The HTTP method we should use when calling the `status_callback` URL. Can be: `GET` or `POST` and the default is `POST`. If an `application_sid` parameter is present, this parameter is ignored. * * @param string $statusCallbackMethod HTTP Method to use with status_callback * @return $this Fluent Builder */ public function setStatusCallbackMethod($statusCallbackMethod) { $this->options['statusCallbackMethod'] = $statusCallbackMethod; return $this; } /** * A string of keys to dial after connecting to the number, maximum of 32 digits. Valid digits in the string include: any digit (`0`-`9`), '`#`', '`*`' and '`w`', to insert a half second pause. For example, if you connected to a company phone number and wanted to pause for one second, and then dial extension 1234 followed by the pound key, the value of this parameter would be `ww1234#`. Remember to URL-encode this string, since the '`#`' character has special meaning in a URL. If both `SendDigits` and `MachineDetection` parameters are provided, then `MachineDetection` will be ignored. * * @param string $sendDigits The digits to dial after connecting to the number * @return $this Fluent Builder */ public function setSendDigits($sendDigits) { $this->options['sendDigits'] = $sendDigits; return $this; } /** * The integer number of seconds that we should allow the phone to ring before assuming there is no answer. The default is `60` seconds and the maximum is `600` seconds. For some call flows, we will add a 5-second buffer to the timeout value you provide. For this reason, a timeout value of 10 seconds could result in an actual timeout closer to 15 seconds. You can set this to a short time, such as `15` seconds, to hang up before reaching an answering machine or voicemail. * * @param int $timeout Number of seconds to wait for an answer * @return $this Fluent Builder */ public function setTimeout($timeout) { $this->options['timeout'] = $timeout; return $this; } /** * Whether to record the call. Can be `true` to record the phone call, or `false` to not. The default is `false`. The `recording_url` is sent to the `status_callback` URL. * * @param bool $record Whether to record the call * @return $this Fluent Builder */ public function setRecord($record) { $this->options['record'] = $record; return $this; } /** * The number of channels in the final recording. Can be: `mono` or `dual`. The default is `mono`. `mono` records both legs of the call in a single channel of the recording file. `dual` records each leg to a separate channel of the recording file. The first channel of a dual-channel recording contains the parent call and the second channel contains the child call. * * @param string $recordingChannels The number of channels in the final * recording * @return $this Fluent Builder */ public function setRecordingChannels($recordingChannels) { $this->options['recordingChannels'] = $recordingChannels; return $this; } /** * The URL that we call when the recording is available to be accessed. * * @param string $recordingStatusCallback The URL that we call when the * recording is available to be accessed * @return $this Fluent Builder */ public function setRecordingStatusCallback($recordingStatusCallback) { $this->options['recordingStatusCallback'] = $recordingStatusCallback; return $this; } /** * The HTTP method we should use when calling the `recording_status_callback` URL. Can be: `GET` or `POST` and the default is `POST`. * * @param string $recordingStatusCallbackMethod The HTTP method we should use * when calling the * `recording_status_callback` URL * @return $this Fluent Builder */ public function setRecordingStatusCallbackMethod($recordingStatusCallbackMethod) { $this->options['recordingStatusCallbackMethod'] = $recordingStatusCallbackMethod; return $this; } /** * The username used to authenticate the caller making a SIP call. * * @param string $sipAuthUsername The username used to authenticate the caller * making a SIP call * @return $this Fluent Builder */ public function setSipAuthUsername($sipAuthUsername) { $this->options['sipAuthUsername'] = $sipAuthUsername; return $this; } /** * The password required to authenticate the user account specified in `sip_auth_username`. * * @param string $sipAuthPassword The password required to authenticate the * user account specified in `sip_auth_username`. * @return $this Fluent Builder */ public function setSipAuthPassword($sipAuthPassword) { $this->options['sipAuthPassword'] = $sipAuthPassword; return $this; } /** * Whether to detect if a human, answering machine, or fax has picked up the call. Can be: `Enable` or `DetectMessageEnd`. Use `Enable` if you would like us to return `AnsweredBy` as soon as the called party is identified. Use `DetectMessageEnd`, if you would like to leave a message on an answering machine. If `send_digits` is provided, this parameter is ignored. For more information, see [Answering Machine Detection](https://www.twilio.com/docs/voice/answering-machine-detection). * * @param string $machineDetection Enable machine detection or end of greeting * detection * @return $this Fluent Builder */ public function setMachineDetection($machineDetection) { $this->options['machineDetection'] = $machineDetection; return $this; } /** * The number of seconds that we should attempt to detect an answering machine before timing out and sending a voice request with `AnsweredBy` of `unknown`. The default timeout is 30 seconds. * * @param int $machineDetectionTimeout Number of seconds to wait for machine * detection * @return $this Fluent Builder */ public function setMachineDetectionTimeout($machineDetectionTimeout) { $this->options['machineDetectionTimeout'] = $machineDetectionTimeout; return $this; } /** * The recording status events that will trigger calls to the URL specified in `recording_status_callback`. Can be: `in-progress`, `completed` and `absent`. Defaults to `completed`. Separate multiple values with a space. * * @param string $recordingStatusCallbackEvent The recording status events that * will trigger calls to the URL * specified in * `recording_status_callback` * @return $this Fluent Builder */ public function setRecordingStatusCallbackEvent($recordingStatusCallbackEvent) { $this->options['recordingStatusCallbackEvent'] = $recordingStatusCallbackEvent; return $this; } /** * Whether to trim any leading and trailing silence from the recording. Can be: `trim-silence` or `do-not-trim` and the default is `trim-silence`. * * @param string $trim Set this parameter to control trimming of silence on the * recording. * @return $this Fluent Builder */ public function setTrim($trim) { $this->options['trim'] = $trim; return $this; } /** * The phone number, SIP address, or Client identifier that made this call. Phone numbers are in [E.164 format](https://wwnw.twilio.com/docs/glossary/what-e164) (e.g., +16175551212). SIP addresses are formatted as `name@company.com`. * * @param string $callerId The phone number, SIP address, or Client identifier * that made this call. Phone numbers are in E.164 * format (e.g., +16175551212). SIP addresses are * formatted as `name@company.com`. * @return $this Fluent Builder */ public function setCallerId($callerId) { $this->options['callerId'] = $callerId; return $this; } /** * The number of milliseconds that is used as the measuring stick for the length of the speech activity, where durations lower than this value will be interpreted as a human and longer than this value as a machine. Possible Values: 1000-6000. Default: 2400. * * @param int $machineDetectionSpeechThreshold Number of milliseconds for * measuring stick for the length * of the speech activity * @return $this Fluent Builder */ public function setMachineDetectionSpeechThreshold($machineDetectionSpeechThreshold) { $this->options['machineDetectionSpeechThreshold'] = $machineDetectionSpeechThreshold; return $this; } /** * The number of milliseconds of silence after speech activity at which point the speech activity is considered complete. Possible Values: 500-5000. Default: 1200. * * @param int $machineDetectionSpeechEndThreshold Number of milliseconds of * silence after speech activity * @return $this Fluent Builder */ public function setMachineDetectionSpeechEndThreshold($machineDetectionSpeechEndThreshold) { $this->options['machineDetectionSpeechEndThreshold'] = $machineDetectionSpeechEndThreshold; return $this; } /** * The number of milliseconds of initial silence after which an `unknown` AnsweredBy result will be returned. Possible Values: 2000-10000. Default: 5000. * * @param int $machineDetectionSilenceTimeout Number of milliseconds of initial * silence * @return $this Fluent Builder */ public function setMachineDetectionSilenceTimeout($machineDetectionSilenceTimeout) { $this->options['machineDetectionSilenceTimeout'] = $machineDetectionSilenceTimeout; 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.CreateCallOptions ' . \implode(' ', $options) . ']'; } } class ReadCallOptions extends Options { /** * @param string $to Phone number or Client identifier of calls to include * @param string $from Phone number or Client identifier to filter `from` on * @param string $parentCallSid Parent call SID to filter on * @param string $status The status of the resources to read * @param string $startTimeBefore Only include calls that started on this date * @param string $startTime Only include calls that started on this date * @param string $startTimeAfter Only include calls that started on this date * @param string $endTimeBefore Only include calls that ended on this date * @param string $endTime Only include calls that ended on this date * @param string $endTimeAfter Only include calls that ended on this date */ public function __construct($to = Values::NONE, $from = Values::NONE, $parentCallSid = Values::NONE, $status = Values::NONE, $startTimeBefore = Values::NONE, $startTime = Values::NONE, $startTimeAfter = Values::NONE, $endTimeBefore = Values::NONE, $endTime = Values::NONE, $endTimeAfter = Values::NONE) { $this->options['to'] = $to; $this->options['from'] = $from; $this->options['parentCallSid'] = $parentCallSid; $this->options['status'] = $status; $this->options['startTimeBefore'] = $startTimeBefore; $this->options['startTime'] = $startTime; $this->options['startTimeAfter'] = $startTimeAfter; $this->options['endTimeBefore'] = $endTimeBefore; $this->options['endTime'] = $endTime; $this->options['endTimeAfter'] = $endTimeAfter; } /** * Only show calls made to this phone number, SIP address, Client identifier or SIM SID. * * @param string $to Phone number or Client identifier of calls to include * @return $this Fluent Builder */ public function setTo($to) { $this->options['to'] = $to; return $this; } /** * Only include calls from this phone number, SIP address, Client identifier or SIM SID. * * @param string $from Phone number or Client identifier to filter `from` on * @return $this Fluent Builder */ public function setFrom($from) { $this->options['from'] = $from; return $this; } /** * Only include calls spawned by calls with this SID. * * @param string $parentCallSid Parent call SID to filter on * @return $this Fluent Builder */ public function setParentCallSid($parentCallSid) { $this->options['parentCallSid'] = $parentCallSid; return $this; } /** * The status of the calls to include. Can be: `queued`, `ringing`, `in-progress`, `canceled`, `completed`, `failed`, `busy`, or `no-answer`. * * @param string $status The status of the resources to read * @return $this Fluent Builder */ public function setStatus($status) { $this->options['status'] = $status; return $this; } /** * Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. * * @param string $startTimeBefore Only include calls that started on this date * @return $this Fluent Builder */ public function setStartTimeBefore($startTimeBefore) { $this->options['startTimeBefore'] = $startTimeBefore; return $this; } /** * Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. * * @param string $startTime Only include calls that started on this date * @return $this Fluent Builder */ public function setStartTime($startTime) { $this->options['startTime'] = $startTime; return $this; } /** * Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. * * @param string $startTimeAfter Only include calls that started on this date * @return $this Fluent Builder */ public function setStartTimeAfter($startTimeAfter) { $this->options['startTimeAfter'] = $startTimeAfter; return $this; } /** * Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. * * @param string $endTimeBefore Only include calls that ended on this date * @return $this Fluent Builder */ public function setEndTimeBefore($endTimeBefore) { $this->options['endTimeBefore'] = $endTimeBefore; return $this; } /** * Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. * * @param string $endTime Only include calls that ended on this date * @return $this Fluent Builder */ public function setEndTime($endTime) { $this->options['endTime'] = $endTime; return $this; } /** * Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. * * @param string $endTimeAfter Only include calls that ended on this date * @return $this Fluent Builder */ public function setEndTimeAfter($endTimeAfter) { $this->options['endTimeAfter'] = $endTimeAfter; 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.ReadCallOptions ' . \implode(' ', $options) . ']'; } } class UpdateCallOptions extends Options { /** * @param string $url The absolute URL that returns TwiML for this call * @param string $method HTTP method to use to fetch TwiML * @param string $status The new status to update the call with. * @param string $fallbackUrl Fallback URL in case of error * @param string $fallbackMethod HTTP Method to use with fallback_url * @param string $statusCallback The URL we should call to send status * information to your application * @param string $statusCallbackMethod HTTP Method to use to call * status_callback * @param string $twiml TwiML instructions for the call */ public function __construct($url = Values::NONE, $method = Values::NONE, $status = Values::NONE, $fallbackUrl = Values::NONE, $fallbackMethod = Values::NONE, $statusCallback = Values::NONE, $statusCallbackMethod = Values::NONE, $twiml = Values::NONE) { $this->options['url'] = $url; $this->options['method'] = $method; $this->options['status'] = $status; $this->options['fallbackUrl'] = $fallbackUrl; $this->options['fallbackMethod'] = $fallbackMethod; $this->options['statusCallback'] = $statusCallback; $this->options['statusCallbackMethod'] = $statusCallbackMethod; $this->options['twiml'] = $twiml; } /** * The absolute URL that returns the TwiML instructions for the call. We will call this URL using the `method` when the call connects. For more information, see the [Url Parameter](https://www.twilio.com/docs/voice/make-calls#specify-a-url-parameter) section in [Making Calls](https://www.twilio.com/docs/voice/make-calls). * * @param string $url The absolute URL that returns TwiML for this call * @return $this Fluent Builder */ public function setUrl($url) { $this->options['url'] = $url; return $this; } /** * The HTTP method we should use when calling the `url`. Can be: `GET` or `POST` and the default is `POST`. If an `application_sid` parameter is present, this parameter is ignored. * * @param string $method HTTP method to use to fetch TwiML * @return $this Fluent Builder */ public function setMethod($method) { $this->options['method'] = $method; return $this; } /** * The new status of the resource. Can be: `canceled` or `completed`. Specifying `canceled` will attempt to hang up calls that are queued or ringing; however, it will not affect calls already in progress. Specifying `completed` will attempt to hang up a call even if it's already in progress. * * @param string $status The new status to update the call with. * @return $this Fluent Builder */ public function setStatus($status) { $this->options['status'] = $status; return $this; } /** * The URL that we call using the `fallback_method` if an error occurs when requesting or executing the TwiML at `url`. If an `application_sid` parameter is present, this parameter is ignored. * * @param string $fallbackUrl Fallback URL in case of error * @return $this Fluent Builder */ public function setFallbackUrl($fallbackUrl) { $this->options['fallbackUrl'] = $fallbackUrl; return $this; } /** * The HTTP method that we should use to request the `fallback_url`. Can be: `GET` or `POST` and the default is `POST`. If an `application_sid` parameter is present, this parameter is ignored. * * @param string $fallbackMethod HTTP Method to use with fallback_url * @return $this Fluent Builder */ public function setFallbackMethod($fallbackMethod) { $this->options['fallbackMethod'] = $fallbackMethod; return $this; } /** * The URL we should call using the `status_callback_method` to send status information to your application. If no `status_callback_event` is specified, we will send the `completed` status. If an `application_sid` parameter is present, this parameter is ignored. URLs must contain a valid hostname (underscores are not permitted). * * @param string $statusCallback The URL we should call to send status * information to your application * @return $this Fluent Builder */ public function setStatusCallback($statusCallback) { $this->options['statusCallback'] = $statusCallback; return $this; } /** * The HTTP method we should use when requesting the `status_callback` URL. Can be: `GET` or `POST` and the default is `POST`. If an `application_sid` parameter is present, this parameter is ignored. * * @param string $statusCallbackMethod HTTP Method to use to call * status_callback * @return $this Fluent Builder */ public function setStatusCallbackMethod($statusCallbackMethod) { $this->options['statusCallbackMethod'] = $statusCallbackMethod; return $this; } /** * TwiML instructions for the call Twilio will use without fetching Twiml from url. Twiml and url parameters are mutually exclusive * * @param string $twiml TwiML instructions for the call * @return $this Fluent Builder */ public function setTwiml($twiml) { $this->options['twiml'] = $twiml; 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.UpdateCallOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/AuthorizedConnectAppPage.php 0000644 00000001434 15002236443 0020515 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Page; class AuthorizedConnectAppPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new AuthorizedConnectAppInstance($this->version, $payload, $this->solution['accountSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.AuthorizedConnectAppPage]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Conference/ParticipantInstance.php 0000644 00000012465 15002236443 0021647 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Conference; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property string $callSid * @property string $callSidToCoach * @property bool $coaching * @property string $conferenceSid * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property bool $endConferenceOnExit * @property bool $muted * @property bool $hold * @property bool $startConferenceOnEnter * @property string $status * @property string $uri */ class ParticipantInstance extends InstanceResource { /** * Initialize the ParticipantInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the Account that created the resource * @param string $conferenceSid The SID of the conference the participant is in * @param string $callSid The Call SID of the resource to fetch * @return \Twilio\Rest\Api\V2010\Account\Conference\ParticipantInstance */ public function __construct(Version $version, array $payload, $accountSid, $conferenceSid, $callSid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'accountSid' => Values::array_get($payload, 'account_sid'), 'callSid' => Values::array_get($payload, 'call_sid'), 'callSidToCoach' => Values::array_get($payload, 'call_sid_to_coach'), 'coaching' => Values::array_get($payload, 'coaching'), 'conferenceSid' => Values::array_get($payload, 'conference_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'endConferenceOnExit' => Values::array_get($payload, 'end_conference_on_exit'), 'muted' => Values::array_get($payload, 'muted'), 'hold' => Values::array_get($payload, 'hold'), 'startConferenceOnEnter' => Values::array_get($payload, 'start_conference_on_enter'), 'status' => Values::array_get($payload, 'status'), 'uri' => Values::array_get($payload, 'uri'), ); $this->solution = array( 'accountSid' => $accountSid, 'conferenceSid' => $conferenceSid, 'callSid' => $callSid ?: $this->properties['callSid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Api\V2010\Account\Conference\ParticipantContext Context * for * this * ParticipantInstance */ protected function proxy() { if (!$this->context) { $this->context = new ParticipantContext( $this->version, $this->solution['accountSid'], $this->solution['conferenceSid'], $this->solution['callSid'] ); } return $this->context; } /** * Fetch a ParticipantInstance * * @return ParticipantInstance Fetched ParticipantInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Update the ParticipantInstance * * @param array|Options $options Optional Arguments * @return ParticipantInstance Updated ParticipantInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Deletes the ParticipantInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.ParticipantInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Conference/ParticipantList.php 0000644 00000022045 15002236443 0021011 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Conference; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class ParticipantList extends ListResource { /** * Construct the ParticipantList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the Account that created the resource * @param string $conferenceSid The SID of the conference the participant is in * @return \Twilio\Rest\Api\V2010\Account\Conference\ParticipantList */ public function __construct(Version $version, $accountSid, $conferenceSid) { parent::__construct($version); // Path Solution $this->solution = array('accountSid' => $accountSid, 'conferenceSid' => $conferenceSid, ); $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/Conferences/' . \rawurlencode($conferenceSid) . '/Participants.json'; } /** * Create a new ParticipantInstance * * @param string $from The `from` phone number used to invite a participant * @param string $to The number, client id, or sip address of the new * participant * @param array|Options $options Optional Arguments * @return ParticipantInstance Newly created ParticipantInstance * @throws TwilioException When an HTTP error occurs. */ public function create($from, $to, $options = array()) { $options = new Values($options); $data = Values::of(array( 'From' => $from, 'To' => $to, 'StatusCallback' => $options['statusCallback'], 'StatusCallbackMethod' => $options['statusCallbackMethod'], 'StatusCallbackEvent' => Serialize::map($options['statusCallbackEvent'], function($e) { return $e; }), 'Timeout' => $options['timeout'], 'Record' => Serialize::booleanToString($options['record']), 'Muted' => Serialize::booleanToString($options['muted']), 'Beep' => $options['beep'], 'StartConferenceOnEnter' => Serialize::booleanToString($options['startConferenceOnEnter']), 'EndConferenceOnExit' => Serialize::booleanToString($options['endConferenceOnExit']), 'WaitUrl' => $options['waitUrl'], 'WaitMethod' => $options['waitMethod'], 'EarlyMedia' => Serialize::booleanToString($options['earlyMedia']), 'MaxParticipants' => $options['maxParticipants'], 'ConferenceRecord' => $options['conferenceRecord'], 'ConferenceTrim' => $options['conferenceTrim'], 'ConferenceStatusCallback' => $options['conferenceStatusCallback'], 'ConferenceStatusCallbackMethod' => $options['conferenceStatusCallbackMethod'], 'ConferenceStatusCallbackEvent' => Serialize::map($options['conferenceStatusCallbackEvent'], function($e) { return $e; }), 'RecordingChannels' => $options['recordingChannels'], 'RecordingStatusCallback' => $options['recordingStatusCallback'], 'RecordingStatusCallbackMethod' => $options['recordingStatusCallbackMethod'], 'SipAuthUsername' => $options['sipAuthUsername'], 'SipAuthPassword' => $options['sipAuthPassword'], 'Region' => $options['region'], 'ConferenceRecordingStatusCallback' => $options['conferenceRecordingStatusCallback'], 'ConferenceRecordingStatusCallbackMethod' => $options['conferenceRecordingStatusCallbackMethod'], 'RecordingStatusCallbackEvent' => Serialize::map($options['recordingStatusCallbackEvent'], function($e) { return $e; }), 'ConferenceRecordingStatusCallbackEvent' => Serialize::map($options['conferenceRecordingStatusCallbackEvent'], function($e) { return $e; }), 'Coaching' => Serialize::booleanToString($options['coaching']), 'CallSidToCoach' => $options['callSidToCoach'], )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new ParticipantInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['conferenceSid'] ); } /** * Streams ParticipantInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($options = array(), $limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads ParticipantInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return ParticipantInstance[] Array of results */ public function read($options = array(), $limit = null, $pageSize = null) { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Retrieve a single page of ParticipantInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of ParticipantInstance */ public function page($options = array(), $pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $options = new Values($options); $params = Values::of(array( 'Muted' => Serialize::booleanToString($options['muted']), 'Hold' => Serialize::booleanToString($options['hold']), 'Coaching' => Serialize::booleanToString($options['coaching']), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new ParticipantPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of ParticipantInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of ParticipantInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new ParticipantPage($this->version, $response, $this->solution); } /** * Constructs a ParticipantContext * * @param string $callSid The Call SID of the resource to fetch * @return \Twilio\Rest\Api\V2010\Account\Conference\ParticipantContext */ public function getContext($callSid) { return new ParticipantContext( $this->version, $this->solution['accountSid'], $this->solution['conferenceSid'], $callSid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.ParticipantList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Conference/RecordingInstance.php 0000644 00000013256 15002236443 0021304 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Conference; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property string $apiVersion * @property string $callSid * @property string $conferenceSid * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property \DateTime $startTime * @property string $duration * @property string $sid * @property string $price * @property string $priceUnit * @property string $status * @property int $channels * @property string $source * @property int $errorCode * @property array $encryptionDetails * @property string $uri */ class RecordingInstance extends InstanceResource { /** * Initialize the RecordingInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the Account that created the resource * @param string $conferenceSid The Conference SID that identifies the * conference associated with the recording * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Api\V2010\Account\Conference\RecordingInstance */ public function __construct(Version $version, array $payload, $accountSid, $conferenceSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'accountSid' => Values::array_get($payload, 'account_sid'), 'apiVersion' => Values::array_get($payload, 'api_version'), 'callSid' => Values::array_get($payload, 'call_sid'), 'conferenceSid' => Values::array_get($payload, 'conference_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'startTime' => Deserialize::dateTime(Values::array_get($payload, 'start_time')), 'duration' => Values::array_get($payload, 'duration'), 'sid' => Values::array_get($payload, 'sid'), 'price' => Values::array_get($payload, 'price'), 'priceUnit' => Values::array_get($payload, 'price_unit'), 'status' => Values::array_get($payload, 'status'), 'channels' => Values::array_get($payload, 'channels'), 'source' => Values::array_get($payload, 'source'), 'errorCode' => Values::array_get($payload, 'error_code'), 'encryptionDetails' => Values::array_get($payload, 'encryption_details'), 'uri' => Values::array_get($payload, 'uri'), ); $this->solution = array( 'accountSid' => $accountSid, 'conferenceSid' => $conferenceSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Api\V2010\Account\Conference\RecordingContext Context * for this * RecordingInstance */ protected function proxy() { if (!$this->context) { $this->context = new RecordingContext( $this->version, $this->solution['accountSid'], $this->solution['conferenceSid'], $this->solution['sid'] ); } return $this->context; } /** * Update the RecordingInstance * * @param string $status The new status of the recording * @param array|Options $options Optional Arguments * @return RecordingInstance Updated RecordingInstance * @throws TwilioException When an HTTP error occurs. */ public function update($status, $options = array()) { return $this->proxy()->update($status, $options); } /** * Fetch a RecordingInstance * * @return RecordingInstance Fetched RecordingInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the RecordingInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.RecordingInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Conference/RecordingList.php 0000644 00000013443 15002236443 0020451 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Conference; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class RecordingList extends ListResource { /** * Construct the RecordingList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the Account that created the resource * @param string $conferenceSid The Conference SID that identifies the * conference associated with the recording * @return \Twilio\Rest\Api\V2010\Account\Conference\RecordingList */ public function __construct(Version $version, $accountSid, $conferenceSid) { parent::__construct($version); // Path Solution $this->solution = array('accountSid' => $accountSid, 'conferenceSid' => $conferenceSid, ); $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/Conferences/' . \rawurlencode($conferenceSid) . '/Recordings.json'; } /** * Streams RecordingInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($options = array(), $limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads RecordingInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return RecordingInstance[] Array of results */ public function read($options = array(), $limit = null, $pageSize = null) { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Retrieve a single page of RecordingInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of RecordingInstance */ public function page($options = array(), $pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $options = new Values($options); $params = Values::of(array( 'DateCreated<' => Serialize::iso8601Date($options['dateCreatedBefore']), 'DateCreated' => Serialize::iso8601Date($options['dateCreated']), 'DateCreated>' => Serialize::iso8601Date($options['dateCreatedAfter']), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new RecordingPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of RecordingInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of RecordingInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new RecordingPage($this->version, $response, $this->solution); } /** * Constructs a RecordingContext * * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Api\V2010\Account\Conference\RecordingContext */ public function getContext($sid) { return new RecordingContext( $this->version, $this->solution['accountSid'], $this->solution['conferenceSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.RecordingList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Conference/ParticipantContext.php 0000644 00000010125 15002236443 0021516 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Conference; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class ParticipantContext extends InstanceContext { /** * Initialize the ParticipantContext * * @param \Twilio\Version $version Version that contains the resource * @param string $accountSid The SID of the Account that created the resource * to fetch * @param string $conferenceSid The SID of the conference with the participant * to fetch * @param string $callSid The Call SID of the resource to fetch * @return \Twilio\Rest\Api\V2010\Account\Conference\ParticipantContext */ public function __construct(Version $version, $accountSid, $conferenceSid, $callSid) { parent::__construct($version); // Path Solution $this->solution = array( 'accountSid' => $accountSid, 'conferenceSid' => $conferenceSid, 'callSid' => $callSid, ); $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/Conferences/' . \rawurlencode($conferenceSid) . '/Participants/' . \rawurlencode($callSid) . '.json'; } /** * Fetch a ParticipantInstance * * @return ParticipantInstance Fetched ParticipantInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new ParticipantInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['conferenceSid'], $this->solution['callSid'] ); } /** * Update the ParticipantInstance * * @param array|Options $options Optional Arguments * @return ParticipantInstance Updated ParticipantInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { $options = new Values($options); $data = Values::of(array( 'Muted' => Serialize::booleanToString($options['muted']), 'Hold' => Serialize::booleanToString($options['hold']), 'HoldUrl' => $options['holdUrl'], 'HoldMethod' => $options['holdMethod'], 'AnnounceUrl' => $options['announceUrl'], 'AnnounceMethod' => $options['announceMethod'], 'WaitUrl' => $options['waitUrl'], 'WaitMethod' => $options['waitMethod'], 'BeepOnExit' => Serialize::booleanToString($options['beepOnExit']), 'EndConferenceOnExit' => Serialize::booleanToString($options['endConferenceOnExit']), 'Coaching' => Serialize::booleanToString($options['coaching']), 'CallSidToCoach' => $options['callSidToCoach'], )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new ParticipantInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['conferenceSid'], $this->solution['callSid'] ); } /** * Deletes the ParticipantInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.ParticipantContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Conference/RecordingContext.php 0000644 00000006553 15002236443 0021166 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Conference; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Values; use Twilio\Version; class RecordingContext extends InstanceContext { /** * Initialize the RecordingContext * * @param \Twilio\Version $version Version that contains the resource * @param string $accountSid The SID of the Account that created the resource * to fetch * @param string $conferenceSid Fetch by unique Conference SID for the recording * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Api\V2010\Account\Conference\RecordingContext */ public function __construct(Version $version, $accountSid, $conferenceSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array( 'accountSid' => $accountSid, 'conferenceSid' => $conferenceSid, 'sid' => $sid, ); $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/Conferences/' . \rawurlencode($conferenceSid) . '/Recordings/' . \rawurlencode($sid) . '.json'; } /** * Update the RecordingInstance * * @param string $status The new status of the recording * @param array|Options $options Optional Arguments * @return RecordingInstance Updated RecordingInstance * @throws TwilioException When an HTTP error occurs. */ public function update($status, $options = array()) { $options = new Values($options); $data = Values::of(array('Status' => $status, 'PauseBehavior' => $options['pauseBehavior'], )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new RecordingInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['conferenceSid'], $this->solution['sid'] ); } /** * Fetch a RecordingInstance * * @return RecordingInstance Fetched RecordingInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new RecordingInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['conferenceSid'], $this->solution['sid'] ); } /** * Deletes the RecordingInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.RecordingContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Conference/ParticipantPage.php 0000644 00000001550 15002236443 0020750 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Conference; use Twilio\Page; class ParticipantPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new ParticipantInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['conferenceSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.ParticipantPage]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Conference/RecordingPage.php 0000644 00000001542 15002236443 0020407 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Conference; use Twilio\Page; class RecordingPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new RecordingInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['conferenceSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.RecordingPage]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Conference/RecordingOptions.php 0000644 00000012561 15002236443 0021171 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Conference; use Twilio\Options; use Twilio\Values; abstract class RecordingOptions { /** * @param string $pauseBehavior Whether to record during a pause * @return UpdateRecordingOptions Options builder */ public static function update($pauseBehavior = Values::NONE) { return new UpdateRecordingOptions($pauseBehavior); } /** * @param string $dateCreatedBefore The `YYYY-MM-DD` value of the resources to * read * @param string $dateCreated The `YYYY-MM-DD` value of the resources to read * @param string $dateCreatedAfter The `YYYY-MM-DD` value of the resources to * read * @return ReadRecordingOptions Options builder */ public static function read($dateCreatedBefore = Values::NONE, $dateCreated = Values::NONE, $dateCreatedAfter = Values::NONE) { return new ReadRecordingOptions($dateCreatedBefore, $dateCreated, $dateCreatedAfter); } } class UpdateRecordingOptions extends Options { /** * @param string $pauseBehavior Whether to record during a pause */ public function __construct($pauseBehavior = Values::NONE) { $this->options['pauseBehavior'] = $pauseBehavior; } /** * Whether to record during a pause. Can be: `skip` or `silence` and the default is `silence`. `skip` does not record during the pause period, while `silence` will replace the actual audio of the call with silence during the pause period. This parameter only applies when setting `status` is set to `paused`. * * @param string $pauseBehavior Whether to record during a pause * @return $this Fluent Builder */ public function setPauseBehavior($pauseBehavior) { $this->options['pauseBehavior'] = $pauseBehavior; 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.UpdateRecordingOptions ' . \implode(' ', $options) . ']'; } } class ReadRecordingOptions extends Options { /** * @param string $dateCreatedBefore The `YYYY-MM-DD` value of the resources to * read * @param string $dateCreated The `YYYY-MM-DD` value of the resources to read * @param string $dateCreatedAfter The `YYYY-MM-DD` value of the resources to * read */ public function __construct($dateCreatedBefore = Values::NONE, $dateCreated = Values::NONE, $dateCreatedAfter = Values::NONE) { $this->options['dateCreatedBefore'] = $dateCreatedBefore; $this->options['dateCreated'] = $dateCreated; $this->options['dateCreatedAfter'] = $dateCreatedAfter; } /** * The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. You can also specify inequality: `DateCreated<=YYYY-MM-DD` will return recordings generated at or before midnight on a given date, and `DateCreated>=YYYY-MM-DD` returns recordings generated at or after midnight on a date. * * @param string $dateCreatedBefore The `YYYY-MM-DD` value of the resources to * read * @return $this Fluent Builder */ public function setDateCreatedBefore($dateCreatedBefore) { $this->options['dateCreatedBefore'] = $dateCreatedBefore; return $this; } /** * The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. You can also specify inequality: `DateCreated<=YYYY-MM-DD` will return recordings generated at or before midnight on a given date, and `DateCreated>=YYYY-MM-DD` returns recordings generated at or after midnight on a date. * * @param string $dateCreated The `YYYY-MM-DD` value of the resources to read * @return $this Fluent Builder */ public function setDateCreated($dateCreated) { $this->options['dateCreated'] = $dateCreated; return $this; } /** * The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. You can also specify inequality: `DateCreated<=YYYY-MM-DD` will return recordings generated at or before midnight on a given date, and `DateCreated>=YYYY-MM-DD` returns recordings generated at or after midnight on a date. * * @param string $dateCreatedAfter The `YYYY-MM-DD` value of the resources to * read * @return $this Fluent Builder */ public function setDateCreatedAfter($dateCreatedAfter) { $this->options['dateCreatedAfter'] = $dateCreatedAfter; 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.ReadRecordingOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Conference/ParticipantOptions.php 0000644 00000126220 15002236443 0021531 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Conference; use Twilio\Options; use Twilio\Values; abstract class ParticipantOptions { /** * @param bool $muted Whether the participant should be muted * @param bool $hold Whether the participant should be on hold * @param string $holdUrl The URL we call using the `hold_method` for music * that plays when the participant is on hold * @param string $holdMethod The HTTP method we should use to call hold_url * @param string $announceUrl The URL we call using the `announce_method` for * an announcement to the participant * @param string $announceMethod The HTTP method we should use to call * announce_url * @param string $waitUrl URL that hosts pre-conference hold music * @param string $waitMethod The HTTP method we should use to call `wait_url` * @param bool $beepOnExit Whether to play a notification beep to the * conference when the participant exit * @param bool $endConferenceOnExit Whether to end the conference when the * participant leaves * @param bool $coaching Indicates if the participant changed to coach * @param string $callSidToCoach The SID of the participant who is being * `coached` * @return UpdateParticipantOptions Options builder */ public static function update($muted = Values::NONE, $hold = Values::NONE, $holdUrl = Values::NONE, $holdMethod = Values::NONE, $announceUrl = Values::NONE, $announceMethod = Values::NONE, $waitUrl = Values::NONE, $waitMethod = Values::NONE, $beepOnExit = Values::NONE, $endConferenceOnExit = Values::NONE, $coaching = Values::NONE, $callSidToCoach = Values::NONE) { return new UpdateParticipantOptions($muted, $hold, $holdUrl, $holdMethod, $announceUrl, $announceMethod, $waitUrl, $waitMethod, $beepOnExit, $endConferenceOnExit, $coaching, $callSidToCoach); } /** * @param string $statusCallback The URL we should call to send status * information to your application * @param string $statusCallbackMethod The HTTP method we should use to call * `status_callback` * @param string $statusCallbackEvent Set state change events that will trigger * a callback * @param int $timeout he number of seconds that we should wait for an answer * @param bool $record Whether to record the participant and their conferences * @param bool $muted Whether to mute the agent * @param string $beep Whether to play a notification beep to the conference * when the participant joins * @param bool $startConferenceOnEnter Whether the conference starts when the * participant joins the conference * @param bool $endConferenceOnExit Whether to end the conference when the * participant leaves * @param string $waitUrl URL that hosts pre-conference hold music * @param string $waitMethod The HTTP method we should use to call `wait_url` * @param bool $earlyMedia Whether agents can hear the state of the outbound * call * @param int $maxParticipants The maximum number of agent conference * participants * @param string $conferenceRecord Whether to record the conference the * participant is joining * @param string $conferenceTrim Whether to trim leading and trailing silence * from your recorded conference audio files * @param string $conferenceStatusCallback The callback URL for conference * events * @param string $conferenceStatusCallbackMethod HTTP method for requesting * `conference_status_callback` * URL * @param string $conferenceStatusCallbackEvent The conference state changes * that should generate a call to * `conference_status_callback` * @param string $recordingChannels Specify `mono` or `dual` recording channels * @param string $recordingStatusCallback The URL that we should call using the * `recording_status_callback_method` * when the recording status changes * @param string $recordingStatusCallbackMethod The HTTP method we should use * when we call * `recording_status_callback` * @param string $sipAuthUsername The SIP username used for authentication * @param string $sipAuthPassword The SIP password for authentication * @param string $region The region where we should mix the conference audio * @param string $conferenceRecordingStatusCallback The URL we should call * using the * `conference_recording_status_callback_method` when the conference recording is available * @param string $conferenceRecordingStatusCallbackMethod The HTTP method we * should use to call * `conference_recording_status_callback` * @param string $recordingStatusCallbackEvent The recording state changes that * should generate a call to * `recording_status_callback` * @param string $conferenceRecordingStatusCallbackEvent The conference * recording state * changes that should * generate a call to * `conference_recording_status_callback` * @param bool $coaching Indicates if the participant changed to coach * @param string $callSidToCoach The SID of the participant who is being * `coached` * @return CreateParticipantOptions Options builder */ public static function create($statusCallback = Values::NONE, $statusCallbackMethod = Values::NONE, $statusCallbackEvent = Values::NONE, $timeout = Values::NONE, $record = Values::NONE, $muted = Values::NONE, $beep = Values::NONE, $startConferenceOnEnter = Values::NONE, $endConferenceOnExit = Values::NONE, $waitUrl = Values::NONE, $waitMethod = Values::NONE, $earlyMedia = Values::NONE, $maxParticipants = Values::NONE, $conferenceRecord = Values::NONE, $conferenceTrim = Values::NONE, $conferenceStatusCallback = Values::NONE, $conferenceStatusCallbackMethod = Values::NONE, $conferenceStatusCallbackEvent = Values::NONE, $recordingChannels = Values::NONE, $recordingStatusCallback = Values::NONE, $recordingStatusCallbackMethod = Values::NONE, $sipAuthUsername = Values::NONE, $sipAuthPassword = Values::NONE, $region = Values::NONE, $conferenceRecordingStatusCallback = Values::NONE, $conferenceRecordingStatusCallbackMethod = Values::NONE, $recordingStatusCallbackEvent = Values::NONE, $conferenceRecordingStatusCallbackEvent = Values::NONE, $coaching = Values::NONE, $callSidToCoach = Values::NONE) { return new CreateParticipantOptions($statusCallback, $statusCallbackMethod, $statusCallbackEvent, $timeout, $record, $muted, $beep, $startConferenceOnEnter, $endConferenceOnExit, $waitUrl, $waitMethod, $earlyMedia, $maxParticipants, $conferenceRecord, $conferenceTrim, $conferenceStatusCallback, $conferenceStatusCallbackMethod, $conferenceStatusCallbackEvent, $recordingChannels, $recordingStatusCallback, $recordingStatusCallbackMethod, $sipAuthUsername, $sipAuthPassword, $region, $conferenceRecordingStatusCallback, $conferenceRecordingStatusCallbackMethod, $recordingStatusCallbackEvent, $conferenceRecordingStatusCallbackEvent, $coaching, $callSidToCoach); } /** * @param bool $muted Whether to return only participants that are muted * @param bool $hold Whether to return only participants that are on hold * @param bool $coaching Whether to return only participants who are coaching * another call * @return ReadParticipantOptions Options builder */ public static function read($muted = Values::NONE, $hold = Values::NONE, $coaching = Values::NONE) { return new ReadParticipantOptions($muted, $hold, $coaching); } } class UpdateParticipantOptions extends Options { /** * @param bool $muted Whether the participant should be muted * @param bool $hold Whether the participant should be on hold * @param string $holdUrl The URL we call using the `hold_method` for music * that plays when the participant is on hold * @param string $holdMethod The HTTP method we should use to call hold_url * @param string $announceUrl The URL we call using the `announce_method` for * an announcement to the participant * @param string $announceMethod The HTTP method we should use to call * announce_url * @param string $waitUrl URL that hosts pre-conference hold music * @param string $waitMethod The HTTP method we should use to call `wait_url` * @param bool $beepOnExit Whether to play a notification beep to the * conference when the participant exit * @param bool $endConferenceOnExit Whether to end the conference when the * participant leaves * @param bool $coaching Indicates if the participant changed to coach * @param string $callSidToCoach The SID of the participant who is being * `coached` */ public function __construct($muted = Values::NONE, $hold = Values::NONE, $holdUrl = Values::NONE, $holdMethod = Values::NONE, $announceUrl = Values::NONE, $announceMethod = Values::NONE, $waitUrl = Values::NONE, $waitMethod = Values::NONE, $beepOnExit = Values::NONE, $endConferenceOnExit = Values::NONE, $coaching = Values::NONE, $callSidToCoach = Values::NONE) { $this->options['muted'] = $muted; $this->options['hold'] = $hold; $this->options['holdUrl'] = $holdUrl; $this->options['holdMethod'] = $holdMethod; $this->options['announceUrl'] = $announceUrl; $this->options['announceMethod'] = $announceMethod; $this->options['waitUrl'] = $waitUrl; $this->options['waitMethod'] = $waitMethod; $this->options['beepOnExit'] = $beepOnExit; $this->options['endConferenceOnExit'] = $endConferenceOnExit; $this->options['coaching'] = $coaching; $this->options['callSidToCoach'] = $callSidToCoach; } /** * Whether the participant should be muted. Can be `true` or `false`. `true` will mute the participant, and `false` will un-mute them. Anything value other than `true` or `false` is interpreted as `false`. * * @param bool $muted Whether the participant should be muted * @return $this Fluent Builder */ public function setMuted($muted) { $this->options['muted'] = $muted; return $this; } /** * Whether the participant should be on hold. Can be: `true` or `false`. `true` puts the participant on hold, and `false` lets them rejoin the conference. * * @param bool $hold Whether the participant should be on hold * @return $this Fluent Builder */ public function setHold($hold) { $this->options['hold'] = $hold; return $this; } /** * The URL we call using the `hold_method` for music that plays when the participant is on hold. The URL may return an MP3 file, a WAV file, or a TwiML document that contains the `<Play>`, `<Say>` or `<Redirect>` commands. * * @param string $holdUrl The URL we call using the `hold_method` for music * that plays when the participant is on hold * @return $this Fluent Builder */ public function setHoldUrl($holdUrl) { $this->options['holdUrl'] = $holdUrl; return $this; } /** * The HTTP method we should use to call `hold_url`. Can be: `GET` or `POST` and the default is `GET`. * * @param string $holdMethod The HTTP method we should use to call hold_url * @return $this Fluent Builder */ public function setHoldMethod($holdMethod) { $this->options['holdMethod'] = $holdMethod; return $this; } /** * The URL we call using the `announce_method` for an announcement to the participant. The URL must return an MP3 file, a WAV file, or a TwiML document that contains `<Play>` or `<Say>` commands. * * @param string $announceUrl The URL we call using the `announce_method` for * an announcement to the participant * @return $this Fluent Builder */ public function setAnnounceUrl($announceUrl) { $this->options['announceUrl'] = $announceUrl; return $this; } /** * The HTTP method we should use to call `announce_url`. Can be: `GET` or `POST` and defaults to `POST`. * * @param string $announceMethod The HTTP method we should use to call * announce_url * @return $this Fluent Builder */ public function setAnnounceMethod($announceMethod) { $this->options['announceMethod'] = $announceMethod; return $this; } /** * The URL we should call using the `wait_method` for the music to play while participants are waiting for the conference to start. The default value is the URL of our standard hold music. [Learn more about hold music](https://www.twilio.com/labs/twimlets/holdmusic). * * @param string $waitUrl URL that hosts pre-conference hold music * @return $this Fluent Builder */ public function setWaitUrl($waitUrl) { $this->options['waitUrl'] = $waitUrl; return $this; } /** * The HTTP method we should use to call `wait_url`. Can be `GET` or `POST` and the default is `POST`. When using a static audio file, this should be `GET` so that we can cache the file. * * @param string $waitMethod The HTTP method we should use to call `wait_url` * @return $this Fluent Builder */ public function setWaitMethod($waitMethod) { $this->options['waitMethod'] = $waitMethod; return $this; } /** * Whether to play a notification beep to the conference when the participant exits. Can be: `true` or `false`. * * @param bool $beepOnExit Whether to play a notification beep to the * conference when the participant exit * @return $this Fluent Builder */ public function setBeepOnExit($beepOnExit) { $this->options['beepOnExit'] = $beepOnExit; return $this; } /** * Whether to end the conference when the participant leaves. Can be: `true` or `false` and defaults to `false`. * * @param bool $endConferenceOnExit Whether to end the conference when the * participant leaves * @return $this Fluent Builder */ public function setEndConferenceOnExit($endConferenceOnExit) { $this->options['endConferenceOnExit'] = $endConferenceOnExit; return $this; } /** * Whether the participant is coaching another call. Can be: `true` or `false`. If not present, defaults to `false` unless `call_sid_to_coach` is defined. If `true`, `call_sid_to_coach` must be defined. * * @param bool $coaching Indicates if the participant changed to coach * @return $this Fluent Builder */ public function setCoaching($coaching) { $this->options['coaching'] = $coaching; return $this; } /** * The SID of the participant who is being `coached`. The participant being coached is the only participant who can hear the participant who is `coaching`. * * @param string $callSidToCoach The SID of the participant who is being * `coached` * @return $this Fluent Builder */ public function setCallSidToCoach($callSidToCoach) { $this->options['callSidToCoach'] = $callSidToCoach; 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.UpdateParticipantOptions ' . \implode(' ', $options) . ']'; } } class CreateParticipantOptions extends Options { /** * @param string $statusCallback The URL we should call to send status * information to your application * @param string $statusCallbackMethod The HTTP method we should use to call * `status_callback` * @param string $statusCallbackEvent Set state change events that will trigger * a callback * @param int $timeout he number of seconds that we should wait for an answer * @param bool $record Whether to record the participant and their conferences * @param bool $muted Whether to mute the agent * @param string $beep Whether to play a notification beep to the conference * when the participant joins * @param bool $startConferenceOnEnter Whether the conference starts when the * participant joins the conference * @param bool $endConferenceOnExit Whether to end the conference when the * participant leaves * @param string $waitUrl URL that hosts pre-conference hold music * @param string $waitMethod The HTTP method we should use to call `wait_url` * @param bool $earlyMedia Whether agents can hear the state of the outbound * call * @param int $maxParticipants The maximum number of agent conference * participants * @param string $conferenceRecord Whether to record the conference the * participant is joining * @param string $conferenceTrim Whether to trim leading and trailing silence * from your recorded conference audio files * @param string $conferenceStatusCallback The callback URL for conference * events * @param string $conferenceStatusCallbackMethod HTTP method for requesting * `conference_status_callback` * URL * @param string $conferenceStatusCallbackEvent The conference state changes * that should generate a call to * `conference_status_callback` * @param string $recordingChannels Specify `mono` or `dual` recording channels * @param string $recordingStatusCallback The URL that we should call using the * `recording_status_callback_method` * when the recording status changes * @param string $recordingStatusCallbackMethod The HTTP method we should use * when we call * `recording_status_callback` * @param string $sipAuthUsername The SIP username used for authentication * @param string $sipAuthPassword The SIP password for authentication * @param string $region The region where we should mix the conference audio * @param string $conferenceRecordingStatusCallback The URL we should call * using the * `conference_recording_status_callback_method` when the conference recording is available * @param string $conferenceRecordingStatusCallbackMethod The HTTP method we * should use to call * `conference_recording_status_callback` * @param string $recordingStatusCallbackEvent The recording state changes that * should generate a call to * `recording_status_callback` * @param string $conferenceRecordingStatusCallbackEvent The conference * recording state * changes that should * generate a call to * `conference_recording_status_callback` * @param bool $coaching Indicates if the participant changed to coach * @param string $callSidToCoach The SID of the participant who is being * `coached` */ public function __construct($statusCallback = Values::NONE, $statusCallbackMethod = Values::NONE, $statusCallbackEvent = Values::NONE, $timeout = Values::NONE, $record = Values::NONE, $muted = Values::NONE, $beep = Values::NONE, $startConferenceOnEnter = Values::NONE, $endConferenceOnExit = Values::NONE, $waitUrl = Values::NONE, $waitMethod = Values::NONE, $earlyMedia = Values::NONE, $maxParticipants = Values::NONE, $conferenceRecord = Values::NONE, $conferenceTrim = Values::NONE, $conferenceStatusCallback = Values::NONE, $conferenceStatusCallbackMethod = Values::NONE, $conferenceStatusCallbackEvent = Values::NONE, $recordingChannels = Values::NONE, $recordingStatusCallback = Values::NONE, $recordingStatusCallbackMethod = Values::NONE, $sipAuthUsername = Values::NONE, $sipAuthPassword = Values::NONE, $region = Values::NONE, $conferenceRecordingStatusCallback = Values::NONE, $conferenceRecordingStatusCallbackMethod = Values::NONE, $recordingStatusCallbackEvent = Values::NONE, $conferenceRecordingStatusCallbackEvent = Values::NONE, $coaching = Values::NONE, $callSidToCoach = Values::NONE) { $this->options['statusCallback'] = $statusCallback; $this->options['statusCallbackMethod'] = $statusCallbackMethod; $this->options['statusCallbackEvent'] = $statusCallbackEvent; $this->options['timeout'] = $timeout; $this->options['record'] = $record; $this->options['muted'] = $muted; $this->options['beep'] = $beep; $this->options['startConferenceOnEnter'] = $startConferenceOnEnter; $this->options['endConferenceOnExit'] = $endConferenceOnExit; $this->options['waitUrl'] = $waitUrl; $this->options['waitMethod'] = $waitMethod; $this->options['earlyMedia'] = $earlyMedia; $this->options['maxParticipants'] = $maxParticipants; $this->options['conferenceRecord'] = $conferenceRecord; $this->options['conferenceTrim'] = $conferenceTrim; $this->options['conferenceStatusCallback'] = $conferenceStatusCallback; $this->options['conferenceStatusCallbackMethod'] = $conferenceStatusCallbackMethod; $this->options['conferenceStatusCallbackEvent'] = $conferenceStatusCallbackEvent; $this->options['recordingChannels'] = $recordingChannels; $this->options['recordingStatusCallback'] = $recordingStatusCallback; $this->options['recordingStatusCallbackMethod'] = $recordingStatusCallbackMethod; $this->options['sipAuthUsername'] = $sipAuthUsername; $this->options['sipAuthPassword'] = $sipAuthPassword; $this->options['region'] = $region; $this->options['conferenceRecordingStatusCallback'] = $conferenceRecordingStatusCallback; $this->options['conferenceRecordingStatusCallbackMethod'] = $conferenceRecordingStatusCallbackMethod; $this->options['recordingStatusCallbackEvent'] = $recordingStatusCallbackEvent; $this->options['conferenceRecordingStatusCallbackEvent'] = $conferenceRecordingStatusCallbackEvent; $this->options['coaching'] = $coaching; $this->options['callSidToCoach'] = $callSidToCoach; } /** * The URL we should call using the `status_callback_method` to send status information to your application. * * @param string $statusCallback The URL we should call to send status * information to your application * @return $this Fluent Builder */ public function setStatusCallback($statusCallback) { $this->options['statusCallback'] = $statusCallback; return $this; } /** * The HTTP method we should use to call `status_callback`. Can be: `GET` and `POST` and defaults to `POST`. * * @param string $statusCallbackMethod The HTTP method we should use to call * `status_callback` * @return $this Fluent Builder */ public function setStatusCallbackMethod($statusCallbackMethod) { $this->options['statusCallbackMethod'] = $statusCallbackMethod; return $this; } /** * The conference state changes that should generate a call to `status_callback`. Can be: `initiated`, `ringing`, `answered`, and `completed`. Separate multiple values with a space. The default value is `completed`. * * @param string $statusCallbackEvent Set state change events that will trigger * a callback * @return $this Fluent Builder */ public function setStatusCallbackEvent($statusCallbackEvent) { $this->options['statusCallbackEvent'] = $statusCallbackEvent; return $this; } /** * The number of seconds that we should allow the phone to ring before assuming there is no answer. Can be an integer between `5` and `600`, inclusive. The default value is `60`. We always add a 5-second timeout buffer to outgoing calls, so value of 10 would result in an actual timeout that was closer to 15 seconds. * * @param int $timeout he number of seconds that we should wait for an answer * @return $this Fluent Builder */ public function setTimeout($timeout) { $this->options['timeout'] = $timeout; return $this; } /** * Whether to record the participant and their conferences, including the time between conferences. Can be `true` or `false` and the default is `false`. * * @param bool $record Whether to record the participant and their conferences * @return $this Fluent Builder */ public function setRecord($record) { $this->options['record'] = $record; return $this; } /** * Whether the agent is muted in the conference. Can be `true` or `false` and the default is `false`. * * @param bool $muted Whether to mute the agent * @return $this Fluent Builder */ public function setMuted($muted) { $this->options['muted'] = $muted; return $this; } /** * Whether to play a notification beep to the conference when the participant joins. Can be: `true`, `false`, `onEnter`, or `onExit`. The default value is `true`. * * @param string $beep Whether to play a notification beep to the conference * when the participant joins * @return $this Fluent Builder */ public function setBeep($beep) { $this->options['beep'] = $beep; return $this; } /** * Whether to start the conference when the participant joins, if it has not already started. Can be: `true` or `false` and the default is `true`. If `false` and the conference has not started, the participant is muted and hears background music until another participant starts the conference. * * @param bool $startConferenceOnEnter Whether the conference starts when the * participant joins the conference * @return $this Fluent Builder */ public function setStartConferenceOnEnter($startConferenceOnEnter) { $this->options['startConferenceOnEnter'] = $startConferenceOnEnter; return $this; } /** * Whether to end the conference when the participant leaves. Can be: `true` or `false` and defaults to `false`. * * @param bool $endConferenceOnExit Whether to end the conference when the * participant leaves * @return $this Fluent Builder */ public function setEndConferenceOnExit($endConferenceOnExit) { $this->options['endConferenceOnExit'] = $endConferenceOnExit; return $this; } /** * The URL we should call using the `wait_method` for the music to play while participants are waiting for the conference to start. The default value is the URL of our standard hold music. [Learn more about hold music](https://www.twilio.com/labs/twimlets/holdmusic). * * @param string $waitUrl URL that hosts pre-conference hold music * @return $this Fluent Builder */ public function setWaitUrl($waitUrl) { $this->options['waitUrl'] = $waitUrl; return $this; } /** * The HTTP method we should use to call `wait_url`. Can be `GET` or `POST` and the default is `POST`. When using a static audio file, this should be `GET` so that we can cache the file. * * @param string $waitMethod The HTTP method we should use to call `wait_url` * @return $this Fluent Builder */ public function setWaitMethod($waitMethod) { $this->options['waitMethod'] = $waitMethod; return $this; } /** * Whether to allow an agent to hear the state of the outbound call, including ringing or disconnect messages. Can be: `true` or `false` and defaults to `true`. * * @param bool $earlyMedia Whether agents can hear the state of the outbound * call * @return $this Fluent Builder */ public function setEarlyMedia($earlyMedia) { $this->options['earlyMedia'] = $earlyMedia; return $this; } /** * The maximum number of participants in the conference. Can be a positive integer from `2` to `250`. The default value is `250`. * * @param int $maxParticipants The maximum number of agent conference * participants * @return $this Fluent Builder */ public function setMaxParticipants($maxParticipants) { $this->options['maxParticipants'] = $maxParticipants; return $this; } /** * Whether to record the conference the participant is joining. Can be: `true`, `false`, `record-from-start`, and `do-not-record`. The default value is `false`. * * @param string $conferenceRecord Whether to record the conference the * participant is joining * @return $this Fluent Builder */ public function setConferenceRecord($conferenceRecord) { $this->options['conferenceRecord'] = $conferenceRecord; return $this; } /** * Whether to trim leading and trailing silence from your recorded conference audio files. Can be: `trim-silence` or `do-not-trim` and defaults to `trim-silence`. * * @param string $conferenceTrim Whether to trim leading and trailing silence * from your recorded conference audio files * @return $this Fluent Builder */ public function setConferenceTrim($conferenceTrim) { $this->options['conferenceTrim'] = $conferenceTrim; return $this; } /** * The URL we should call using the `conference_status_callback_method` when the conference events in `conference_status_callback_event` occur. Only the value set by the first participant to join the conference is used. Subsequent `conference_status_callback` values are ignored. * * @param string $conferenceStatusCallback The callback URL for conference * events * @return $this Fluent Builder */ public function setConferenceStatusCallback($conferenceStatusCallback) { $this->options['conferenceStatusCallback'] = $conferenceStatusCallback; return $this; } /** * The HTTP method we should use to call `conference_status_callback`. Can be: `GET` or `POST` and defaults to `POST`. * * @param string $conferenceStatusCallbackMethod HTTP method for requesting * `conference_status_callback` * URL * @return $this Fluent Builder */ public function setConferenceStatusCallbackMethod($conferenceStatusCallbackMethod) { $this->options['conferenceStatusCallbackMethod'] = $conferenceStatusCallbackMethod; return $this; } /** * The conference state changes that should generate a call to `conference_status_callback`. Can be: `start`, `end`, `join`, `leave`, `mute`, `hold`, and `speaker`. Separate multiple values with a space. Defaults to `start end`. * * @param string $conferenceStatusCallbackEvent The conference state changes * that should generate a call to * `conference_status_callback` * @return $this Fluent Builder */ public function setConferenceStatusCallbackEvent($conferenceStatusCallbackEvent) { $this->options['conferenceStatusCallbackEvent'] = $conferenceStatusCallbackEvent; return $this; } /** * The recording channels for the final recording. Can be: `mono` or `dual` and the default is `mono`. * * @param string $recordingChannels Specify `mono` or `dual` recording channels * @return $this Fluent Builder */ public function setRecordingChannels($recordingChannels) { $this->options['recordingChannels'] = $recordingChannels; return $this; } /** * The URL that we should call using the `recording_status_callback_method` when the recording status changes. * * @param string $recordingStatusCallback The URL that we should call using the * `recording_status_callback_method` * when the recording status changes * @return $this Fluent Builder */ public function setRecordingStatusCallback($recordingStatusCallback) { $this->options['recordingStatusCallback'] = $recordingStatusCallback; return $this; } /** * The HTTP method we should use when we call `recording_status_callback`. Can be: `GET` or `POST` and defaults to `POST`. * * @param string $recordingStatusCallbackMethod The HTTP method we should use * when we call * `recording_status_callback` * @return $this Fluent Builder */ public function setRecordingStatusCallbackMethod($recordingStatusCallbackMethod) { $this->options['recordingStatusCallbackMethod'] = $recordingStatusCallbackMethod; return $this; } /** * The SIP username used for authentication. * * @param string $sipAuthUsername The SIP username used for authentication * @return $this Fluent Builder */ public function setSipAuthUsername($sipAuthUsername) { $this->options['sipAuthUsername'] = $sipAuthUsername; return $this; } /** * The SIP password for authentication. * * @param string $sipAuthPassword The SIP password for authentication * @return $this Fluent Builder */ public function setSipAuthPassword($sipAuthPassword) { $this->options['sipAuthPassword'] = $sipAuthPassword; return $this; } /** * The [region](https://support.twilio.com/hc/en-us/articles/223132167-How-global-low-latency-routing-and-region-selection-work-for-conferences-and-Client-calls) where we should mix the recorded audio. Can be:`us1`, `ie1`, `de1`, `sg1`, `br1`, `au1`, or `jp1`. * * @param string $region The region where we should mix the conference audio * @return $this Fluent Builder */ public function setRegion($region) { $this->options['region'] = $region; return $this; } /** * The URL we should call using the `conference_recording_status_callback_method` when the conference recording is available. * * @param string $conferenceRecordingStatusCallback The URL we should call * using the * `conference_recording_status_callback_method` when the conference recording is available * @return $this Fluent Builder */ public function setConferenceRecordingStatusCallback($conferenceRecordingStatusCallback) { $this->options['conferenceRecordingStatusCallback'] = $conferenceRecordingStatusCallback; return $this; } /** * The HTTP method we should use to call `conference_recording_status_callback`. Can be: `GET` or `POST` and defaults to `POST`. * * @param string $conferenceRecordingStatusCallbackMethod The HTTP method we * should use to call * `conference_recording_status_callback` * @return $this Fluent Builder */ public function setConferenceRecordingStatusCallbackMethod($conferenceRecordingStatusCallbackMethod) { $this->options['conferenceRecordingStatusCallbackMethod'] = $conferenceRecordingStatusCallbackMethod; return $this; } /** * The recording state changes that should generate a call to `recording_status_callback`. Can be: `in-progress`, `completed`, and `failed`. Separate multiple values with a space. The default value is `in-progress completed failed`. * * @param string $recordingStatusCallbackEvent The recording state changes that * should generate a call to * `recording_status_callback` * @return $this Fluent Builder */ public function setRecordingStatusCallbackEvent($recordingStatusCallbackEvent) { $this->options['recordingStatusCallbackEvent'] = $recordingStatusCallbackEvent; return $this; } /** * The conference recording state changes that generate a call to `conference_recording_status_callback`. Can be: `in-progress`, `completed`, and `failed`. Separate multiple values with a space. The default value is `in-progress completed failed`. * * @param string $conferenceRecordingStatusCallbackEvent The conference * recording state * changes that should * generate a call to * `conference_recording_status_callback` * @return $this Fluent Builder */ public function setConferenceRecordingStatusCallbackEvent($conferenceRecordingStatusCallbackEvent) { $this->options['conferenceRecordingStatusCallbackEvent'] = $conferenceRecordingStatusCallbackEvent; return $this; } /** * Whether the participant is coaching another call. Can be: `true` or `false`. If not present, defaults to `false` unless `call_sid_to_coach` is defined. If `true`, `call_sid_to_coach` must be defined. * * @param bool $coaching Indicates if the participant changed to coach * @return $this Fluent Builder */ public function setCoaching($coaching) { $this->options['coaching'] = $coaching; return $this; } /** * The SID of the participant who is being `coached`. The participant being coached is the only participant who can hear the participant who is `coaching`. * * @param string $callSidToCoach The SID of the participant who is being * `coached` * @return $this Fluent Builder */ public function setCallSidToCoach($callSidToCoach) { $this->options['callSidToCoach'] = $callSidToCoach; 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.CreateParticipantOptions ' . \implode(' ', $options) . ']'; } } class ReadParticipantOptions extends Options { /** * @param bool $muted Whether to return only participants that are muted * @param bool $hold Whether to return only participants that are on hold * @param bool $coaching Whether to return only participants who are coaching * another call */ public function __construct($muted = Values::NONE, $hold = Values::NONE, $coaching = Values::NONE) { $this->options['muted'] = $muted; $this->options['hold'] = $hold; $this->options['coaching'] = $coaching; } /** * Whether to return only participants that are muted. Can be: `true` or `false`. * * @param bool $muted Whether to return only participants that are muted * @return $this Fluent Builder */ public function setMuted($muted) { $this->options['muted'] = $muted; return $this; } /** * Whether to return only participants that are on hold. Can be: `true` or `false`. * * @param bool $hold Whether to return only participants that are on hold * @return $this Fluent Builder */ public function setHold($hold) { $this->options['hold'] = $hold; return $this; } /** * Whether to return only participants who are coaching another call. Can be: `true` or `false`. * * @param bool $coaching Whether to return only participants who are coaching * another call * @return $this Fluent Builder */ public function setCoaching($coaching) { $this->options['coaching'] = $coaching; 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.ReadParticipantOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/AddressPage.php 0000644 00000001365 15002236443 0016014 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Page; class AddressPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new AddressInstance($this->version, $payload, $this->solution['accountSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.AddressPage]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/KeyPage.php 0000644 00000001351 15002236443 0015152 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Page; class KeyPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new KeyInstance($this->version, $payload, $this->solution['accountSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.KeyPage]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/KeyContext.php 0000644 00000005541 15002236443 0015727 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Values; use Twilio\Version; class KeyContext extends InstanceContext { /** * Initialize the KeyContext * * @param \Twilio\Version $version Version that contains the resource * @param string $accountSid The SID of the Account that created the resource * to fetch * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Api\V2010\Account\KeyContext */ public function __construct(Version $version, $accountSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array('accountSid' => $accountSid, 'sid' => $sid, ); $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/Keys/' . \rawurlencode($sid) . '.json'; } /** * Fetch a KeyInstance * * @return KeyInstance Fetched KeyInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new KeyInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['sid'] ); } /** * Update the KeyInstance * * @param array|Options $options Optional Arguments * @return KeyInstance Updated KeyInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { $options = new Values($options); $data = Values::of(array('FriendlyName' => $options['friendlyName'], )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new KeyInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['sid'] ); } /** * Deletes the KeyInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.KeyContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumberInstance.php 0000644 00000016542 15002236443 0021230 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property string $addressSid * @property string $addressRequirements * @property string $apiVersion * @property bool $beta * @property string $capabilities * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $friendlyName * @property string $identitySid * @property string $phoneNumber * @property string $origin * @property string $sid * @property string $smsApplicationSid * @property string $smsFallbackMethod * @property string $smsFallbackUrl * @property string $smsMethod * @property string $smsUrl * @property string $statusCallback * @property string $statusCallbackMethod * @property string $trunkSid * @property string $uri * @property string $voiceApplicationSid * @property bool $voiceCallerIdLookup * @property string $voiceFallbackMethod * @property string $voiceFallbackUrl * @property string $voiceMethod * @property string $voiceUrl * @property string $emergencyStatus * @property string $emergencyAddressSid * @property string $bundleSid */ class IncomingPhoneNumberInstance extends InstanceResource { protected $_assignedAddOns = null; /** * Initialize the IncomingPhoneNumberInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the Account that created the resource * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Api\V2010\Account\IncomingPhoneNumberInstance */ public function __construct(Version $version, array $payload, $accountSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'accountSid' => Values::array_get($payload, 'account_sid'), 'addressSid' => Values::array_get($payload, 'address_sid'), 'addressRequirements' => Values::array_get($payload, 'address_requirements'), 'apiVersion' => Values::array_get($payload, 'api_version'), 'beta' => Values::array_get($payload, 'beta'), 'capabilities' => Values::array_get($payload, 'capabilities'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'identitySid' => Values::array_get($payload, 'identity_sid'), 'phoneNumber' => Values::array_get($payload, 'phone_number'), 'origin' => Values::array_get($payload, 'origin'), 'sid' => Values::array_get($payload, 'sid'), 'smsApplicationSid' => Values::array_get($payload, 'sms_application_sid'), 'smsFallbackMethod' => Values::array_get($payload, 'sms_fallback_method'), 'smsFallbackUrl' => Values::array_get($payload, 'sms_fallback_url'), 'smsMethod' => Values::array_get($payload, 'sms_method'), 'smsUrl' => Values::array_get($payload, 'sms_url'), 'statusCallback' => Values::array_get($payload, 'status_callback'), 'statusCallbackMethod' => Values::array_get($payload, 'status_callback_method'), 'trunkSid' => Values::array_get($payload, 'trunk_sid'), 'uri' => Values::array_get($payload, 'uri'), 'voiceApplicationSid' => Values::array_get($payload, 'voice_application_sid'), 'voiceCallerIdLookup' => Values::array_get($payload, 'voice_caller_id_lookup'), 'voiceFallbackMethod' => Values::array_get($payload, 'voice_fallback_method'), 'voiceFallbackUrl' => Values::array_get($payload, 'voice_fallback_url'), 'voiceMethod' => Values::array_get($payload, 'voice_method'), 'voiceUrl' => Values::array_get($payload, 'voice_url'), 'emergencyStatus' => Values::array_get($payload, 'emergency_status'), 'emergencyAddressSid' => Values::array_get($payload, 'emergency_address_sid'), 'bundleSid' => Values::array_get($payload, 'bundle_sid'), ); $this->solution = array('accountSid' => $accountSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Api\V2010\Account\IncomingPhoneNumberContext Context * for this * IncomingPhoneNumberInstance */ protected function proxy() { if (!$this->context) { $this->context = new IncomingPhoneNumberContext( $this->version, $this->solution['accountSid'], $this->solution['sid'] ); } return $this->context; } /** * Update the IncomingPhoneNumberInstance * * @param array|Options $options Optional Arguments * @return IncomingPhoneNumberInstance Updated IncomingPhoneNumberInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Fetch a IncomingPhoneNumberInstance * * @return IncomingPhoneNumberInstance Fetched IncomingPhoneNumberInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the IncomingPhoneNumberInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Access the assignedAddOns * * @return \Twilio\Rest\Api\V2010\Account\IncomingPhoneNumber\AssignedAddOnList */ protected function getAssignedAddOns() { return $this->proxy()->assignedAddOns; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.IncomingPhoneNumberInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Queue/MemberOptions.php 0000644 00000003055 15002236443 0017477 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Queue; use Twilio\Options; use Twilio\Values; abstract class MemberOptions { /** * @param string $method How to pass the update request data * @return UpdateMemberOptions Options builder */ public static function update($method = Values::NONE) { return new UpdateMemberOptions($method); } } class UpdateMemberOptions extends Options { /** * @param string $method How to pass the update request data */ public function __construct($method = Values::NONE) { $this->options['method'] = $method; } /** * How to pass the update request data. Can be `GET` or `POST` and the default is `POST`. `POST` sends the data as encoded form data and `GET` sends the data as query parameters. * * @param string $method How to pass the update request data * @return $this Fluent Builder */ public function setMethod($method) { $this->options['method'] = $method; 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.UpdateMemberOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Queue/MemberContext.php 0000644 00000006000 15002236443 0017461 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Queue; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Values; use Twilio\Version; class MemberContext extends InstanceContext { /** * Initialize the MemberContext * * @param \Twilio\Version $version Version that contains the resource * @param string $accountSid The SID of the Account that created the * resource(s) to fetch * @param string $queueSid The SID of the Queue in which to find the members * @param string $callSid The Call SID of the resource(s) to fetch * @return \Twilio\Rest\Api\V2010\Account\Queue\MemberContext */ public function __construct(Version $version, $accountSid, $queueSid, $callSid) { parent::__construct($version); // Path Solution $this->solution = array( 'accountSid' => $accountSid, 'queueSid' => $queueSid, 'callSid' => $callSid, ); $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/Queues/' . \rawurlencode($queueSid) . '/Members/' . \rawurlencode($callSid) . '.json'; } /** * Fetch a MemberInstance * * @return MemberInstance Fetched MemberInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new MemberInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['queueSid'], $this->solution['callSid'] ); } /** * Update the MemberInstance * * @param string $url The absolute URL of the Queue resource * @param array|Options $options Optional Arguments * @return MemberInstance Updated MemberInstance * @throws TwilioException When an HTTP error occurs. */ public function update($url, $options = array()) { $options = new Values($options); $data = Values::of(array('Url' => $url, 'Method' => $options['method'], )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new MemberInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['queueSid'], $this->solution['callSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.MemberContext ' . \implode(' ', $context) . ']'; } }sdk/src/Twilio/Rest/Api/V2010/Account/Queue/MemberList.php 0000644 00000012065 15002236443 0016760 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Queue; use Twilio\ListResource; use Twilio\Values; use Twilio\Version; class MemberList extends ListResource { /** * Construct the MemberList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the Account that created this resource * @param string $queueSid The SID of the Queue the member is in * @return \Twilio\Rest\Api\V2010\Account\Queue\MemberList */ public function __construct(Version $version, $accountSid, $queueSid) { parent::__construct($version); // Path Solution $this->solution = array('accountSid' => $accountSid, 'queueSid' => $queueSid, ); $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/Queues/' . \rawurlencode($queueSid) . '/Members.json'; } /** * Streams MemberInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads MemberInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return MemberInstance[] Array of results */ public function read($limit = null, $pageSize = null) { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of MemberInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of MemberInstance */ public function page($pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $params = Values::of(array( 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new MemberPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of MemberInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of MemberInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new MemberPage($this->version, $response, $this->solution); } /** * Constructs a MemberContext * * @param string $callSid The Call SID of the resource(s) to fetch * @return \Twilio\Rest\Api\V2010\Account\Queue\MemberContext */ public function getContext($callSid) { return new MemberContext( $this->version, $this->solution['accountSid'], $this->solution['queueSid'], $callSid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.MemberList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Queue/MemberPage.php 0000644 00000001517 15002236443 0016721 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Queue; use Twilio\Page; class MemberPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new MemberInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['queueSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.MemberPage]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Queue/MemberInstance.php 0000644 00000010106 15002236443 0017603 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Queue; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $callSid * @property \DateTime $dateEnqueued * @property int $position * @property string $uri * @property int $waitTime * @property string $queueSid */ class MemberInstance extends InstanceResource { /** * Initialize the MemberInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the Account that created this resource * @param string $queueSid The SID of the Queue the member is in * @param string $callSid The Call SID of the resource(s) to fetch * @return \Twilio\Rest\Api\V2010\Account\Queue\MemberInstance */ public function __construct(Version $version, array $payload, $accountSid, $queueSid, $callSid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'callSid' => Values::array_get($payload, 'call_sid'), 'dateEnqueued' => Deserialize::dateTime(Values::array_get($payload, 'date_enqueued')), 'position' => Values::array_get($payload, 'position'), 'uri' => Values::array_get($payload, 'uri'), 'waitTime' => Values::array_get($payload, 'wait_time'), 'queueSid' => Values::array_get($payload, 'queue_sid'), ); $this->solution = array( 'accountSid' => $accountSid, 'queueSid' => $queueSid, 'callSid' => $callSid ?: $this->properties['callSid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Api\V2010\Account\Queue\MemberContext Context for this * MemberInstance */ protected function proxy() { if (!$this->context) { $this->context = new MemberContext( $this->version, $this->solution['accountSid'], $this->solution['queueSid'], $this->solution['callSid'] ); } return $this->context; } /** * Fetch a MemberInstance * * @return MemberInstance Fetched MemberInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Update the MemberInstance * * @param string $url The absolute URL of the Queue resource * @param array|Options $options Optional Arguments * @return MemberInstance Updated MemberInstance * @throws TwilioException When an HTTP error occurs. */ public function update($url, $options = array()) { return $this->proxy()->update($url, $options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.MemberInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/SigningKeyInstance.php 0000644 00000007702 15002236443 0017367 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $friendlyName * @property \DateTime $dateCreated * @property \DateTime $dateUpdated */ class SigningKeyInstance extends InstanceResource { /** * Initialize the SigningKeyInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid A 34 character string that uniquely identifies * this resource. * @param string $sid The sid * @return \Twilio\Rest\Api\V2010\Account\SigningKeyInstance */ public function __construct(Version $version, array $payload, $accountSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'sid' => Values::array_get($payload, 'sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), ); $this->solution = array('accountSid' => $accountSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Api\V2010\Account\SigningKeyContext Context for this * SigningKeyInstance */ protected function proxy() { if (!$this->context) { $this->context = new SigningKeyContext( $this->version, $this->solution['accountSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch a SigningKeyInstance * * @return SigningKeyInstance Fetched SigningKeyInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Update the SigningKeyInstance * * @param array|Options $options Optional Arguments * @return SigningKeyInstance Updated SigningKeyInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Deletes the SigningKeyInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.SigningKeyInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/AddressInstance.php 0000644 00000012444 15002236443 0016704 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property string $city * @property string $customerName * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $friendlyName * @property string $isoCountry * @property string $postalCode * @property string $region * @property string $sid * @property string $street * @property string $uri * @property bool $emergencyEnabled * @property bool $validated * @property bool $verified */ class AddressInstance extends InstanceResource { protected $_dependentPhoneNumbers = null; /** * Initialize the AddressInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the Account that is responsible for the * resource * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Api\V2010\Account\AddressInstance */ public function __construct(Version $version, array $payload, $accountSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'accountSid' => Values::array_get($payload, 'account_sid'), 'city' => Values::array_get($payload, 'city'), 'customerName' => Values::array_get($payload, 'customer_name'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'isoCountry' => Values::array_get($payload, 'iso_country'), 'postalCode' => Values::array_get($payload, 'postal_code'), 'region' => Values::array_get($payload, 'region'), 'sid' => Values::array_get($payload, 'sid'), 'street' => Values::array_get($payload, 'street'), 'uri' => Values::array_get($payload, 'uri'), 'emergencyEnabled' => Values::array_get($payload, 'emergency_enabled'), 'validated' => Values::array_get($payload, 'validated'), 'verified' => Values::array_get($payload, 'verified'), ); $this->solution = array('accountSid' => $accountSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Api\V2010\Account\AddressContext Context for this * AddressInstance */ protected function proxy() { if (!$this->context) { $this->context = new AddressContext( $this->version, $this->solution['accountSid'], $this->solution['sid'] ); } return $this->context; } /** * Deletes the AddressInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Fetch a AddressInstance * * @return AddressInstance Fetched AddressInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Update the AddressInstance * * @param array|Options $options Optional Arguments * @return AddressInstance Updated AddressInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Access the dependentPhoneNumbers * * @return \Twilio\Rest\Api\V2010\Account\Address\DependentPhoneNumberList */ protected function getDependentPhoneNumbers() { return $this->proxy()->dependentPhoneNumbers; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.AddressInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/SigningKeyPage.php 0000644 00000001376 15002236443 0016500 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Page; class SigningKeyPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new SigningKeyInstance($this->version, $payload, $this->solution['accountSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.SigningKeyPage]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/QueueInstance.php 0000644 00000011113 15002236443 0016373 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property int $averageWaitTime * @property int $currentSize * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $friendlyName * @property int $maxSize * @property string $sid * @property string $uri */ class QueueInstance extends InstanceResource { protected $_members = null; /** * Initialize the QueueInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the Account that created this resource * @param string $sid The unique string that identifies this resource * @return \Twilio\Rest\Api\V2010\Account\QueueInstance */ public function __construct(Version $version, array $payload, $accountSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'accountSid' => Values::array_get($payload, 'account_sid'), 'averageWaitTime' => Values::array_get($payload, 'average_wait_time'), 'currentSize' => Values::array_get($payload, 'current_size'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'maxSize' => Values::array_get($payload, 'max_size'), 'sid' => Values::array_get($payload, 'sid'), 'uri' => Values::array_get($payload, 'uri'), ); $this->solution = array('accountSid' => $accountSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Api\V2010\Account\QueueContext Context for this * QueueInstance */ protected function proxy() { if (!$this->context) { $this->context = new QueueContext( $this->version, $this->solution['accountSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch a QueueInstance * * @return QueueInstance Fetched QueueInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Update the QueueInstance * * @param array|Options $options Optional Arguments * @return QueueInstance Updated QueueInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Deletes the QueueInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Access the members * * @return \Twilio\Rest\Api\V2010\Account\Queue\MemberList */ protected function getMembers() { return $this->proxy()->members; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.QueueInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/ApplicationOptions.php 0000644 00000063240 15002236443 0017451 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Options; use Twilio\Values; abstract class ApplicationOptions { /** * @param string $apiVersion The API version to use to start a new TwiML session * @param string $voiceUrl The URL to call when the phone number receives a call * @param string $voiceMethod The HTTP method to use with the voice_url * @param string $voiceFallbackUrl The URL to call when a TwiML error occurs * @param string $voiceFallbackMethod The HTTP method to use with * voice_fallback_url * @param string $statusCallback The URL to send status information to your * application * @param string $statusCallbackMethod The HTTP method to use to call * status_callback * @param bool $voiceCallerIdLookup Whether to lookup the caller's name * @param string $smsUrl The URL to call when the phone number receives an * incoming SMS message * @param string $smsMethod The HTTP method to use with sms_url * @param string $smsFallbackUrl The URL to call when an error occurs while * retrieving or executing the TwiML * @param string $smsFallbackMethod The HTTP method to use with sms_fallback_url * @param string $smsStatusCallback The URL to send status information to your * application * @param string $messageStatusCallback The URL to send message status * information to your application * @param string $friendlyName A string to describe the new resource * @return CreateApplicationOptions Options builder */ public static function create($apiVersion = Values::NONE, $voiceUrl = Values::NONE, $voiceMethod = Values::NONE, $voiceFallbackUrl = Values::NONE, $voiceFallbackMethod = Values::NONE, $statusCallback = Values::NONE, $statusCallbackMethod = Values::NONE, $voiceCallerIdLookup = Values::NONE, $smsUrl = Values::NONE, $smsMethod = Values::NONE, $smsFallbackUrl = Values::NONE, $smsFallbackMethod = Values::NONE, $smsStatusCallback = Values::NONE, $messageStatusCallback = Values::NONE, $friendlyName = Values::NONE) { return new CreateApplicationOptions($apiVersion, $voiceUrl, $voiceMethod, $voiceFallbackUrl, $voiceFallbackMethod, $statusCallback, $statusCallbackMethod, $voiceCallerIdLookup, $smsUrl, $smsMethod, $smsFallbackUrl, $smsFallbackMethod, $smsStatusCallback, $messageStatusCallback, $friendlyName); } /** * @param string $friendlyName The string that identifies the Application * resources to read * @return ReadApplicationOptions Options builder */ public static function read($friendlyName = Values::NONE) { return new ReadApplicationOptions($friendlyName); } /** * @param string $friendlyName A string to describe the resource * @param string $apiVersion The API version to use to start a new TwiML session * @param string $voiceUrl The URL to call when the phone number receives a call * @param string $voiceMethod The HTTP method to use with the voice_url * @param string $voiceFallbackUrl The URL to call when a TwiML error occurs * @param string $voiceFallbackMethod The HTTP method to use with * voice_fallback_url * @param string $statusCallback The URL to send status information to your * application * @param string $statusCallbackMethod The HTTP method to use to call * status_callback * @param bool $voiceCallerIdLookup Whether to lookup the caller's name * @param string $smsUrl The URL to call when the phone number receives an * incoming SMS message * @param string $smsMethod The HTTP method to use with sms_url * @param string $smsFallbackUrl The URL to call when an error occurs while * retrieving or executing the TwiML * @param string $smsFallbackMethod The HTTP method to use with sms_fallback_url * @param string $smsStatusCallback The URL to send status information to your * application * @param string $messageStatusCallback The URL to send message status * information to your application * @return UpdateApplicationOptions Options builder */ public static function update($friendlyName = Values::NONE, $apiVersion = Values::NONE, $voiceUrl = Values::NONE, $voiceMethod = Values::NONE, $voiceFallbackUrl = Values::NONE, $voiceFallbackMethod = Values::NONE, $statusCallback = Values::NONE, $statusCallbackMethod = Values::NONE, $voiceCallerIdLookup = Values::NONE, $smsUrl = Values::NONE, $smsMethod = Values::NONE, $smsFallbackUrl = Values::NONE, $smsFallbackMethod = Values::NONE, $smsStatusCallback = Values::NONE, $messageStatusCallback = Values::NONE) { return new UpdateApplicationOptions($friendlyName, $apiVersion, $voiceUrl, $voiceMethod, $voiceFallbackUrl, $voiceFallbackMethod, $statusCallback, $statusCallbackMethod, $voiceCallerIdLookup, $smsUrl, $smsMethod, $smsFallbackUrl, $smsFallbackMethod, $smsStatusCallback, $messageStatusCallback); } } class CreateApplicationOptions extends Options { /** * @param string $apiVersion The API version to use to start a new TwiML session * @param string $voiceUrl The URL to call when the phone number receives a call * @param string $voiceMethod The HTTP method to use with the voice_url * @param string $voiceFallbackUrl The URL to call when a TwiML error occurs * @param string $voiceFallbackMethod The HTTP method to use with * voice_fallback_url * @param string $statusCallback The URL to send status information to your * application * @param string $statusCallbackMethod The HTTP method to use to call * status_callback * @param bool $voiceCallerIdLookup Whether to lookup the caller's name * @param string $smsUrl The URL to call when the phone number receives an * incoming SMS message * @param string $smsMethod The HTTP method to use with sms_url * @param string $smsFallbackUrl The URL to call when an error occurs while * retrieving or executing the TwiML * @param string $smsFallbackMethod The HTTP method to use with sms_fallback_url * @param string $smsStatusCallback The URL to send status information to your * application * @param string $messageStatusCallback The URL to send message status * information to your application * @param string $friendlyName A string to describe the new resource */ public function __construct($apiVersion = Values::NONE, $voiceUrl = Values::NONE, $voiceMethod = Values::NONE, $voiceFallbackUrl = Values::NONE, $voiceFallbackMethod = Values::NONE, $statusCallback = Values::NONE, $statusCallbackMethod = Values::NONE, $voiceCallerIdLookup = Values::NONE, $smsUrl = Values::NONE, $smsMethod = Values::NONE, $smsFallbackUrl = Values::NONE, $smsFallbackMethod = Values::NONE, $smsStatusCallback = Values::NONE, $messageStatusCallback = Values::NONE, $friendlyName = Values::NONE) { $this->options['apiVersion'] = $apiVersion; $this->options['voiceUrl'] = $voiceUrl; $this->options['voiceMethod'] = $voiceMethod; $this->options['voiceFallbackUrl'] = $voiceFallbackUrl; $this->options['voiceFallbackMethod'] = $voiceFallbackMethod; $this->options['statusCallback'] = $statusCallback; $this->options['statusCallbackMethod'] = $statusCallbackMethod; $this->options['voiceCallerIdLookup'] = $voiceCallerIdLookup; $this->options['smsUrl'] = $smsUrl; $this->options['smsMethod'] = $smsMethod; $this->options['smsFallbackUrl'] = $smsFallbackUrl; $this->options['smsFallbackMethod'] = $smsFallbackMethod; $this->options['smsStatusCallback'] = $smsStatusCallback; $this->options['messageStatusCallback'] = $messageStatusCallback; $this->options['friendlyName'] = $friendlyName; } /** * The API version to use to start a new TwiML session. Can be: `2010-04-01` or `2008-08-01`. The default value is the account's default API version. * * @param string $apiVersion The API version to use to start a new TwiML session * @return $this Fluent Builder */ public function setApiVersion($apiVersion) { $this->options['apiVersion'] = $apiVersion; return $this; } /** * The URL we should call when the phone number assigned to this application receives a call. * * @param string $voiceUrl The URL to call when the phone number receives a call * @return $this Fluent Builder */ public function setVoiceUrl($voiceUrl) { $this->options['voiceUrl'] = $voiceUrl; return $this; } /** * The HTTP method we should use to call `voice_url`. Can be: `GET` or `POST`. * * @param string $voiceMethod The HTTP method to use with the voice_url * @return $this Fluent Builder */ public function setVoiceMethod($voiceMethod) { $this->options['voiceMethod'] = $voiceMethod; return $this; } /** * The URL that we should call when an error occurs retrieving or executing the TwiML requested by `url`. * * @param string $voiceFallbackUrl The URL to call when a TwiML error occurs * @return $this Fluent Builder */ public function setVoiceFallbackUrl($voiceFallbackUrl) { $this->options['voiceFallbackUrl'] = $voiceFallbackUrl; return $this; } /** * The HTTP method we should use to call `voice_fallback_url`. Can be: `GET` or `POST`. * * @param string $voiceFallbackMethod The HTTP method to use with * voice_fallback_url * @return $this Fluent Builder */ public function setVoiceFallbackMethod($voiceFallbackMethod) { $this->options['voiceFallbackMethod'] = $voiceFallbackMethod; return $this; } /** * The URL we should call using the `status_callback_method` to send status information to your application. * * @param string $statusCallback The URL to send status information to your * application * @return $this Fluent Builder */ public function setStatusCallback($statusCallback) { $this->options['statusCallback'] = $statusCallback; return $this; } /** * The HTTP method we should use to call `status_callback`. Can be: `GET` or `POST`. * * @param string $statusCallbackMethod The HTTP method to use to call * status_callback * @return $this Fluent Builder */ public function setStatusCallbackMethod($statusCallbackMethod) { $this->options['statusCallbackMethod'] = $statusCallbackMethod; return $this; } /** * Whether we should look up the caller's caller-ID name from the CNAM database (additional charges apply). Can be: `true` or `false`. * * @param bool $voiceCallerIdLookup Whether to lookup the caller's name * @return $this Fluent Builder */ public function setVoiceCallerIdLookup($voiceCallerIdLookup) { $this->options['voiceCallerIdLookup'] = $voiceCallerIdLookup; return $this; } /** * The URL we should call when the phone number receives an incoming SMS message. * * @param string $smsUrl The URL to call when the phone number receives an * incoming SMS message * @return $this Fluent Builder */ public function setSmsUrl($smsUrl) { $this->options['smsUrl'] = $smsUrl; return $this; } /** * The HTTP method we should use to call `sms_url`. Can be: `GET` or `POST`. * * @param string $smsMethod The HTTP method to use with sms_url * @return $this Fluent Builder */ public function setSmsMethod($smsMethod) { $this->options['smsMethod'] = $smsMethod; return $this; } /** * The URL that we should call when an error occurs while retrieving or executing the TwiML from `sms_url`. * * @param string $smsFallbackUrl The URL to call when an error occurs while * retrieving or executing the TwiML * @return $this Fluent Builder */ public function setSmsFallbackUrl($smsFallbackUrl) { $this->options['smsFallbackUrl'] = $smsFallbackUrl; return $this; } /** * The HTTP method we should use to call `sms_fallback_url`. Can be: `GET` or `POST`. * * @param string $smsFallbackMethod The HTTP method to use with sms_fallback_url * @return $this Fluent Builder */ public function setSmsFallbackMethod($smsFallbackMethod) { $this->options['smsFallbackMethod'] = $smsFallbackMethod; return $this; } /** * The URL we should call using a POST method to send status information about SMS messages sent by the application. * * @param string $smsStatusCallback The URL to send status information to your * application * @return $this Fluent Builder */ public function setSmsStatusCallback($smsStatusCallback) { $this->options['smsStatusCallback'] = $smsStatusCallback; return $this; } /** * The URL we should call using a POST method to send message status information to your application. * * @param string $messageStatusCallback The URL to send message status * information to your application * @return $this Fluent Builder */ public function setMessageStatusCallback($messageStatusCallback) { $this->options['messageStatusCallback'] = $messageStatusCallback; return $this; } /** * A descriptive string that you create to describe the new application. It can be up to 64 characters long. * * @param string $friendlyName A string to describe the new resource * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; 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.CreateApplicationOptions ' . \implode(' ', $options) . ']'; } } class ReadApplicationOptions extends Options { /** * @param string $friendlyName The string that identifies the Application * resources to read */ public function __construct($friendlyName = Values::NONE) { $this->options['friendlyName'] = $friendlyName; } /** * The string that identifies the Application resources to read. * * @param string $friendlyName The string that identifies the Application * resources to read * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; 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.ReadApplicationOptions ' . \implode(' ', $options) . ']'; } } class UpdateApplicationOptions extends Options { /** * @param string $friendlyName A string to describe the resource * @param string $apiVersion The API version to use to start a new TwiML session * @param string $voiceUrl The URL to call when the phone number receives a call * @param string $voiceMethod The HTTP method to use with the voice_url * @param string $voiceFallbackUrl The URL to call when a TwiML error occurs * @param string $voiceFallbackMethod The HTTP method to use with * voice_fallback_url * @param string $statusCallback The URL to send status information to your * application * @param string $statusCallbackMethod The HTTP method to use to call * status_callback * @param bool $voiceCallerIdLookup Whether to lookup the caller's name * @param string $smsUrl The URL to call when the phone number receives an * incoming SMS message * @param string $smsMethod The HTTP method to use with sms_url * @param string $smsFallbackUrl The URL to call when an error occurs while * retrieving or executing the TwiML * @param string $smsFallbackMethod The HTTP method to use with sms_fallback_url * @param string $smsStatusCallback The URL to send status information to your * application * @param string $messageStatusCallback The URL to send message status * information to your application */ public function __construct($friendlyName = Values::NONE, $apiVersion = Values::NONE, $voiceUrl = Values::NONE, $voiceMethod = Values::NONE, $voiceFallbackUrl = Values::NONE, $voiceFallbackMethod = Values::NONE, $statusCallback = Values::NONE, $statusCallbackMethod = Values::NONE, $voiceCallerIdLookup = Values::NONE, $smsUrl = Values::NONE, $smsMethod = Values::NONE, $smsFallbackUrl = Values::NONE, $smsFallbackMethod = Values::NONE, $smsStatusCallback = Values::NONE, $messageStatusCallback = Values::NONE) { $this->options['friendlyName'] = $friendlyName; $this->options['apiVersion'] = $apiVersion; $this->options['voiceUrl'] = $voiceUrl; $this->options['voiceMethod'] = $voiceMethod; $this->options['voiceFallbackUrl'] = $voiceFallbackUrl; $this->options['voiceFallbackMethod'] = $voiceFallbackMethod; $this->options['statusCallback'] = $statusCallback; $this->options['statusCallbackMethod'] = $statusCallbackMethod; $this->options['voiceCallerIdLookup'] = $voiceCallerIdLookup; $this->options['smsUrl'] = $smsUrl; $this->options['smsMethod'] = $smsMethod; $this->options['smsFallbackUrl'] = $smsFallbackUrl; $this->options['smsFallbackMethod'] = $smsFallbackMethod; $this->options['smsStatusCallback'] = $smsStatusCallback; $this->options['messageStatusCallback'] = $messageStatusCallback; } /** * A descriptive string that you create to describe the resource. It can be up to 64 characters long. * * @param string $friendlyName A string to describe the resource * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The API version to use to start a new TwiML session. Can be: `2010-04-01` or `2008-08-01`. The default value is your account's default API version. * * @param string $apiVersion The API version to use to start a new TwiML session * @return $this Fluent Builder */ public function setApiVersion($apiVersion) { $this->options['apiVersion'] = $apiVersion; return $this; } /** * The URL we should call when the phone number assigned to this application receives a call. * * @param string $voiceUrl The URL to call when the phone number receives a call * @return $this Fluent Builder */ public function setVoiceUrl($voiceUrl) { $this->options['voiceUrl'] = $voiceUrl; return $this; } /** * The HTTP method we should use to call `voice_url`. Can be: `GET` or `POST`. * * @param string $voiceMethod The HTTP method to use with the voice_url * @return $this Fluent Builder */ public function setVoiceMethod($voiceMethod) { $this->options['voiceMethod'] = $voiceMethod; return $this; } /** * The URL that we should call when an error occurs retrieving or executing the TwiML requested by `url`. * * @param string $voiceFallbackUrl The URL to call when a TwiML error occurs * @return $this Fluent Builder */ public function setVoiceFallbackUrl($voiceFallbackUrl) { $this->options['voiceFallbackUrl'] = $voiceFallbackUrl; return $this; } /** * The HTTP method we should use to call `voice_fallback_url`. Can be: `GET` or `POST`. * * @param string $voiceFallbackMethod The HTTP method to use with * voice_fallback_url * @return $this Fluent Builder */ public function setVoiceFallbackMethod($voiceFallbackMethod) { $this->options['voiceFallbackMethod'] = $voiceFallbackMethod; return $this; } /** * The URL we should call using the `status_callback_method` to send status information to your application. * * @param string $statusCallback The URL to send status information to your * application * @return $this Fluent Builder */ public function setStatusCallback($statusCallback) { $this->options['statusCallback'] = $statusCallback; return $this; } /** * The HTTP method we should use to call `status_callback`. Can be: `GET` or `POST`. * * @param string $statusCallbackMethod The HTTP method to use to call * status_callback * @return $this Fluent Builder */ public function setStatusCallbackMethod($statusCallbackMethod) { $this->options['statusCallbackMethod'] = $statusCallbackMethod; return $this; } /** * Whether we should look up the caller's caller-ID name from the CNAM database (additional charges apply). Can be: `true` or `false`. * * @param bool $voiceCallerIdLookup Whether to lookup the caller's name * @return $this Fluent Builder */ public function setVoiceCallerIdLookup($voiceCallerIdLookup) { $this->options['voiceCallerIdLookup'] = $voiceCallerIdLookup; return $this; } /** * The URL we should call when the phone number receives an incoming SMS message. * * @param string $smsUrl The URL to call when the phone number receives an * incoming SMS message * @return $this Fluent Builder */ public function setSmsUrl($smsUrl) { $this->options['smsUrl'] = $smsUrl; return $this; } /** * The HTTP method we should use to call `sms_url`. Can be: `GET` or `POST`. * * @param string $smsMethod The HTTP method to use with sms_url * @return $this Fluent Builder */ public function setSmsMethod($smsMethod) { $this->options['smsMethod'] = $smsMethod; return $this; } /** * The URL that we should call when an error occurs while retrieving or executing the TwiML from `sms_url`. * * @param string $smsFallbackUrl The URL to call when an error occurs while * retrieving or executing the TwiML * @return $this Fluent Builder */ public function setSmsFallbackUrl($smsFallbackUrl) { $this->options['smsFallbackUrl'] = $smsFallbackUrl; return $this; } /** * The HTTP method we should use to call `sms_fallback_url`. Can be: `GET` or `POST`. * * @param string $smsFallbackMethod The HTTP method to use with sms_fallback_url * @return $this Fluent Builder */ public function setSmsFallbackMethod($smsFallbackMethod) { $this->options['smsFallbackMethod'] = $smsFallbackMethod; return $this; } /** * The URL we should call using a POST method to send status information about SMS messages sent by the application. * * @param string $smsStatusCallback The URL to send status information to your * application * @return $this Fluent Builder */ public function setSmsStatusCallback($smsStatusCallback) { $this->options['smsStatusCallback'] = $smsStatusCallback; return $this; } /** * The URL we should call using a POST method to send message status information to your application. * * @param string $messageStatusCallback The URL to send message status * information to your application * @return $this Fluent Builder */ public function setMessageStatusCallback($messageStatusCallback) { $this->options['messageStatusCallback'] = $messageStatusCallback; 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.UpdateApplicationOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/SigningKeyList.php 0000644 00000011577 15002236443 0016543 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\ListResource; use Twilio\Values; use Twilio\Version; class SigningKeyList extends ListResource { /** * Construct the SigningKeyList * * @param Version $version Version that contains the resource * @param string $accountSid A 34 character string that uniquely identifies * this resource. * @return \Twilio\Rest\Api\V2010\Account\SigningKeyList */ public function __construct(Version $version, $accountSid) { parent::__construct($version); // Path Solution $this->solution = array('accountSid' => $accountSid, ); $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/SigningKeys.json'; } /** * Streams SigningKeyInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads SigningKeyInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return SigningKeyInstance[] Array of results */ public function read($limit = null, $pageSize = null) { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of SigningKeyInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of SigningKeyInstance */ public function page($pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $params = Values::of(array( 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new SigningKeyPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of SigningKeyInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of SigningKeyInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new SigningKeyPage($this->version, $response, $this->solution); } /** * Constructs a SigningKeyContext * * @param string $sid The sid * @return \Twilio\Rest\Api\V2010\Account\SigningKeyContext */ public function getContext($sid) { return new SigningKeyContext($this->version, $this->solution['accountSid'], $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.SigningKeyList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/TollFreeOptions.php 0000644 00000040271 15002236443 0024330 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry; use Twilio\Options; use Twilio\Values; abstract class TollFreeOptions { /** * @param int $areaCode The area code of the phone numbers to read * @param string $contains The pattern on which to match phone numbers * @param bool $smsEnabled Whether the phone numbers can receive text messages * @param bool $mmsEnabled Whether the phone numbers can receive MMS messages * @param bool $voiceEnabled Whether the phone numbers can receive calls. * @param bool $excludeAllAddressRequired Whether to exclude phone numbers that * require an Address * @param bool $excludeLocalAddressRequired Whether to exclude phone numbers * that require a local address * @param bool $excludeForeignAddressRequired Whether to exclude phone numbers * that require a foreign address * @param bool $beta Whether to read phone numbers new to the Twilio platform * @param string $nearNumber Given a phone number, find a geographically close * number within distance miles. (US/Canada only) * @param string $nearLatLong Given a latitude/longitude pair lat,long find * geographically close numbers within distance * miles. (US/Canada only) * @param int $distance The search radius, in miles, for a near_ query. * (US/Canada only) * @param string $inPostalCode Limit results to a particular postal code. * (US/Canada only) * @param string $inRegion Limit results to a particular region. (US/Canada * only) * @param string $inRateCenter Limit results to a specific rate center, or * given a phone number search within the same rate * center as that number. (US/Canada only) * @param string $inLata Limit results to a specific local access and transport * area. (US/Canada only) * @param string $inLocality Limit results to a particular locality * @param bool $faxEnabled Whether the phone numbers can receive faxes * @return ReadTollFreeOptions Options builder */ public static function read($areaCode = Values::NONE, $contains = Values::NONE, $smsEnabled = Values::NONE, $mmsEnabled = Values::NONE, $voiceEnabled = Values::NONE, $excludeAllAddressRequired = Values::NONE, $excludeLocalAddressRequired = Values::NONE, $excludeForeignAddressRequired = Values::NONE, $beta = Values::NONE, $nearNumber = Values::NONE, $nearLatLong = Values::NONE, $distance = Values::NONE, $inPostalCode = Values::NONE, $inRegion = Values::NONE, $inRateCenter = Values::NONE, $inLata = Values::NONE, $inLocality = Values::NONE, $faxEnabled = Values::NONE) { return new ReadTollFreeOptions($areaCode, $contains, $smsEnabled, $mmsEnabled, $voiceEnabled, $excludeAllAddressRequired, $excludeLocalAddressRequired, $excludeForeignAddressRequired, $beta, $nearNumber, $nearLatLong, $distance, $inPostalCode, $inRegion, $inRateCenter, $inLata, $inLocality, $faxEnabled); } } class ReadTollFreeOptions extends Options { /** * @param int $areaCode The area code of the phone numbers to read * @param string $contains The pattern on which to match phone numbers * @param bool $smsEnabled Whether the phone numbers can receive text messages * @param bool $mmsEnabled Whether the phone numbers can receive MMS messages * @param bool $voiceEnabled Whether the phone numbers can receive calls. * @param bool $excludeAllAddressRequired Whether to exclude phone numbers that * require an Address * @param bool $excludeLocalAddressRequired Whether to exclude phone numbers * that require a local address * @param bool $excludeForeignAddressRequired Whether to exclude phone numbers * that require a foreign address * @param bool $beta Whether to read phone numbers new to the Twilio platform * @param string $nearNumber Given a phone number, find a geographically close * number within distance miles. (US/Canada only) * @param string $nearLatLong Given a latitude/longitude pair lat,long find * geographically close numbers within distance * miles. (US/Canada only) * @param int $distance The search radius, in miles, for a near_ query. * (US/Canada only) * @param string $inPostalCode Limit results to a particular postal code. * (US/Canada only) * @param string $inRegion Limit results to a particular region. (US/Canada * only) * @param string $inRateCenter Limit results to a specific rate center, or * given a phone number search within the same rate * center as that number. (US/Canada only) * @param string $inLata Limit results to a specific local access and transport * area. (US/Canada only) * @param string $inLocality Limit results to a particular locality * @param bool $faxEnabled Whether the phone numbers can receive faxes */ public function __construct($areaCode = Values::NONE, $contains = Values::NONE, $smsEnabled = Values::NONE, $mmsEnabled = Values::NONE, $voiceEnabled = Values::NONE, $excludeAllAddressRequired = Values::NONE, $excludeLocalAddressRequired = Values::NONE, $excludeForeignAddressRequired = Values::NONE, $beta = Values::NONE, $nearNumber = Values::NONE, $nearLatLong = Values::NONE, $distance = Values::NONE, $inPostalCode = Values::NONE, $inRegion = Values::NONE, $inRateCenter = Values::NONE, $inLata = Values::NONE, $inLocality = Values::NONE, $faxEnabled = Values::NONE) { $this->options['areaCode'] = $areaCode; $this->options['contains'] = $contains; $this->options['smsEnabled'] = $smsEnabled; $this->options['mmsEnabled'] = $mmsEnabled; $this->options['voiceEnabled'] = $voiceEnabled; $this->options['excludeAllAddressRequired'] = $excludeAllAddressRequired; $this->options['excludeLocalAddressRequired'] = $excludeLocalAddressRequired; $this->options['excludeForeignAddressRequired'] = $excludeForeignAddressRequired; $this->options['beta'] = $beta; $this->options['nearNumber'] = $nearNumber; $this->options['nearLatLong'] = $nearLatLong; $this->options['distance'] = $distance; $this->options['inPostalCode'] = $inPostalCode; $this->options['inRegion'] = $inRegion; $this->options['inRateCenter'] = $inRateCenter; $this->options['inLata'] = $inLata; $this->options['inLocality'] = $inLocality; $this->options['faxEnabled'] = $faxEnabled; } /** * The area code of the phone numbers to read. Applies to only phone numbers in the US and Canada. * * @param int $areaCode The area code of the phone numbers to read * @return $this Fluent Builder */ public function setAreaCode($areaCode) { $this->options['areaCode'] = $areaCode; return $this; } /** * The pattern on which to match phone numbers. Valid characters are `*`, `0-9`, `a-z`, and `A-Z`. The `*` character matches any single digit. For examples, see [Example 2](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-2) and [Example 3](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-3). If specified, this value must have at least two characters. * * @param string $contains The pattern on which to match phone numbers * @return $this Fluent Builder */ public function setContains($contains) { $this->options['contains'] = $contains; return $this; } /** * Whether the phone numbers can receive text messages. Can be: `true` or `false`. * * @param bool $smsEnabled Whether the phone numbers can receive text messages * @return $this Fluent Builder */ public function setSmsEnabled($smsEnabled) { $this->options['smsEnabled'] = $smsEnabled; return $this; } /** * Whether the phone numbers can receive MMS messages. Can be: `true` or `false`. * * @param bool $mmsEnabled Whether the phone numbers can receive MMS messages * @return $this Fluent Builder */ public function setMmsEnabled($mmsEnabled) { $this->options['mmsEnabled'] = $mmsEnabled; return $this; } /** * Whether the phone numbers can receive calls. Can be: `true` or `false`. * * @param bool $voiceEnabled Whether the phone numbers can receive calls. * @return $this Fluent Builder */ public function setVoiceEnabled($voiceEnabled) { $this->options['voiceEnabled'] = $voiceEnabled; return $this; } /** * Whether to exclude phone numbers that require an [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. * * @param bool $excludeAllAddressRequired Whether to exclude phone numbers that * require an Address * @return $this Fluent Builder */ public function setExcludeAllAddressRequired($excludeAllAddressRequired) { $this->options['excludeAllAddressRequired'] = $excludeAllAddressRequired; return $this; } /** * Whether to exclude phone numbers that require a local [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. * * @param bool $excludeLocalAddressRequired Whether to exclude phone numbers * that require a local address * @return $this Fluent Builder */ public function setExcludeLocalAddressRequired($excludeLocalAddressRequired) { $this->options['excludeLocalAddressRequired'] = $excludeLocalAddressRequired; return $this; } /** * Whether to exclude phone numbers that require a foreign [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. * * @param bool $excludeForeignAddressRequired Whether to exclude phone numbers * that require a foreign address * @return $this Fluent Builder */ public function setExcludeForeignAddressRequired($excludeForeignAddressRequired) { $this->options['excludeForeignAddressRequired'] = $excludeForeignAddressRequired; return $this; } /** * Whether to read phone numbers that are new to the Twilio platform. Can be: `true` or `false` and the default is `true`. * * @param bool $beta Whether to read phone numbers new to the Twilio platform * @return $this Fluent Builder */ public function setBeta($beta) { $this->options['beta'] = $beta; return $this; } /** * Given a phone number, find a geographically close number within `distance` miles. Distance defaults to 25 miles. Applies to only phone numbers in the US and Canada. * * @param string $nearNumber Given a phone number, find a geographically close * number within distance miles. (US/Canada only) * @return $this Fluent Builder */ public function setNearNumber($nearNumber) { $this->options['nearNumber'] = $nearNumber; return $this; } /** * Given a latitude/longitude pair `lat,long` find geographically close numbers within `distance` miles. Applies to only phone numbers in the US and Canada. * * @param string $nearLatLong Given a latitude/longitude pair lat,long find * geographically close numbers within distance * miles. (US/Canada only) * @return $this Fluent Builder */ public function setNearLatLong($nearLatLong) { $this->options['nearLatLong'] = $nearLatLong; return $this; } /** * The search radius, in miles, for a `near_` query. Can be up to `500` and the default is `25`. Applies to only phone numbers in the US and Canada. * * @param int $distance The search radius, in miles, for a near_ query. * (US/Canada only) * @return $this Fluent Builder */ public function setDistance($distance) { $this->options['distance'] = $distance; return $this; } /** * Limit results to a particular postal code. Given a phone number, search within the same postal code as that number. Applies to only phone numbers in the US and Canada. * * @param string $inPostalCode Limit results to a particular postal code. * (US/Canada only) * @return $this Fluent Builder */ public function setInPostalCode($inPostalCode) { $this->options['inPostalCode'] = $inPostalCode; return $this; } /** * Limit results to a particular region, state, or province. Given a phone number, search within the same region as that number. Applies to only phone numbers in the US and Canada. * * @param string $inRegion Limit results to a particular region. (US/Canada * only) * @return $this Fluent Builder */ public function setInRegion($inRegion) { $this->options['inRegion'] = $inRegion; return $this; } /** * Limit results to a specific rate center, or given a phone number search within the same rate center as that number. Requires `in_lata` to be set as well. Applies to only phone numbers in the US and Canada. * * @param string $inRateCenter Limit results to a specific rate center, or * given a phone number search within the same rate * center as that number. (US/Canada only) * @return $this Fluent Builder */ public function setInRateCenter($inRateCenter) { $this->options['inRateCenter'] = $inRateCenter; return $this; } /** * Limit results to a specific local access and transport area ([LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area)). Given a phone number, search within the same [LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area) as that number. Applies to only phone numbers in the US and Canada. * * @param string $inLata Limit results to a specific local access and transport * area. (US/Canada only) * @return $this Fluent Builder */ public function setInLata($inLata) { $this->options['inLata'] = $inLata; return $this; } /** * Limit results to a particular locality or city. Given a phone number, search within the same Locality as that number. * * @param string $inLocality Limit results to a particular locality * @return $this Fluent Builder */ public function setInLocality($inLocality) { $this->options['inLocality'] = $inLocality; return $this; } /** * Whether the phone numbers can receive faxes. Can be: `true` or `false`. * * @param bool $faxEnabled Whether the phone numbers can receive faxes * @return $this Fluent Builder */ public function setFaxEnabled($faxEnabled) { $this->options['faxEnabled'] = $faxEnabled; 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.ReadTollFreeOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/MachineToMachineInstance.php 0000644 00000006224 15002236443 0026061 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $friendlyName * @property string $phoneNumber * @property string $lata * @property string $locality * @property string $rateCenter * @property string $latitude * @property string $longitude * @property string $region * @property string $postalCode * @property string $isoCountry * @property string $addressRequirements * @property bool $beta * @property string $capabilities */ class MachineToMachineInstance extends InstanceResource { /** * Initialize the MachineToMachineInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The account_sid * @param string $countryCode The ISO-3166-1 country code of the country. * @return \Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry\MachineToMachineInstance */ public function __construct(Version $version, array $payload, $accountSid, $countryCode) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'phoneNumber' => Values::array_get($payload, 'phone_number'), 'lata' => Values::array_get($payload, 'lata'), 'locality' => Values::array_get($payload, 'locality'), 'rateCenter' => Values::array_get($payload, 'rate_center'), 'latitude' => Values::array_get($payload, 'latitude'), 'longitude' => Values::array_get($payload, 'longitude'), 'region' => Values::array_get($payload, 'region'), 'postalCode' => Values::array_get($payload, 'postal_code'), 'isoCountry' => Values::array_get($payload, 'iso_country'), 'addressRequirements' => Values::array_get($payload, 'address_requirements'), 'beta' => Values::array_get($payload, 'beta'), 'capabilities' => Values::array_get($payload, 'capabilities'), ); $this->solution = array('accountSid' => $accountSid, 'countryCode' => $countryCode, ); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.MachineToMachineInstance]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/NationalInstance.php 0000644 00000006164 15002236443 0024475 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $friendlyName * @property string $phoneNumber * @property string $lata * @property string $locality * @property string $rateCenter * @property string $latitude * @property string $longitude * @property string $region * @property string $postalCode * @property string $isoCountry * @property string $addressRequirements * @property bool $beta * @property string $capabilities */ class NationalInstance extends InstanceResource { /** * Initialize the NationalInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The account_sid * @param string $countryCode The ISO-3166-1 country code of the country. * @return \Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry\NationalInstance */ public function __construct(Version $version, array $payload, $accountSid, $countryCode) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'phoneNumber' => Values::array_get($payload, 'phone_number'), 'lata' => Values::array_get($payload, 'lata'), 'locality' => Values::array_get($payload, 'locality'), 'rateCenter' => Values::array_get($payload, 'rate_center'), 'latitude' => Values::array_get($payload, 'latitude'), 'longitude' => Values::array_get($payload, 'longitude'), 'region' => Values::array_get($payload, 'region'), 'postalCode' => Values::array_get($payload, 'postal_code'), 'isoCountry' => Values::array_get($payload, 'iso_country'), 'addressRequirements' => Values::array_get($payload, 'address_requirements'), 'beta' => Values::array_get($payload, 'beta'), 'capabilities' => Values::array_get($payload, 'capabilities'), ); $this->solution = array('accountSid' => $accountSid, 'countryCode' => $countryCode, ); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.NationalInstance]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/MachineToMachinePage.php 0000644 00000001606 15002236443 0025170 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry; use Twilio\Page; class MachineToMachinePage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new MachineToMachineInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['countryCode'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.MachineToMachinePage]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/LocalOptions.php 0000644 00000040252 15002236443 0023645 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry; use Twilio\Options; use Twilio\Values; abstract class LocalOptions { /** * @param int $areaCode The area code of the phone numbers to read * @param string $contains The pattern on which to match phone numbers * @param bool $smsEnabled Whether the phone numbers can receive text messages * @param bool $mmsEnabled Whether the phone numbers can receive MMS messages * @param bool $voiceEnabled Whether the phone numbers can receive calls. * @param bool $excludeAllAddressRequired Whether to exclude phone numbers that * require an Address * @param bool $excludeLocalAddressRequired Whether to exclude phone numbers * that require a local address * @param bool $excludeForeignAddressRequired Whether to exclude phone numbers * that require a foreign address * @param bool $beta Whether to read phone numbers new to the Twilio platform * @param string $nearNumber Given a phone number, find a geographically close * number within distance miles. (US/Canada only) * @param string $nearLatLong Given a latitude/longitude pair lat,long find * geographically close numbers within distance * miles. (US/Canada only) * @param int $distance The search radius, in miles, for a near_ query. * (US/Canada only) * @param string $inPostalCode Limit results to a particular postal code. * (US/Canada only) * @param string $inRegion Limit results to a particular region. (US/Canada * only) * @param string $inRateCenter Limit results to a specific rate center, or * given a phone number search within the same rate * center as that number. (US/Canada only) * @param string $inLata Limit results to a specific local access and transport * area. (US/Canada only) * @param string $inLocality Limit results to a particular locality * @param bool $faxEnabled Whether the phone numbers can receive faxes * @return ReadLocalOptions Options builder */ public static function read($areaCode = Values::NONE, $contains = Values::NONE, $smsEnabled = Values::NONE, $mmsEnabled = Values::NONE, $voiceEnabled = Values::NONE, $excludeAllAddressRequired = Values::NONE, $excludeLocalAddressRequired = Values::NONE, $excludeForeignAddressRequired = Values::NONE, $beta = Values::NONE, $nearNumber = Values::NONE, $nearLatLong = Values::NONE, $distance = Values::NONE, $inPostalCode = Values::NONE, $inRegion = Values::NONE, $inRateCenter = Values::NONE, $inLata = Values::NONE, $inLocality = Values::NONE, $faxEnabled = Values::NONE) { return new ReadLocalOptions($areaCode, $contains, $smsEnabled, $mmsEnabled, $voiceEnabled, $excludeAllAddressRequired, $excludeLocalAddressRequired, $excludeForeignAddressRequired, $beta, $nearNumber, $nearLatLong, $distance, $inPostalCode, $inRegion, $inRateCenter, $inLata, $inLocality, $faxEnabled); } } class ReadLocalOptions extends Options { /** * @param int $areaCode The area code of the phone numbers to read * @param string $contains The pattern on which to match phone numbers * @param bool $smsEnabled Whether the phone numbers can receive text messages * @param bool $mmsEnabled Whether the phone numbers can receive MMS messages * @param bool $voiceEnabled Whether the phone numbers can receive calls. * @param bool $excludeAllAddressRequired Whether to exclude phone numbers that * require an Address * @param bool $excludeLocalAddressRequired Whether to exclude phone numbers * that require a local address * @param bool $excludeForeignAddressRequired Whether to exclude phone numbers * that require a foreign address * @param bool $beta Whether to read phone numbers new to the Twilio platform * @param string $nearNumber Given a phone number, find a geographically close * number within distance miles. (US/Canada only) * @param string $nearLatLong Given a latitude/longitude pair lat,long find * geographically close numbers within distance * miles. (US/Canada only) * @param int $distance The search radius, in miles, for a near_ query. * (US/Canada only) * @param string $inPostalCode Limit results to a particular postal code. * (US/Canada only) * @param string $inRegion Limit results to a particular region. (US/Canada * only) * @param string $inRateCenter Limit results to a specific rate center, or * given a phone number search within the same rate * center as that number. (US/Canada only) * @param string $inLata Limit results to a specific local access and transport * area. (US/Canada only) * @param string $inLocality Limit results to a particular locality * @param bool $faxEnabled Whether the phone numbers can receive faxes */ public function __construct($areaCode = Values::NONE, $contains = Values::NONE, $smsEnabled = Values::NONE, $mmsEnabled = Values::NONE, $voiceEnabled = Values::NONE, $excludeAllAddressRequired = Values::NONE, $excludeLocalAddressRequired = Values::NONE, $excludeForeignAddressRequired = Values::NONE, $beta = Values::NONE, $nearNumber = Values::NONE, $nearLatLong = Values::NONE, $distance = Values::NONE, $inPostalCode = Values::NONE, $inRegion = Values::NONE, $inRateCenter = Values::NONE, $inLata = Values::NONE, $inLocality = Values::NONE, $faxEnabled = Values::NONE) { $this->options['areaCode'] = $areaCode; $this->options['contains'] = $contains; $this->options['smsEnabled'] = $smsEnabled; $this->options['mmsEnabled'] = $mmsEnabled; $this->options['voiceEnabled'] = $voiceEnabled; $this->options['excludeAllAddressRequired'] = $excludeAllAddressRequired; $this->options['excludeLocalAddressRequired'] = $excludeLocalAddressRequired; $this->options['excludeForeignAddressRequired'] = $excludeForeignAddressRequired; $this->options['beta'] = $beta; $this->options['nearNumber'] = $nearNumber; $this->options['nearLatLong'] = $nearLatLong; $this->options['distance'] = $distance; $this->options['inPostalCode'] = $inPostalCode; $this->options['inRegion'] = $inRegion; $this->options['inRateCenter'] = $inRateCenter; $this->options['inLata'] = $inLata; $this->options['inLocality'] = $inLocality; $this->options['faxEnabled'] = $faxEnabled; } /** * The area code of the phone numbers to read. Applies to only phone numbers in the US and Canada. * * @param int $areaCode The area code of the phone numbers to read * @return $this Fluent Builder */ public function setAreaCode($areaCode) { $this->options['areaCode'] = $areaCode; return $this; } /** * The pattern on which to match phone numbers. Valid characters are `*`, `0-9`, `a-z`, and `A-Z`. The `*` character matches any single digit. For examples, see [Example 2](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-2) and [Example 3](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-3). If specified, this value must have at least two characters. * * @param string $contains The pattern on which to match phone numbers * @return $this Fluent Builder */ public function setContains($contains) { $this->options['contains'] = $contains; return $this; } /** * Whether the phone numbers can receive text messages. Can be: `true` or `false`. * * @param bool $smsEnabled Whether the phone numbers can receive text messages * @return $this Fluent Builder */ public function setSmsEnabled($smsEnabled) { $this->options['smsEnabled'] = $smsEnabled; return $this; } /** * Whether the phone numbers can receive MMS messages. Can be: `true` or `false`. * * @param bool $mmsEnabled Whether the phone numbers can receive MMS messages * @return $this Fluent Builder */ public function setMmsEnabled($mmsEnabled) { $this->options['mmsEnabled'] = $mmsEnabled; return $this; } /** * Whether the phone numbers can receive calls. Can be: `true` or `false`. * * @param bool $voiceEnabled Whether the phone numbers can receive calls. * @return $this Fluent Builder */ public function setVoiceEnabled($voiceEnabled) { $this->options['voiceEnabled'] = $voiceEnabled; return $this; } /** * Whether to exclude phone numbers that require an [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. * * @param bool $excludeAllAddressRequired Whether to exclude phone numbers that * require an Address * @return $this Fluent Builder */ public function setExcludeAllAddressRequired($excludeAllAddressRequired) { $this->options['excludeAllAddressRequired'] = $excludeAllAddressRequired; return $this; } /** * Whether to exclude phone numbers that require a local [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. * * @param bool $excludeLocalAddressRequired Whether to exclude phone numbers * that require a local address * @return $this Fluent Builder */ public function setExcludeLocalAddressRequired($excludeLocalAddressRequired) { $this->options['excludeLocalAddressRequired'] = $excludeLocalAddressRequired; return $this; } /** * Whether to exclude phone numbers that require a foreign [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. * * @param bool $excludeForeignAddressRequired Whether to exclude phone numbers * that require a foreign address * @return $this Fluent Builder */ public function setExcludeForeignAddressRequired($excludeForeignAddressRequired) { $this->options['excludeForeignAddressRequired'] = $excludeForeignAddressRequired; return $this; } /** * Whether to read phone numbers that are new to the Twilio platform. Can be: `true` or `false` and the default is `true`. * * @param bool $beta Whether to read phone numbers new to the Twilio platform * @return $this Fluent Builder */ public function setBeta($beta) { $this->options['beta'] = $beta; return $this; } /** * Given a phone number, find a geographically close number within `distance` miles. Distance defaults to 25 miles. Applies to only phone numbers in the US and Canada. * * @param string $nearNumber Given a phone number, find a geographically close * number within distance miles. (US/Canada only) * @return $this Fluent Builder */ public function setNearNumber($nearNumber) { $this->options['nearNumber'] = $nearNumber; return $this; } /** * Given a latitude/longitude pair `lat,long` find geographically close numbers within `distance` miles. Applies to only phone numbers in the US and Canada. * * @param string $nearLatLong Given a latitude/longitude pair lat,long find * geographically close numbers within distance * miles. (US/Canada only) * @return $this Fluent Builder */ public function setNearLatLong($nearLatLong) { $this->options['nearLatLong'] = $nearLatLong; return $this; } /** * The search radius, in miles, for a `near_` query. Can be up to `500` and the default is `25`. Applies to only phone numbers in the US and Canada. * * @param int $distance The search radius, in miles, for a near_ query. * (US/Canada only) * @return $this Fluent Builder */ public function setDistance($distance) { $this->options['distance'] = $distance; return $this; } /** * Limit results to a particular postal code. Given a phone number, search within the same postal code as that number. Applies to only phone numbers in the US and Canada. * * @param string $inPostalCode Limit results to a particular postal code. * (US/Canada only) * @return $this Fluent Builder */ public function setInPostalCode($inPostalCode) { $this->options['inPostalCode'] = $inPostalCode; return $this; } /** * Limit results to a particular region, state, or province. Given a phone number, search within the same region as that number. Applies to only phone numbers in the US and Canada. * * @param string $inRegion Limit results to a particular region. (US/Canada * only) * @return $this Fluent Builder */ public function setInRegion($inRegion) { $this->options['inRegion'] = $inRegion; return $this; } /** * Limit results to a specific rate center, or given a phone number search within the same rate center as that number. Requires `in_lata` to be set as well. Applies to only phone numbers in the US and Canada. * * @param string $inRateCenter Limit results to a specific rate center, or * given a phone number search within the same rate * center as that number. (US/Canada only) * @return $this Fluent Builder */ public function setInRateCenter($inRateCenter) { $this->options['inRateCenter'] = $inRateCenter; return $this; } /** * Limit results to a specific local access and transport area ([LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area)). Given a phone number, search within the same [LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area) as that number. Applies to only phone numbers in the US and Canada. * * @param string $inLata Limit results to a specific local access and transport * area. (US/Canada only) * @return $this Fluent Builder */ public function setInLata($inLata) { $this->options['inLata'] = $inLata; return $this; } /** * Limit results to a particular locality or city. Given a phone number, search within the same Locality as that number. * * @param string $inLocality Limit results to a particular locality * @return $this Fluent Builder */ public function setInLocality($inLocality) { $this->options['inLocality'] = $inLocality; return $this; } /** * Whether the phone numbers can receive faxes. Can be: `true` or `false`. * * @param bool $faxEnabled Whether the phone numbers can receive faxes * @return $this Fluent Builder */ public function setFaxEnabled($faxEnabled) { $this->options['faxEnabled'] = $faxEnabled; 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.ReadLocalOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/MobileOptions.php 0000644 00000040257 15002236443 0024027 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry; use Twilio\Options; use Twilio\Values; abstract class MobileOptions { /** * @param int $areaCode The area code of the phone numbers to read * @param string $contains The pattern on which to match phone numbers * @param bool $smsEnabled Whether the phone numbers can receive text messages * @param bool $mmsEnabled Whether the phone numbers can receive MMS messages * @param bool $voiceEnabled Whether the phone numbers can receive calls. * @param bool $excludeAllAddressRequired Whether to exclude phone numbers that * require an Address * @param bool $excludeLocalAddressRequired Whether to exclude phone numbers * that require a local address * @param bool $excludeForeignAddressRequired Whether to exclude phone numbers * that require a foreign address * @param bool $beta Whether to read phone numbers new to the Twilio platform * @param string $nearNumber Given a phone number, find a geographically close * number within distance miles. (US/Canada only) * @param string $nearLatLong Given a latitude/longitude pair lat,long find * geographically close numbers within distance * miles. (US/Canada only) * @param int $distance The search radius, in miles, for a near_ query. * (US/Canada only) * @param string $inPostalCode Limit results to a particular postal code. * (US/Canada only) * @param string $inRegion Limit results to a particular region. (US/Canada * only) * @param string $inRateCenter Limit results to a specific rate center, or * given a phone number search within the same rate * center as that number. (US/Canada only) * @param string $inLata Limit results to a specific local access and transport * area. (US/Canada only) * @param string $inLocality Limit results to a particular locality * @param bool $faxEnabled Whether the phone numbers can receive faxes * @return ReadMobileOptions Options builder */ public static function read($areaCode = Values::NONE, $contains = Values::NONE, $smsEnabled = Values::NONE, $mmsEnabled = Values::NONE, $voiceEnabled = Values::NONE, $excludeAllAddressRequired = Values::NONE, $excludeLocalAddressRequired = Values::NONE, $excludeForeignAddressRequired = Values::NONE, $beta = Values::NONE, $nearNumber = Values::NONE, $nearLatLong = Values::NONE, $distance = Values::NONE, $inPostalCode = Values::NONE, $inRegion = Values::NONE, $inRateCenter = Values::NONE, $inLata = Values::NONE, $inLocality = Values::NONE, $faxEnabled = Values::NONE) { return new ReadMobileOptions($areaCode, $contains, $smsEnabled, $mmsEnabled, $voiceEnabled, $excludeAllAddressRequired, $excludeLocalAddressRequired, $excludeForeignAddressRequired, $beta, $nearNumber, $nearLatLong, $distance, $inPostalCode, $inRegion, $inRateCenter, $inLata, $inLocality, $faxEnabled); } } class ReadMobileOptions extends Options { /** * @param int $areaCode The area code of the phone numbers to read * @param string $contains The pattern on which to match phone numbers * @param bool $smsEnabled Whether the phone numbers can receive text messages * @param bool $mmsEnabled Whether the phone numbers can receive MMS messages * @param bool $voiceEnabled Whether the phone numbers can receive calls. * @param bool $excludeAllAddressRequired Whether to exclude phone numbers that * require an Address * @param bool $excludeLocalAddressRequired Whether to exclude phone numbers * that require a local address * @param bool $excludeForeignAddressRequired Whether to exclude phone numbers * that require a foreign address * @param bool $beta Whether to read phone numbers new to the Twilio platform * @param string $nearNumber Given a phone number, find a geographically close * number within distance miles. (US/Canada only) * @param string $nearLatLong Given a latitude/longitude pair lat,long find * geographically close numbers within distance * miles. (US/Canada only) * @param int $distance The search radius, in miles, for a near_ query. * (US/Canada only) * @param string $inPostalCode Limit results to a particular postal code. * (US/Canada only) * @param string $inRegion Limit results to a particular region. (US/Canada * only) * @param string $inRateCenter Limit results to a specific rate center, or * given a phone number search within the same rate * center as that number. (US/Canada only) * @param string $inLata Limit results to a specific local access and transport * area. (US/Canada only) * @param string $inLocality Limit results to a particular locality * @param bool $faxEnabled Whether the phone numbers can receive faxes */ public function __construct($areaCode = Values::NONE, $contains = Values::NONE, $smsEnabled = Values::NONE, $mmsEnabled = Values::NONE, $voiceEnabled = Values::NONE, $excludeAllAddressRequired = Values::NONE, $excludeLocalAddressRequired = Values::NONE, $excludeForeignAddressRequired = Values::NONE, $beta = Values::NONE, $nearNumber = Values::NONE, $nearLatLong = Values::NONE, $distance = Values::NONE, $inPostalCode = Values::NONE, $inRegion = Values::NONE, $inRateCenter = Values::NONE, $inLata = Values::NONE, $inLocality = Values::NONE, $faxEnabled = Values::NONE) { $this->options['areaCode'] = $areaCode; $this->options['contains'] = $contains; $this->options['smsEnabled'] = $smsEnabled; $this->options['mmsEnabled'] = $mmsEnabled; $this->options['voiceEnabled'] = $voiceEnabled; $this->options['excludeAllAddressRequired'] = $excludeAllAddressRequired; $this->options['excludeLocalAddressRequired'] = $excludeLocalAddressRequired; $this->options['excludeForeignAddressRequired'] = $excludeForeignAddressRequired; $this->options['beta'] = $beta; $this->options['nearNumber'] = $nearNumber; $this->options['nearLatLong'] = $nearLatLong; $this->options['distance'] = $distance; $this->options['inPostalCode'] = $inPostalCode; $this->options['inRegion'] = $inRegion; $this->options['inRateCenter'] = $inRateCenter; $this->options['inLata'] = $inLata; $this->options['inLocality'] = $inLocality; $this->options['faxEnabled'] = $faxEnabled; } /** * The area code of the phone numbers to read. Applies to only phone numbers in the US and Canada. * * @param int $areaCode The area code of the phone numbers to read * @return $this Fluent Builder */ public function setAreaCode($areaCode) { $this->options['areaCode'] = $areaCode; return $this; } /** * The pattern on which to match phone numbers. Valid characters are `*`, `0-9`, `a-z`, and `A-Z`. The `*` character matches any single digit. For examples, see [Example 2](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-2) and [Example 3](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-3). If specified, this value must have at least two characters. * * @param string $contains The pattern on which to match phone numbers * @return $this Fluent Builder */ public function setContains($contains) { $this->options['contains'] = $contains; return $this; } /** * Whether the phone numbers can receive text messages. Can be: `true` or `false`. * * @param bool $smsEnabled Whether the phone numbers can receive text messages * @return $this Fluent Builder */ public function setSmsEnabled($smsEnabled) { $this->options['smsEnabled'] = $smsEnabled; return $this; } /** * Whether the phone numbers can receive MMS messages. Can be: `true` or `false`. * * @param bool $mmsEnabled Whether the phone numbers can receive MMS messages * @return $this Fluent Builder */ public function setMmsEnabled($mmsEnabled) { $this->options['mmsEnabled'] = $mmsEnabled; return $this; } /** * Whether the phone numbers can receive calls. Can be: `true` or `false`. * * @param bool $voiceEnabled Whether the phone numbers can receive calls. * @return $this Fluent Builder */ public function setVoiceEnabled($voiceEnabled) { $this->options['voiceEnabled'] = $voiceEnabled; return $this; } /** * Whether to exclude phone numbers that require an [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. * * @param bool $excludeAllAddressRequired Whether to exclude phone numbers that * require an Address * @return $this Fluent Builder */ public function setExcludeAllAddressRequired($excludeAllAddressRequired) { $this->options['excludeAllAddressRequired'] = $excludeAllAddressRequired; return $this; } /** * Whether to exclude phone numbers that require a local [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. * * @param bool $excludeLocalAddressRequired Whether to exclude phone numbers * that require a local address * @return $this Fluent Builder */ public function setExcludeLocalAddressRequired($excludeLocalAddressRequired) { $this->options['excludeLocalAddressRequired'] = $excludeLocalAddressRequired; return $this; } /** * Whether to exclude phone numbers that require a foreign [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. * * @param bool $excludeForeignAddressRequired Whether to exclude phone numbers * that require a foreign address * @return $this Fluent Builder */ public function setExcludeForeignAddressRequired($excludeForeignAddressRequired) { $this->options['excludeForeignAddressRequired'] = $excludeForeignAddressRequired; return $this; } /** * Whether to read phone numbers that are new to the Twilio platform. Can be: `true` or `false` and the default is `true`. * * @param bool $beta Whether to read phone numbers new to the Twilio platform * @return $this Fluent Builder */ public function setBeta($beta) { $this->options['beta'] = $beta; return $this; } /** * Given a phone number, find a geographically close number within `distance` miles. Distance defaults to 25 miles. Applies to only phone numbers in the US and Canada. * * @param string $nearNumber Given a phone number, find a geographically close * number within distance miles. (US/Canada only) * @return $this Fluent Builder */ public function setNearNumber($nearNumber) { $this->options['nearNumber'] = $nearNumber; return $this; } /** * Given a latitude/longitude pair `lat,long` find geographically close numbers within `distance` miles. Applies to only phone numbers in the US and Canada. * * @param string $nearLatLong Given a latitude/longitude pair lat,long find * geographically close numbers within distance * miles. (US/Canada only) * @return $this Fluent Builder */ public function setNearLatLong($nearLatLong) { $this->options['nearLatLong'] = $nearLatLong; return $this; } /** * The search radius, in miles, for a `near_` query. Can be up to `500` and the default is `25`. Applies to only phone numbers in the US and Canada. * * @param int $distance The search radius, in miles, for a near_ query. * (US/Canada only) * @return $this Fluent Builder */ public function setDistance($distance) { $this->options['distance'] = $distance; return $this; } /** * Limit results to a particular postal code. Given a phone number, search within the same postal code as that number. Applies to only phone numbers in the US and Canada. * * @param string $inPostalCode Limit results to a particular postal code. * (US/Canada only) * @return $this Fluent Builder */ public function setInPostalCode($inPostalCode) { $this->options['inPostalCode'] = $inPostalCode; return $this; } /** * Limit results to a particular region, state, or province. Given a phone number, search within the same region as that number. Applies to only phone numbers in the US and Canada. * * @param string $inRegion Limit results to a particular region. (US/Canada * only) * @return $this Fluent Builder */ public function setInRegion($inRegion) { $this->options['inRegion'] = $inRegion; return $this; } /** * Limit results to a specific rate center, or given a phone number search within the same rate center as that number. Requires `in_lata` to be set as well. Applies to only phone numbers in the US and Canada. * * @param string $inRateCenter Limit results to a specific rate center, or * given a phone number search within the same rate * center as that number. (US/Canada only) * @return $this Fluent Builder */ public function setInRateCenter($inRateCenter) { $this->options['inRateCenter'] = $inRateCenter; return $this; } /** * Limit results to a specific local access and transport area ([LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area)). Given a phone number, search within the same [LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area) as that number. Applies to only phone numbers in the US and Canada. * * @param string $inLata Limit results to a specific local access and transport * area. (US/Canada only) * @return $this Fluent Builder */ public function setInLata($inLata) { $this->options['inLata'] = $inLata; return $this; } /** * Limit results to a particular locality or city. Given a phone number, search within the same Locality as that number. * * @param string $inLocality Limit results to a particular locality * @return $this Fluent Builder */ public function setInLocality($inLocality) { $this->options['inLocality'] = $inLocality; return $this; } /** * Whether the phone numbers can receive faxes. Can be: `true` or `false`. * * @param bool $faxEnabled Whether the phone numbers can receive faxes * @return $this Fluent Builder */ public function setFaxEnabled($faxEnabled) { $this->options['faxEnabled'] = $faxEnabled; 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.ReadMobileOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/VoipPage.php 0000644 00000001542 15002236443 0022750 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry; use Twilio\Page; class VoipPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new VoipInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['countryCode'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.VoipPage]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/LocalInstance.php 0000644 00000006150 15002236443 0023755 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $friendlyName * @property string $phoneNumber * @property string $lata * @property string $locality * @property string $rateCenter * @property string $latitude * @property string $longitude * @property string $region * @property string $postalCode * @property string $isoCountry * @property string $addressRequirements * @property bool $beta * @property string $capabilities */ class LocalInstance extends InstanceResource { /** * Initialize the LocalInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The account_sid * @param string $countryCode The ISO-3166-1 country code of the country. * @return \Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry\LocalInstance */ public function __construct(Version $version, array $payload, $accountSid, $countryCode) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'phoneNumber' => Values::array_get($payload, 'phone_number'), 'lata' => Values::array_get($payload, 'lata'), 'locality' => Values::array_get($payload, 'locality'), 'rateCenter' => Values::array_get($payload, 'rate_center'), 'latitude' => Values::array_get($payload, 'latitude'), 'longitude' => Values::array_get($payload, 'longitude'), 'region' => Values::array_get($payload, 'region'), 'postalCode' => Values::array_get($payload, 'postal_code'), 'isoCountry' => Values::array_get($payload, 'iso_country'), 'addressRequirements' => Values::array_get($payload, 'address_requirements'), 'beta' => Values::array_get($payload, 'beta'), 'capabilities' => Values::array_get($payload, 'capabilities'), ); $this->solution = array('accountSid' => $accountSid, 'countryCode' => $countryCode, ); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.LocalInstance]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/SharedCostOptions.php 0000644 00000040303 15002236443 0024647 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry; use Twilio\Options; use Twilio\Values; abstract class SharedCostOptions { /** * @param int $areaCode The area code of the phone numbers to read * @param string $contains The pattern on which to match phone numbers * @param bool $smsEnabled Whether the phone numbers can receive text messages * @param bool $mmsEnabled Whether the phone numbers can receive MMS messages * @param bool $voiceEnabled Whether the phone numbers can receive calls. * @param bool $excludeAllAddressRequired Whether to exclude phone numbers that * require an Address * @param bool $excludeLocalAddressRequired Whether to exclude phone numbers * that require a local address * @param bool $excludeForeignAddressRequired Whether to exclude phone numbers * that require a foreign address * @param bool $beta Whether to read phone numbers new to the Twilio platform * @param string $nearNumber Given a phone number, find a geographically close * number within distance miles. (US/Canada only) * @param string $nearLatLong Given a latitude/longitude pair lat,long find * geographically close numbers within distance * miles. (US/Canada only) * @param int $distance The search radius, in miles, for a near_ query. * (US/Canada only) * @param string $inPostalCode Limit results to a particular postal code. * (US/Canada only) * @param string $inRegion Limit results to a particular region. (US/Canada * only) * @param string $inRateCenter Limit results to a specific rate center, or * given a phone number search within the same rate * center as that number. (US/Canada only) * @param string $inLata Limit results to a specific local access and transport * area. (US/Canada only) * @param string $inLocality Limit results to a particular locality * @param bool $faxEnabled Whether the phone numbers can receive faxes * @return ReadSharedCostOptions Options builder */ public static function read($areaCode = Values::NONE, $contains = Values::NONE, $smsEnabled = Values::NONE, $mmsEnabled = Values::NONE, $voiceEnabled = Values::NONE, $excludeAllAddressRequired = Values::NONE, $excludeLocalAddressRequired = Values::NONE, $excludeForeignAddressRequired = Values::NONE, $beta = Values::NONE, $nearNumber = Values::NONE, $nearLatLong = Values::NONE, $distance = Values::NONE, $inPostalCode = Values::NONE, $inRegion = Values::NONE, $inRateCenter = Values::NONE, $inLata = Values::NONE, $inLocality = Values::NONE, $faxEnabled = Values::NONE) { return new ReadSharedCostOptions($areaCode, $contains, $smsEnabled, $mmsEnabled, $voiceEnabled, $excludeAllAddressRequired, $excludeLocalAddressRequired, $excludeForeignAddressRequired, $beta, $nearNumber, $nearLatLong, $distance, $inPostalCode, $inRegion, $inRateCenter, $inLata, $inLocality, $faxEnabled); } } class ReadSharedCostOptions extends Options { /** * @param int $areaCode The area code of the phone numbers to read * @param string $contains The pattern on which to match phone numbers * @param bool $smsEnabled Whether the phone numbers can receive text messages * @param bool $mmsEnabled Whether the phone numbers can receive MMS messages * @param bool $voiceEnabled Whether the phone numbers can receive calls. * @param bool $excludeAllAddressRequired Whether to exclude phone numbers that * require an Address * @param bool $excludeLocalAddressRequired Whether to exclude phone numbers * that require a local address * @param bool $excludeForeignAddressRequired Whether to exclude phone numbers * that require a foreign address * @param bool $beta Whether to read phone numbers new to the Twilio platform * @param string $nearNumber Given a phone number, find a geographically close * number within distance miles. (US/Canada only) * @param string $nearLatLong Given a latitude/longitude pair lat,long find * geographically close numbers within distance * miles. (US/Canada only) * @param int $distance The search radius, in miles, for a near_ query. * (US/Canada only) * @param string $inPostalCode Limit results to a particular postal code. * (US/Canada only) * @param string $inRegion Limit results to a particular region. (US/Canada * only) * @param string $inRateCenter Limit results to a specific rate center, or * given a phone number search within the same rate * center as that number. (US/Canada only) * @param string $inLata Limit results to a specific local access and transport * area. (US/Canada only) * @param string $inLocality Limit results to a particular locality * @param bool $faxEnabled Whether the phone numbers can receive faxes */ public function __construct($areaCode = Values::NONE, $contains = Values::NONE, $smsEnabled = Values::NONE, $mmsEnabled = Values::NONE, $voiceEnabled = Values::NONE, $excludeAllAddressRequired = Values::NONE, $excludeLocalAddressRequired = Values::NONE, $excludeForeignAddressRequired = Values::NONE, $beta = Values::NONE, $nearNumber = Values::NONE, $nearLatLong = Values::NONE, $distance = Values::NONE, $inPostalCode = Values::NONE, $inRegion = Values::NONE, $inRateCenter = Values::NONE, $inLata = Values::NONE, $inLocality = Values::NONE, $faxEnabled = Values::NONE) { $this->options['areaCode'] = $areaCode; $this->options['contains'] = $contains; $this->options['smsEnabled'] = $smsEnabled; $this->options['mmsEnabled'] = $mmsEnabled; $this->options['voiceEnabled'] = $voiceEnabled; $this->options['excludeAllAddressRequired'] = $excludeAllAddressRequired; $this->options['excludeLocalAddressRequired'] = $excludeLocalAddressRequired; $this->options['excludeForeignAddressRequired'] = $excludeForeignAddressRequired; $this->options['beta'] = $beta; $this->options['nearNumber'] = $nearNumber; $this->options['nearLatLong'] = $nearLatLong; $this->options['distance'] = $distance; $this->options['inPostalCode'] = $inPostalCode; $this->options['inRegion'] = $inRegion; $this->options['inRateCenter'] = $inRateCenter; $this->options['inLata'] = $inLata; $this->options['inLocality'] = $inLocality; $this->options['faxEnabled'] = $faxEnabled; } /** * The area code of the phone numbers to read. Applies to only phone numbers in the US and Canada. * * @param int $areaCode The area code of the phone numbers to read * @return $this Fluent Builder */ public function setAreaCode($areaCode) { $this->options['areaCode'] = $areaCode; return $this; } /** * The pattern on which to match phone numbers. Valid characters are `*`, `0-9`, `a-z`, and `A-Z`. The `*` character matches any single digit. For examples, see [Example 2](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-2) and [Example 3](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-3). If specified, this value must have at least two characters. * * @param string $contains The pattern on which to match phone numbers * @return $this Fluent Builder */ public function setContains($contains) { $this->options['contains'] = $contains; return $this; } /** * Whether the phone numbers can receive text messages. Can be: `true` or `false`. * * @param bool $smsEnabled Whether the phone numbers can receive text messages * @return $this Fluent Builder */ public function setSmsEnabled($smsEnabled) { $this->options['smsEnabled'] = $smsEnabled; return $this; } /** * Whether the phone numbers can receive MMS messages. Can be: `true` or `false`. * * @param bool $mmsEnabled Whether the phone numbers can receive MMS messages * @return $this Fluent Builder */ public function setMmsEnabled($mmsEnabled) { $this->options['mmsEnabled'] = $mmsEnabled; return $this; } /** * Whether the phone numbers can receive calls. Can be: `true` or `false`. * * @param bool $voiceEnabled Whether the phone numbers can receive calls. * @return $this Fluent Builder */ public function setVoiceEnabled($voiceEnabled) { $this->options['voiceEnabled'] = $voiceEnabled; return $this; } /** * Whether to exclude phone numbers that require an [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. * * @param bool $excludeAllAddressRequired Whether to exclude phone numbers that * require an Address * @return $this Fluent Builder */ public function setExcludeAllAddressRequired($excludeAllAddressRequired) { $this->options['excludeAllAddressRequired'] = $excludeAllAddressRequired; return $this; } /** * Whether to exclude phone numbers that require a local [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. * * @param bool $excludeLocalAddressRequired Whether to exclude phone numbers * that require a local address * @return $this Fluent Builder */ public function setExcludeLocalAddressRequired($excludeLocalAddressRequired) { $this->options['excludeLocalAddressRequired'] = $excludeLocalAddressRequired; return $this; } /** * Whether to exclude phone numbers that require a foreign [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. * * @param bool $excludeForeignAddressRequired Whether to exclude phone numbers * that require a foreign address * @return $this Fluent Builder */ public function setExcludeForeignAddressRequired($excludeForeignAddressRequired) { $this->options['excludeForeignAddressRequired'] = $excludeForeignAddressRequired; return $this; } /** * Whether to read phone numbers that are new to the Twilio platform. Can be: `true` or `false` and the default is `true`. * * @param bool $beta Whether to read phone numbers new to the Twilio platform * @return $this Fluent Builder */ public function setBeta($beta) { $this->options['beta'] = $beta; return $this; } /** * Given a phone number, find a geographically close number within `distance` miles. Distance defaults to 25 miles. Applies to only phone numbers in the US and Canada. * * @param string $nearNumber Given a phone number, find a geographically close * number within distance miles. (US/Canada only) * @return $this Fluent Builder */ public function setNearNumber($nearNumber) { $this->options['nearNumber'] = $nearNumber; return $this; } /** * Given a latitude/longitude pair `lat,long` find geographically close numbers within `distance` miles. Applies to only phone numbers in the US and Canada. * * @param string $nearLatLong Given a latitude/longitude pair lat,long find * geographically close numbers within distance * miles. (US/Canada only) * @return $this Fluent Builder */ public function setNearLatLong($nearLatLong) { $this->options['nearLatLong'] = $nearLatLong; return $this; } /** * The search radius, in miles, for a `near_` query. Can be up to `500` and the default is `25`. Applies to only phone numbers in the US and Canada. * * @param int $distance The search radius, in miles, for a near_ query. * (US/Canada only) * @return $this Fluent Builder */ public function setDistance($distance) { $this->options['distance'] = $distance; return $this; } /** * Limit results to a particular postal code. Given a phone number, search within the same postal code as that number. Applies to only phone numbers in the US and Canada. * * @param string $inPostalCode Limit results to a particular postal code. * (US/Canada only) * @return $this Fluent Builder */ public function setInPostalCode($inPostalCode) { $this->options['inPostalCode'] = $inPostalCode; return $this; } /** * Limit results to a particular region, state, or province. Given a phone number, search within the same region as that number. Applies to only phone numbers in the US and Canada. * * @param string $inRegion Limit results to a particular region. (US/Canada * only) * @return $this Fluent Builder */ public function setInRegion($inRegion) { $this->options['inRegion'] = $inRegion; return $this; } /** * Limit results to a specific rate center, or given a phone number search within the same rate center as that number. Requires `in_lata` to be set as well. Applies to only phone numbers in the US and Canada. * * @param string $inRateCenter Limit results to a specific rate center, or * given a phone number search within the same rate * center as that number. (US/Canada only) * @return $this Fluent Builder */ public function setInRateCenter($inRateCenter) { $this->options['inRateCenter'] = $inRateCenter; return $this; } /** * Limit results to a specific local access and transport area ([LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area)). Given a phone number, search within the same [LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area) as that number. Applies to only phone numbers in the US and Canada. * * @param string $inLata Limit results to a specific local access and transport * area. (US/Canada only) * @return $this Fluent Builder */ public function setInLata($inLata) { $this->options['inLata'] = $inLata; return $this; } /** * Limit results to a particular locality or city. Given a phone number, search within the same Locality as that number. * * @param string $inLocality Limit results to a particular locality * @return $this Fluent Builder */ public function setInLocality($inLocality) { $this->options['inLocality'] = $inLocality; return $this; } /** * Whether the phone numbers can receive faxes. Can be: `true` or `false`. * * @param bool $faxEnabled Whether the phone numbers can receive faxes * @return $this Fluent Builder */ public function setFaxEnabled($faxEnabled) { $this->options['faxEnabled'] = $faxEnabled; 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.ReadSharedCostOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/SharedCostInstance.php 0000644 00000006174 15002236443 0024770 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $friendlyName * @property string $phoneNumber * @property string $lata * @property string $locality * @property string $rateCenter * @property string $latitude * @property string $longitude * @property string $region * @property string $postalCode * @property string $isoCountry * @property string $addressRequirements * @property bool $beta * @property string $capabilities */ class SharedCostInstance extends InstanceResource { /** * Initialize the SharedCostInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The account_sid * @param string $countryCode The ISO-3166-1 country code of the country. * @return \Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry\SharedCostInstance */ public function __construct(Version $version, array $payload, $accountSid, $countryCode) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'phoneNumber' => Values::array_get($payload, 'phone_number'), 'lata' => Values::array_get($payload, 'lata'), 'locality' => Values::array_get($payload, 'locality'), 'rateCenter' => Values::array_get($payload, 'rate_center'), 'latitude' => Values::array_get($payload, 'latitude'), 'longitude' => Values::array_get($payload, 'longitude'), 'region' => Values::array_get($payload, 'region'), 'postalCode' => Values::array_get($payload, 'postal_code'), 'isoCountry' => Values::array_get($payload, 'iso_country'), 'addressRequirements' => Values::array_get($payload, 'address_requirements'), 'beta' => Values::array_get($payload, 'beta'), 'capabilities' => Values::array_get($payload, 'capabilities'), ); $this->solution = array('accountSid' => $accountSid, 'countryCode' => $countryCode, ); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.SharedCostInstance]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/TollFreeList.php 0000644 00000014373 15002236443 0023614 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class TollFreeList extends ListResource { /** * Construct the TollFreeList * * @param Version $version Version that contains the resource * @param string $accountSid The account_sid * @param string $countryCode The ISO-3166-1 country code of the country. * @return \Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry\TollFreeList */ public function __construct(Version $version, $accountSid, $countryCode) { parent::__construct($version); // Path Solution $this->solution = array('accountSid' => $accountSid, 'countryCode' => $countryCode, ); $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/AvailablePhoneNumbers/' . \rawurlencode($countryCode) . '/TollFree.json'; } /** * Streams TollFreeInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($options = array(), $limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads TollFreeInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return TollFreeInstance[] Array of results */ public function read($options = array(), $limit = null, $pageSize = null) { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Retrieve a single page of TollFreeInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of TollFreeInstance */ public function page($options = array(), $pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $options = new Values($options); $params = Values::of(array( 'AreaCode' => $options['areaCode'], 'Contains' => $options['contains'], 'SmsEnabled' => Serialize::booleanToString($options['smsEnabled']), 'MmsEnabled' => Serialize::booleanToString($options['mmsEnabled']), 'VoiceEnabled' => Serialize::booleanToString($options['voiceEnabled']), 'ExcludeAllAddressRequired' => Serialize::booleanToString($options['excludeAllAddressRequired']), 'ExcludeLocalAddressRequired' => Serialize::booleanToString($options['excludeLocalAddressRequired']), 'ExcludeForeignAddressRequired' => Serialize::booleanToString($options['excludeForeignAddressRequired']), 'Beta' => Serialize::booleanToString($options['beta']), 'NearNumber' => $options['nearNumber'], 'NearLatLong' => $options['nearLatLong'], 'Distance' => $options['distance'], 'InPostalCode' => $options['inPostalCode'], 'InRegion' => $options['inRegion'], 'InRateCenter' => $options['inRateCenter'], 'InLata' => $options['inLata'], 'InLocality' => $options['inLocality'], 'FaxEnabled' => Serialize::booleanToString($options['faxEnabled']), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new TollFreePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of TollFreeInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of TollFreeInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new TollFreePage($this->version, $response, $this->solution); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.TollFreeList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/SharedCostList.php 0000644 00000014427 15002236443 0024137 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class SharedCostList extends ListResource { /** * Construct the SharedCostList * * @param Version $version Version that contains the resource * @param string $accountSid The account_sid * @param string $countryCode The ISO-3166-1 country code of the country. * @return \Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry\SharedCostList */ public function __construct(Version $version, $accountSid, $countryCode) { parent::__construct($version); // Path Solution $this->solution = array('accountSid' => $accountSid, 'countryCode' => $countryCode, ); $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/AvailablePhoneNumbers/' . \rawurlencode($countryCode) . '/SharedCost.json'; } /** * Streams SharedCostInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($options = array(), $limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads SharedCostInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return SharedCostInstance[] Array of results */ public function read($options = array(), $limit = null, $pageSize = null) { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Retrieve a single page of SharedCostInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of SharedCostInstance */ public function page($options = array(), $pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $options = new Values($options); $params = Values::of(array( 'AreaCode' => $options['areaCode'], 'Contains' => $options['contains'], 'SmsEnabled' => Serialize::booleanToString($options['smsEnabled']), 'MmsEnabled' => Serialize::booleanToString($options['mmsEnabled']), 'VoiceEnabled' => Serialize::booleanToString($options['voiceEnabled']), 'ExcludeAllAddressRequired' => Serialize::booleanToString($options['excludeAllAddressRequired']), 'ExcludeLocalAddressRequired' => Serialize::booleanToString($options['excludeLocalAddressRequired']), 'ExcludeForeignAddressRequired' => Serialize::booleanToString($options['excludeForeignAddressRequired']), 'Beta' => Serialize::booleanToString($options['beta']), 'NearNumber' => $options['nearNumber'], 'NearLatLong' => $options['nearLatLong'], 'Distance' => $options['distance'], 'InPostalCode' => $options['inPostalCode'], 'InRegion' => $options['inRegion'], 'InRateCenter' => $options['inRateCenter'], 'InLata' => $options['inLata'], 'InLocality' => $options['inLocality'], 'FaxEnabled' => Serialize::booleanToString($options['faxEnabled']), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new SharedCostPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of SharedCostInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of SharedCostInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new SharedCostPage($this->version, $response, $this->solution); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.SharedCostList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/TollFreeInstance.php 0000644 00000006164 15002236443 0024444 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $friendlyName * @property string $phoneNumber * @property string $lata * @property string $locality * @property string $rateCenter * @property string $latitude * @property string $longitude * @property string $region * @property string $postalCode * @property string $isoCountry * @property string $addressRequirements * @property bool $beta * @property string $capabilities */ class TollFreeInstance extends InstanceResource { /** * Initialize the TollFreeInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The account_sid * @param string $countryCode The ISO-3166-1 country code of the country. * @return \Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry\TollFreeInstance */ public function __construct(Version $version, array $payload, $accountSid, $countryCode) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'phoneNumber' => Values::array_get($payload, 'phone_number'), 'lata' => Values::array_get($payload, 'lata'), 'locality' => Values::array_get($payload, 'locality'), 'rateCenter' => Values::array_get($payload, 'rate_center'), 'latitude' => Values::array_get($payload, 'latitude'), 'longitude' => Values::array_get($payload, 'longitude'), 'region' => Values::array_get($payload, 'region'), 'postalCode' => Values::array_get($payload, 'postal_code'), 'isoCountry' => Values::array_get($payload, 'iso_country'), 'addressRequirements' => Values::array_get($payload, 'address_requirements'), 'beta' => Values::array_get($payload, 'beta'), 'capabilities' => Values::array_get($payload, 'capabilities'), ); $this->solution = array('accountSid' => $accountSid, 'countryCode' => $countryCode, ); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.TollFreeInstance]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/VoipList.php 0000644 00000014303 15002236443 0023006 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class VoipList extends ListResource { /** * Construct the VoipList * * @param Version $version Version that contains the resource * @param string $accountSid The account_sid * @param string $countryCode The ISO-3166-1 country code of the country. * @return \Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry\VoipList */ public function __construct(Version $version, $accountSid, $countryCode) { parent::__construct($version); // Path Solution $this->solution = array('accountSid' => $accountSid, 'countryCode' => $countryCode, ); $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/AvailablePhoneNumbers/' . \rawurlencode($countryCode) . '/Voip.json'; } /** * Streams VoipInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($options = array(), $limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads VoipInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return VoipInstance[] Array of results */ public function read($options = array(), $limit = null, $pageSize = null) { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Retrieve a single page of VoipInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of VoipInstance */ public function page($options = array(), $pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $options = new Values($options); $params = Values::of(array( 'AreaCode' => $options['areaCode'], 'Contains' => $options['contains'], 'SmsEnabled' => Serialize::booleanToString($options['smsEnabled']), 'MmsEnabled' => Serialize::booleanToString($options['mmsEnabled']), 'VoiceEnabled' => Serialize::booleanToString($options['voiceEnabled']), 'ExcludeAllAddressRequired' => Serialize::booleanToString($options['excludeAllAddressRequired']), 'ExcludeLocalAddressRequired' => Serialize::booleanToString($options['excludeLocalAddressRequired']), 'ExcludeForeignAddressRequired' => Serialize::booleanToString($options['excludeForeignAddressRequired']), 'Beta' => Serialize::booleanToString($options['beta']), 'NearNumber' => $options['nearNumber'], 'NearLatLong' => $options['nearLatLong'], 'Distance' => $options['distance'], 'InPostalCode' => $options['inPostalCode'], 'InRegion' => $options['inRegion'], 'InRateCenter' => $options['inRateCenter'], 'InLata' => $options['inLata'], 'InLocality' => $options['inLocality'], 'FaxEnabled' => Serialize::booleanToString($options['faxEnabled']), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new VoipPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of VoipInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of VoipInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new VoipPage($this->version, $response, $this->solution); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.VoipList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/NationalPage.php 0000644 00000001556 15002236443 0023605 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry; use Twilio\Page; class NationalPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new NationalInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['countryCode'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.NationalPage]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/VoipInstance.php 0000644 00000006144 15002236443 0023643 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $friendlyName * @property string $phoneNumber * @property string $lata * @property string $locality * @property string $rateCenter * @property string $latitude * @property string $longitude * @property string $region * @property string $postalCode * @property string $isoCountry * @property string $addressRequirements * @property bool $beta * @property string $capabilities */ class VoipInstance extends InstanceResource { /** * Initialize the VoipInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The account_sid * @param string $countryCode The ISO-3166-1 country code of the country. * @return \Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry\VoipInstance */ public function __construct(Version $version, array $payload, $accountSid, $countryCode) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'phoneNumber' => Values::array_get($payload, 'phone_number'), 'lata' => Values::array_get($payload, 'lata'), 'locality' => Values::array_get($payload, 'locality'), 'rateCenter' => Values::array_get($payload, 'rate_center'), 'latitude' => Values::array_get($payload, 'latitude'), 'longitude' => Values::array_get($payload, 'longitude'), 'region' => Values::array_get($payload, 'region'), 'postalCode' => Values::array_get($payload, 'postal_code'), 'isoCountry' => Values::array_get($payload, 'iso_country'), 'addressRequirements' => Values::array_get($payload, 'address_requirements'), 'beta' => Values::array_get($payload, 'beta'), 'capabilities' => Values::array_get($payload, 'capabilities'), ); $this->solution = array('accountSid' => $accountSid, 'countryCode' => $countryCode, ); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.VoipInstance]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/NationalList.php 0000644 00000014373 15002236443 0023645 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class NationalList extends ListResource { /** * Construct the NationalList * * @param Version $version Version that contains the resource * @param string $accountSid The account_sid * @param string $countryCode The ISO-3166-1 country code of the country. * @return \Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry\NationalList */ public function __construct(Version $version, $accountSid, $countryCode) { parent::__construct($version); // Path Solution $this->solution = array('accountSid' => $accountSid, 'countryCode' => $countryCode, ); $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/AvailablePhoneNumbers/' . \rawurlencode($countryCode) . '/National.json'; } /** * Streams NationalInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($options = array(), $limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads NationalInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return NationalInstance[] Array of results */ public function read($options = array(), $limit = null, $pageSize = null) { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Retrieve a single page of NationalInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of NationalInstance */ public function page($options = array(), $pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $options = new Values($options); $params = Values::of(array( 'AreaCode' => $options['areaCode'], 'Contains' => $options['contains'], 'SmsEnabled' => Serialize::booleanToString($options['smsEnabled']), 'MmsEnabled' => Serialize::booleanToString($options['mmsEnabled']), 'VoiceEnabled' => Serialize::booleanToString($options['voiceEnabled']), 'ExcludeAllAddressRequired' => Serialize::booleanToString($options['excludeAllAddressRequired']), 'ExcludeLocalAddressRequired' => Serialize::booleanToString($options['excludeLocalAddressRequired']), 'ExcludeForeignAddressRequired' => Serialize::booleanToString($options['excludeForeignAddressRequired']), 'Beta' => Serialize::booleanToString($options['beta']), 'NearNumber' => $options['nearNumber'], 'NearLatLong' => $options['nearLatLong'], 'Distance' => $options['distance'], 'InPostalCode' => $options['inPostalCode'], 'InRegion' => $options['inRegion'], 'InRateCenter' => $options['inRateCenter'], 'InLata' => $options['inLata'], 'InLocality' => $options['inLocality'], 'FaxEnabled' => Serialize::booleanToString($options['faxEnabled']), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new NationalPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of NationalInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of NationalInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new NationalPage($this->version, $response, $this->solution); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.NationalList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/MachineToMachineOptions.php 0000644 00000040341 15002236443 0025746 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry; use Twilio\Options; use Twilio\Values; abstract class MachineToMachineOptions { /** * @param int $areaCode The area code of the phone numbers to read * @param string $contains The pattern on which to match phone numbers * @param bool $smsEnabled Whether the phone numbers can receive text messages * @param bool $mmsEnabled Whether the phone numbers can receive MMS messages * @param bool $voiceEnabled Whether the phone numbers can receive calls. * @param bool $excludeAllAddressRequired Whether to exclude phone numbers that * require an Address * @param bool $excludeLocalAddressRequired Whether to exclude phone numbers * that require a local address * @param bool $excludeForeignAddressRequired Whether to exclude phone numbers * that require a foreign address * @param bool $beta Whether to read phone numbers new to the Twilio platform * @param string $nearNumber Given a phone number, find a geographically close * number within distance miles. (US/Canada only) * @param string $nearLatLong Given a latitude/longitude pair lat,long find * geographically close numbers within distance * miles. (US/Canada only) * @param int $distance The search radius, in miles, for a near_ query. * (US/Canada only) * @param string $inPostalCode Limit results to a particular postal code. * (US/Canada only) * @param string $inRegion Limit results to a particular region. (US/Canada * only) * @param string $inRateCenter Limit results to a specific rate center, or * given a phone number search within the same rate * center as that number. (US/Canada only) * @param string $inLata Limit results to a specific local access and transport * area. (US/Canada only) * @param string $inLocality Limit results to a particular locality * @param bool $faxEnabled Whether the phone numbers can receive faxes * @return ReadMachineToMachineOptions Options builder */ public static function read($areaCode = Values::NONE, $contains = Values::NONE, $smsEnabled = Values::NONE, $mmsEnabled = Values::NONE, $voiceEnabled = Values::NONE, $excludeAllAddressRequired = Values::NONE, $excludeLocalAddressRequired = Values::NONE, $excludeForeignAddressRequired = Values::NONE, $beta = Values::NONE, $nearNumber = Values::NONE, $nearLatLong = Values::NONE, $distance = Values::NONE, $inPostalCode = Values::NONE, $inRegion = Values::NONE, $inRateCenter = Values::NONE, $inLata = Values::NONE, $inLocality = Values::NONE, $faxEnabled = Values::NONE) { return new ReadMachineToMachineOptions($areaCode, $contains, $smsEnabled, $mmsEnabled, $voiceEnabled, $excludeAllAddressRequired, $excludeLocalAddressRequired, $excludeForeignAddressRequired, $beta, $nearNumber, $nearLatLong, $distance, $inPostalCode, $inRegion, $inRateCenter, $inLata, $inLocality, $faxEnabled); } } class ReadMachineToMachineOptions extends Options { /** * @param int $areaCode The area code of the phone numbers to read * @param string $contains The pattern on which to match phone numbers * @param bool $smsEnabled Whether the phone numbers can receive text messages * @param bool $mmsEnabled Whether the phone numbers can receive MMS messages * @param bool $voiceEnabled Whether the phone numbers can receive calls. * @param bool $excludeAllAddressRequired Whether to exclude phone numbers that * require an Address * @param bool $excludeLocalAddressRequired Whether to exclude phone numbers * that require a local address * @param bool $excludeForeignAddressRequired Whether to exclude phone numbers * that require a foreign address * @param bool $beta Whether to read phone numbers new to the Twilio platform * @param string $nearNumber Given a phone number, find a geographically close * number within distance miles. (US/Canada only) * @param string $nearLatLong Given a latitude/longitude pair lat,long find * geographically close numbers within distance * miles. (US/Canada only) * @param int $distance The search radius, in miles, for a near_ query. * (US/Canada only) * @param string $inPostalCode Limit results to a particular postal code. * (US/Canada only) * @param string $inRegion Limit results to a particular region. (US/Canada * only) * @param string $inRateCenter Limit results to a specific rate center, or * given a phone number search within the same rate * center as that number. (US/Canada only) * @param string $inLata Limit results to a specific local access and transport * area. (US/Canada only) * @param string $inLocality Limit results to a particular locality * @param bool $faxEnabled Whether the phone numbers can receive faxes */ public function __construct($areaCode = Values::NONE, $contains = Values::NONE, $smsEnabled = Values::NONE, $mmsEnabled = Values::NONE, $voiceEnabled = Values::NONE, $excludeAllAddressRequired = Values::NONE, $excludeLocalAddressRequired = Values::NONE, $excludeForeignAddressRequired = Values::NONE, $beta = Values::NONE, $nearNumber = Values::NONE, $nearLatLong = Values::NONE, $distance = Values::NONE, $inPostalCode = Values::NONE, $inRegion = Values::NONE, $inRateCenter = Values::NONE, $inLata = Values::NONE, $inLocality = Values::NONE, $faxEnabled = Values::NONE) { $this->options['areaCode'] = $areaCode; $this->options['contains'] = $contains; $this->options['smsEnabled'] = $smsEnabled; $this->options['mmsEnabled'] = $mmsEnabled; $this->options['voiceEnabled'] = $voiceEnabled; $this->options['excludeAllAddressRequired'] = $excludeAllAddressRequired; $this->options['excludeLocalAddressRequired'] = $excludeLocalAddressRequired; $this->options['excludeForeignAddressRequired'] = $excludeForeignAddressRequired; $this->options['beta'] = $beta; $this->options['nearNumber'] = $nearNumber; $this->options['nearLatLong'] = $nearLatLong; $this->options['distance'] = $distance; $this->options['inPostalCode'] = $inPostalCode; $this->options['inRegion'] = $inRegion; $this->options['inRateCenter'] = $inRateCenter; $this->options['inLata'] = $inLata; $this->options['inLocality'] = $inLocality; $this->options['faxEnabled'] = $faxEnabled; } /** * The area code of the phone numbers to read. Applies to only phone numbers in the US and Canada. * * @param int $areaCode The area code of the phone numbers to read * @return $this Fluent Builder */ public function setAreaCode($areaCode) { $this->options['areaCode'] = $areaCode; return $this; } /** * The pattern on which to match phone numbers. Valid characters are `*`, `0-9`, `a-z`, and `A-Z`. The `*` character matches any single digit. For examples, see [Example 2](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-2) and [Example 3](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-3). If specified, this value must have at least two characters. * * @param string $contains The pattern on which to match phone numbers * @return $this Fluent Builder */ public function setContains($contains) { $this->options['contains'] = $contains; return $this; } /** * Whether the phone numbers can receive text messages. Can be: `true` or `false`. * * @param bool $smsEnabled Whether the phone numbers can receive text messages * @return $this Fluent Builder */ public function setSmsEnabled($smsEnabled) { $this->options['smsEnabled'] = $smsEnabled; return $this; } /** * Whether the phone numbers can receive MMS messages. Can be: `true` or `false`. * * @param bool $mmsEnabled Whether the phone numbers can receive MMS messages * @return $this Fluent Builder */ public function setMmsEnabled($mmsEnabled) { $this->options['mmsEnabled'] = $mmsEnabled; return $this; } /** * Whether the phone numbers can receive calls. Can be: `true` or `false`. * * @param bool $voiceEnabled Whether the phone numbers can receive calls. * @return $this Fluent Builder */ public function setVoiceEnabled($voiceEnabled) { $this->options['voiceEnabled'] = $voiceEnabled; return $this; } /** * Whether to exclude phone numbers that require an [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. * * @param bool $excludeAllAddressRequired Whether to exclude phone numbers that * require an Address * @return $this Fluent Builder */ public function setExcludeAllAddressRequired($excludeAllAddressRequired) { $this->options['excludeAllAddressRequired'] = $excludeAllAddressRequired; return $this; } /** * Whether to exclude phone numbers that require a local [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. * * @param bool $excludeLocalAddressRequired Whether to exclude phone numbers * that require a local address * @return $this Fluent Builder */ public function setExcludeLocalAddressRequired($excludeLocalAddressRequired) { $this->options['excludeLocalAddressRequired'] = $excludeLocalAddressRequired; return $this; } /** * Whether to exclude phone numbers that require a foreign [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. * * @param bool $excludeForeignAddressRequired Whether to exclude phone numbers * that require a foreign address * @return $this Fluent Builder */ public function setExcludeForeignAddressRequired($excludeForeignAddressRequired) { $this->options['excludeForeignAddressRequired'] = $excludeForeignAddressRequired; return $this; } /** * Whether to read phone numbers that are new to the Twilio platform. Can be: `true` or `false` and the default is `true`. * * @param bool $beta Whether to read phone numbers new to the Twilio platform * @return $this Fluent Builder */ public function setBeta($beta) { $this->options['beta'] = $beta; return $this; } /** * Given a phone number, find a geographically close number within `distance` miles. Distance defaults to 25 miles. Applies to only phone numbers in the US and Canada. * * @param string $nearNumber Given a phone number, find a geographically close * number within distance miles. (US/Canada only) * @return $this Fluent Builder */ public function setNearNumber($nearNumber) { $this->options['nearNumber'] = $nearNumber; return $this; } /** * Given a latitude/longitude pair `lat,long` find geographically close numbers within `distance` miles. Applies to only phone numbers in the US and Canada. * * @param string $nearLatLong Given a latitude/longitude pair lat,long find * geographically close numbers within distance * miles. (US/Canada only) * @return $this Fluent Builder */ public function setNearLatLong($nearLatLong) { $this->options['nearLatLong'] = $nearLatLong; return $this; } /** * The search radius, in miles, for a `near_` query. Can be up to `500` and the default is `25`. Applies to only phone numbers in the US and Canada. * * @param int $distance The search radius, in miles, for a near_ query. * (US/Canada only) * @return $this Fluent Builder */ public function setDistance($distance) { $this->options['distance'] = $distance; return $this; } /** * Limit results to a particular postal code. Given a phone number, search within the same postal code as that number. Applies to only phone numbers in the US and Canada. * * @param string $inPostalCode Limit results to a particular postal code. * (US/Canada only) * @return $this Fluent Builder */ public function setInPostalCode($inPostalCode) { $this->options['inPostalCode'] = $inPostalCode; return $this; } /** * Limit results to a particular region, state, or province. Given a phone number, search within the same region as that number. Applies to only phone numbers in the US and Canada. * * @param string $inRegion Limit results to a particular region. (US/Canada * only) * @return $this Fluent Builder */ public function setInRegion($inRegion) { $this->options['inRegion'] = $inRegion; return $this; } /** * Limit results to a specific rate center, or given a phone number search within the same rate center as that number. Requires `in_lata` to be set as well. Applies to only phone numbers in the US and Canada. * * @param string $inRateCenter Limit results to a specific rate center, or * given a phone number search within the same rate * center as that number. (US/Canada only) * @return $this Fluent Builder */ public function setInRateCenter($inRateCenter) { $this->options['inRateCenter'] = $inRateCenter; return $this; } /** * Limit results to a specific local access and transport area ([LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area)). Given a phone number, search within the same [LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area) as that number. Applies to only phone numbers in the US and Canada. * * @param string $inLata Limit results to a specific local access and transport * area. (US/Canada only) * @return $this Fluent Builder */ public function setInLata($inLata) { $this->options['inLata'] = $inLata; return $this; } /** * Limit results to a particular locality or city. Given a phone number, search within the same Locality as that number. * * @param string $inLocality Limit results to a particular locality * @return $this Fluent Builder */ public function setInLocality($inLocality) { $this->options['inLocality'] = $inLocality; return $this; } /** * Whether the phone numbers can receive faxes. Can be: `true` or `false`. * * @param bool $faxEnabled Whether the phone numbers can receive faxes * @return $this Fluent Builder */ public function setFaxEnabled($faxEnabled) { $this->options['faxEnabled'] = $faxEnabled; 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.ReadMachineToMachineOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/SharedCostPage.php 0000644 00000001564 15002236443 0024076 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry; use Twilio\Page; class SharedCostPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new SharedCostInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['countryCode'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.SharedCostPage]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/MobilePage.php 0000644 00000001550 15002236443 0023241 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry; use Twilio\Page; class MobilePage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new MobileInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['countryCode'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.MobilePage]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/MobileInstance.php 0000644 00000006154 15002236443 0024136 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $friendlyName * @property string $phoneNumber * @property string $lata * @property string $locality * @property string $rateCenter * @property string $latitude * @property string $longitude * @property string $region * @property string $postalCode * @property string $isoCountry * @property string $addressRequirements * @property bool $beta * @property string $capabilities */ class MobileInstance extends InstanceResource { /** * Initialize the MobileInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The account_sid * @param string $countryCode The ISO-3166-1 country code of the country. * @return \Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry\MobileInstance */ public function __construct(Version $version, array $payload, $accountSid, $countryCode) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'phoneNumber' => Values::array_get($payload, 'phone_number'), 'lata' => Values::array_get($payload, 'lata'), 'locality' => Values::array_get($payload, 'locality'), 'rateCenter' => Values::array_get($payload, 'rate_center'), 'latitude' => Values::array_get($payload, 'latitude'), 'longitude' => Values::array_get($payload, 'longitude'), 'region' => Values::array_get($payload, 'region'), 'postalCode' => Values::array_get($payload, 'postal_code'), 'isoCountry' => Values::array_get($payload, 'iso_country'), 'addressRequirements' => Values::array_get($payload, 'address_requirements'), 'beta' => Values::array_get($payload, 'beta'), 'capabilities' => Values::array_get($payload, 'capabilities'), ); $this->solution = array('accountSid' => $accountSid, 'countryCode' => $countryCode, ); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.MobileInstance]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/LocalPage.php 0000644 00000001545 15002236443 0023070 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry; use Twilio\Page; class LocalPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new LocalInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['countryCode'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.LocalPage]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/VoipOptions.php 0000644 00000040245 15002236443 0023532 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry; use Twilio\Options; use Twilio\Values; abstract class VoipOptions { /** * @param int $areaCode The area code of the phone numbers to read * @param string $contains The pattern on which to match phone numbers * @param bool $smsEnabled Whether the phone numbers can receive text messages * @param bool $mmsEnabled Whether the phone numbers can receive MMS messages * @param bool $voiceEnabled Whether the phone numbers can receive calls. * @param bool $excludeAllAddressRequired Whether to exclude phone numbers that * require an Address * @param bool $excludeLocalAddressRequired Whether to exclude phone numbers * that require a local address * @param bool $excludeForeignAddressRequired Whether to exclude phone numbers * that require a foreign address * @param bool $beta Whether to read phone numbers new to the Twilio platform * @param string $nearNumber Given a phone number, find a geographically close * number within distance miles. (US/Canada only) * @param string $nearLatLong Given a latitude/longitude pair lat,long find * geographically close numbers within distance * miles. (US/Canada only) * @param int $distance The search radius, in miles, for a near_ query. * (US/Canada only) * @param string $inPostalCode Limit results to a particular postal code. * (US/Canada only) * @param string $inRegion Limit results to a particular region. (US/Canada * only) * @param string $inRateCenter Limit results to a specific rate center, or * given a phone number search within the same rate * center as that number. (US/Canada only) * @param string $inLata Limit results to a specific local access and transport * area. (US/Canada only) * @param string $inLocality Limit results to a particular locality * @param bool $faxEnabled Whether the phone numbers can receive faxes * @return ReadVoipOptions Options builder */ public static function read($areaCode = Values::NONE, $contains = Values::NONE, $smsEnabled = Values::NONE, $mmsEnabled = Values::NONE, $voiceEnabled = Values::NONE, $excludeAllAddressRequired = Values::NONE, $excludeLocalAddressRequired = Values::NONE, $excludeForeignAddressRequired = Values::NONE, $beta = Values::NONE, $nearNumber = Values::NONE, $nearLatLong = Values::NONE, $distance = Values::NONE, $inPostalCode = Values::NONE, $inRegion = Values::NONE, $inRateCenter = Values::NONE, $inLata = Values::NONE, $inLocality = Values::NONE, $faxEnabled = Values::NONE) { return new ReadVoipOptions($areaCode, $contains, $smsEnabled, $mmsEnabled, $voiceEnabled, $excludeAllAddressRequired, $excludeLocalAddressRequired, $excludeForeignAddressRequired, $beta, $nearNumber, $nearLatLong, $distance, $inPostalCode, $inRegion, $inRateCenter, $inLata, $inLocality, $faxEnabled); } } class ReadVoipOptions extends Options { /** * @param int $areaCode The area code of the phone numbers to read * @param string $contains The pattern on which to match phone numbers * @param bool $smsEnabled Whether the phone numbers can receive text messages * @param bool $mmsEnabled Whether the phone numbers can receive MMS messages * @param bool $voiceEnabled Whether the phone numbers can receive calls. * @param bool $excludeAllAddressRequired Whether to exclude phone numbers that * require an Address * @param bool $excludeLocalAddressRequired Whether to exclude phone numbers * that require a local address * @param bool $excludeForeignAddressRequired Whether to exclude phone numbers * that require a foreign address * @param bool $beta Whether to read phone numbers new to the Twilio platform * @param string $nearNumber Given a phone number, find a geographically close * number within distance miles. (US/Canada only) * @param string $nearLatLong Given a latitude/longitude pair lat,long find * geographically close numbers within distance * miles. (US/Canada only) * @param int $distance The search radius, in miles, for a near_ query. * (US/Canada only) * @param string $inPostalCode Limit results to a particular postal code. * (US/Canada only) * @param string $inRegion Limit results to a particular region. (US/Canada * only) * @param string $inRateCenter Limit results to a specific rate center, or * given a phone number search within the same rate * center as that number. (US/Canada only) * @param string $inLata Limit results to a specific local access and transport * area. (US/Canada only) * @param string $inLocality Limit results to a particular locality * @param bool $faxEnabled Whether the phone numbers can receive faxes */ public function __construct($areaCode = Values::NONE, $contains = Values::NONE, $smsEnabled = Values::NONE, $mmsEnabled = Values::NONE, $voiceEnabled = Values::NONE, $excludeAllAddressRequired = Values::NONE, $excludeLocalAddressRequired = Values::NONE, $excludeForeignAddressRequired = Values::NONE, $beta = Values::NONE, $nearNumber = Values::NONE, $nearLatLong = Values::NONE, $distance = Values::NONE, $inPostalCode = Values::NONE, $inRegion = Values::NONE, $inRateCenter = Values::NONE, $inLata = Values::NONE, $inLocality = Values::NONE, $faxEnabled = Values::NONE) { $this->options['areaCode'] = $areaCode; $this->options['contains'] = $contains; $this->options['smsEnabled'] = $smsEnabled; $this->options['mmsEnabled'] = $mmsEnabled; $this->options['voiceEnabled'] = $voiceEnabled; $this->options['excludeAllAddressRequired'] = $excludeAllAddressRequired; $this->options['excludeLocalAddressRequired'] = $excludeLocalAddressRequired; $this->options['excludeForeignAddressRequired'] = $excludeForeignAddressRequired; $this->options['beta'] = $beta; $this->options['nearNumber'] = $nearNumber; $this->options['nearLatLong'] = $nearLatLong; $this->options['distance'] = $distance; $this->options['inPostalCode'] = $inPostalCode; $this->options['inRegion'] = $inRegion; $this->options['inRateCenter'] = $inRateCenter; $this->options['inLata'] = $inLata; $this->options['inLocality'] = $inLocality; $this->options['faxEnabled'] = $faxEnabled; } /** * The area code of the phone numbers to read. Applies to only phone numbers in the US and Canada. * * @param int $areaCode The area code of the phone numbers to read * @return $this Fluent Builder */ public function setAreaCode($areaCode) { $this->options['areaCode'] = $areaCode; return $this; } /** * The pattern on which to match phone numbers. Valid characters are `*`, `0-9`, `a-z`, and `A-Z`. The `*` character matches any single digit. For examples, see [Example 2](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-2) and [Example 3](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-3). If specified, this value must have at least two characters. * * @param string $contains The pattern on which to match phone numbers * @return $this Fluent Builder */ public function setContains($contains) { $this->options['contains'] = $contains; return $this; } /** * Whether the phone numbers can receive text messages. Can be: `true` or `false`. * * @param bool $smsEnabled Whether the phone numbers can receive text messages * @return $this Fluent Builder */ public function setSmsEnabled($smsEnabled) { $this->options['smsEnabled'] = $smsEnabled; return $this; } /** * Whether the phone numbers can receive MMS messages. Can be: `true` or `false`. * * @param bool $mmsEnabled Whether the phone numbers can receive MMS messages * @return $this Fluent Builder */ public function setMmsEnabled($mmsEnabled) { $this->options['mmsEnabled'] = $mmsEnabled; return $this; } /** * Whether the phone numbers can receive calls. Can be: `true` or `false`. * * @param bool $voiceEnabled Whether the phone numbers can receive calls. * @return $this Fluent Builder */ public function setVoiceEnabled($voiceEnabled) { $this->options['voiceEnabled'] = $voiceEnabled; return $this; } /** * Whether to exclude phone numbers that require an [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. * * @param bool $excludeAllAddressRequired Whether to exclude phone numbers that * require an Address * @return $this Fluent Builder */ public function setExcludeAllAddressRequired($excludeAllAddressRequired) { $this->options['excludeAllAddressRequired'] = $excludeAllAddressRequired; return $this; } /** * Whether to exclude phone numbers that require a local [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. * * @param bool $excludeLocalAddressRequired Whether to exclude phone numbers * that require a local address * @return $this Fluent Builder */ public function setExcludeLocalAddressRequired($excludeLocalAddressRequired) { $this->options['excludeLocalAddressRequired'] = $excludeLocalAddressRequired; return $this; } /** * Whether to exclude phone numbers that require a foreign [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. * * @param bool $excludeForeignAddressRequired Whether to exclude phone numbers * that require a foreign address * @return $this Fluent Builder */ public function setExcludeForeignAddressRequired($excludeForeignAddressRequired) { $this->options['excludeForeignAddressRequired'] = $excludeForeignAddressRequired; return $this; } /** * Whether to read phone numbers that are new to the Twilio platform. Can be: `true` or `false` and the default is `true`. * * @param bool $beta Whether to read phone numbers new to the Twilio platform * @return $this Fluent Builder */ public function setBeta($beta) { $this->options['beta'] = $beta; return $this; } /** * Given a phone number, find a geographically close number within `distance` miles. Distance defaults to 25 miles. Applies to only phone numbers in the US and Canada. * * @param string $nearNumber Given a phone number, find a geographically close * number within distance miles. (US/Canada only) * @return $this Fluent Builder */ public function setNearNumber($nearNumber) { $this->options['nearNumber'] = $nearNumber; return $this; } /** * Given a latitude/longitude pair `lat,long` find geographically close numbers within `distance` miles. Applies to only phone numbers in the US and Canada. * * @param string $nearLatLong Given a latitude/longitude pair lat,long find * geographically close numbers within distance * miles. (US/Canada only) * @return $this Fluent Builder */ public function setNearLatLong($nearLatLong) { $this->options['nearLatLong'] = $nearLatLong; return $this; } /** * The search radius, in miles, for a `near_` query. Can be up to `500` and the default is `25`. Applies to only phone numbers in the US and Canada. * * @param int $distance The search radius, in miles, for a near_ query. * (US/Canada only) * @return $this Fluent Builder */ public function setDistance($distance) { $this->options['distance'] = $distance; return $this; } /** * Limit results to a particular postal code. Given a phone number, search within the same postal code as that number. Applies to only phone numbers in the US and Canada. * * @param string $inPostalCode Limit results to a particular postal code. * (US/Canada only) * @return $this Fluent Builder */ public function setInPostalCode($inPostalCode) { $this->options['inPostalCode'] = $inPostalCode; return $this; } /** * Limit results to a particular region, state, or province. Given a phone number, search within the same region as that number. Applies to only phone numbers in the US and Canada. * * @param string $inRegion Limit results to a particular region. (US/Canada * only) * @return $this Fluent Builder */ public function setInRegion($inRegion) { $this->options['inRegion'] = $inRegion; return $this; } /** * Limit results to a specific rate center, or given a phone number search within the same rate center as that number. Requires `in_lata` to be set as well. Applies to only phone numbers in the US and Canada. * * @param string $inRateCenter Limit results to a specific rate center, or * given a phone number search within the same rate * center as that number. (US/Canada only) * @return $this Fluent Builder */ public function setInRateCenter($inRateCenter) { $this->options['inRateCenter'] = $inRateCenter; return $this; } /** * Limit results to a specific local access and transport area ([LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area)). Given a phone number, search within the same [LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area) as that number. Applies to only phone numbers in the US and Canada. * * @param string $inLata Limit results to a specific local access and transport * area. (US/Canada only) * @return $this Fluent Builder */ public function setInLata($inLata) { $this->options['inLata'] = $inLata; return $this; } /** * Limit results to a particular locality or city. Given a phone number, search within the same Locality as that number. * * @param string $inLocality Limit results to a particular locality * @return $this Fluent Builder */ public function setInLocality($inLocality) { $this->options['inLocality'] = $inLocality; return $this; } /** * Whether the phone numbers can receive faxes. Can be: `true` or `false`. * * @param bool $faxEnabled Whether the phone numbers can receive faxes * @return $this Fluent Builder */ public function setFaxEnabled($faxEnabled) { $this->options['faxEnabled'] = $faxEnabled; 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.ReadVoipOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/MobileList.php 0000644 00000014337 15002236443 0023307 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class MobileList extends ListResource { /** * Construct the MobileList * * @param Version $version Version that contains the resource * @param string $accountSid The account_sid * @param string $countryCode The ISO-3166-1 country code of the country. * @return \Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry\MobileList */ public function __construct(Version $version, $accountSid, $countryCode) { parent::__construct($version); // Path Solution $this->solution = array('accountSid' => $accountSid, 'countryCode' => $countryCode, ); $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/AvailablePhoneNumbers/' . \rawurlencode($countryCode) . '/Mobile.json'; } /** * Streams MobileInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($options = array(), $limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads MobileInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return MobileInstance[] Array of results */ public function read($options = array(), $limit = null, $pageSize = null) { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Retrieve a single page of MobileInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of MobileInstance */ public function page($options = array(), $pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $options = new Values($options); $params = Values::of(array( 'AreaCode' => $options['areaCode'], 'Contains' => $options['contains'], 'SmsEnabled' => Serialize::booleanToString($options['smsEnabled']), 'MmsEnabled' => Serialize::booleanToString($options['mmsEnabled']), 'VoiceEnabled' => Serialize::booleanToString($options['voiceEnabled']), 'ExcludeAllAddressRequired' => Serialize::booleanToString($options['excludeAllAddressRequired']), 'ExcludeLocalAddressRequired' => Serialize::booleanToString($options['excludeLocalAddressRequired']), 'ExcludeForeignAddressRequired' => Serialize::booleanToString($options['excludeForeignAddressRequired']), 'Beta' => Serialize::booleanToString($options['beta']), 'NearNumber' => $options['nearNumber'], 'NearLatLong' => $options['nearLatLong'], 'Distance' => $options['distance'], 'InPostalCode' => $options['inPostalCode'], 'InRegion' => $options['inRegion'], 'InRateCenter' => $options['inRateCenter'], 'InLata' => $options['inLata'], 'InLocality' => $options['inLocality'], 'FaxEnabled' => Serialize::booleanToString($options['faxEnabled']), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new MobilePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of MobileInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of MobileInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new MobilePage($this->version, $response, $this->solution); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.MobileList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/NationalOptions.php 0000644 00000040271 15002236443 0024361 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry; use Twilio\Options; use Twilio\Values; abstract class NationalOptions { /** * @param int $areaCode The area code of the phone numbers to read * @param string $contains The pattern on which to match phone numbers * @param bool $smsEnabled Whether the phone numbers can receive text messages * @param bool $mmsEnabled Whether the phone numbers can receive MMS messages * @param bool $voiceEnabled Whether the phone numbers can receive calls. * @param bool $excludeAllAddressRequired Whether to exclude phone numbers that * require an Address * @param bool $excludeLocalAddressRequired Whether to exclude phone numbers * that require a local address * @param bool $excludeForeignAddressRequired Whether to exclude phone numbers * that require a foreign address * @param bool $beta Whether to read phone numbers new to the Twilio platform * @param string $nearNumber Given a phone number, find a geographically close * number within distance miles. (US/Canada only) * @param string $nearLatLong Given a latitude/longitude pair lat,long find * geographically close numbers within distance * miles. (US/Canada only) * @param int $distance The search radius, in miles, for a near_ query. * (US/Canada only) * @param string $inPostalCode Limit results to a particular postal code. * (US/Canada only) * @param string $inRegion Limit results to a particular region. (US/Canada * only) * @param string $inRateCenter Limit results to a specific rate center, or * given a phone number search within the same rate * center as that number. (US/Canada only) * @param string $inLata Limit results to a specific local access and transport * area. (US/Canada only) * @param string $inLocality Limit results to a particular locality * @param bool $faxEnabled Whether the phone numbers can receive faxes * @return ReadNationalOptions Options builder */ public static function read($areaCode = Values::NONE, $contains = Values::NONE, $smsEnabled = Values::NONE, $mmsEnabled = Values::NONE, $voiceEnabled = Values::NONE, $excludeAllAddressRequired = Values::NONE, $excludeLocalAddressRequired = Values::NONE, $excludeForeignAddressRequired = Values::NONE, $beta = Values::NONE, $nearNumber = Values::NONE, $nearLatLong = Values::NONE, $distance = Values::NONE, $inPostalCode = Values::NONE, $inRegion = Values::NONE, $inRateCenter = Values::NONE, $inLata = Values::NONE, $inLocality = Values::NONE, $faxEnabled = Values::NONE) { return new ReadNationalOptions($areaCode, $contains, $smsEnabled, $mmsEnabled, $voiceEnabled, $excludeAllAddressRequired, $excludeLocalAddressRequired, $excludeForeignAddressRequired, $beta, $nearNumber, $nearLatLong, $distance, $inPostalCode, $inRegion, $inRateCenter, $inLata, $inLocality, $faxEnabled); } } class ReadNationalOptions extends Options { /** * @param int $areaCode The area code of the phone numbers to read * @param string $contains The pattern on which to match phone numbers * @param bool $smsEnabled Whether the phone numbers can receive text messages * @param bool $mmsEnabled Whether the phone numbers can receive MMS messages * @param bool $voiceEnabled Whether the phone numbers can receive calls. * @param bool $excludeAllAddressRequired Whether to exclude phone numbers that * require an Address * @param bool $excludeLocalAddressRequired Whether to exclude phone numbers * that require a local address * @param bool $excludeForeignAddressRequired Whether to exclude phone numbers * that require a foreign address * @param bool $beta Whether to read phone numbers new to the Twilio platform * @param string $nearNumber Given a phone number, find a geographically close * number within distance miles. (US/Canada only) * @param string $nearLatLong Given a latitude/longitude pair lat,long find * geographically close numbers within distance * miles. (US/Canada only) * @param int $distance The search radius, in miles, for a near_ query. * (US/Canada only) * @param string $inPostalCode Limit results to a particular postal code. * (US/Canada only) * @param string $inRegion Limit results to a particular region. (US/Canada * only) * @param string $inRateCenter Limit results to a specific rate center, or * given a phone number search within the same rate * center as that number. (US/Canada only) * @param string $inLata Limit results to a specific local access and transport * area. (US/Canada only) * @param string $inLocality Limit results to a particular locality * @param bool $faxEnabled Whether the phone numbers can receive faxes */ public function __construct($areaCode = Values::NONE, $contains = Values::NONE, $smsEnabled = Values::NONE, $mmsEnabled = Values::NONE, $voiceEnabled = Values::NONE, $excludeAllAddressRequired = Values::NONE, $excludeLocalAddressRequired = Values::NONE, $excludeForeignAddressRequired = Values::NONE, $beta = Values::NONE, $nearNumber = Values::NONE, $nearLatLong = Values::NONE, $distance = Values::NONE, $inPostalCode = Values::NONE, $inRegion = Values::NONE, $inRateCenter = Values::NONE, $inLata = Values::NONE, $inLocality = Values::NONE, $faxEnabled = Values::NONE) { $this->options['areaCode'] = $areaCode; $this->options['contains'] = $contains; $this->options['smsEnabled'] = $smsEnabled; $this->options['mmsEnabled'] = $mmsEnabled; $this->options['voiceEnabled'] = $voiceEnabled; $this->options['excludeAllAddressRequired'] = $excludeAllAddressRequired; $this->options['excludeLocalAddressRequired'] = $excludeLocalAddressRequired; $this->options['excludeForeignAddressRequired'] = $excludeForeignAddressRequired; $this->options['beta'] = $beta; $this->options['nearNumber'] = $nearNumber; $this->options['nearLatLong'] = $nearLatLong; $this->options['distance'] = $distance; $this->options['inPostalCode'] = $inPostalCode; $this->options['inRegion'] = $inRegion; $this->options['inRateCenter'] = $inRateCenter; $this->options['inLata'] = $inLata; $this->options['inLocality'] = $inLocality; $this->options['faxEnabled'] = $faxEnabled; } /** * The area code of the phone numbers to read. Applies to only phone numbers in the US and Canada. * * @param int $areaCode The area code of the phone numbers to read * @return $this Fluent Builder */ public function setAreaCode($areaCode) { $this->options['areaCode'] = $areaCode; return $this; } /** * The pattern on which to match phone numbers. Valid characters are `*`, `0-9`, `a-z`, and `A-Z`. The `*` character matches any single digit. For examples, see [Example 2](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-2) and [Example 3](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-3). If specified, this value must have at least two characters. * * @param string $contains The pattern on which to match phone numbers * @return $this Fluent Builder */ public function setContains($contains) { $this->options['contains'] = $contains; return $this; } /** * Whether the phone numbers can receive text messages. Can be: `true` or `false`. * * @param bool $smsEnabled Whether the phone numbers can receive text messages * @return $this Fluent Builder */ public function setSmsEnabled($smsEnabled) { $this->options['smsEnabled'] = $smsEnabled; return $this; } /** * Whether the phone numbers can receive MMS messages. Can be: `true` or `false`. * * @param bool $mmsEnabled Whether the phone numbers can receive MMS messages * @return $this Fluent Builder */ public function setMmsEnabled($mmsEnabled) { $this->options['mmsEnabled'] = $mmsEnabled; return $this; } /** * Whether the phone numbers can receive calls. Can be: `true` or `false`. * * @param bool $voiceEnabled Whether the phone numbers can receive calls. * @return $this Fluent Builder */ public function setVoiceEnabled($voiceEnabled) { $this->options['voiceEnabled'] = $voiceEnabled; return $this; } /** * Whether to exclude phone numbers that require an [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. * * @param bool $excludeAllAddressRequired Whether to exclude phone numbers that * require an Address * @return $this Fluent Builder */ public function setExcludeAllAddressRequired($excludeAllAddressRequired) { $this->options['excludeAllAddressRequired'] = $excludeAllAddressRequired; return $this; } /** * Whether to exclude phone numbers that require a local [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. * * @param bool $excludeLocalAddressRequired Whether to exclude phone numbers * that require a local address * @return $this Fluent Builder */ public function setExcludeLocalAddressRequired($excludeLocalAddressRequired) { $this->options['excludeLocalAddressRequired'] = $excludeLocalAddressRequired; return $this; } /** * Whether to exclude phone numbers that require a foreign [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. * * @param bool $excludeForeignAddressRequired Whether to exclude phone numbers * that require a foreign address * @return $this Fluent Builder */ public function setExcludeForeignAddressRequired($excludeForeignAddressRequired) { $this->options['excludeForeignAddressRequired'] = $excludeForeignAddressRequired; return $this; } /** * Whether to read phone numbers that are new to the Twilio platform. Can be: `true` or `false` and the default is `true`. * * @param bool $beta Whether to read phone numbers new to the Twilio platform * @return $this Fluent Builder */ public function setBeta($beta) { $this->options['beta'] = $beta; return $this; } /** * Given a phone number, find a geographically close number within `distance` miles. Distance defaults to 25 miles. Applies to only phone numbers in the US and Canada. * * @param string $nearNumber Given a phone number, find a geographically close * number within distance miles. (US/Canada only) * @return $this Fluent Builder */ public function setNearNumber($nearNumber) { $this->options['nearNumber'] = $nearNumber; return $this; } /** * Given a latitude/longitude pair `lat,long` find geographically close numbers within `distance` miles. Applies to only phone numbers in the US and Canada. * * @param string $nearLatLong Given a latitude/longitude pair lat,long find * geographically close numbers within distance * miles. (US/Canada only) * @return $this Fluent Builder */ public function setNearLatLong($nearLatLong) { $this->options['nearLatLong'] = $nearLatLong; return $this; } /** * The search radius, in miles, for a `near_` query. Can be up to `500` and the default is `25`. Applies to only phone numbers in the US and Canada. * * @param int $distance The search radius, in miles, for a near_ query. * (US/Canada only) * @return $this Fluent Builder */ public function setDistance($distance) { $this->options['distance'] = $distance; return $this; } /** * Limit results to a particular postal code. Given a phone number, search within the same postal code as that number. Applies to only phone numbers in the US and Canada. * * @param string $inPostalCode Limit results to a particular postal code. * (US/Canada only) * @return $this Fluent Builder */ public function setInPostalCode($inPostalCode) { $this->options['inPostalCode'] = $inPostalCode; return $this; } /** * Limit results to a particular region, state, or province. Given a phone number, search within the same region as that number. Applies to only phone numbers in the US and Canada. * * @param string $inRegion Limit results to a particular region. (US/Canada * only) * @return $this Fluent Builder */ public function setInRegion($inRegion) { $this->options['inRegion'] = $inRegion; return $this; } /** * Limit results to a specific rate center, or given a phone number search within the same rate center as that number. Requires `in_lata` to be set as well. Applies to only phone numbers in the US and Canada. * * @param string $inRateCenter Limit results to a specific rate center, or * given a phone number search within the same rate * center as that number. (US/Canada only) * @return $this Fluent Builder */ public function setInRateCenter($inRateCenter) { $this->options['inRateCenter'] = $inRateCenter; return $this; } /** * Limit results to a specific local access and transport area ([LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area)). Given a phone number, search within the same [LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area) as that number. Applies to only phone numbers in the US and Canada. * * @param string $inLata Limit results to a specific local access and transport * area. (US/Canada only) * @return $this Fluent Builder */ public function setInLata($inLata) { $this->options['inLata'] = $inLata; return $this; } /** * Limit results to a particular locality or city. Given a phone number, search within the same Locality as that number. * * @param string $inLocality Limit results to a particular locality * @return $this Fluent Builder */ public function setInLocality($inLocality) { $this->options['inLocality'] = $inLocality; return $this; } /** * Whether the phone numbers can receive faxes. Can be: `true` or `false`. * * @param bool $faxEnabled Whether the phone numbers can receive faxes * @return $this Fluent Builder */ public function setFaxEnabled($faxEnabled) { $this->options['faxEnabled'] = $faxEnabled; 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.ReadNationalOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/LocalList.php 0000644 00000014321 15002236443 0023123 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class LocalList extends ListResource { /** * Construct the LocalList * * @param Version $version Version that contains the resource * @param string $accountSid The account_sid * @param string $countryCode The ISO-3166-1 country code of the country. * @return \Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry\LocalList */ public function __construct(Version $version, $accountSid, $countryCode) { parent::__construct($version); // Path Solution $this->solution = array('accountSid' => $accountSid, 'countryCode' => $countryCode, ); $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/AvailablePhoneNumbers/' . \rawurlencode($countryCode) . '/Local.json'; } /** * Streams LocalInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($options = array(), $limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads LocalInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return LocalInstance[] Array of results */ public function read($options = array(), $limit = null, $pageSize = null) { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Retrieve a single page of LocalInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of LocalInstance */ public function page($options = array(), $pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $options = new Values($options); $params = Values::of(array( 'AreaCode' => $options['areaCode'], 'Contains' => $options['contains'], 'SmsEnabled' => Serialize::booleanToString($options['smsEnabled']), 'MmsEnabled' => Serialize::booleanToString($options['mmsEnabled']), 'VoiceEnabled' => Serialize::booleanToString($options['voiceEnabled']), 'ExcludeAllAddressRequired' => Serialize::booleanToString($options['excludeAllAddressRequired']), 'ExcludeLocalAddressRequired' => Serialize::booleanToString($options['excludeLocalAddressRequired']), 'ExcludeForeignAddressRequired' => Serialize::booleanToString($options['excludeForeignAddressRequired']), 'Beta' => Serialize::booleanToString($options['beta']), 'NearNumber' => $options['nearNumber'], 'NearLatLong' => $options['nearLatLong'], 'Distance' => $options['distance'], 'InPostalCode' => $options['inPostalCode'], 'InRegion' => $options['inRegion'], 'InRateCenter' => $options['inRateCenter'], 'InLata' => $options['inLata'], 'InLocality' => $options['inLocality'], 'FaxEnabled' => Serialize::booleanToString($options['faxEnabled']), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new LocalPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of LocalInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of LocalInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new LocalPage($this->version, $response, $this->solution); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.LocalList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/TollFreePage.php 0000644 00000001556 15002236443 0023554 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry; use Twilio\Page; class TollFreePage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new TollFreeInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['countryCode'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.TollFreePage]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/MachineToMachineList.php 0000644 00000014553 15002236443 0025234 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class MachineToMachineList extends ListResource { /** * Construct the MachineToMachineList * * @param Version $version Version that contains the resource * @param string $accountSid The account_sid * @param string $countryCode The ISO-3166-1 country code of the country. * @return \Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry\MachineToMachineList */ public function __construct(Version $version, $accountSid, $countryCode) { parent::__construct($version); // Path Solution $this->solution = array('accountSid' => $accountSid, 'countryCode' => $countryCode, ); $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/AvailablePhoneNumbers/' . \rawurlencode($countryCode) . '/MachineToMachine.json'; } /** * Streams MachineToMachineInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($options = array(), $limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads MachineToMachineInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return MachineToMachineInstance[] Array of results */ public function read($options = array(), $limit = null, $pageSize = null) { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Retrieve a single page of MachineToMachineInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of MachineToMachineInstance */ public function page($options = array(), $pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $options = new Values($options); $params = Values::of(array( 'AreaCode' => $options['areaCode'], 'Contains' => $options['contains'], 'SmsEnabled' => Serialize::booleanToString($options['smsEnabled']), 'MmsEnabled' => Serialize::booleanToString($options['mmsEnabled']), 'VoiceEnabled' => Serialize::booleanToString($options['voiceEnabled']), 'ExcludeAllAddressRequired' => Serialize::booleanToString($options['excludeAllAddressRequired']), 'ExcludeLocalAddressRequired' => Serialize::booleanToString($options['excludeLocalAddressRequired']), 'ExcludeForeignAddressRequired' => Serialize::booleanToString($options['excludeForeignAddressRequired']), 'Beta' => Serialize::booleanToString($options['beta']), 'NearNumber' => $options['nearNumber'], 'NearLatLong' => $options['nearLatLong'], 'Distance' => $options['distance'], 'InPostalCode' => $options['inPostalCode'], 'InRegion' => $options['inRegion'], 'InRateCenter' => $options['inRateCenter'], 'InLata' => $options['inLata'], 'InLocality' => $options['inLocality'], 'FaxEnabled' => Serialize::booleanToString($options['faxEnabled']), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new MachineToMachinePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of MachineToMachineInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of MachineToMachineInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new MachineToMachinePage($this->version, $response, $this->solution); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.MachineToMachineList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumberList.php 0000644 00000023761 15002236443 0020400 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Rest\Api\V2010\Account\IncomingPhoneNumber\LocalList; use Twilio\Rest\Api\V2010\Account\IncomingPhoneNumber\MobileList; use Twilio\Rest\Api\V2010\Account\IncomingPhoneNumber\TollFreeList; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * @property \Twilio\Rest\Api\V2010\Account\IncomingPhoneNumber\LocalList $local * @property \Twilio\Rest\Api\V2010\Account\IncomingPhoneNumber\MobileList $mobile * @property \Twilio\Rest\Api\V2010\Account\IncomingPhoneNumber\TollFreeList $tollFree */ class IncomingPhoneNumberList extends ListResource { protected $_local = null; protected $_mobile = null; protected $_tollFree = null; /** * Construct the IncomingPhoneNumberList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the Account that created the resource * @return \Twilio\Rest\Api\V2010\Account\IncomingPhoneNumberList */ public function __construct(Version $version, $accountSid) { parent::__construct($version); // Path Solution $this->solution = array('accountSid' => $accountSid, ); $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/IncomingPhoneNumbers.json'; } /** * Streams IncomingPhoneNumberInstance records from the API as a generator * stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($options = array(), $limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads IncomingPhoneNumberInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return IncomingPhoneNumberInstance[] Array of results */ public function read($options = array(), $limit = null, $pageSize = null) { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Retrieve a single page of IncomingPhoneNumberInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of IncomingPhoneNumberInstance */ public function page($options = array(), $pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $options = new Values($options); $params = Values::of(array( 'Beta' => Serialize::booleanToString($options['beta']), 'FriendlyName' => $options['friendlyName'], 'PhoneNumber' => $options['phoneNumber'], 'Origin' => $options['origin'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new IncomingPhoneNumberPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of IncomingPhoneNumberInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of IncomingPhoneNumberInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new IncomingPhoneNumberPage($this->version, $response, $this->solution); } /** * Create a new IncomingPhoneNumberInstance * * @param array|Options $options Optional Arguments * @return IncomingPhoneNumberInstance Newly created IncomingPhoneNumberInstance * @throws TwilioException When an HTTP error occurs. */ public function create($options = array()) { $options = new Values($options); $data = Values::of(array( 'PhoneNumber' => $options['phoneNumber'], 'AreaCode' => $options['areaCode'], 'ApiVersion' => $options['apiVersion'], 'FriendlyName' => $options['friendlyName'], 'SmsApplicationSid' => $options['smsApplicationSid'], 'SmsFallbackMethod' => $options['smsFallbackMethod'], 'SmsFallbackUrl' => $options['smsFallbackUrl'], 'SmsMethod' => $options['smsMethod'], 'SmsUrl' => $options['smsUrl'], 'StatusCallback' => $options['statusCallback'], 'StatusCallbackMethod' => $options['statusCallbackMethod'], 'VoiceApplicationSid' => $options['voiceApplicationSid'], 'VoiceCallerIdLookup' => Serialize::booleanToString($options['voiceCallerIdLookup']), 'VoiceFallbackMethod' => $options['voiceFallbackMethod'], 'VoiceFallbackUrl' => $options['voiceFallbackUrl'], 'VoiceMethod' => $options['voiceMethod'], 'VoiceUrl' => $options['voiceUrl'], 'EmergencyStatus' => $options['emergencyStatus'], 'EmergencyAddressSid' => $options['emergencyAddressSid'], 'TrunkSid' => $options['trunkSid'], 'IdentitySid' => $options['identitySid'], 'AddressSid' => $options['addressSid'], 'VoiceReceiveMode' => $options['voiceReceiveMode'], 'BundleSid' => $options['bundleSid'], )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new IncomingPhoneNumberInstance($this->version, $payload, $this->solution['accountSid']); } /** * Access the local */ protected function getLocal() { if (!$this->_local) { $this->_local = new LocalList($this->version, $this->solution['accountSid']); } return $this->_local; } /** * Access the mobile */ protected function getMobile() { if (!$this->_mobile) { $this->_mobile = new MobileList($this->version, $this->solution['accountSid']); } return $this->_mobile; } /** * Access the tollFree */ protected function getTollFree() { if (!$this->_tollFree) { $this->_tollFree = new TollFreeList($this->version, $this->solution['accountSid']); } return $this->_tollFree; } /** * Constructs a IncomingPhoneNumberContext * * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Api\V2010\Account\IncomingPhoneNumberContext */ public function getContext($sid) { return new IncomingPhoneNumberContext($this->version, $this->solution['accountSid'], $sid); } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get($name) { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.IncomingPhoneNumberList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/ConferenceList.php 0000644 00000013427 15002236443 0016537 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class ConferenceList extends ListResource { /** * Construct the ConferenceList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the Account that created this resource * @return \Twilio\Rest\Api\V2010\Account\ConferenceList */ public function __construct(Version $version, $accountSid) { parent::__construct($version); // Path Solution $this->solution = array('accountSid' => $accountSid, ); $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/Conferences.json'; } /** * Streams ConferenceInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($options = array(), $limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads ConferenceInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return ConferenceInstance[] Array of results */ public function read($options = array(), $limit = null, $pageSize = null) { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Retrieve a single page of ConferenceInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of ConferenceInstance */ public function page($options = array(), $pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $options = new Values($options); $params = Values::of(array( 'DateCreated<' => Serialize::iso8601Date($options['dateCreatedBefore']), 'DateCreated' => Serialize::iso8601Date($options['dateCreated']), 'DateCreated>' => Serialize::iso8601Date($options['dateCreatedAfter']), 'DateUpdated<' => Serialize::iso8601Date($options['dateUpdatedBefore']), 'DateUpdated' => Serialize::iso8601Date($options['dateUpdated']), 'DateUpdated>' => Serialize::iso8601Date($options['dateUpdatedAfter']), 'FriendlyName' => $options['friendlyName'], 'Status' => $options['status'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new ConferencePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of ConferenceInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of ConferenceInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new ConferencePage($this->version, $response, $this->solution); } /** * Constructs a ConferenceContext * * @param string $sid The unique string that identifies this resource * @return \Twilio\Rest\Api\V2010\Account\ConferenceContext */ public function getContext($sid) { return new ConferenceContext($this->version, $this->solution['accountSid'], $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.ConferenceList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/RecordingPage.php 0000644 00000001373 15002236443 0016342 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Page; class RecordingPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new RecordingInstance($this->version, $payload, $this->solution['accountSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.RecordingPage]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Call/FeedbackInstance.php 0000644 00000010626 15002236443 0017656 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Call; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $issues * @property int $qualityScore * @property string $sid */ class FeedbackInstance extends InstanceResource { /** * Initialize the FeedbackInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The unique sid that identifies this account * @param string $callSid The unique string that identifies this resource * @return \Twilio\Rest\Api\V2010\Account\Call\FeedbackInstance */ public function __construct(Version $version, array $payload, $accountSid, $callSid) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'accountSid' => Values::array_get($payload, 'account_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'issues' => Values::array_get($payload, 'issues'), 'qualityScore' => Values::array_get($payload, 'quality_score'), 'sid' => Values::array_get($payload, 'sid'), ); $this->solution = array('accountSid' => $accountSid, 'callSid' => $callSid, ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Api\V2010\Account\Call\FeedbackContext Context for this * FeedbackInstance */ protected function proxy() { if (!$this->context) { $this->context = new FeedbackContext( $this->version, $this->solution['accountSid'], $this->solution['callSid'] ); } return $this->context; } /** * Create a new FeedbackInstance * * @param int $qualityScore The call quality expressed as an integer from 1 to 5 * @param array|Options $options Optional Arguments * @return FeedbackInstance Newly created FeedbackInstance * @throws TwilioException When an HTTP error occurs. */ public function create($qualityScore, $options = array()) { return $this->proxy()->create($qualityScore, $options); } /** * Fetch a FeedbackInstance * * @return FeedbackInstance Fetched FeedbackInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Update the FeedbackInstance * * @param int $qualityScore The call quality expressed as an integer from 1 to 5 * @param array|Options $options Optional Arguments * @return FeedbackInstance Updated FeedbackInstance * @throws TwilioException When an HTTP error occurs. */ public function update($qualityScore, $options = array()) { return $this->proxy()->update($qualityScore, $options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.FeedbackInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Call/NotificationContext.php 0000644 00000004645 15002236443 0020504 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Call; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; class NotificationContext extends InstanceContext { /** * Initialize the NotificationContext * * @param \Twilio\Version $version Version that contains the resource * @param string $accountSid The SID of the Account that created the resource * to fetch * @param string $callSid The Call SID of the resource to fetch * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Api\V2010\Account\Call\NotificationContext */ public function __construct(Version $version, $accountSid, $callSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array('accountSid' => $accountSid, 'callSid' => $callSid, 'sid' => $sid, ); $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/Calls/' . \rawurlencode($callSid) . '/Notifications/' . \rawurlencode($sid) . '.json'; } /** * Fetch a NotificationInstance * * @return NotificationInstance Fetched NotificationInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new NotificationInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['callSid'], $this->solution['sid'] ); } /** * Deletes the NotificationInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.NotificationContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Call/FeedbackOptions.php 0000644 00000005707 15002236443 0017551 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Call; use Twilio\Options; use Twilio\Values; abstract class FeedbackOptions { /** * @param string $issue Issues experienced during the call * @return CreateFeedbackOptions Options builder */ public static function create($issue = Values::NONE) { return new CreateFeedbackOptions($issue); } /** * @param string $issue Issues experienced during the call * @return UpdateFeedbackOptions Options builder */ public static function update($issue = Values::NONE) { return new UpdateFeedbackOptions($issue); } } class CreateFeedbackOptions extends Options { /** * @param string $issue Issues experienced during the call */ public function __construct($issue = Values::NONE) { $this->options['issue'] = $issue; } /** * A list of one or more issues experienced during the call. Issues can be: `imperfect-audio`, `dropped-call`, `incorrect-caller-id`, `post-dial-delay`, `digits-not-captured`, `audio-latency`, `unsolicited-call`, or `one-way-audio`. * * @param string $issue Issues experienced during the call * @return $this Fluent Builder */ public function setIssue($issue) { $this->options['issue'] = $issue; 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.CreateFeedbackOptions ' . \implode(' ', $options) . ']'; } } class UpdateFeedbackOptions extends Options { /** * @param string $issue Issues experienced during the call */ public function __construct($issue = Values::NONE) { $this->options['issue'] = $issue; } /** * One or more issues experienced during the call. The issues can be: `imperfect-audio`, `dropped-call`, `incorrect-caller-id`, `post-dial-delay`, `digits-not-captured`, `audio-latency`, `unsolicited-call`, or `one-way-audio`. * * @param string $issue Issues experienced during the call * @return $this Fluent Builder */ public function setIssue($issue) { $this->options['issue'] = $issue; 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.UpdateFeedbackOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Call/NotificationInstance.php 0000644 00000012346 15002236443 0020621 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Call; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property string $apiVersion * @property string $callSid * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $errorCode * @property string $log * @property \DateTime $messageDate * @property string $messageText * @property string $moreInfo * @property string $requestMethod * @property string $requestUrl * @property string $requestVariables * @property string $responseBody * @property string $responseHeaders * @property string $sid * @property string $uri */ class NotificationInstance extends InstanceResource { /** * Initialize the NotificationInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the Account that created the resource * @param string $callSid The SID of the Call the resource is associated with * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Api\V2010\Account\Call\NotificationInstance */ public function __construct(Version $version, array $payload, $accountSid, $callSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'accountSid' => Values::array_get($payload, 'account_sid'), 'apiVersion' => Values::array_get($payload, 'api_version'), 'callSid' => Values::array_get($payload, 'call_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'errorCode' => Values::array_get($payload, 'error_code'), 'log' => Values::array_get($payload, 'log'), 'messageDate' => Deserialize::dateTime(Values::array_get($payload, 'message_date')), 'messageText' => Values::array_get($payload, 'message_text'), 'moreInfo' => Values::array_get($payload, 'more_info'), 'requestMethod' => Values::array_get($payload, 'request_method'), 'requestUrl' => Values::array_get($payload, 'request_url'), 'requestVariables' => Values::array_get($payload, 'request_variables'), 'responseBody' => Values::array_get($payload, 'response_body'), 'responseHeaders' => Values::array_get($payload, 'response_headers'), 'sid' => Values::array_get($payload, 'sid'), 'uri' => Values::array_get($payload, 'uri'), ); $this->solution = array( 'accountSid' => $accountSid, 'callSid' => $callSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Api\V2010\Account\Call\NotificationContext Context for * this * NotificationInstance */ protected function proxy() { if (!$this->context) { $this->context = new NotificationContext( $this->version, $this->solution['accountSid'], $this->solution['callSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch a NotificationInstance * * @return NotificationInstance Fetched NotificationInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the NotificationInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.NotificationInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Call/RecordingInstance.php 0000644 00000013062 15002236443 0020103 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Call; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property string $apiVersion * @property string $callSid * @property string $conferenceSid * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property \DateTime $startTime * @property string $duration * @property string $sid * @property string $price * @property string $uri * @property array $encryptionDetails * @property string $priceUnit * @property string $status * @property int $channels * @property string $source * @property int $errorCode */ class RecordingInstance extends InstanceResource { /** * Initialize the RecordingInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the Account that created the resource * @param string $callSid The SID of the Call the resource is associated with * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Api\V2010\Account\Call\RecordingInstance */ public function __construct(Version $version, array $payload, $accountSid, $callSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'accountSid' => Values::array_get($payload, 'account_sid'), 'apiVersion' => Values::array_get($payload, 'api_version'), 'callSid' => Values::array_get($payload, 'call_sid'), 'conferenceSid' => Values::array_get($payload, 'conference_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'startTime' => Deserialize::dateTime(Values::array_get($payload, 'start_time')), 'duration' => Values::array_get($payload, 'duration'), 'sid' => Values::array_get($payload, 'sid'), 'price' => Values::array_get($payload, 'price'), 'uri' => Values::array_get($payload, 'uri'), 'encryptionDetails' => Values::array_get($payload, 'encryption_details'), 'priceUnit' => Values::array_get($payload, 'price_unit'), 'status' => Values::array_get($payload, 'status'), 'channels' => Values::array_get($payload, 'channels'), 'source' => Values::array_get($payload, 'source'), 'errorCode' => Values::array_get($payload, 'error_code'), ); $this->solution = array( 'accountSid' => $accountSid, 'callSid' => $callSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Api\V2010\Account\Call\RecordingContext Context for * this * RecordingInstance */ protected function proxy() { if (!$this->context) { $this->context = new RecordingContext( $this->version, $this->solution['accountSid'], $this->solution['callSid'], $this->solution['sid'] ); } return $this->context; } /** * Update the RecordingInstance * * @param string $status The new status of the recording * @param array|Options $options Optional Arguments * @return RecordingInstance Updated RecordingInstance * @throws TwilioException When an HTTP error occurs. */ public function update($status, $options = array()) { return $this->proxy()->update($status, $options); } /** * Fetch a RecordingInstance * * @return RecordingInstance Fetched RecordingInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the RecordingInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.RecordingInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Call/FeedbackList.php 0000644 00000002523 15002236443 0017022 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Call; use Twilio\ListResource; use Twilio\Version; class FeedbackList extends ListResource { /** * Construct the FeedbackList * * @param Version $version Version that contains the resource * @param string $accountSid The unique sid that identifies this account * @param string $callSid The unique string that identifies this resource * @return \Twilio\Rest\Api\V2010\Account\Call\FeedbackList */ public function __construct(Version $version, $accountSid, $callSid) { parent::__construct($version); // Path Solution $this->solution = array('accountSid' => $accountSid, 'callSid' => $callSid, ); } /** * Constructs a FeedbackContext * * @return \Twilio\Rest\Api\V2010\Account\Call\FeedbackContext */ public function getContext() { return new FeedbackContext( $this->version, $this->solution['accountSid'], $this->solution['callSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.FeedbackList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Call/FeedbackSummaryInstance.php 0000644 00000011705 15002236443 0021233 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Call; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property int $callCount * @property int $callFeedbackCount * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property \DateTime $endDate * @property bool $includeSubaccounts * @property string $issues * @property string $qualityScoreAverage * @property string $qualityScoreMedian * @property string $qualityScoreStandardDeviation * @property string $sid * @property \DateTime $startDate * @property string $status */ class FeedbackSummaryInstance extends InstanceResource { /** * Initialize the FeedbackSummaryInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the Account that created this resource * @param string $sid A string that uniquely identifies this feedback summary * resource * @return \Twilio\Rest\Api\V2010\Account\Call\FeedbackSummaryInstance */ public function __construct(Version $version, array $payload, $accountSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'accountSid' => Values::array_get($payload, 'account_sid'), 'callCount' => Values::array_get($payload, 'call_count'), 'callFeedbackCount' => Values::array_get($payload, 'call_feedback_count'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'endDate' => Deserialize::dateTime(Values::array_get($payload, 'end_date')), 'includeSubaccounts' => Values::array_get($payload, 'include_subaccounts'), 'issues' => Values::array_get($payload, 'issues'), 'qualityScoreAverage' => Values::array_get($payload, 'quality_score_average'), 'qualityScoreMedian' => Values::array_get($payload, 'quality_score_median'), 'qualityScoreStandardDeviation' => Values::array_get($payload, 'quality_score_standard_deviation'), 'sid' => Values::array_get($payload, 'sid'), 'startDate' => Deserialize::dateTime(Values::array_get($payload, 'start_date')), 'status' => Values::array_get($payload, 'status'), ); $this->solution = array('accountSid' => $accountSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Api\V2010\Account\Call\FeedbackSummaryContext Context * for this * FeedbackSummaryInstance */ protected function proxy() { if (!$this->context) { $this->context = new FeedbackSummaryContext( $this->version, $this->solution['accountSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch a FeedbackSummaryInstance * * @return FeedbackSummaryInstance Fetched FeedbackSummaryInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the FeedbackSummaryInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.FeedbackSummaryInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Call/FeedbackSummaryOptions.php 0000644 00000007325 15002236443 0021125 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Call; use Twilio\Options; use Twilio\Values; abstract class FeedbackSummaryOptions { /** * @param bool $includeSubaccounts `true` includes feedback from the specified * account and its subaccounts * @param string $statusCallback The URL that we will request when the feedback * summary is complete * @param string $statusCallbackMethod The HTTP method we use to make requests * to the StatusCallback URL * @return CreateFeedbackSummaryOptions Options builder */ public static function create($includeSubaccounts = Values::NONE, $statusCallback = Values::NONE, $statusCallbackMethod = Values::NONE) { return new CreateFeedbackSummaryOptions($includeSubaccounts, $statusCallback, $statusCallbackMethod); } } class CreateFeedbackSummaryOptions extends Options { /** * @param bool $includeSubaccounts `true` includes feedback from the specified * account and its subaccounts * @param string $statusCallback The URL that we will request when the feedback * summary is complete * @param string $statusCallbackMethod The HTTP method we use to make requests * to the StatusCallback URL */ public function __construct($includeSubaccounts = Values::NONE, $statusCallback = Values::NONE, $statusCallbackMethod = Values::NONE) { $this->options['includeSubaccounts'] = $includeSubaccounts; $this->options['statusCallback'] = $statusCallback; $this->options['statusCallbackMethod'] = $statusCallbackMethod; } /** * Whether to also include Feedback resources from all subaccounts. `true` includes feedback from all subaccounts and `false`, the default, includes feedback from only the specified account. * * @param bool $includeSubaccounts `true` includes feedback from the specified * account and its subaccounts * @return $this Fluent Builder */ public function setIncludeSubaccounts($includeSubaccounts) { $this->options['includeSubaccounts'] = $includeSubaccounts; return $this; } /** * The URL that we will request when the feedback summary is complete. * * @param string $statusCallback The URL that we will request when the feedback * summary is complete * @return $this Fluent Builder */ public function setStatusCallback($statusCallback) { $this->options['statusCallback'] = $statusCallback; return $this; } /** * The HTTP method (`GET` or `POST`) we use to make the request to the `StatusCallback` URL. * * @param string $statusCallbackMethod The HTTP method we use to make requests * to the StatusCallback URL * @return $this Fluent Builder */ public function setStatusCallbackMethod($statusCallbackMethod) { $this->options['statusCallbackMethod'] = $statusCallbackMethod; 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.CreateFeedbackSummaryOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Call/FeedbackPage.php 0000644 00000001523 15002236443 0016762 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Call; use Twilio\Page; class FeedbackPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new FeedbackInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['callSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.FeedbackPage]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Call/RecordingList.php 0000644 00000015445 15002236443 0017261 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Call; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class RecordingList extends ListResource { /** * Construct the RecordingList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the Account that created the resource * @param string $callSid The SID of the Call the resource is associated with * @return \Twilio\Rest\Api\V2010\Account\Call\RecordingList */ public function __construct(Version $version, $accountSid, $callSid) { parent::__construct($version); // Path Solution $this->solution = array('accountSid' => $accountSid, 'callSid' => $callSid, ); $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/Calls/' . \rawurlencode($callSid) . '/Recordings.json'; } /** * Create a new RecordingInstance * * @param array|Options $options Optional Arguments * @return RecordingInstance Newly created RecordingInstance * @throws TwilioException When an HTTP error occurs. */ public function create($options = array()) { $options = new Values($options); $data = Values::of(array( 'RecordingStatusCallbackEvent' => Serialize::map($options['recordingStatusCallbackEvent'], function($e) { return $e; }), 'RecordingStatusCallback' => $options['recordingStatusCallback'], 'RecordingStatusCallbackMethod' => $options['recordingStatusCallbackMethod'], 'Trim' => $options['trim'], 'RecordingChannels' => $options['recordingChannels'], )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new RecordingInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['callSid'] ); } /** * Streams RecordingInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($options = array(), $limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads RecordingInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return RecordingInstance[] Array of results */ public function read($options = array(), $limit = null, $pageSize = null) { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Retrieve a single page of RecordingInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of RecordingInstance */ public function page($options = array(), $pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $options = new Values($options); $params = Values::of(array( 'DateCreated<' => Serialize::iso8601Date($options['dateCreatedBefore']), 'DateCreated' => Serialize::iso8601Date($options['dateCreated']), 'DateCreated>' => Serialize::iso8601Date($options['dateCreatedAfter']), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new RecordingPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of RecordingInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of RecordingInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new RecordingPage($this->version, $response, $this->solution); } /** * Constructs a RecordingContext * * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Api\V2010\Account\Call\RecordingContext */ public function getContext($sid) { return new RecordingContext( $this->version, $this->solution['accountSid'], $this->solution['callSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.RecordingList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Call/NotificationList.php 0000644 00000013400 15002236443 0017760 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Call; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class NotificationList extends ListResource { /** * Construct the NotificationList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the Account that created the resource * @param string $callSid The SID of the Call the resource is associated with * @return \Twilio\Rest\Api\V2010\Account\Call\NotificationList */ public function __construct(Version $version, $accountSid, $callSid) { parent::__construct($version); // Path Solution $this->solution = array('accountSid' => $accountSid, 'callSid' => $callSid, ); $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/Calls/' . \rawurlencode($callSid) . '/Notifications.json'; } /** * Streams NotificationInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($options = array(), $limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads NotificationInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return NotificationInstance[] Array of results */ public function read($options = array(), $limit = null, $pageSize = null) { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Retrieve a single page of NotificationInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of NotificationInstance */ public function page($options = array(), $pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $options = new Values($options); $params = Values::of(array( 'Log' => $options['log'], 'MessageDate<' => Serialize::iso8601Date($options['messageDateBefore']), 'MessageDate' => Serialize::iso8601Date($options['messageDate']), 'MessageDate>' => Serialize::iso8601Date($options['messageDateAfter']), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new NotificationPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of NotificationInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of NotificationInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new NotificationPage($this->version, $response, $this->solution); } /** * Constructs a NotificationContext * * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Api\V2010\Account\Call\NotificationContext */ public function getContext($sid) { return new NotificationContext( $this->version, $this->solution['accountSid'], $this->solution['callSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.NotificationList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Call/FeedbackContext.php 0000644 00000007412 15002236443 0017535 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Call; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class FeedbackContext extends InstanceContext { /** * Initialize the FeedbackContext * * @param \Twilio\Version $version Version that contains the resource * @param string $accountSid The unique sid that identifies this account * @param string $callSid The call sid that uniquely identifies the call * @return \Twilio\Rest\Api\V2010\Account\Call\FeedbackContext */ public function __construct(Version $version, $accountSid, $callSid) { parent::__construct($version); // Path Solution $this->solution = array('accountSid' => $accountSid, 'callSid' => $callSid, ); $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/Calls/' . \rawurlencode($callSid) . '/Feedback.json'; } /** * Create a new FeedbackInstance * * @param int $qualityScore The call quality expressed as an integer from 1 to 5 * @param array|Options $options Optional Arguments * @return FeedbackInstance Newly created FeedbackInstance * @throws TwilioException When an HTTP error occurs. */ public function create($qualityScore, $options = array()) { $options = new Values($options); $data = Values::of(array( 'QualityScore' => $qualityScore, 'Issue' => Serialize::map($options['issue'], function($e) { return $e; }), )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new FeedbackInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['callSid'] ); } /** * Fetch a FeedbackInstance * * @return FeedbackInstance Fetched FeedbackInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new FeedbackInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['callSid'] ); } /** * Update the FeedbackInstance * * @param int $qualityScore The call quality expressed as an integer from 1 to 5 * @param array|Options $options Optional Arguments * @return FeedbackInstance Updated FeedbackInstance * @throws TwilioException When an HTTP error occurs. */ public function update($qualityScore, $options = array()) { $options = new Values($options); $data = Values::of(array( 'QualityScore' => $qualityScore, 'Issue' => Serialize::map($options['issue'], function($e) { return $e; }), )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new FeedbackInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['callSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.FeedbackContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Call/RecordingContext.php 0000644 00000006367 15002236443 0017775 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Call; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Values; use Twilio\Version; class RecordingContext extends InstanceContext { /** * Initialize the RecordingContext * * @param \Twilio\Version $version Version that contains the resource * @param string $accountSid The SID of the Account that created the resource * to fetch * @param string $callSid The Call SID of the resource to fetch * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Api\V2010\Account\Call\RecordingContext */ public function __construct(Version $version, $accountSid, $callSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array('accountSid' => $accountSid, 'callSid' => $callSid, 'sid' => $sid, ); $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/Calls/' . \rawurlencode($callSid) . '/Recordings/' . \rawurlencode($sid) . '.json'; } /** * Update the RecordingInstance * * @param string $status The new status of the recording * @param array|Options $options Optional Arguments * @return RecordingInstance Updated RecordingInstance * @throws TwilioException When an HTTP error occurs. */ public function update($status, $options = array()) { $options = new Values($options); $data = Values::of(array('Status' => $status, 'PauseBehavior' => $options['pauseBehavior'], )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new RecordingInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['callSid'], $this->solution['sid'] ); } /** * Fetch a RecordingInstance * * @return RecordingInstance Fetched RecordingInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new RecordingInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['callSid'], $this->solution['sid'] ); } /** * Deletes the RecordingInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.RecordingContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Call/FeedbackSummaryContext.php 0000644 00000004422 15002236443 0021111 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Call; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; class FeedbackSummaryContext extends InstanceContext { /** * Initialize the FeedbackSummaryContext * * @param \Twilio\Version $version Version that contains the resource * @param string $accountSid The unique sid that identifies this account * @param string $sid A string that uniquely identifies this feedback summary * resource * @return \Twilio\Rest\Api\V2010\Account\Call\FeedbackSummaryContext */ public function __construct(Version $version, $accountSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array('accountSid' => $accountSid, 'sid' => $sid, ); $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/Calls/FeedbackSummary/' . \rawurlencode($sid) . '.json'; } /** * Fetch a FeedbackSummaryInstance * * @return FeedbackSummaryInstance Fetched FeedbackSummaryInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new FeedbackSummaryInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['sid'] ); } /** * Deletes the FeedbackSummaryInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.FeedbackSummaryContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Call/FeedbackSummaryPage.php 0000644 00000001422 15002236443 0020336 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Call; use Twilio\Page; class FeedbackSummaryPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new FeedbackSummaryInstance($this->version, $payload, $this->solution['accountSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.FeedbackSummaryPage]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Call/RecordingPage.php 0000644 00000001526 15002236443 0017215 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Call; use Twilio\Page; class RecordingPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new RecordingInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['callSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.RecordingPage]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Call/RecordingOptions.php 0000644 00000026716 15002236443 0020004 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Call; use Twilio\Options; use Twilio\Values; abstract class RecordingOptions { /** * @param string $recordingStatusCallbackEvent The recording status changes * that should generate a callback * @param string $recordingStatusCallback The callback URL on each selected * recording event * @param string $recordingStatusCallbackMethod The HTTP method we should use * to call * `recording_status_callback` * @param string $trim Whether to trim the silence in the recording * @param string $recordingChannels The number of channels that the output * recording will be configured with * @return CreateRecordingOptions Options builder */ public static function create($recordingStatusCallbackEvent = Values::NONE, $recordingStatusCallback = Values::NONE, $recordingStatusCallbackMethod = Values::NONE, $trim = Values::NONE, $recordingChannels = Values::NONE) { return new CreateRecordingOptions($recordingStatusCallbackEvent, $recordingStatusCallback, $recordingStatusCallbackMethod, $trim, $recordingChannels); } /** * @param string $pauseBehavior Whether to record or not during the pause * period. * @return UpdateRecordingOptions Options builder */ public static function update($pauseBehavior = Values::NONE) { return new UpdateRecordingOptions($pauseBehavior); } /** * @param string $dateCreatedBefore The `YYYY-MM-DD` value of the resources to * read * @param string $dateCreated The `YYYY-MM-DD` value of the resources to read * @param string $dateCreatedAfter The `YYYY-MM-DD` value of the resources to * read * @return ReadRecordingOptions Options builder */ public static function read($dateCreatedBefore = Values::NONE, $dateCreated = Values::NONE, $dateCreatedAfter = Values::NONE) { return new ReadRecordingOptions($dateCreatedBefore, $dateCreated, $dateCreatedAfter); } } class CreateRecordingOptions extends Options { /** * @param string $recordingStatusCallbackEvent The recording status changes * that should generate a callback * @param string $recordingStatusCallback The callback URL on each selected * recording event * @param string $recordingStatusCallbackMethod The HTTP method we should use * to call * `recording_status_callback` * @param string $trim Whether to trim the silence in the recording * @param string $recordingChannels The number of channels that the output * recording will be configured with */ public function __construct($recordingStatusCallbackEvent = Values::NONE, $recordingStatusCallback = Values::NONE, $recordingStatusCallbackMethod = Values::NONE, $trim = Values::NONE, $recordingChannels = Values::NONE) { $this->options['recordingStatusCallbackEvent'] = $recordingStatusCallbackEvent; $this->options['recordingStatusCallback'] = $recordingStatusCallback; $this->options['recordingStatusCallbackMethod'] = $recordingStatusCallbackMethod; $this->options['trim'] = $trim; $this->options['recordingChannels'] = $recordingChannels; } /** * The recording status events on which we should call the `recording_status_callback` URL. Can be: `in-progress`, `completed` and `absent` and the default is `completed`. Separate multiple event values with a space. * * @param string $recordingStatusCallbackEvent The recording status changes * that should generate a callback * @return $this Fluent Builder */ public function setRecordingStatusCallbackEvent($recordingStatusCallbackEvent) { $this->options['recordingStatusCallbackEvent'] = $recordingStatusCallbackEvent; return $this; } /** * The URL we should call using the `recording_status_callback_method` on each recording event specified in `recording_status_callback_event`. For more information, see [RecordingStatusCallback parameters](https://www.twilio.com/docs/voice/api/recording#recordingstatuscallback). * * @param string $recordingStatusCallback The callback URL on each selected * recording event * @return $this Fluent Builder */ public function setRecordingStatusCallback($recordingStatusCallback) { $this->options['recordingStatusCallback'] = $recordingStatusCallback; return $this; } /** * The HTTP method we should use to call `recording_status_callback`. Can be: `GET` or `POST` and the default is `POST`. * * @param string $recordingStatusCallbackMethod The HTTP method we should use * to call * `recording_status_callback` * @return $this Fluent Builder */ public function setRecordingStatusCallbackMethod($recordingStatusCallbackMethod) { $this->options['recordingStatusCallbackMethod'] = $recordingStatusCallbackMethod; return $this; } /** * Whether to trim any leading and trailing silence in the recording. Can be: `trim-silence` or `do-not-trim` and the default is `do-not-trim`. `trim-silence` trims the silence from the beginning and end of the recording and `do-not-trim` does not. * * @param string $trim Whether to trim the silence in the recording * @return $this Fluent Builder */ public function setTrim($trim) { $this->options['trim'] = $trim; return $this; } /** * The number of channels used in the recording. Can be: `mono` or `dual` and the default is `mono`. `mono` records all parties of the call into one channel. `dual` records each party of a 2-party call into separate channels. * * @param string $recordingChannels The number of channels that the output * recording will be configured with * @return $this Fluent Builder */ public function setRecordingChannels($recordingChannels) { $this->options['recordingChannels'] = $recordingChannels; 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.CreateRecordingOptions ' . \implode(' ', $options) . ']'; } } class UpdateRecordingOptions extends Options { /** * @param string $pauseBehavior Whether to record or not during the pause * period. */ public function __construct($pauseBehavior = Values::NONE) { $this->options['pauseBehavior'] = $pauseBehavior; } /** * Whether to record during a pause. Can be: `skip` or `silence` and the default is `silence`. `skip` does not record during the pause period, while `silence` will replace the actual audio of the call with silence during the pause period. This parameter only applies when setting `status` is set to `paused`. * * @param string $pauseBehavior Whether to record or not during the pause * period. * @return $this Fluent Builder */ public function setPauseBehavior($pauseBehavior) { $this->options['pauseBehavior'] = $pauseBehavior; 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.UpdateRecordingOptions ' . \implode(' ', $options) . ']'; } } class ReadRecordingOptions extends Options { /** * @param string $dateCreatedBefore The `YYYY-MM-DD` value of the resources to * read * @param string $dateCreated The `YYYY-MM-DD` value of the resources to read * @param string $dateCreatedAfter The `YYYY-MM-DD` value of the resources to * read */ public function __construct($dateCreatedBefore = Values::NONE, $dateCreated = Values::NONE, $dateCreatedAfter = Values::NONE) { $this->options['dateCreatedBefore'] = $dateCreatedBefore; $this->options['dateCreated'] = $dateCreated; $this->options['dateCreatedAfter'] = $dateCreatedAfter; } /** * The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. You can also specify inequality: `DateCreated<=YYYY-MM-DD` will return recordings generated at or before midnight on a given date, and `DateCreated>=YYYY-MM-DD` returns recordings generated at or after midnight on a date. * * @param string $dateCreatedBefore The `YYYY-MM-DD` value of the resources to * read * @return $this Fluent Builder */ public function setDateCreatedBefore($dateCreatedBefore) { $this->options['dateCreatedBefore'] = $dateCreatedBefore; return $this; } /** * The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. You can also specify inequality: `DateCreated<=YYYY-MM-DD` will return recordings generated at or before midnight on a given date, and `DateCreated>=YYYY-MM-DD` returns recordings generated at or after midnight on a date. * * @param string $dateCreated The `YYYY-MM-DD` value of the resources to read * @return $this Fluent Builder */ public function setDateCreated($dateCreated) { $this->options['dateCreated'] = $dateCreated; return $this; } /** * The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. You can also specify inequality: `DateCreated<=YYYY-MM-DD` will return recordings generated at or before midnight on a given date, and `DateCreated>=YYYY-MM-DD` returns recordings generated at or after midnight on a date. * * @param string $dateCreatedAfter The `YYYY-MM-DD` value of the resources to * read * @return $this Fluent Builder */ public function setDateCreatedAfter($dateCreatedAfter) { $this->options['dateCreatedAfter'] = $dateCreatedAfter; 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.ReadRecordingOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Call/NotificationPage.php 0000644 00000001537 15002236443 0017731 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Call; use Twilio\Page; class NotificationPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new NotificationInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['callSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.NotificationPage]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Call/FeedbackSummaryList.php 0000644 00000005264 15002236443 0020405 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Call; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class FeedbackSummaryList extends ListResource { /** * Construct the FeedbackSummaryList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the Account that created this resource * @return \Twilio\Rest\Api\V2010\Account\Call\FeedbackSummaryList */ public function __construct(Version $version, $accountSid) { parent::__construct($version); // Path Solution $this->solution = array('accountSid' => $accountSid, ); $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/Calls/FeedbackSummary.json'; } /** * Create a new FeedbackSummaryInstance * * @param \DateTime $startDate Only include feedback given on or after this date * @param \DateTime $endDate Only include feedback given on or before this date * @param array|Options $options Optional Arguments * @return FeedbackSummaryInstance Newly created FeedbackSummaryInstance * @throws TwilioException When an HTTP error occurs. */ public function create($startDate, $endDate, $options = array()) { $options = new Values($options); $data = Values::of(array( 'StartDate' => Serialize::iso8601Date($startDate), 'EndDate' => Serialize::iso8601Date($endDate), 'IncludeSubaccounts' => Serialize::booleanToString($options['includeSubaccounts']), 'StatusCallback' => $options['statusCallback'], 'StatusCallbackMethod' => $options['statusCallbackMethod'], )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new FeedbackSummaryInstance($this->version, $payload, $this->solution['accountSid']); } /** * Constructs a FeedbackSummaryContext * * @param string $sid A string that uniquely identifies this feedback summary * resource * @return \Twilio\Rest\Api\V2010\Account\Call\FeedbackSummaryContext */ public function getContext($sid) { return new FeedbackSummaryContext($this->version, $this->solution['accountSid'], $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.FeedbackSummaryList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Call/NotificationOptions.php 0000644 00000007372 15002236443 0020513 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Call; use Twilio\Options; use Twilio\Values; abstract class NotificationOptions { /** * @param int $log Filter by log level * @param string $messageDateBefore Filter by date * @param string $messageDate Filter by date * @param string $messageDateAfter Filter by date * @return ReadNotificationOptions Options builder */ public static function read($log = Values::NONE, $messageDateBefore = Values::NONE, $messageDate = Values::NONE, $messageDateAfter = Values::NONE) { return new ReadNotificationOptions($log, $messageDateBefore, $messageDate, $messageDateAfter); } } class ReadNotificationOptions extends Options { /** * @param int $log Filter by log level * @param string $messageDateBefore Filter by date * @param string $messageDate Filter by date * @param string $messageDateAfter Filter by date */ public function __construct($log = Values::NONE, $messageDateBefore = Values::NONE, $messageDate = Values::NONE, $messageDateAfter = Values::NONE) { $this->options['log'] = $log; $this->options['messageDateBefore'] = $messageDateBefore; $this->options['messageDate'] = $messageDate; $this->options['messageDateAfter'] = $messageDateAfter; } /** * Only read notifications of the specified log level. Can be: `0` to read only ERROR notifications or `1` to read only WARNING notifications. By default, all notifications are read. * * @param int $log Filter by log level * @return $this Fluent Builder */ public function setLog($log) { $this->options['log'] = $log; return $this; } /** * Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date. * * @param string $messageDateBefore Filter by date * @return $this Fluent Builder */ public function setMessageDateBefore($messageDateBefore) { $this->options['messageDateBefore'] = $messageDateBefore; return $this; } /** * Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date. * * @param string $messageDate Filter by date * @return $this Fluent Builder */ public function setMessageDate($messageDate) { $this->options['messageDate'] = $messageDate; return $this; } /** * Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date. * * @param string $messageDateAfter Filter by date * @return $this Fluent Builder */ public function setMessageDateAfter($messageDateAfter) { $this->options['messageDateAfter'] = $messageDateAfter; 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.ReadNotificationOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/RecordingOptions.php 0000644 00000013114 15002236443 0017115 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Options; use Twilio\Values; abstract class RecordingOptions { /** * @param string $dateCreatedBefore Only include recordings that were created * on this date * @param string $dateCreated Only include recordings that were created on this * date * @param string $dateCreatedAfter Only include recordings that were created on * this date * @param string $callSid The Call SID of the resources to read * @param string $conferenceSid Read by unique Conference SID for the recording * @return ReadRecordingOptions Options builder */ public static function read($dateCreatedBefore = Values::NONE, $dateCreated = Values::NONE, $dateCreatedAfter = Values::NONE, $callSid = Values::NONE, $conferenceSid = Values::NONE) { return new ReadRecordingOptions($dateCreatedBefore, $dateCreated, $dateCreatedAfter, $callSid, $conferenceSid); } } class ReadRecordingOptions extends Options { /** * @param string $dateCreatedBefore Only include recordings that were created * on this date * @param string $dateCreated Only include recordings that were created on this * date * @param string $dateCreatedAfter Only include recordings that were created on * this date * @param string $callSid The Call SID of the resources to read * @param string $conferenceSid Read by unique Conference SID for the recording */ public function __construct($dateCreatedBefore = Values::NONE, $dateCreated = Values::NONE, $dateCreatedAfter = Values::NONE, $callSid = Values::NONE, $conferenceSid = Values::NONE) { $this->options['dateCreatedBefore'] = $dateCreatedBefore; $this->options['dateCreated'] = $dateCreated; $this->options['dateCreatedAfter'] = $dateCreatedAfter; $this->options['callSid'] = $callSid; $this->options['conferenceSid'] = $conferenceSid; } /** * Only include recordings that were created on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read recordings that were created on this date. You can also specify an inequality, such as `DateCreated<=YYYY-MM-DD`, to read recordings that were created on or before midnight of this date, and `DateCreated>=YYYY-MM-DD` to read recordings that were created on or after midnight of this date. * * @param string $dateCreatedBefore Only include recordings that were created * on this date * @return $this Fluent Builder */ public function setDateCreatedBefore($dateCreatedBefore) { $this->options['dateCreatedBefore'] = $dateCreatedBefore; return $this; } /** * Only include recordings that were created on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read recordings that were created on this date. You can also specify an inequality, such as `DateCreated<=YYYY-MM-DD`, to read recordings that were created on or before midnight of this date, and `DateCreated>=YYYY-MM-DD` to read recordings that were created on or after midnight of this date. * * @param string $dateCreated Only include recordings that were created on this * date * @return $this Fluent Builder */ public function setDateCreated($dateCreated) { $this->options['dateCreated'] = $dateCreated; return $this; } /** * Only include recordings that were created on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read recordings that were created on this date. You can also specify an inequality, such as `DateCreated<=YYYY-MM-DD`, to read recordings that were created on or before midnight of this date, and `DateCreated>=YYYY-MM-DD` to read recordings that were created on or after midnight of this date. * * @param string $dateCreatedAfter Only include recordings that were created on * this date * @return $this Fluent Builder */ public function setDateCreatedAfter($dateCreatedAfter) { $this->options['dateCreatedAfter'] = $dateCreatedAfter; return $this; } /** * The [Call](https://www.twilio.com/docs/voice/api/call-resource) SID of the resources to read. * * @param string $callSid The Call SID of the resources to read * @return $this Fluent Builder */ public function setCallSid($callSid) { $this->options['callSid'] = $callSid; return $this; } /** * The Conference SID that identifies the conference associated with the recording to read. * * @param string $conferenceSid Read by unique Conference SID for the recording * @return $this Fluent Builder */ public function setConferenceSid($conferenceSid) { $this->options['conferenceSid'] = $conferenceSid; 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.ReadRecordingOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/QueueList.php 0000644 00000013111 15002236443 0015542 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; class QueueList extends ListResource { /** * Construct the QueueList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the Account that created this resource * @return \Twilio\Rest\Api\V2010\Account\QueueList */ public function __construct(Version $version, $accountSid) { parent::__construct($version); // Path Solution $this->solution = array('accountSid' => $accountSid, ); $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/Queues.json'; } /** * Streams QueueInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads QueueInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return QueueInstance[] Array of results */ public function read($limit = null, $pageSize = null) { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of QueueInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of QueueInstance */ public function page($pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $params = Values::of(array( 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new QueuePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of QueueInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of QueueInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new QueuePage($this->version, $response, $this->solution); } /** * Create a new QueueInstance * * @param string $friendlyName A string to describe this resource * @param array|Options $options Optional Arguments * @return QueueInstance Newly created QueueInstance * @throws TwilioException When an HTTP error occurs. */ public function create($friendlyName, $options = array()) { $options = new Values($options); $data = Values::of(array('FriendlyName' => $friendlyName, 'MaxSize' => $options['maxSize'], )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new QueueInstance($this->version, $payload, $this->solution['accountSid']); } /** * Constructs a QueueContext * * @param string $sid The unique string that identifies this resource * @return \Twilio\Rest\Api\V2010\Account\QueueContext */ public function getContext($sid) { return new QueueContext($this->version, $this->solution['accountSid'], $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.QueueList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/ValidationRequestOptions.php 0000644 00000012004 15002236443 0020641 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Options; use Twilio\Values; abstract class ValidationRequestOptions { /** * @param string $friendlyName A string to describe the resource * @param int $callDelay The number of seconds to delay before initiating the * verification call * @param string $extension The digits to dial after connecting the * verification call * @param string $statusCallback The URL we should call to send status * information to your application * @param string $statusCallbackMethod The HTTP method we should use to call * status_callback * @return CreateValidationRequestOptions Options builder */ public static function create($friendlyName = Values::NONE, $callDelay = Values::NONE, $extension = Values::NONE, $statusCallback = Values::NONE, $statusCallbackMethod = Values::NONE) { return new CreateValidationRequestOptions($friendlyName, $callDelay, $extension, $statusCallback, $statusCallbackMethod); } } class CreateValidationRequestOptions extends Options { /** * @param string $friendlyName A string to describe the resource * @param int $callDelay The number of seconds to delay before initiating the * verification call * @param string $extension The digits to dial after connecting the * verification call * @param string $statusCallback The URL we should call to send status * information to your application * @param string $statusCallbackMethod The HTTP method we should use to call * status_callback */ public function __construct($friendlyName = Values::NONE, $callDelay = Values::NONE, $extension = Values::NONE, $statusCallback = Values::NONE, $statusCallbackMethod = Values::NONE) { $this->options['friendlyName'] = $friendlyName; $this->options['callDelay'] = $callDelay; $this->options['extension'] = $extension; $this->options['statusCallback'] = $statusCallback; $this->options['statusCallbackMethod'] = $statusCallbackMethod; } /** * A descriptive string that you create to describe the new caller ID resource. It can be up to 64 characters long. The default value is a formatted version of the phone number. * * @param string $friendlyName A string to describe the resource * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The number of seconds to delay before initiating the verification call. Can be an integer between `0` and `60`, inclusive. The default is `0`. * * @param int $callDelay The number of seconds to delay before initiating the * verification call * @return $this Fluent Builder */ public function setCallDelay($callDelay) { $this->options['callDelay'] = $callDelay; return $this; } /** * The digits to dial after connecting the verification call. * * @param string $extension The digits to dial after connecting the * verification call * @return $this Fluent Builder */ public function setExtension($extension) { $this->options['extension'] = $extension; return $this; } /** * The URL we should call using the `status_callback_method` to send status information about the verification process to your application. * * @param string $statusCallback The URL we should call to send status * information to your application * @return $this Fluent Builder */ public function setStatusCallback($statusCallback) { $this->options['statusCallback'] = $statusCallback; return $this; } /** * The HTTP method we should use to call `status_callback`. Can be: `GET` or `POST`, and the default is `POST`. * * @param string $statusCallbackMethod The HTTP method we should use to call * status_callback * @return $this Fluent Builder */ public function setStatusCallbackMethod($statusCallbackMethod) { $this->options['statusCallbackMethod'] = $statusCallbackMethod; 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.CreateValidationRequestOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/ConferenceInstance.php 0000644 00000011402 15002236443 0017357 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $apiVersion * @property string $friendlyName * @property string $region * @property string $sid * @property string $status * @property string $uri * @property array $subresourceUris */ class ConferenceInstance extends InstanceResource { protected $_participants = null; protected $_recordings = null; /** * Initialize the ConferenceInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the Account that created this resource * @param string $sid The unique string that identifies this resource * @return \Twilio\Rest\Api\V2010\Account\ConferenceInstance */ public function __construct(Version $version, array $payload, $accountSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'accountSid' => Values::array_get($payload, 'account_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'apiVersion' => Values::array_get($payload, 'api_version'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'region' => Values::array_get($payload, 'region'), 'sid' => Values::array_get($payload, 'sid'), 'status' => Values::array_get($payload, 'status'), 'uri' => Values::array_get($payload, 'uri'), 'subresourceUris' => Values::array_get($payload, 'subresource_uris'), ); $this->solution = array('accountSid' => $accountSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Api\V2010\Account\ConferenceContext Context for this * ConferenceInstance */ protected function proxy() { if (!$this->context) { $this->context = new ConferenceContext( $this->version, $this->solution['accountSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch a ConferenceInstance * * @return ConferenceInstance Fetched ConferenceInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Update the ConferenceInstance * * @param array|Options $options Optional Arguments * @return ConferenceInstance Updated ConferenceInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Access the participants * * @return \Twilio\Rest\Api\V2010\Account\Conference\ParticipantList */ protected function getParticipants() { return $this->proxy()->participants; } /** * Access the recordings * * @return \Twilio\Rest\Api\V2010\Account\Conference\RecordingList */ protected function getRecordings() { return $this->proxy()->recordings; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.ConferenceInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/ConferenceContext.php 0000644 00000012427 15002236443 0017247 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Rest\Api\V2010\Account\Conference\ParticipantList; use Twilio\Rest\Api\V2010\Account\Conference\RecordingList; use Twilio\Values; use Twilio\Version; /** * @property \Twilio\Rest\Api\V2010\Account\Conference\ParticipantList $participants * @property \Twilio\Rest\Api\V2010\Account\Conference\RecordingList $recordings * @method \Twilio\Rest\Api\V2010\Account\Conference\ParticipantContext participants(string $callSid) * @method \Twilio\Rest\Api\V2010\Account\Conference\RecordingContext recordings(string $sid) */ class ConferenceContext extends InstanceContext { protected $_participants = null; protected $_recordings = null; /** * Initialize the ConferenceContext * * @param \Twilio\Version $version Version that contains the resource * @param string $accountSid The SID of the Account that created the * resource(s) to fetch * @param string $sid The unique string that identifies this resource * @return \Twilio\Rest\Api\V2010\Account\ConferenceContext */ public function __construct(Version $version, $accountSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array('accountSid' => $accountSid, 'sid' => $sid, ); $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/Conferences/' . \rawurlencode($sid) . '.json'; } /** * Fetch a ConferenceInstance * * @return ConferenceInstance Fetched ConferenceInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new ConferenceInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['sid'] ); } /** * Update the ConferenceInstance * * @param array|Options $options Optional Arguments * @return ConferenceInstance Updated ConferenceInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { $options = new Values($options); $data = Values::of(array( 'Status' => $options['status'], 'AnnounceUrl' => $options['announceUrl'], 'AnnounceMethod' => $options['announceMethod'], )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new ConferenceInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['sid'] ); } /** * Access the participants * * @return \Twilio\Rest\Api\V2010\Account\Conference\ParticipantList */ protected function getParticipants() { if (!$this->_participants) { $this->_participants = new ParticipantList( $this->version, $this->solution['accountSid'], $this->solution['sid'] ); } return $this->_participants; } /** * Access the recordings * * @return \Twilio\Rest\Api\V2010\Account\Conference\RecordingList */ protected function getRecordings() { if (!$this->_recordings) { $this->_recordings = new RecordingList( $this->version, $this->solution['accountSid'], $this->solution['sid'] ); } return $this->_recordings; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get($name) { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.ConferenceContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Recording/TranscriptionInstance.php 0000644 00000011311 15002236443 0022062 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Recording; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property string $apiVersion * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $duration * @property string $price * @property string $priceUnit * @property string $recordingSid * @property string $sid * @property string $status * @property string $transcriptionText * @property string $type * @property string $uri */ class TranscriptionInstance extends InstanceResource { /** * Initialize the TranscriptionInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the Account that created the resource * @param string $recordingSid The SID that identifies the transcription's * recording * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Api\V2010\Account\Recording\TranscriptionInstance */ public function __construct(Version $version, array $payload, $accountSid, $recordingSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'accountSid' => Values::array_get($payload, 'account_sid'), 'apiVersion' => Values::array_get($payload, 'api_version'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'duration' => Values::array_get($payload, 'duration'), 'price' => Values::array_get($payload, 'price'), 'priceUnit' => Values::array_get($payload, 'price_unit'), 'recordingSid' => Values::array_get($payload, 'recording_sid'), 'sid' => Values::array_get($payload, 'sid'), 'status' => Values::array_get($payload, 'status'), 'transcriptionText' => Values::array_get($payload, 'transcription_text'), 'type' => Values::array_get($payload, 'type'), 'uri' => Values::array_get($payload, 'uri'), ); $this->solution = array( 'accountSid' => $accountSid, 'recordingSid' => $recordingSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Api\V2010\Account\Recording\TranscriptionContext Context for this TranscriptionInstance */ protected function proxy() { if (!$this->context) { $this->context = new TranscriptionContext( $this->version, $this->solution['accountSid'], $this->solution['recordingSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch a TranscriptionInstance * * @return TranscriptionInstance Fetched TranscriptionInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the TranscriptionInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.TranscriptionInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Recording/TranscriptionList.php 0000644 00000012400 15002236443 0021231 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Recording; use Twilio\ListResource; use Twilio\Values; use Twilio\Version; class TranscriptionList extends ListResource { /** * Construct the TranscriptionList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the Account that created the resource * @param string $recordingSid The SID that identifies the transcription's * recording * @return \Twilio\Rest\Api\V2010\Account\Recording\TranscriptionList */ public function __construct(Version $version, $accountSid, $recordingSid) { parent::__construct($version); // Path Solution $this->solution = array('accountSid' => $accountSid, 'recordingSid' => $recordingSid, ); $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/Recordings/' . \rawurlencode($recordingSid) . '/Transcriptions.json'; } /** * Streams TranscriptionInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads TranscriptionInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return TranscriptionInstance[] Array of results */ public function read($limit = null, $pageSize = null) { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of TranscriptionInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of TranscriptionInstance */ public function page($pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $params = Values::of(array( 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new TranscriptionPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of TranscriptionInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of TranscriptionInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new TranscriptionPage($this->version, $response, $this->solution); } /** * Constructs a TranscriptionContext * * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Api\V2010\Account\Recording\TranscriptionContext */ public function getContext($sid) { return new TranscriptionContext( $this->version, $this->solution['accountSid'], $this->solution['recordingSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.TranscriptionList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Recording/AddOnResultInstance.php 0000644 00000011637 15002236443 0021422 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Recording; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $accountSid * @property string $status * @property string $addOnSid * @property string $addOnConfigurationSid * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property \DateTime $dateCompleted * @property string $referenceSid * @property array $subresourceUris */ class AddOnResultInstance extends InstanceResource { protected $_payloads = null; /** * Initialize the AddOnResultInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the Account that created the resource * @param string $referenceSid The SID of the recording to which the * AddOnResult resource belongs * @param string $sid The unique string that identifies the resource to fetch * @return \Twilio\Rest\Api\V2010\Account\Recording\AddOnResultInstance */ public function __construct(Version $version, array $payload, $accountSid, $referenceSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'status' => Values::array_get($payload, 'status'), 'addOnSid' => Values::array_get($payload, 'add_on_sid'), 'addOnConfigurationSid' => Values::array_get($payload, 'add_on_configuration_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'dateCompleted' => Deserialize::dateTime(Values::array_get($payload, 'date_completed')), 'referenceSid' => Values::array_get($payload, 'reference_sid'), 'subresourceUris' => Values::array_get($payload, 'subresource_uris'), ); $this->solution = array( 'accountSid' => $accountSid, 'referenceSid' => $referenceSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Api\V2010\Account\Recording\AddOnResultContext Context * for this * AddOnResultInstance */ protected function proxy() { if (!$this->context) { $this->context = new AddOnResultContext( $this->version, $this->solution['accountSid'], $this->solution['referenceSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch a AddOnResultInstance * * @return AddOnResultInstance Fetched AddOnResultInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the AddOnResultInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Access the payloads * * @return \Twilio\Rest\Api\V2010\Account\Recording\AddOnResult\PayloadList */ protected function getPayloads() { return $this->proxy()->payloads; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.AddOnResultInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Recording/AddOnResultContext.php 0000644 00000010612 15002236443 0021272 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Recording; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Rest\Api\V2010\Account\Recording\AddOnResult\PayloadList; use Twilio\Values; use Twilio\Version; /** * @property \Twilio\Rest\Api\V2010\Account\Recording\AddOnResult\PayloadList $payloads * @method \Twilio\Rest\Api\V2010\Account\Recording\AddOnResult\PayloadContext payloads(string $sid) */ class AddOnResultContext extends InstanceContext { protected $_payloads = null; /** * Initialize the AddOnResultContext * * @param \Twilio\Version $version Version that contains the resource * @param string $accountSid The SID of the Account that created the resource * to fetch * @param string $referenceSid The SID of the recording to which the result to * fetch belongs * @param string $sid The unique string that identifies the resource to fetch * @return \Twilio\Rest\Api\V2010\Account\Recording\AddOnResultContext */ public function __construct(Version $version, $accountSid, $referenceSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array( 'accountSid' => $accountSid, 'referenceSid' => $referenceSid, 'sid' => $sid, ); $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/Recordings/' . \rawurlencode($referenceSid) . '/AddOnResults/' . \rawurlencode($sid) . '.json'; } /** * Fetch a AddOnResultInstance * * @return AddOnResultInstance Fetched AddOnResultInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new AddOnResultInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['referenceSid'], $this->solution['sid'] ); } /** * Deletes the AddOnResultInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Access the payloads * * @return \Twilio\Rest\Api\V2010\Account\Recording\AddOnResult\PayloadList */ protected function getPayloads() { if (!$this->_payloads) { $this->_payloads = new PayloadList( $this->version, $this->solution['accountSid'], $this->solution['referenceSid'], $this->solution['sid'] ); } return $this->_payloads; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get($name) { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.AddOnResultContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Recording/TranscriptionContext.php 0000644 00000005110 15002236443 0021742 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Recording; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; class TranscriptionContext extends InstanceContext { /** * Initialize the TranscriptionContext * * @param \Twilio\Version $version Version that contains the resource * @param string $accountSid The SID of the Account that created the resource * to fetch * @param string $recordingSid The SID of the recording that created the * transcriptions to fetch * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Api\V2010\Account\Recording\TranscriptionContext */ public function __construct(Version $version, $accountSid, $recordingSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array( 'accountSid' => $accountSid, 'recordingSid' => $recordingSid, 'sid' => $sid, ); $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/Recordings/' . \rawurlencode($recordingSid) . '/Transcriptions/' . \rawurlencode($sid) . '.json'; } /** * Fetch a TranscriptionInstance * * @return TranscriptionInstance Fetched TranscriptionInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new TranscriptionInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['recordingSid'], $this->solution['sid'] ); } /** * Deletes the TranscriptionInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.TranscriptionContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Recording/TranscriptionPage.php 0000644 00000001554 15002236443 0021202 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Recording; use Twilio\Page; class TranscriptionPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new TranscriptionInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['recordingSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.TranscriptionPage]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Recording/AddOnResultList.php 0000644 00000012364 15002236443 0020567 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Recording; use Twilio\ListResource; use Twilio\Values; use Twilio\Version; class AddOnResultList extends ListResource { /** * Construct the AddOnResultList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the Account that created the resource * @param string $referenceSid The SID of the recording to which the * AddOnResult resource belongs * @return \Twilio\Rest\Api\V2010\Account\Recording\AddOnResultList */ public function __construct(Version $version, $accountSid, $referenceSid) { parent::__construct($version); // Path Solution $this->solution = array('accountSid' => $accountSid, 'referenceSid' => $referenceSid, ); $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/Recordings/' . \rawurlencode($referenceSid) . '/AddOnResults.json'; } /** * Streams AddOnResultInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads AddOnResultInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return AddOnResultInstance[] Array of results */ public function read($limit = null, $pageSize = null) { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of AddOnResultInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of AddOnResultInstance */ public function page($pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $params = Values::of(array( 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new AddOnResultPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of AddOnResultInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of AddOnResultInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new AddOnResultPage($this->version, $response, $this->solution); } /** * Constructs a AddOnResultContext * * @param string $sid The unique string that identifies the resource to fetch * @return \Twilio\Rest\Api\V2010\Account\Recording\AddOnResultContext */ public function getContext($sid) { return new AddOnResultContext( $this->version, $this->solution['accountSid'], $this->solution['referenceSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.AddOnResultList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Recording/AddOnResult/PayloadPage.php 0000644 00000001625 15002236443 0022117 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Recording\AddOnResult; use Twilio\Page; class PayloadPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new PayloadInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['referenceSid'], $this->solution['addOnResultSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.PayloadPage]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Recording/AddOnResult/PayloadList.php 0000644 00000013131 15002236443 0022151 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Recording\AddOnResult; use Twilio\ListResource; use Twilio\Values; use Twilio\Version; class PayloadList extends ListResource { /** * Construct the PayloadList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the Account that created the resource * @param string $referenceSid The SID of the recording to which the * AddOnResult resource that contains the payload * belongs * @param string $addOnResultSid The SID of the AddOnResult to which the * payload belongs * @return \Twilio\Rest\Api\V2010\Account\Recording\AddOnResult\PayloadList */ public function __construct(Version $version, $accountSid, $referenceSid, $addOnResultSid) { parent::__construct($version); // Path Solution $this->solution = array( 'accountSid' => $accountSid, 'referenceSid' => $referenceSid, 'addOnResultSid' => $addOnResultSid, ); $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/Recordings/' . \rawurlencode($referenceSid) . '/AddOnResults/' . \rawurlencode($addOnResultSid) . '/Payloads.json'; } /** * Streams PayloadInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads PayloadInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return PayloadInstance[] Array of results */ public function read($limit = null, $pageSize = null) { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of PayloadInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of PayloadInstance */ public function page($pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $params = Values::of(array( 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new PayloadPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of PayloadInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of PayloadInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new PayloadPage($this->version, $response, $this->solution); } /** * Constructs a PayloadContext * * @param string $sid The unique string that identifies the resource to fetch * @return \Twilio\Rest\Api\V2010\Account\Recording\AddOnResult\PayloadContext */ public function getContext($sid) { return new PayloadContext( $this->version, $this->solution['accountSid'], $this->solution['referenceSid'], $this->solution['addOnResultSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.PayloadList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Recording/AddOnResult/PayloadContext.php 0000644 00000005644 15002236443 0022674 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Recording\AddOnResult; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; class PayloadContext extends InstanceContext { /** * Initialize the PayloadContext * * @param \Twilio\Version $version Version that contains the resource * @param string $accountSid The SID of the Account that created the resource * to fetch * @param string $referenceSid The SID of the recording to which the * AddOnResult resource that contains the payload * to fetch belongs * @param string $addOnResultSid The SID of the AddOnResult to which the * payload to fetch belongs * @param string $sid The unique string that identifies the resource to fetch * @return \Twilio\Rest\Api\V2010\Account\Recording\AddOnResult\PayloadContext */ public function __construct(Version $version, $accountSid, $referenceSid, $addOnResultSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array( 'accountSid' => $accountSid, 'referenceSid' => $referenceSid, 'addOnResultSid' => $addOnResultSid, 'sid' => $sid, ); $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/Recordings/' . \rawurlencode($referenceSid) . '/AddOnResults/' . \rawurlencode($addOnResultSid) . '/Payloads/' . \rawurlencode($sid) . '.json'; } /** * Fetch a PayloadInstance * * @return PayloadInstance Fetched PayloadInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new PayloadInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['referenceSid'], $this->solution['addOnResultSid'], $this->solution['sid'] ); } /** * Deletes the PayloadInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.PayloadContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Recording/AddOnResult/PayloadInstance.php 0000644 00000011615 15002236443 0023007 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Recording\AddOnResult; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $addOnResultSid * @property string $accountSid * @property string $label * @property string $addOnSid * @property string $addOnConfigurationSid * @property string $contentType * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $referenceSid * @property array $subresourceUris */ class PayloadInstance extends InstanceResource { /** * Initialize the PayloadInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the Account that created the resource * @param string $referenceSid The SID of the recording to which the * AddOnResult resource that contains the payload * belongs * @param string $addOnResultSid The SID of the AddOnResult to which the * payload belongs * @param string $sid The unique string that identifies the resource to fetch * @return \Twilio\Rest\Api\V2010\Account\Recording\AddOnResult\PayloadInstance */ public function __construct(Version $version, array $payload, $accountSid, $referenceSid, $addOnResultSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'sid' => Values::array_get($payload, 'sid'), 'addOnResultSid' => Values::array_get($payload, 'add_on_result_sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'label' => Values::array_get($payload, 'label'), 'addOnSid' => Values::array_get($payload, 'add_on_sid'), 'addOnConfigurationSid' => Values::array_get($payload, 'add_on_configuration_sid'), 'contentType' => Values::array_get($payload, 'content_type'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'referenceSid' => Values::array_get($payload, 'reference_sid'), 'subresourceUris' => Values::array_get($payload, 'subresource_uris'), ); $this->solution = array( 'accountSid' => $accountSid, 'referenceSid' => $referenceSid, 'addOnResultSid' => $addOnResultSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Api\V2010\Account\Recording\AddOnResult\PayloadContext Context for this PayloadInstance */ protected function proxy() { if (!$this->context) { $this->context = new PayloadContext( $this->version, $this->solution['accountSid'], $this->solution['referenceSid'], $this->solution['addOnResultSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch a PayloadInstance * * @return PayloadInstance Fetched PayloadInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the PayloadInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.PayloadInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Recording/AddOnResultPage.php 0000644 00000001546 15002236443 0020530 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Recording; use Twilio\Page; class AddOnResultPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new AddOnResultInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['referenceSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.AddOnResultPage]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/NotificationPage.php 0000644 00000001404 15002236443 0017047 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Page; class NotificationPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new NotificationInstance($this->version, $payload, $this->solution['accountSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.NotificationPage]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/SipInstance.php 0000644 00000003173 15002236443 0016051 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; class SipInstance extends InstanceResource { /** * Initialize the SipInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid A 34 character string that uniquely identifies * this resource. * @return \Twilio\Rest\Api\V2010\Account\SipInstance */ public function __construct(Version $version, array $payload, $accountSid) { parent::__construct($version); $this->solution = array('accountSid' => $accountSid, ); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.SipInstance]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/ApplicationPage.php 0000644 00000001401 15002236443 0016661 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Page; class ApplicationPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new ApplicationInstance($this->version, $payload, $this->solution['accountSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.ApplicationPage]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/ConnectAppOptions.php 0000644 00000016042 15002236443 0017236 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Options; use Twilio\Values; abstract class ConnectAppOptions { /** * @param string $authorizeRedirectUrl The URL to redirect the user to after * authorization * @param string $companyName The company name to set for the Connect App * @param string $deauthorizeCallbackMethod The HTTP method to use when calling * deauthorize_callback_url * @param string $deauthorizeCallbackUrl The URL to call to de-authorize the * Connect App * @param string $description A description of the Connect App * @param string $friendlyName A string to describe the resource * @param string $homepageUrl A public URL where users can obtain more * information * @param string $permissions The set of permissions that your ConnectApp will * request * @return UpdateConnectAppOptions Options builder */ public static function update($authorizeRedirectUrl = Values::NONE, $companyName = Values::NONE, $deauthorizeCallbackMethod = Values::NONE, $deauthorizeCallbackUrl = Values::NONE, $description = Values::NONE, $friendlyName = Values::NONE, $homepageUrl = Values::NONE, $permissions = Values::NONE) { return new UpdateConnectAppOptions($authorizeRedirectUrl, $companyName, $deauthorizeCallbackMethod, $deauthorizeCallbackUrl, $description, $friendlyName, $homepageUrl, $permissions); } } class UpdateConnectAppOptions extends Options { /** * @param string $authorizeRedirectUrl The URL to redirect the user to after * authorization * @param string $companyName The company name to set for the Connect App * @param string $deauthorizeCallbackMethod The HTTP method to use when calling * deauthorize_callback_url * @param string $deauthorizeCallbackUrl The URL to call to de-authorize the * Connect App * @param string $description A description of the Connect App * @param string $friendlyName A string to describe the resource * @param string $homepageUrl A public URL where users can obtain more * information * @param string $permissions The set of permissions that your ConnectApp will * request */ public function __construct($authorizeRedirectUrl = Values::NONE, $companyName = Values::NONE, $deauthorizeCallbackMethod = Values::NONE, $deauthorizeCallbackUrl = Values::NONE, $description = Values::NONE, $friendlyName = Values::NONE, $homepageUrl = Values::NONE, $permissions = Values::NONE) { $this->options['authorizeRedirectUrl'] = $authorizeRedirectUrl; $this->options['companyName'] = $companyName; $this->options['deauthorizeCallbackMethod'] = $deauthorizeCallbackMethod; $this->options['deauthorizeCallbackUrl'] = $deauthorizeCallbackUrl; $this->options['description'] = $description; $this->options['friendlyName'] = $friendlyName; $this->options['homepageUrl'] = $homepageUrl; $this->options['permissions'] = $permissions; } /** * The URL to redirect the user to after we authenticate the user and obtain authorization to access the Connect App. * * @param string $authorizeRedirectUrl The URL to redirect the user to after * authorization * @return $this Fluent Builder */ public function setAuthorizeRedirectUrl($authorizeRedirectUrl) { $this->options['authorizeRedirectUrl'] = $authorizeRedirectUrl; return $this; } /** * The company name to set for the Connect App. * * @param string $companyName The company name to set for the Connect App * @return $this Fluent Builder */ public function setCompanyName($companyName) { $this->options['companyName'] = $companyName; return $this; } /** * The HTTP method to use when calling `deauthorize_callback_url`. * * @param string $deauthorizeCallbackMethod The HTTP method to use when calling * deauthorize_callback_url * @return $this Fluent Builder */ public function setDeauthorizeCallbackMethod($deauthorizeCallbackMethod) { $this->options['deauthorizeCallbackMethod'] = $deauthorizeCallbackMethod; return $this; } /** * The URL to call using the `deauthorize_callback_method` to de-authorize the Connect App. * * @param string $deauthorizeCallbackUrl The URL to call to de-authorize the * Connect App * @return $this Fluent Builder */ public function setDeauthorizeCallbackUrl($deauthorizeCallbackUrl) { $this->options['deauthorizeCallbackUrl'] = $deauthorizeCallbackUrl; return $this; } /** * A description of the Connect App. * * @param string $description A description of the Connect App * @return $this Fluent Builder */ public function setDescription($description) { $this->options['description'] = $description; return $this; } /** * A descriptive string that you create to describe the resource. It can be up to 64 characters long. * * @param string $friendlyName A string to describe the resource * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * A public URL where users can obtain more information about this Connect App. * * @param string $homepageUrl A public URL where users can obtain more * information * @return $this Fluent Builder */ public function setHomepageUrl($homepageUrl) { $this->options['homepageUrl'] = $homepageUrl; return $this; } /** * A comma-separated list of the permissions you will request from the users of this ConnectApp. Can include: `get-all` and `post-all`. * * @param string $permissions The set of permissions that your ConnectApp will * request * @return $this Fluent Builder */ public function setPermissions($permissions) { $this->options['permissions'] = $permissions; 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.UpdateConnectAppOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/ApplicationList.php 0000644 00000015513 15002236443 0016731 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class ApplicationList extends ListResource { /** * Construct the ApplicationList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the Account that created the resource * @return \Twilio\Rest\Api\V2010\Account\ApplicationList */ public function __construct(Version $version, $accountSid) { parent::__construct($version); // Path Solution $this->solution = array('accountSid' => $accountSid, ); $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/Applications.json'; } /** * Create a new ApplicationInstance * * @param array|Options $options Optional Arguments * @return ApplicationInstance Newly created ApplicationInstance * @throws TwilioException When an HTTP error occurs. */ public function create($options = array()) { $options = new Values($options); $data = Values::of(array( 'ApiVersion' => $options['apiVersion'], 'VoiceUrl' => $options['voiceUrl'], 'VoiceMethod' => $options['voiceMethod'], 'VoiceFallbackUrl' => $options['voiceFallbackUrl'], 'VoiceFallbackMethod' => $options['voiceFallbackMethod'], 'StatusCallback' => $options['statusCallback'], 'StatusCallbackMethod' => $options['statusCallbackMethod'], 'VoiceCallerIdLookup' => Serialize::booleanToString($options['voiceCallerIdLookup']), 'SmsUrl' => $options['smsUrl'], 'SmsMethod' => $options['smsMethod'], 'SmsFallbackUrl' => $options['smsFallbackUrl'], 'SmsFallbackMethod' => $options['smsFallbackMethod'], 'SmsStatusCallback' => $options['smsStatusCallback'], 'MessageStatusCallback' => $options['messageStatusCallback'], 'FriendlyName' => $options['friendlyName'], )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new ApplicationInstance($this->version, $payload, $this->solution['accountSid']); } /** * Streams ApplicationInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($options = array(), $limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads ApplicationInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return ApplicationInstance[] Array of results */ public function read($options = array(), $limit = null, $pageSize = null) { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Retrieve a single page of ApplicationInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of ApplicationInstance */ public function page($options = array(), $pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $options = new Values($options); $params = Values::of(array( 'FriendlyName' => $options['friendlyName'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new ApplicationPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of ApplicationInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of ApplicationInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new ApplicationPage($this->version, $response, $this->solution); } /** * Constructs a ApplicationContext * * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Api\V2010\Account\ApplicationContext */ public function getContext($sid) { return new ApplicationContext($this->version, $this->solution['accountSid'], $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.ApplicationList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Usage/TriggerInstance.php 0000644 00000012337 15002236443 0017767 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Usage; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property string $apiVersion * @property string $callbackMethod * @property string $callbackUrl * @property string $currentValue * @property \DateTime $dateCreated * @property \DateTime $dateFired * @property \DateTime $dateUpdated * @property string $friendlyName * @property string $recurring * @property string $sid * @property string $triggerBy * @property string $triggerValue * @property string $uri * @property string $usageCategory * @property string $usageRecordUri */ class TriggerInstance extends InstanceResource { /** * Initialize the TriggerInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid A 34 character string that uniquely identifies * this resource. * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Api\V2010\Account\Usage\TriggerInstance */ public function __construct(Version $version, array $payload, $accountSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'accountSid' => Values::array_get($payload, 'account_sid'), 'apiVersion' => Values::array_get($payload, 'api_version'), 'callbackMethod' => Values::array_get($payload, 'callback_method'), 'callbackUrl' => Values::array_get($payload, 'callback_url'), 'currentValue' => Values::array_get($payload, 'current_value'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateFired' => Deserialize::dateTime(Values::array_get($payload, 'date_fired')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'recurring' => Values::array_get($payload, 'recurring'), 'sid' => Values::array_get($payload, 'sid'), 'triggerBy' => Values::array_get($payload, 'trigger_by'), 'triggerValue' => Values::array_get($payload, 'trigger_value'), 'uri' => Values::array_get($payload, 'uri'), 'usageCategory' => Values::array_get($payload, 'usage_category'), 'usageRecordUri' => Values::array_get($payload, 'usage_record_uri'), ); $this->solution = array('accountSid' => $accountSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Api\V2010\Account\Usage\TriggerContext Context for this * TriggerInstance */ protected function proxy() { if (!$this->context) { $this->context = new TriggerContext( $this->version, $this->solution['accountSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch a TriggerInstance * * @return TriggerInstance Fetched TriggerInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Update the TriggerInstance * * @param array|Options $options Optional Arguments * @return TriggerInstance Updated TriggerInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Deletes the TriggerInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.TriggerInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Usage/TriggerContext.php 0000644 00000006062 15002236443 0017645 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Usage; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Values; use Twilio\Version; class TriggerContext extends InstanceContext { /** * Initialize the TriggerContext * * @param \Twilio\Version $version Version that contains the resource * @param string $accountSid The SID of the Account that created the resource * to fetch * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Api\V2010\Account\Usage\TriggerContext */ public function __construct(Version $version, $accountSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array('accountSid' => $accountSid, 'sid' => $sid, ); $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/Usage/Triggers/' . \rawurlencode($sid) . '.json'; } /** * Fetch a TriggerInstance * * @return TriggerInstance Fetched TriggerInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new TriggerInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['sid'] ); } /** * Update the TriggerInstance * * @param array|Options $options Optional Arguments * @return TriggerInstance Updated TriggerInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { $options = new Values($options); $data = Values::of(array( 'CallbackMethod' => $options['callbackMethod'], 'CallbackUrl' => $options['callbackUrl'], 'FriendlyName' => $options['friendlyName'], )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new TriggerInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['sid'] ); } /** * Deletes the TriggerInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.TriggerContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Usage/RecordInstance.php 0000644 00000006352 15002236443 0017602 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Usage; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property string $apiVersion * @property string $asOf * @property string $category * @property string $count * @property string $countUnit * @property string $description * @property \DateTime $endDate * @property string $price * @property string $priceUnit * @property \DateTime $startDate * @property array $subresourceUris * @property string $uri * @property string $usage * @property string $usageUnit */ class RecordInstance extends InstanceResource { /** * Initialize the RecordInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid A 34 character string that uniquely identifies * this resource. * @return \Twilio\Rest\Api\V2010\Account\Usage\RecordInstance */ public function __construct(Version $version, array $payload, $accountSid) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'accountSid' => Values::array_get($payload, 'account_sid'), 'apiVersion' => Values::array_get($payload, 'api_version'), 'asOf' => Values::array_get($payload, 'as_of'), 'category' => Values::array_get($payload, 'category'), 'count' => Values::array_get($payload, 'count'), 'countUnit' => Values::array_get($payload, 'count_unit'), 'description' => Values::array_get($payload, 'description'), 'endDate' => Deserialize::dateTime(Values::array_get($payload, 'end_date')), 'price' => Values::array_get($payload, 'price'), 'priceUnit' => Values::array_get($payload, 'price_unit'), 'startDate' => Deserialize::dateTime(Values::array_get($payload, 'start_date')), 'subresourceUris' => Values::array_get($payload, 'subresource_uris'), 'uri' => Values::array_get($payload, 'uri'), 'usage' => Values::array_get($payload, 'usage'), 'usageUnit' => Values::array_get($payload, 'usage_unit'), ); $this->solution = array('accountSid' => $accountSid, ); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.RecordInstance]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/TodayInstance.php 0000644 00000006364 15002236443 0020665 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Usage\Record; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property string $apiVersion * @property string $asOf * @property string $category * @property string $count * @property string $countUnit * @property string $description * @property \DateTime $endDate * @property string $price * @property string $priceUnit * @property \DateTime $startDate * @property array $subresourceUris * @property string $uri * @property string $usage * @property string $usageUnit */ class TodayInstance extends InstanceResource { /** * Initialize the TodayInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid A 34 character string that uniquely identifies * this resource. * @return \Twilio\Rest\Api\V2010\Account\Usage\Record\TodayInstance */ public function __construct(Version $version, array $payload, $accountSid) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'accountSid' => Values::array_get($payload, 'account_sid'), 'apiVersion' => Values::array_get($payload, 'api_version'), 'asOf' => Values::array_get($payload, 'as_of'), 'category' => Values::array_get($payload, 'category'), 'count' => Values::array_get($payload, 'count'), 'countUnit' => Values::array_get($payload, 'count_unit'), 'description' => Values::array_get($payload, 'description'), 'endDate' => Deserialize::dateTime(Values::array_get($payload, 'end_date')), 'price' => Values::array_get($payload, 'price'), 'priceUnit' => Values::array_get($payload, 'price_unit'), 'startDate' => Deserialize::dateTime(Values::array_get($payload, 'start_date')), 'subresourceUris' => Values::array_get($payload, 'subresource_uris'), 'uri' => Values::array_get($payload, 'uri'), 'usage' => Values::array_get($payload, 'usage'), 'usageUnit' => Values::array_get($payload, 'usage_unit'), ); $this->solution = array('accountSid' => $accountSid, ); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.TodayInstance]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/YearlyList.php 0000644 00000012261 15002236443 0020212 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Usage\Record; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class YearlyList extends ListResource { /** * Construct the YearlyList * * @param Version $version Version that contains the resource * @param string $accountSid A 34 character string that uniquely identifies * this resource. * @return \Twilio\Rest\Api\V2010\Account\Usage\Record\YearlyList */ public function __construct(Version $version, $accountSid) { parent::__construct($version); // Path Solution $this->solution = array('accountSid' => $accountSid, ); $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/Usage/Records/Yearly.json'; } /** * Streams YearlyInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($options = array(), $limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads YearlyInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return YearlyInstance[] Array of results */ public function read($options = array(), $limit = null, $pageSize = null) { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Retrieve a single page of YearlyInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of YearlyInstance */ public function page($options = array(), $pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $options = new Values($options); $params = Values::of(array( 'Category' => $options['category'], 'StartDate' => Serialize::iso8601Date($options['startDate']), 'EndDate' => Serialize::iso8601Date($options['endDate']), 'IncludeSubaccounts' => Serialize::booleanToString($options['includeSubaccounts']), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new YearlyPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of YearlyInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of YearlyInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new YearlyPage($this->version, $response, $this->solution); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.YearlyList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/YearlyOptions.php 0000644 00000011123 15002236443 0020726 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Usage\Record; use Twilio\Options; use Twilio\Values; abstract class YearlyOptions { /** * @param string $category The usage category of the UsageRecord resources to * read * @param \DateTime $startDate Only include usage that has occurred on or after * this date * @param \DateTime $endDate Only include usage that occurred on or before this * date * @param bool $includeSubaccounts Whether to include usage from the master * account and all its subaccounts * @return ReadYearlyOptions Options builder */ public static function read($category = Values::NONE, $startDate = Values::NONE, $endDate = Values::NONE, $includeSubaccounts = Values::NONE) { return new ReadYearlyOptions($category, $startDate, $endDate, $includeSubaccounts); } } class ReadYearlyOptions extends Options { /** * @param string $category The usage category of the UsageRecord resources to * read * @param \DateTime $startDate Only include usage that has occurred on or after * this date * @param \DateTime $endDate Only include usage that occurred on or before this * date * @param bool $includeSubaccounts Whether to include usage from the master * account and all its subaccounts */ public function __construct($category = Values::NONE, $startDate = Values::NONE, $endDate = Values::NONE, $includeSubaccounts = Values::NONE) { $this->options['category'] = $category; $this->options['startDate'] = $startDate; $this->options['endDate'] = $endDate; $this->options['includeSubaccounts'] = $includeSubaccounts; } /** * The [usage category](https://www.twilio.com/docs/usage/api/usage-record#usage-categories) of the UsageRecord resources to read. Only UsageRecord resources in the specified category are retrieved. * * @param string $category The usage category of the UsageRecord resources to * read * @return $this Fluent Builder */ public function setCategory($category) { $this->options['category'] = $category; return $this; } /** * Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `-30days`, which will set the start date to be 30 days before the current date. * * @param \DateTime $startDate Only include usage that has occurred on or after * this date * @return $this Fluent Builder */ public function setStartDate($startDate) { $this->options['startDate'] = $startDate; return $this; } /** * Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `+30days`, which will set the end date to 30 days from the current date. * * @param \DateTime $endDate Only include usage that occurred on or before this * date * @return $this Fluent Builder */ public function setEndDate($endDate) { $this->options['endDate'] = $endDate; return $this; } /** * Whether to include usage from the master account and all its subaccounts. Can be: `true` (the default) to include usage from the master account and all subaccounts or `false` to retrieve usage from only the specified account. * * @param bool $includeSubaccounts Whether to include usage from the master * account and all its subaccounts * @return $this Fluent Builder */ public function setIncludeSubaccounts($includeSubaccounts) { $this->options['includeSubaccounts'] = $includeSubaccounts; 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.ReadYearlyOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/TodayOptions.php 0000644 00000011116 15002236443 0020543 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Usage\Record; use Twilio\Options; use Twilio\Values; abstract class TodayOptions { /** * @param string $category The usage category of the UsageRecord resources to * read * @param \DateTime $startDate Only include usage that has occurred on or after * this date * @param \DateTime $endDate Only include usage that occurred on or before this * date * @param bool $includeSubaccounts Whether to include usage from the master * account and all its subaccounts * @return ReadTodayOptions Options builder */ public static function read($category = Values::NONE, $startDate = Values::NONE, $endDate = Values::NONE, $includeSubaccounts = Values::NONE) { return new ReadTodayOptions($category, $startDate, $endDate, $includeSubaccounts); } } class ReadTodayOptions extends Options { /** * @param string $category The usage category of the UsageRecord resources to * read * @param \DateTime $startDate Only include usage that has occurred on or after * this date * @param \DateTime $endDate Only include usage that occurred on or before this * date * @param bool $includeSubaccounts Whether to include usage from the master * account and all its subaccounts */ public function __construct($category = Values::NONE, $startDate = Values::NONE, $endDate = Values::NONE, $includeSubaccounts = Values::NONE) { $this->options['category'] = $category; $this->options['startDate'] = $startDate; $this->options['endDate'] = $endDate; $this->options['includeSubaccounts'] = $includeSubaccounts; } /** * The [usage category](https://www.twilio.com/docs/usage/api/usage-record#usage-categories) of the UsageRecord resources to read. Only UsageRecord resources in the specified category are retrieved. * * @param string $category The usage category of the UsageRecord resources to * read * @return $this Fluent Builder */ public function setCategory($category) { $this->options['category'] = $category; return $this; } /** * Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `-30days`, which will set the start date to be 30 days before the current date. * * @param \DateTime $startDate Only include usage that has occurred on or after * this date * @return $this Fluent Builder */ public function setStartDate($startDate) { $this->options['startDate'] = $startDate; return $this; } /** * Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `+30days`, which will set the end date to 30 days from the current date. * * @param \DateTime $endDate Only include usage that occurred on or before this * date * @return $this Fluent Builder */ public function setEndDate($endDate) { $this->options['endDate'] = $endDate; return $this; } /** * Whether to include usage from the master account and all its subaccounts. Can be: `true` (the default) to include usage from the master account and all subaccounts or `false` to retrieve usage from only the specified account. * * @param bool $includeSubaccounts Whether to include usage from the master * account and all its subaccounts * @return $this Fluent Builder */ public function setIncludeSubaccounts($includeSubaccounts) { $this->options['includeSubaccounts'] = $includeSubaccounts; 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.ReadTodayOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/LastMonthInstance.php 0000644 00000006404 15002236443 0021511 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Usage\Record; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property string $apiVersion * @property string $asOf * @property string $category * @property string $count * @property string $countUnit * @property string $description * @property \DateTime $endDate * @property string $price * @property string $priceUnit * @property \DateTime $startDate * @property array $subresourceUris * @property string $uri * @property string $usage * @property string $usageUnit */ class LastMonthInstance extends InstanceResource { /** * Initialize the LastMonthInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid A 34 character string that uniquely identifies * this resource. * @return \Twilio\Rest\Api\V2010\Account\Usage\Record\LastMonthInstance */ public function __construct(Version $version, array $payload, $accountSid) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'accountSid' => Values::array_get($payload, 'account_sid'), 'apiVersion' => Values::array_get($payload, 'api_version'), 'asOf' => Values::array_get($payload, 'as_of'), 'category' => Values::array_get($payload, 'category'), 'count' => Values::array_get($payload, 'count'), 'countUnit' => Values::array_get($payload, 'count_unit'), 'description' => Values::array_get($payload, 'description'), 'endDate' => Deserialize::dateTime(Values::array_get($payload, 'end_date')), 'price' => Values::array_get($payload, 'price'), 'priceUnit' => Values::array_get($payload, 'price_unit'), 'startDate' => Deserialize::dateTime(Values::array_get($payload, 'start_date')), 'subresourceUris' => Values::array_get($payload, 'subresource_uris'), 'uri' => Values::array_get($payload, 'uri'), 'usage' => Values::array_get($payload, 'usage'), 'usageUnit' => Values::array_get($payload, 'usage_unit'), ); $this->solution = array('accountSid' => $accountSid, ); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.LastMonthInstance]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/DailyPage.php 0000644 00000001374 15002236443 0017753 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Usage\Record; use Twilio\Page; class DailyPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new DailyInstance($this->version, $payload, $this->solution['accountSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.DailyPage]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/MonthlyPage.php 0000644 00000001402 15002236443 0020333 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Usage\Record; use Twilio\Page; class MonthlyPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new MonthlyInstance($this->version, $payload, $this->solution['accountSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.MonthlyPage]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/MonthlyOptions.php 0000644 00000011130 15002236443 0021111 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Usage\Record; use Twilio\Options; use Twilio\Values; abstract class MonthlyOptions { /** * @param string $category The usage category of the UsageRecord resources to * read * @param \DateTime $startDate Only include usage that has occurred on or after * this date * @param \DateTime $endDate Only include usage that occurred on or before this * date * @param bool $includeSubaccounts Whether to include usage from the master * account and all its subaccounts * @return ReadMonthlyOptions Options builder */ public static function read($category = Values::NONE, $startDate = Values::NONE, $endDate = Values::NONE, $includeSubaccounts = Values::NONE) { return new ReadMonthlyOptions($category, $startDate, $endDate, $includeSubaccounts); } } class ReadMonthlyOptions extends Options { /** * @param string $category The usage category of the UsageRecord resources to * read * @param \DateTime $startDate Only include usage that has occurred on or after * this date * @param \DateTime $endDate Only include usage that occurred on or before this * date * @param bool $includeSubaccounts Whether to include usage from the master * account and all its subaccounts */ public function __construct($category = Values::NONE, $startDate = Values::NONE, $endDate = Values::NONE, $includeSubaccounts = Values::NONE) { $this->options['category'] = $category; $this->options['startDate'] = $startDate; $this->options['endDate'] = $endDate; $this->options['includeSubaccounts'] = $includeSubaccounts; } /** * The [usage category](https://www.twilio.com/docs/usage/api/usage-record#usage-categories) of the UsageRecord resources to read. Only UsageRecord resources in the specified category are retrieved. * * @param string $category The usage category of the UsageRecord resources to * read * @return $this Fluent Builder */ public function setCategory($category) { $this->options['category'] = $category; return $this; } /** * Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `-30days`, which will set the start date to be 30 days before the current date. * * @param \DateTime $startDate Only include usage that has occurred on or after * this date * @return $this Fluent Builder */ public function setStartDate($startDate) { $this->options['startDate'] = $startDate; return $this; } /** * Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `+30days`, which will set the end date to 30 days from the current date. * * @param \DateTime $endDate Only include usage that occurred on or before this * date * @return $this Fluent Builder */ public function setEndDate($endDate) { $this->options['endDate'] = $endDate; return $this; } /** * Whether to include usage from the master account and all its subaccounts. Can be: `true` (the default) to include usage from the master account and all subaccounts or `false` to retrieve usage from only the specified account. * * @param bool $includeSubaccounts Whether to include usage from the master * account and all its subaccounts * @return $this Fluent Builder */ public function setIncludeSubaccounts($includeSubaccounts) { $this->options['includeSubaccounts'] = $includeSubaccounts; 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.ReadMonthlyOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/DailyInstance.php 0000644 00000006364 15002236443 0020647 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Usage\Record; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property string $apiVersion * @property string $asOf * @property string $category * @property string $count * @property string $countUnit * @property string $description * @property \DateTime $endDate * @property string $price * @property string $priceUnit * @property \DateTime $startDate * @property array $subresourceUris * @property string $uri * @property string $usage * @property string $usageUnit */ class DailyInstance extends InstanceResource { /** * Initialize the DailyInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid A 34 character string that uniquely identifies * this resource. * @return \Twilio\Rest\Api\V2010\Account\Usage\Record\DailyInstance */ public function __construct(Version $version, array $payload, $accountSid) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'accountSid' => Values::array_get($payload, 'account_sid'), 'apiVersion' => Values::array_get($payload, 'api_version'), 'asOf' => Values::array_get($payload, 'as_of'), 'category' => Values::array_get($payload, 'category'), 'count' => Values::array_get($payload, 'count'), 'countUnit' => Values::array_get($payload, 'count_unit'), 'description' => Values::array_get($payload, 'description'), 'endDate' => Deserialize::dateTime(Values::array_get($payload, 'end_date')), 'price' => Values::array_get($payload, 'price'), 'priceUnit' => Values::array_get($payload, 'price_unit'), 'startDate' => Deserialize::dateTime(Values::array_get($payload, 'start_date')), 'subresourceUris' => Values::array_get($payload, 'subresource_uris'), 'uri' => Values::array_get($payload, 'uri'), 'usage' => Values::array_get($payload, 'usage'), 'usageUnit' => Values::array_get($payload, 'usage_unit'), ); $this->solution = array('accountSid' => $accountSid, ); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.DailyInstance]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/AllTimeList.php 0000644 00000012277 15002236443 0020303 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Usage\Record; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class AllTimeList extends ListResource { /** * Construct the AllTimeList * * @param Version $version Version that contains the resource * @param string $accountSid A 34 character string that uniquely identifies * this resource. * @return \Twilio\Rest\Api\V2010\Account\Usage\Record\AllTimeList */ public function __construct(Version $version, $accountSid) { parent::__construct($version); // Path Solution $this->solution = array('accountSid' => $accountSid, ); $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/Usage/Records/AllTime.json'; } /** * Streams AllTimeInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($options = array(), $limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads AllTimeInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return AllTimeInstance[] Array of results */ public function read($options = array(), $limit = null, $pageSize = null) { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Retrieve a single page of AllTimeInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of AllTimeInstance */ public function page($options = array(), $pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $options = new Values($options); $params = Values::of(array( 'Category' => $options['category'], 'StartDate' => Serialize::iso8601Date($options['startDate']), 'EndDate' => Serialize::iso8601Date($options['endDate']), 'IncludeSubaccounts' => Serialize::booleanToString($options['includeSubaccounts']), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new AllTimePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of AllTimeInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of AllTimeInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new AllTimePage($this->version, $response, $this->solution); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.AllTimeList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/DailyOptions.php 0000644 00000011116 15002236443 0020525 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Usage\Record; use Twilio\Options; use Twilio\Values; abstract class DailyOptions { /** * @param string $category The usage category of the UsageRecord resources to * read * @param \DateTime $startDate Only include usage that has occurred on or after * this date * @param \DateTime $endDate Only include usage that occurred on or before this * date * @param bool $includeSubaccounts Whether to include usage from the master * account and all its subaccounts * @return ReadDailyOptions Options builder */ public static function read($category = Values::NONE, $startDate = Values::NONE, $endDate = Values::NONE, $includeSubaccounts = Values::NONE) { return new ReadDailyOptions($category, $startDate, $endDate, $includeSubaccounts); } } class ReadDailyOptions extends Options { /** * @param string $category The usage category of the UsageRecord resources to * read * @param \DateTime $startDate Only include usage that has occurred on or after * this date * @param \DateTime $endDate Only include usage that occurred on or before this * date * @param bool $includeSubaccounts Whether to include usage from the master * account and all its subaccounts */ public function __construct($category = Values::NONE, $startDate = Values::NONE, $endDate = Values::NONE, $includeSubaccounts = Values::NONE) { $this->options['category'] = $category; $this->options['startDate'] = $startDate; $this->options['endDate'] = $endDate; $this->options['includeSubaccounts'] = $includeSubaccounts; } /** * The [usage category](https://www.twilio.com/docs/usage/api/usage-record#usage-categories) of the UsageRecord resources to read. Only UsageRecord resources in the specified category are retrieved. * * @param string $category The usage category of the UsageRecord resources to * read * @return $this Fluent Builder */ public function setCategory($category) { $this->options['category'] = $category; return $this; } /** * Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `-30days`, which will set the start date to be 30 days before the current date. * * @param \DateTime $startDate Only include usage that has occurred on or after * this date * @return $this Fluent Builder */ public function setStartDate($startDate) { $this->options['startDate'] = $startDate; return $this; } /** * Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `+30days`, which will set the end date to 30 days from the current date. * * @param \DateTime $endDate Only include usage that occurred on or before this * date * @return $this Fluent Builder */ public function setEndDate($endDate) { $this->options['endDate'] = $endDate; return $this; } /** * Whether to include usage from the master account and all its subaccounts. Can be: `true` (the default) to include usage from the master account and all subaccounts or `false` to retrieve usage from only the specified account. * * @param bool $includeSubaccounts Whether to include usage from the master * account and all its subaccounts * @return $this Fluent Builder */ public function setIncludeSubaccounts($includeSubaccounts) { $this->options['includeSubaccounts'] = $includeSubaccounts; 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.ReadDailyOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/LastMonthList.php 0000644 00000012333 15002236443 0020656 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Usage\Record; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class LastMonthList extends ListResource { /** * Construct the LastMonthList * * @param Version $version Version that contains the resource * @param string $accountSid A 34 character string that uniquely identifies * this resource. * @return \Twilio\Rest\Api\V2010\Account\Usage\Record\LastMonthList */ public function __construct(Version $version, $accountSid) { parent::__construct($version); // Path Solution $this->solution = array('accountSid' => $accountSid, ); $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/Usage/Records/LastMonth.json'; } /** * Streams LastMonthInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($options = array(), $limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads LastMonthInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return LastMonthInstance[] Array of results */ public function read($options = array(), $limit = null, $pageSize = null) { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Retrieve a single page of LastMonthInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of LastMonthInstance */ public function page($options = array(), $pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $options = new Values($options); $params = Values::of(array( 'Category' => $options['category'], 'StartDate' => Serialize::iso8601Date($options['startDate']), 'EndDate' => Serialize::iso8601Date($options['endDate']), 'IncludeSubaccounts' => Serialize::booleanToString($options['includeSubaccounts']), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new LastMonthPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of LastMonthInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of LastMonthInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new LastMonthPage($this->version, $response, $this->solution); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.LastMonthList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/YearlyInstance.php 0000644 00000006370 15002236443 0021047 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Usage\Record; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property string $apiVersion * @property string $asOf * @property string $category * @property string $count * @property string $countUnit * @property string $description * @property \DateTime $endDate * @property string $price * @property string $priceUnit * @property \DateTime $startDate * @property array $subresourceUris * @property string $uri * @property string $usage * @property string $usageUnit */ class YearlyInstance extends InstanceResource { /** * Initialize the YearlyInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid A 34 character string that uniquely identifies * this resource. * @return \Twilio\Rest\Api\V2010\Account\Usage\Record\YearlyInstance */ public function __construct(Version $version, array $payload, $accountSid) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'accountSid' => Values::array_get($payload, 'account_sid'), 'apiVersion' => Values::array_get($payload, 'api_version'), 'asOf' => Values::array_get($payload, 'as_of'), 'category' => Values::array_get($payload, 'category'), 'count' => Values::array_get($payload, 'count'), 'countUnit' => Values::array_get($payload, 'count_unit'), 'description' => Values::array_get($payload, 'description'), 'endDate' => Deserialize::dateTime(Values::array_get($payload, 'end_date')), 'price' => Values::array_get($payload, 'price'), 'priceUnit' => Values::array_get($payload, 'price_unit'), 'startDate' => Deserialize::dateTime(Values::array_get($payload, 'start_date')), 'subresourceUris' => Values::array_get($payload, 'subresource_uris'), 'uri' => Values::array_get($payload, 'uri'), 'usage' => Values::array_get($payload, 'usage'), 'usageUnit' => Values::array_get($payload, 'usage_unit'), ); $this->solution = array('accountSid' => $accountSid, ); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.YearlyInstance]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/YesterdayInstance.php 0000644 00000006404 15002236443 0021551 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Usage\Record; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property string $apiVersion * @property string $asOf * @property string $category * @property string $count * @property string $countUnit * @property string $description * @property \DateTime $endDate * @property string $price * @property string $priceUnit * @property \DateTime $startDate * @property array $subresourceUris * @property string $uri * @property string $usage * @property string $usageUnit */ class YesterdayInstance extends InstanceResource { /** * Initialize the YesterdayInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid A 34 character string that uniquely identifies * this resource. * @return \Twilio\Rest\Api\V2010\Account\Usage\Record\YesterdayInstance */ public function __construct(Version $version, array $payload, $accountSid) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'accountSid' => Values::array_get($payload, 'account_sid'), 'apiVersion' => Values::array_get($payload, 'api_version'), 'asOf' => Values::array_get($payload, 'as_of'), 'category' => Values::array_get($payload, 'category'), 'count' => Values::array_get($payload, 'count'), 'countUnit' => Values::array_get($payload, 'count_unit'), 'description' => Values::array_get($payload, 'description'), 'endDate' => Deserialize::dateTime(Values::array_get($payload, 'end_date')), 'price' => Values::array_get($payload, 'price'), 'priceUnit' => Values::array_get($payload, 'price_unit'), 'startDate' => Deserialize::dateTime(Values::array_get($payload, 'start_date')), 'subresourceUris' => Values::array_get($payload, 'subresource_uris'), 'uri' => Values::array_get($payload, 'uri'), 'usage' => Values::array_get($payload, 'usage'), 'usageUnit' => Values::array_get($payload, 'usage_unit'), ); $this->solution = array('accountSid' => $accountSid, ); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.YesterdayInstance]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/AllTimePage.php 0000644 00000001402 15002236443 0020230 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Usage\Record; use Twilio\Page; class AllTimePage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new AllTimeInstance($this->version, $payload, $this->solution['accountSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.AllTimePage]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/ThisMonthOptions.php 0000644 00000011142 15002236443 0021377 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Usage\Record; use Twilio\Options; use Twilio\Values; abstract class ThisMonthOptions { /** * @param string $category The usage category of the UsageRecord resources to * read * @param \DateTime $startDate Only include usage that has occurred on or after * this date * @param \DateTime $endDate Only include usage that occurred on or before this * date * @param bool $includeSubaccounts Whether to include usage from the master * account and all its subaccounts * @return ReadThisMonthOptions Options builder */ public static function read($category = Values::NONE, $startDate = Values::NONE, $endDate = Values::NONE, $includeSubaccounts = Values::NONE) { return new ReadThisMonthOptions($category, $startDate, $endDate, $includeSubaccounts); } } class ReadThisMonthOptions extends Options { /** * @param string $category The usage category of the UsageRecord resources to * read * @param \DateTime $startDate Only include usage that has occurred on or after * this date * @param \DateTime $endDate Only include usage that occurred on or before this * date * @param bool $includeSubaccounts Whether to include usage from the master * account and all its subaccounts */ public function __construct($category = Values::NONE, $startDate = Values::NONE, $endDate = Values::NONE, $includeSubaccounts = Values::NONE) { $this->options['category'] = $category; $this->options['startDate'] = $startDate; $this->options['endDate'] = $endDate; $this->options['includeSubaccounts'] = $includeSubaccounts; } /** * The [usage category](https://www.twilio.com/docs/usage/api/usage-record#usage-categories) of the UsageRecord resources to read. Only UsageRecord resources in the specified category are retrieved. * * @param string $category The usage category of the UsageRecord resources to * read * @return $this Fluent Builder */ public function setCategory($category) { $this->options['category'] = $category; return $this; } /** * Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `-30days`, which will set the start date to be 30 days before the current date. * * @param \DateTime $startDate Only include usage that has occurred on or after * this date * @return $this Fluent Builder */ public function setStartDate($startDate) { $this->options['startDate'] = $startDate; return $this; } /** * Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `+30days`, which will set the end date to 30 days from the current date. * * @param \DateTime $endDate Only include usage that occurred on or before this * date * @return $this Fluent Builder */ public function setEndDate($endDate) { $this->options['endDate'] = $endDate; return $this; } /** * Whether to include usage from the master account and all its subaccounts. Can be: `true` (the default) to include usage from the master account and all subaccounts or `false` to retrieve usage from only the specified account. * * @param bool $includeSubaccounts Whether to include usage from the master * account and all its subaccounts * @return $this Fluent Builder */ public function setIncludeSubaccounts($includeSubaccounts) { $this->options['includeSubaccounts'] = $includeSubaccounts; 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.ReadThisMonthOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/AllTimeInstance.php 0000644 00000006374 15002236443 0021135 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Usage\Record; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property string $apiVersion * @property string $asOf * @property string $category * @property string $count * @property string $countUnit * @property string $description * @property \DateTime $endDate * @property string $price * @property string $priceUnit * @property \DateTime $startDate * @property array $subresourceUris * @property string $uri * @property string $usage * @property string $usageUnit */ class AllTimeInstance extends InstanceResource { /** * Initialize the AllTimeInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid A 34 character string that uniquely identifies * this resource. * @return \Twilio\Rest\Api\V2010\Account\Usage\Record\AllTimeInstance */ public function __construct(Version $version, array $payload, $accountSid) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'accountSid' => Values::array_get($payload, 'account_sid'), 'apiVersion' => Values::array_get($payload, 'api_version'), 'asOf' => Values::array_get($payload, 'as_of'), 'category' => Values::array_get($payload, 'category'), 'count' => Values::array_get($payload, 'count'), 'countUnit' => Values::array_get($payload, 'count_unit'), 'description' => Values::array_get($payload, 'description'), 'endDate' => Deserialize::dateTime(Values::array_get($payload, 'end_date')), 'price' => Values::array_get($payload, 'price'), 'priceUnit' => Values::array_get($payload, 'price_unit'), 'startDate' => Deserialize::dateTime(Values::array_get($payload, 'start_date')), 'subresourceUris' => Values::array_get($payload, 'subresource_uris'), 'uri' => Values::array_get($payload, 'uri'), 'usage' => Values::array_get($payload, 'usage'), 'usageUnit' => Values::array_get($payload, 'usage_unit'), ); $this->solution = array('accountSid' => $accountSid, ); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.AllTimeInstance]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/DailyList.php 0000644 00000012243 15002236443 0020007 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Usage\Record; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class DailyList extends ListResource { /** * Construct the DailyList * * @param Version $version Version that contains the resource * @param string $accountSid A 34 character string that uniquely identifies * this resource. * @return \Twilio\Rest\Api\V2010\Account\Usage\Record\DailyList */ public function __construct(Version $version, $accountSid) { parent::__construct($version); // Path Solution $this->solution = array('accountSid' => $accountSid, ); $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/Usage/Records/Daily.json'; } /** * Streams DailyInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($options = array(), $limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads DailyInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return DailyInstance[] Array of results */ public function read($options = array(), $limit = null, $pageSize = null) { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Retrieve a single page of DailyInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of DailyInstance */ public function page($options = array(), $pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $options = new Values($options); $params = Values::of(array( 'Category' => $options['category'], 'StartDate' => Serialize::iso8601Date($options['startDate']), 'EndDate' => Serialize::iso8601Date($options['endDate']), 'IncludeSubaccounts' => Serialize::booleanToString($options['includeSubaccounts']), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new DailyPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of DailyInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of DailyInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new DailyPage($this->version, $response, $this->solution); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.DailyList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/ThisMonthInstance.php 0000644 00000006404 15002236443 0021515 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Usage\Record; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property string $apiVersion * @property string $asOf * @property string $category * @property string $count * @property string $countUnit * @property string $description * @property \DateTime $endDate * @property string $price * @property string $priceUnit * @property \DateTime $startDate * @property array $subresourceUris * @property string $uri * @property string $usage * @property string $usageUnit */ class ThisMonthInstance extends InstanceResource { /** * Initialize the ThisMonthInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid A 34 character string that uniquely identifies * this resource. * @return \Twilio\Rest\Api\V2010\Account\Usage\Record\ThisMonthInstance */ public function __construct(Version $version, array $payload, $accountSid) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'accountSid' => Values::array_get($payload, 'account_sid'), 'apiVersion' => Values::array_get($payload, 'api_version'), 'asOf' => Values::array_get($payload, 'as_of'), 'category' => Values::array_get($payload, 'category'), 'count' => Values::array_get($payload, 'count'), 'countUnit' => Values::array_get($payload, 'count_unit'), 'description' => Values::array_get($payload, 'description'), 'endDate' => Deserialize::dateTime(Values::array_get($payload, 'end_date')), 'price' => Values::array_get($payload, 'price'), 'priceUnit' => Values::array_get($payload, 'price_unit'), 'startDate' => Deserialize::dateTime(Values::array_get($payload, 'start_date')), 'subresourceUris' => Values::array_get($payload, 'subresource_uris'), 'uri' => Values::array_get($payload, 'uri'), 'usage' => Values::array_get($payload, 'usage'), 'usageUnit' => Values::array_get($payload, 'usage_unit'), ); $this->solution = array('accountSid' => $accountSid, ); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.ThisMonthInstance]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/LastMonthOptions.php 0000644 00000011142 15002236443 0021373 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Usage\Record; use Twilio\Options; use Twilio\Values; abstract class LastMonthOptions { /** * @param string $category The usage category of the UsageRecord resources to * read * @param \DateTime $startDate Only include usage that has occurred on or after * this date * @param \DateTime $endDate Only include usage that occurred on or before this * date * @param bool $includeSubaccounts Whether to include usage from the master * account and all its subaccounts * @return ReadLastMonthOptions Options builder */ public static function read($category = Values::NONE, $startDate = Values::NONE, $endDate = Values::NONE, $includeSubaccounts = Values::NONE) { return new ReadLastMonthOptions($category, $startDate, $endDate, $includeSubaccounts); } } class ReadLastMonthOptions extends Options { /** * @param string $category The usage category of the UsageRecord resources to * read * @param \DateTime $startDate Only include usage that has occurred on or after * this date * @param \DateTime $endDate Only include usage that occurred on or before this * date * @param bool $includeSubaccounts Whether to include usage from the master * account and all its subaccounts */ public function __construct($category = Values::NONE, $startDate = Values::NONE, $endDate = Values::NONE, $includeSubaccounts = Values::NONE) { $this->options['category'] = $category; $this->options['startDate'] = $startDate; $this->options['endDate'] = $endDate; $this->options['includeSubaccounts'] = $includeSubaccounts; } /** * The [usage category](https://www.twilio.com/docs/usage/api/usage-record#usage-categories) of the UsageRecord resources to read. Only UsageRecord resources in the specified category are retrieved. * * @param string $category The usage category of the UsageRecord resources to * read * @return $this Fluent Builder */ public function setCategory($category) { $this->options['category'] = $category; return $this; } /** * Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `-30days`, which will set the start date to be 30 days before the current date. * * @param \DateTime $startDate Only include usage that has occurred on or after * this date * @return $this Fluent Builder */ public function setStartDate($startDate) { $this->options['startDate'] = $startDate; return $this; } /** * Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `+30days`, which will set the end date to 30 days from the current date. * * @param \DateTime $endDate Only include usage that occurred on or before this * date * @return $this Fluent Builder */ public function setEndDate($endDate) { $this->options['endDate'] = $endDate; return $this; } /** * Whether to include usage from the master account and all its subaccounts. Can be: `true` (the default) to include usage from the master account and all subaccounts or `false` to retrieve usage from only the specified account. * * @param bool $includeSubaccounts Whether to include usage from the master * account and all its subaccounts * @return $this Fluent Builder */ public function setIncludeSubaccounts($includeSubaccounts) { $this->options['includeSubaccounts'] = $includeSubaccounts; 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.ReadLastMonthOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/YearlyPage.php 0000644 00000001377 15002236443 0020161 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Usage\Record; use Twilio\Page; class YearlyPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new YearlyInstance($this->version, $payload, $this->solution['accountSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.YearlyPage]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/YesterdayOptions.php 0000644 00000011142 15002236443 0021433 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Usage\Record; use Twilio\Options; use Twilio\Values; abstract class YesterdayOptions { /** * @param string $category The usage category of the UsageRecord resources to * read * @param \DateTime $startDate Only include usage that has occurred on or after * this date * @param \DateTime $endDate Only include usage that occurred on or before this * date * @param bool $includeSubaccounts Whether to include usage from the master * account and all its subaccounts * @return ReadYesterdayOptions Options builder */ public static function read($category = Values::NONE, $startDate = Values::NONE, $endDate = Values::NONE, $includeSubaccounts = Values::NONE) { return new ReadYesterdayOptions($category, $startDate, $endDate, $includeSubaccounts); } } class ReadYesterdayOptions extends Options { /** * @param string $category The usage category of the UsageRecord resources to * read * @param \DateTime $startDate Only include usage that has occurred on or after * this date * @param \DateTime $endDate Only include usage that occurred on or before this * date * @param bool $includeSubaccounts Whether to include usage from the master * account and all its subaccounts */ public function __construct($category = Values::NONE, $startDate = Values::NONE, $endDate = Values::NONE, $includeSubaccounts = Values::NONE) { $this->options['category'] = $category; $this->options['startDate'] = $startDate; $this->options['endDate'] = $endDate; $this->options['includeSubaccounts'] = $includeSubaccounts; } /** * The [usage category](https://www.twilio.com/docs/usage/api/usage-record#usage-categories) of the UsageRecord resources to read. Only UsageRecord resources in the specified category are retrieved. * * @param string $category The usage category of the UsageRecord resources to * read * @return $this Fluent Builder */ public function setCategory($category) { $this->options['category'] = $category; return $this; } /** * Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `-30days`, which will set the start date to be 30 days before the current date. * * @param \DateTime $startDate Only include usage that has occurred on or after * this date * @return $this Fluent Builder */ public function setStartDate($startDate) { $this->options['startDate'] = $startDate; return $this; } /** * Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `+30days`, which will set the end date to 30 days from the current date. * * @param \DateTime $endDate Only include usage that occurred on or before this * date * @return $this Fluent Builder */ public function setEndDate($endDate) { $this->options['endDate'] = $endDate; return $this; } /** * Whether to include usage from the master account and all its subaccounts. Can be: `true` (the default) to include usage from the master account and all subaccounts or `false` to retrieve usage from only the specified account. * * @param bool $includeSubaccounts Whether to include usage from the master * account and all its subaccounts * @return $this Fluent Builder */ public function setIncludeSubaccounts($includeSubaccounts) { $this->options['includeSubaccounts'] = $includeSubaccounts; 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.ReadYesterdayOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/TodayList.php 0000644 00000012243 15002236443 0020025 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Usage\Record; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class TodayList extends ListResource { /** * Construct the TodayList * * @param Version $version Version that contains the resource * @param string $accountSid A 34 character string that uniquely identifies * this resource. * @return \Twilio\Rest\Api\V2010\Account\Usage\Record\TodayList */ public function __construct(Version $version, $accountSid) { parent::__construct($version); // Path Solution $this->solution = array('accountSid' => $accountSid, ); $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/Usage/Records/Today.json'; } /** * Streams TodayInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($options = array(), $limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads TodayInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return TodayInstance[] Array of results */ public function read($options = array(), $limit = null, $pageSize = null) { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Retrieve a single page of TodayInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of TodayInstance */ public function page($options = array(), $pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $options = new Values($options); $params = Values::of(array( 'Category' => $options['category'], 'StartDate' => Serialize::iso8601Date($options['startDate']), 'EndDate' => Serialize::iso8601Date($options['endDate']), 'IncludeSubaccounts' => Serialize::booleanToString($options['includeSubaccounts']), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new TodayPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of TodayInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of TodayInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new TodayPage($this->version, $response, $this->solution); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.TodayList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/YesterdayList.php 0000644 00000012333 15002236443 0020716 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Usage\Record; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class YesterdayList extends ListResource { /** * Construct the YesterdayList * * @param Version $version Version that contains the resource * @param string $accountSid A 34 character string that uniquely identifies * this resource. * @return \Twilio\Rest\Api\V2010\Account\Usage\Record\YesterdayList */ public function __construct(Version $version, $accountSid) { parent::__construct($version); // Path Solution $this->solution = array('accountSid' => $accountSid, ); $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/Usage/Records/Yesterday.json'; } /** * Streams YesterdayInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($options = array(), $limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads YesterdayInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return YesterdayInstance[] Array of results */ public function read($options = array(), $limit = null, $pageSize = null) { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Retrieve a single page of YesterdayInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of YesterdayInstance */ public function page($options = array(), $pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $options = new Values($options); $params = Values::of(array( 'Category' => $options['category'], 'StartDate' => Serialize::iso8601Date($options['startDate']), 'EndDate' => Serialize::iso8601Date($options['endDate']), 'IncludeSubaccounts' => Serialize::booleanToString($options['includeSubaccounts']), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new YesterdayPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of YesterdayInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of YesterdayInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new YesterdayPage($this->version, $response, $this->solution); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.YesterdayList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/ThisMonthPage.php 0000644 00000001410 15002236443 0020615 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Usage\Record; use Twilio\Page; class ThisMonthPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new ThisMonthInstance($this->version, $payload, $this->solution['accountSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.ThisMonthPage]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/LastMonthPage.php 0000644 00000001410 15002236443 0020611 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Usage\Record; use Twilio\Page; class LastMonthPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new LastMonthInstance($this->version, $payload, $this->solution['accountSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.LastMonthPage]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/AllTimeOptions.php 0000644 00000011130 15002236443 0021006 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Usage\Record; use Twilio\Options; use Twilio\Values; abstract class AllTimeOptions { /** * @param string $category The usage category of the UsageRecord resources to * read * @param \DateTime $startDate Only include usage that has occurred on or after * this date * @param \DateTime $endDate Only include usage that occurred on or before this * date * @param bool $includeSubaccounts Whether to include usage from the master * account and all its subaccounts * @return ReadAllTimeOptions Options builder */ public static function read($category = Values::NONE, $startDate = Values::NONE, $endDate = Values::NONE, $includeSubaccounts = Values::NONE) { return new ReadAllTimeOptions($category, $startDate, $endDate, $includeSubaccounts); } } class ReadAllTimeOptions extends Options { /** * @param string $category The usage category of the UsageRecord resources to * read * @param \DateTime $startDate Only include usage that has occurred on or after * this date * @param \DateTime $endDate Only include usage that occurred on or before this * date * @param bool $includeSubaccounts Whether to include usage from the master * account and all its subaccounts */ public function __construct($category = Values::NONE, $startDate = Values::NONE, $endDate = Values::NONE, $includeSubaccounts = Values::NONE) { $this->options['category'] = $category; $this->options['startDate'] = $startDate; $this->options['endDate'] = $endDate; $this->options['includeSubaccounts'] = $includeSubaccounts; } /** * The [usage category](https://www.twilio.com/docs/usage/api/usage-record#usage-categories) of the UsageRecord resources to read. Only UsageRecord resources in the specified category are retrieved. * * @param string $category The usage category of the UsageRecord resources to * read * @return $this Fluent Builder */ public function setCategory($category) { $this->options['category'] = $category; return $this; } /** * Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `-30days`, which will set the start date to be 30 days before the current date. * * @param \DateTime $startDate Only include usage that has occurred on or after * this date * @return $this Fluent Builder */ public function setStartDate($startDate) { $this->options['startDate'] = $startDate; return $this; } /** * Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `+30days`, which will set the end date to 30 days from the current date. * * @param \DateTime $endDate Only include usage that occurred on or before this * date * @return $this Fluent Builder */ public function setEndDate($endDate) { $this->options['endDate'] = $endDate; return $this; } /** * Whether to include usage from the master account and all its subaccounts. Can be: `true` (the default) to include usage from the master account and all subaccounts or `false` to retrieve usage from only the specified account. * * @param bool $includeSubaccounts Whether to include usage from the master * account and all its subaccounts * @return $this Fluent Builder */ public function setIncludeSubaccounts($includeSubaccounts) { $this->options['includeSubaccounts'] = $includeSubaccounts; 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.ReadAllTimeOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/MonthlyInstance.php 0000644 00000006374 15002236443 0021240 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Usage\Record; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property string $apiVersion * @property string $asOf * @property string $category * @property string $count * @property string $countUnit * @property string $description * @property \DateTime $endDate * @property string $price * @property string $priceUnit * @property \DateTime $startDate * @property array $subresourceUris * @property string $uri * @property string $usage * @property string $usageUnit */ class MonthlyInstance extends InstanceResource { /** * Initialize the MonthlyInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid A 34 character string that uniquely identifies * this resource. * @return \Twilio\Rest\Api\V2010\Account\Usage\Record\MonthlyInstance */ public function __construct(Version $version, array $payload, $accountSid) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'accountSid' => Values::array_get($payload, 'account_sid'), 'apiVersion' => Values::array_get($payload, 'api_version'), 'asOf' => Values::array_get($payload, 'as_of'), 'category' => Values::array_get($payload, 'category'), 'count' => Values::array_get($payload, 'count'), 'countUnit' => Values::array_get($payload, 'count_unit'), 'description' => Values::array_get($payload, 'description'), 'endDate' => Deserialize::dateTime(Values::array_get($payload, 'end_date')), 'price' => Values::array_get($payload, 'price'), 'priceUnit' => Values::array_get($payload, 'price_unit'), 'startDate' => Deserialize::dateTime(Values::array_get($payload, 'start_date')), 'subresourceUris' => Values::array_get($payload, 'subresource_uris'), 'uri' => Values::array_get($payload, 'uri'), 'usage' => Values::array_get($payload, 'usage'), 'usageUnit' => Values::array_get($payload, 'usage_unit'), ); $this->solution = array('accountSid' => $accountSid, ); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.MonthlyInstance]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/TodayPage.php 0000644 00000001374 15002236443 0017771 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Usage\Record; use Twilio\Page; class TodayPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new TodayInstance($this->version, $payload, $this->solution['accountSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.TodayPage]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/YesterdayPage.php 0000644 00000001410 15002236443 0020651 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Usage\Record; use Twilio\Page; class YesterdayPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new YesterdayInstance($this->version, $payload, $this->solution['accountSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.YesterdayPage]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/MonthlyList.php 0000644 00000012277 15002236443 0020406 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Usage\Record; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class MonthlyList extends ListResource { /** * Construct the MonthlyList * * @param Version $version Version that contains the resource * @param string $accountSid A 34 character string that uniquely identifies * this resource. * @return \Twilio\Rest\Api\V2010\Account\Usage\Record\MonthlyList */ public function __construct(Version $version, $accountSid) { parent::__construct($version); // Path Solution $this->solution = array('accountSid' => $accountSid, ); $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/Usage/Records/Monthly.json'; } /** * Streams MonthlyInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($options = array(), $limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads MonthlyInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return MonthlyInstance[] Array of results */ public function read($options = array(), $limit = null, $pageSize = null) { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Retrieve a single page of MonthlyInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of MonthlyInstance */ public function page($options = array(), $pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $options = new Values($options); $params = Values::of(array( 'Category' => $options['category'], 'StartDate' => Serialize::iso8601Date($options['startDate']), 'EndDate' => Serialize::iso8601Date($options['endDate']), 'IncludeSubaccounts' => Serialize::booleanToString($options['includeSubaccounts']), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new MonthlyPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of MonthlyInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of MonthlyInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new MonthlyPage($this->version, $response, $this->solution); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.MonthlyList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Usage/Record/ThisMonthList.php 0000644 00000012333 15002236443 0020662 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Usage\Record; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class ThisMonthList extends ListResource { /** * Construct the ThisMonthList * * @param Version $version Version that contains the resource * @param string $accountSid A 34 character string that uniquely identifies * this resource. * @return \Twilio\Rest\Api\V2010\Account\Usage\Record\ThisMonthList */ public function __construct(Version $version, $accountSid) { parent::__construct($version); // Path Solution $this->solution = array('accountSid' => $accountSid, ); $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/Usage/Records/ThisMonth.json'; } /** * Streams ThisMonthInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($options = array(), $limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads ThisMonthInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return ThisMonthInstance[] Array of results */ public function read($options = array(), $limit = null, $pageSize = null) { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Retrieve a single page of ThisMonthInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of ThisMonthInstance */ public function page($options = array(), $pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $options = new Values($options); $params = Values::of(array( 'Category' => $options['category'], 'StartDate' => Serialize::iso8601Date($options['startDate']), 'EndDate' => Serialize::iso8601Date($options['endDate']), 'IncludeSubaccounts' => Serialize::booleanToString($options['includeSubaccounts']), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new ThisMonthPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of ThisMonthInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of ThisMonthInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new ThisMonthPage($this->version, $response, $this->solution); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.ThisMonthList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Usage/TriggerPage.php 0000644 00000001373 15002236443 0017075 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Usage; use Twilio\Page; class TriggerPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new TriggerInstance($this->version, $payload, $this->solution['accountSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.TriggerPage]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Usage/RecordOptions.php 0000644 00000011114 15002236443 0017461 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Usage; use Twilio\Options; use Twilio\Values; abstract class RecordOptions { /** * @param string $category The usage category of the UsageRecord resources to * read * @param \DateTime $startDate Only include usage that has occurred on or after * this date * @param \DateTime $endDate Only include usage that occurred on or before this * date * @param bool $includeSubaccounts Whether to include usage from the master * account and all its subaccounts * @return ReadRecordOptions Options builder */ public static function read($category = Values::NONE, $startDate = Values::NONE, $endDate = Values::NONE, $includeSubaccounts = Values::NONE) { return new ReadRecordOptions($category, $startDate, $endDate, $includeSubaccounts); } } class ReadRecordOptions extends Options { /** * @param string $category The usage category of the UsageRecord resources to * read * @param \DateTime $startDate Only include usage that has occurred on or after * this date * @param \DateTime $endDate Only include usage that occurred on or before this * date * @param bool $includeSubaccounts Whether to include usage from the master * account and all its subaccounts */ public function __construct($category = Values::NONE, $startDate = Values::NONE, $endDate = Values::NONE, $includeSubaccounts = Values::NONE) { $this->options['category'] = $category; $this->options['startDate'] = $startDate; $this->options['endDate'] = $endDate; $this->options['includeSubaccounts'] = $includeSubaccounts; } /** * The [usage category](https://www.twilio.com/docs/usage/api/usage-record#usage-categories) of the UsageRecord resources to read. Only UsageRecord resources in the specified category are retrieved. * * @param string $category The usage category of the UsageRecord resources to * read * @return $this Fluent Builder */ public function setCategory($category) { $this->options['category'] = $category; return $this; } /** * Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `-30days`, which will set the start date to be 30 days before the current date. * * @param \DateTime $startDate Only include usage that has occurred on or after * this date * @return $this Fluent Builder */ public function setStartDate($startDate) { $this->options['startDate'] = $startDate; return $this; } /** * Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `+30days`, which will set the end date to 30 days from the current date. * * @param \DateTime $endDate Only include usage that occurred on or before this * date * @return $this Fluent Builder */ public function setEndDate($endDate) { $this->options['endDate'] = $endDate; return $this; } /** * Whether to include usage from the master account and all its subaccounts. Can be: `true` (the default) to include usage from the master account and all subaccounts or `false` to retrieve usage from only the specified account. * * @param bool $includeSubaccounts Whether to include usage from the master * account and all its subaccounts * @return $this Fluent Builder */ public function setIncludeSubaccounts($includeSubaccounts) { $this->options['includeSubaccounts'] = $includeSubaccounts; 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.ReadRecordOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Usage/RecordList.php 0000644 00000023150 15002236443 0016744 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Usage; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Rest\Api\V2010\Account\Usage\Record\AllTimeList; use Twilio\Rest\Api\V2010\Account\Usage\Record\DailyList; use Twilio\Rest\Api\V2010\Account\Usage\Record\LastMonthList; use Twilio\Rest\Api\V2010\Account\Usage\Record\MonthlyList; use Twilio\Rest\Api\V2010\Account\Usage\Record\ThisMonthList; use Twilio\Rest\Api\V2010\Account\Usage\Record\TodayList; use Twilio\Rest\Api\V2010\Account\Usage\Record\YearlyList; use Twilio\Rest\Api\V2010\Account\Usage\Record\YesterdayList; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * @property \Twilio\Rest\Api\V2010\Account\Usage\Record\AllTimeList $allTime * @property \Twilio\Rest\Api\V2010\Account\Usage\Record\DailyList $daily * @property \Twilio\Rest\Api\V2010\Account\Usage\Record\LastMonthList $lastMonth * @property \Twilio\Rest\Api\V2010\Account\Usage\Record\MonthlyList $monthly * @property \Twilio\Rest\Api\V2010\Account\Usage\Record\ThisMonthList $thisMonth * @property \Twilio\Rest\Api\V2010\Account\Usage\Record\TodayList $today * @property \Twilio\Rest\Api\V2010\Account\Usage\Record\YearlyList $yearly * @property \Twilio\Rest\Api\V2010\Account\Usage\Record\YesterdayList $yesterday */ class RecordList extends ListResource { protected $_allTime = null; protected $_daily = null; protected $_lastMonth = null; protected $_monthly = null; protected $_thisMonth = null; protected $_today = null; protected $_yearly = null; protected $_yesterday = null; /** * Construct the RecordList * * @param Version $version Version that contains the resource * @param string $accountSid A 34 character string that uniquely identifies * this resource. * @return \Twilio\Rest\Api\V2010\Account\Usage\RecordList */ public function __construct(Version $version, $accountSid) { parent::__construct($version); // Path Solution $this->solution = array('accountSid' => $accountSid, ); $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/Usage/Records.json'; } /** * Streams RecordInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($options = array(), $limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads RecordInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return RecordInstance[] Array of results */ public function read($options = array(), $limit = null, $pageSize = null) { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Retrieve a single page of RecordInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of RecordInstance */ public function page($options = array(), $pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $options = new Values($options); $params = Values::of(array( 'Category' => $options['category'], 'StartDate' => Serialize::iso8601Date($options['startDate']), 'EndDate' => Serialize::iso8601Date($options['endDate']), 'IncludeSubaccounts' => Serialize::booleanToString($options['includeSubaccounts']), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new RecordPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of RecordInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of RecordInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new RecordPage($this->version, $response, $this->solution); } /** * Access the allTime */ protected function getAllTime() { if (!$this->_allTime) { $this->_allTime = new AllTimeList($this->version, $this->solution['accountSid']); } return $this->_allTime; } /** * Access the daily */ protected function getDaily() { if (!$this->_daily) { $this->_daily = new DailyList($this->version, $this->solution['accountSid']); } return $this->_daily; } /** * Access the lastMonth */ protected function getLastMonth() { if (!$this->_lastMonth) { $this->_lastMonth = new LastMonthList($this->version, $this->solution['accountSid']); } return $this->_lastMonth; } /** * Access the monthly */ protected function getMonthly() { if (!$this->_monthly) { $this->_monthly = new MonthlyList($this->version, $this->solution['accountSid']); } return $this->_monthly; } /** * Access the thisMonth */ protected function getThisMonth() { if (!$this->_thisMonth) { $this->_thisMonth = new ThisMonthList($this->version, $this->solution['accountSid']); } return $this->_thisMonth; } /** * Access the today */ protected function getToday() { if (!$this->_today) { $this->_today = new TodayList($this->version, $this->solution['accountSid']); } return $this->_today; } /** * Access the yearly */ protected function getYearly() { if (!$this->_yearly) { $this->_yearly = new YearlyList($this->version, $this->solution['accountSid']); } return $this->_yearly; } /** * Access the yesterday */ protected function getYesterday() { if (!$this->_yesterday) { $this->_yesterday = new YesterdayList($this->version, $this->solution['accountSid']); } return $this->_yesterday; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get($name) { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.RecordList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Usage/RecordPage.php 0000644 00000001370 15002236443 0016705 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Usage; use Twilio\Page; class RecordPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new RecordInstance($this->version, $payload, $this->solution['accountSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.RecordPage]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Usage/TriggerList.php 0000644 00000015133 15002236443 0017133 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Usage; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; class TriggerList extends ListResource { /** * Construct the TriggerList * * @param Version $version Version that contains the resource * @param string $accountSid A 34 character string that uniquely identifies * this resource. * @return \Twilio\Rest\Api\V2010\Account\Usage\TriggerList */ public function __construct(Version $version, $accountSid) { parent::__construct($version); // Path Solution $this->solution = array('accountSid' => $accountSid, ); $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/Usage/Triggers.json'; } /** * Create a new TriggerInstance * * @param string $callbackUrl The URL we call when the trigger fires * @param string $triggerValue The usage value at which the trigger should fire * @param string $usageCategory The usage category the trigger watches * @param array|Options $options Optional Arguments * @return TriggerInstance Newly created TriggerInstance * @throws TwilioException When an HTTP error occurs. */ public function create($callbackUrl, $triggerValue, $usageCategory, $options = array()) { $options = new Values($options); $data = Values::of(array( 'CallbackUrl' => $callbackUrl, 'TriggerValue' => $triggerValue, 'UsageCategory' => $usageCategory, 'CallbackMethod' => $options['callbackMethod'], 'FriendlyName' => $options['friendlyName'], 'Recurring' => $options['recurring'], 'TriggerBy' => $options['triggerBy'], )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new TriggerInstance($this->version, $payload, $this->solution['accountSid']); } /** * Streams TriggerInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($options = array(), $limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads TriggerInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return TriggerInstance[] Array of results */ public function read($options = array(), $limit = null, $pageSize = null) { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Retrieve a single page of TriggerInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of TriggerInstance */ public function page($options = array(), $pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $options = new Values($options); $params = Values::of(array( 'Recurring' => $options['recurring'], 'TriggerBy' => $options['triggerBy'], 'UsageCategory' => $options['usageCategory'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new TriggerPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of TriggerInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of TriggerInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new TriggerPage($this->version, $response, $this->solution); } /** * Constructs a TriggerContext * * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Api\V2010\Account\Usage\TriggerContext */ public function getContext($sid) { return new TriggerContext($this->version, $this->solution['accountSid'], $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.TriggerList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/Usage/TriggerOptions.php 0000644 00000022613 15002236443 0017654 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Usage; use Twilio\Options; use Twilio\Values; abstract class TriggerOptions { /** * @param string $callbackMethod The HTTP method to use to call callback_url * @param string $callbackUrl The URL we call when the trigger fires * @param string $friendlyName A string to describe the resource * @return UpdateTriggerOptions Options builder */ public static function update($callbackMethod = Values::NONE, $callbackUrl = Values::NONE, $friendlyName = Values::NONE) { return new UpdateTriggerOptions($callbackMethod, $callbackUrl, $friendlyName); } /** * @param string $callbackMethod The HTTP method to use to call callback_url * @param string $friendlyName A string to describe the resource * @param string $recurring The frequency of a recurring UsageTrigger * @param string $triggerBy The field in the UsageRecord resource that fires * the trigger * @return CreateTriggerOptions Options builder */ public static function create($callbackMethod = Values::NONE, $friendlyName = Values::NONE, $recurring = Values::NONE, $triggerBy = Values::NONE) { return new CreateTriggerOptions($callbackMethod, $friendlyName, $recurring, $triggerBy); } /** * @param string $recurring The frequency of recurring UsageTriggers to read * @param string $triggerBy The trigger field of the UsageTriggers to read * @param string $usageCategory The usage category of the UsageTriggers to read * @return ReadTriggerOptions Options builder */ public static function read($recurring = Values::NONE, $triggerBy = Values::NONE, $usageCategory = Values::NONE) { return new ReadTriggerOptions($recurring, $triggerBy, $usageCategory); } } class UpdateTriggerOptions extends Options { /** * @param string $callbackMethod The HTTP method to use to call callback_url * @param string $callbackUrl The URL we call when the trigger fires * @param string $friendlyName A string to describe the resource */ public function __construct($callbackMethod = Values::NONE, $callbackUrl = Values::NONE, $friendlyName = Values::NONE) { $this->options['callbackMethod'] = $callbackMethod; $this->options['callbackUrl'] = $callbackUrl; $this->options['friendlyName'] = $friendlyName; } /** * The HTTP method we should use to call `callback_url`. Can be: `GET` or `POST` and the default is `POST`. * * @param string $callbackMethod The HTTP method to use to call callback_url * @return $this Fluent Builder */ public function setCallbackMethod($callbackMethod) { $this->options['callbackMethod'] = $callbackMethod; return $this; } /** * The URL we should call using `callback_method` when the trigger fires. * * @param string $callbackUrl The URL we call when the trigger fires * @return $this Fluent Builder */ public function setCallbackUrl($callbackUrl) { $this->options['callbackUrl'] = $callbackUrl; return $this; } /** * A descriptive string that you create to describe the resource. It can be up to 64 characters long. * * @param string $friendlyName A string to describe the resource * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; 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.UpdateTriggerOptions ' . \implode(' ', $options) . ']'; } } class CreateTriggerOptions extends Options { /** * @param string $callbackMethod The HTTP method to use to call callback_url * @param string $friendlyName A string to describe the resource * @param string $recurring The frequency of a recurring UsageTrigger * @param string $triggerBy The field in the UsageRecord resource that fires * the trigger */ public function __construct($callbackMethod = Values::NONE, $friendlyName = Values::NONE, $recurring = Values::NONE, $triggerBy = Values::NONE) { $this->options['callbackMethod'] = $callbackMethod; $this->options['friendlyName'] = $friendlyName; $this->options['recurring'] = $recurring; $this->options['triggerBy'] = $triggerBy; } /** * The HTTP method we should use to call `callback_url`. Can be: `GET` or `POST` and the default is `POST`. * * @param string $callbackMethod The HTTP method to use to call callback_url * @return $this Fluent Builder */ public function setCallbackMethod($callbackMethod) { $this->options['callbackMethod'] = $callbackMethod; return $this; } /** * A descriptive string that you create to describe the resource. It can be up to 64 characters long. * * @param string $friendlyName A string to describe the resource * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The frequency of a recurring UsageTrigger. Can be: `daily`, `monthly`, or `yearly` for recurring triggers or empty for non-recurring triggers. A trigger will only fire once during each period. Recurring times are in GMT. * * @param string $recurring The frequency of a recurring UsageTrigger * @return $this Fluent Builder */ public function setRecurring($recurring) { $this->options['recurring'] = $recurring; return $this; } /** * The field in the [UsageRecord](https://www.twilio.com/docs/usage/api/usage-record) resource that should fire the trigger. Can be: `count`, `usage`, or `price` as described in the [UsageRecords documentation](https://www.twilio.com/docs/usage/api/usage-record#usage-count-price). The default is `usage`. * * @param string $triggerBy The field in the UsageRecord resource that fires * the trigger * @return $this Fluent Builder */ public function setTriggerBy($triggerBy) { $this->options['triggerBy'] = $triggerBy; 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.CreateTriggerOptions ' . \implode(' ', $options) . ']'; } } class ReadTriggerOptions extends Options { /** * @param string $recurring The frequency of recurring UsageTriggers to read * @param string $triggerBy The trigger field of the UsageTriggers to read * @param string $usageCategory The usage category of the UsageTriggers to read */ public function __construct($recurring = Values::NONE, $triggerBy = Values::NONE, $usageCategory = Values::NONE) { $this->options['recurring'] = $recurring; $this->options['triggerBy'] = $triggerBy; $this->options['usageCategory'] = $usageCategory; } /** * The frequency of recurring UsageTriggers to read. Can be: `daily`, `monthly`, or `yearly` to read recurring UsageTriggers. An empty value or a value of `alltime` reads non-recurring UsageTriggers. * * @param string $recurring The frequency of recurring UsageTriggers to read * @return $this Fluent Builder */ public function setRecurring($recurring) { $this->options['recurring'] = $recurring; return $this; } /** * The trigger field of the UsageTriggers to read. Can be: `count`, `usage`, or `price` as described in the [UsageRecords documentation](https://www.twilio.com/docs/usage/api/usage-record#usage-count-price). * * @param string $triggerBy The trigger field of the UsageTriggers to read * @return $this Fluent Builder */ public function setTriggerBy($triggerBy) { $this->options['triggerBy'] = $triggerBy; return $this; } /** * The usage category of the UsageTriggers to read. Must be a supported [usage categories](https://www.twilio.com/docs/usage/api/usage-record#usage-categories). * * @param string $usageCategory The usage category of the UsageTriggers to read * @return $this Fluent Builder */ public function setUsageCategory($usageCategory) { $this->options['usageCategory'] = $usageCategory; 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.ReadTriggerOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/OutgoingCallerIdContext.php 0000644 00000006027 15002236443 0020372 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Values; use Twilio\Version; class OutgoingCallerIdContext extends InstanceContext { /** * Initialize the OutgoingCallerIdContext * * @param \Twilio\Version $version Version that contains the resource * @param string $accountSid The SID of the Account that created the resource * to fetch * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Api\V2010\Account\OutgoingCallerIdContext */ public function __construct(Version $version, $accountSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array('accountSid' => $accountSid, 'sid' => $sid, ); $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/OutgoingCallerIds/' . \rawurlencode($sid) . '.json'; } /** * Fetch a OutgoingCallerIdInstance * * @return OutgoingCallerIdInstance Fetched OutgoingCallerIdInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new OutgoingCallerIdInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['sid'] ); } /** * Update the OutgoingCallerIdInstance * * @param array|Options $options Optional Arguments * @return OutgoingCallerIdInstance Updated OutgoingCallerIdInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { $options = new Values($options); $data = Values::of(array('FriendlyName' => $options['friendlyName'], )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new OutgoingCallerIdInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['sid'] ); } /** * Deletes the OutgoingCallerIdInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.OutgoingCallerIdContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/AddressList.php 0000644 00000015642 15002236443 0016056 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class AddressList extends ListResource { /** * Construct the AddressList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the Account that is responsible for the * resource * @return \Twilio\Rest\Api\V2010\Account\AddressList */ public function __construct(Version $version, $accountSid) { parent::__construct($version); // Path Solution $this->solution = array('accountSid' => $accountSid, ); $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/Addresses.json'; } /** * Create a new AddressInstance * * @param string $customerName The name to associate with the new address * @param string $street The number and street address of the new address * @param string $city The city of the new address * @param string $region The state or region of the new address * @param string $postalCode The postal code of the new address * @param string $isoCountry The ISO country code of the new address * @param array|Options $options Optional Arguments * @return AddressInstance Newly created AddressInstance * @throws TwilioException When an HTTP error occurs. */ public function create($customerName, $street, $city, $region, $postalCode, $isoCountry, $options = array()) { $options = new Values($options); $data = Values::of(array( 'CustomerName' => $customerName, 'Street' => $street, 'City' => $city, 'Region' => $region, 'PostalCode' => $postalCode, 'IsoCountry' => $isoCountry, 'FriendlyName' => $options['friendlyName'], 'EmergencyEnabled' => Serialize::booleanToString($options['emergencyEnabled']), 'AutoCorrectAddress' => Serialize::booleanToString($options['autoCorrectAddress']), )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new AddressInstance($this->version, $payload, $this->solution['accountSid']); } /** * Streams AddressInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($options = array(), $limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads AddressInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return AddressInstance[] Array of results */ public function read($options = array(), $limit = null, $pageSize = null) { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Retrieve a single page of AddressInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of AddressInstance */ public function page($options = array(), $pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $options = new Values($options); $params = Values::of(array( 'CustomerName' => $options['customerName'], 'FriendlyName' => $options['friendlyName'], 'IsoCountry' => $options['isoCountry'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new AddressPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of AddressInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of AddressInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new AddressPage($this->version, $response, $this->solution); } /** * Constructs a AddressContext * * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Api\V2010\Account\AddressContext */ public function getContext($sid) { return new AddressContext($this->version, $this->solution['accountSid'], $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.AddressList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/ConnectAppInstance.php 0000644 00000011247 15002236443 0017351 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property string $authorizeRedirectUrl * @property string $companyName * @property string $deauthorizeCallbackMethod * @property string $deauthorizeCallbackUrl * @property string $description * @property string $friendlyName * @property string $homepageUrl * @property string $permissions * @property string $sid * @property string $uri */ class ConnectAppInstance extends InstanceResource { /** * Initialize the ConnectAppInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $accountSid The SID of the Account that created the resource * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Api\V2010\Account\ConnectAppInstance */ public function __construct(Version $version, array $payload, $accountSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'accountSid' => Values::array_get($payload, 'account_sid'), 'authorizeRedirectUrl' => Values::array_get($payload, 'authorize_redirect_url'), 'companyName' => Values::array_get($payload, 'company_name'), 'deauthorizeCallbackMethod' => Values::array_get($payload, 'deauthorize_callback_method'), 'deauthorizeCallbackUrl' => Values::array_get($payload, 'deauthorize_callback_url'), 'description' => Values::array_get($payload, 'description'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'homepageUrl' => Values::array_get($payload, 'homepage_url'), 'permissions' => Values::array_get($payload, 'permissions'), 'sid' => Values::array_get($payload, 'sid'), 'uri' => Values::array_get($payload, 'uri'), ); $this->solution = array('accountSid' => $accountSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Api\V2010\Account\ConnectAppContext Context for this * ConnectAppInstance */ protected function proxy() { if (!$this->context) { $this->context = new ConnectAppContext( $this->version, $this->solution['accountSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch a ConnectAppInstance * * @return ConnectAppInstance Fetched ConnectAppInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Update the ConnectAppInstance * * @param array|Options $options Optional Arguments * @return ConnectAppInstance Updated ConnectAppInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Deletes the ConnectAppInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.ConnectAppInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/MessageOptions.php 0000644 00000041376 15002236443 0016600 0 ustar 00 <?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 SID of the Messaging Service you want * to associate with the message. * @param string $body The text of the message you want to send. Can be up to * 1,600 characters in length. * @param string $mediaUrl The URL of the media to send with the message * @param string $statusCallback The URL we should call to send status * information to your application * @param string $applicationSid The application to use for callbacks * @param string $maxPrice The total maximum price up to 4 decimal places in US * dollars acceptable for the message to be delivered. * @param bool $provideFeedback Whether to confirm delivery of the message * @param int $validityPeriod The number of seconds that the message can remain * in our outgoing queue. * @param bool $forceDelivery Reserved * @param bool $smartEncoded Whether to detect Unicode characters that have a * similar GSM-7 character and replace them * @param string $persistentAction Rich actions for Channels Messages. * @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, $forceDelivery = Values::NONE, $smartEncoded = Values::NONE, $persistentAction = Values::NONE) { return new CreateMessageOptions($from, $messagingServiceSid, $body, $mediaUrl, $statusCallback, $applicationSid, $maxPrice, $provideFeedback, $validityPeriod, $forceDelivery, $smartEncoded, $persistentAction); } /** * @param string $to Filter by messages sent 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 SID of the Messaging Service you want * to associate with the message. * @param string $body The text of the message you want to send. Can be up to * 1,600 characters in length. * @param string $mediaUrl The URL of the media to send with the message * @param string $statusCallback The URL we should call to send status * information to your application * @param string $applicationSid The application to use for callbacks * @param string $maxPrice The total maximum price up to 4 decimal places in US * dollars acceptable for the message to be delivered. * @param bool $provideFeedback Whether to confirm delivery of the message * @param int $validityPeriod The number of seconds that the message can remain * in our outgoing queue. * @param bool $forceDelivery Reserved * @param bool $smartEncoded Whether to detect Unicode characters that have a * similar GSM-7 character and replace them * @param string $persistentAction Rich actions for Channels Messages. */ 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, $forceDelivery = Values::NONE, $smartEncoded = Values::NONE, $persistentAction = 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['forceDelivery'] = $forceDelivery; $this->options['smartEncoded'] = $smartEncoded; $this->options['persistentAction'] = $persistentAction; } /** * A Twilio phone number in [E.164](https://www.twilio.com/docs/glossary/what-e164) format, an [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) that is enabled for the type of message you want to send. Phone numbers or [short codes](https://www.twilio.com/docs/sms/api/short-code) purchased from Twilio also work here. You cannot, for example, spoof messages from a private cell phone number. If you are using `messaging_service_sid`, this parameter must be empty. * * @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 SID of the [Messaging Service](https://www.twilio.com/docs/sms/services#send-a-message-with-copilot) you want to associate with the Message. Set this parameter to use the [Messaging Service Settings and Copilot Features](https://www.twilio.com/console/sms/services) you have configured and leave the `from` parameter empty. When only this parameter is set, Twilio will use your enabled Copilot Features to select the `from` phone number for delivery. * * @param string $messagingServiceSid The SID of the Messaging Service you want * to associate with the message. * @return $this Fluent Builder */ public function setMessagingServiceSid($messagingServiceSid) { $this->options['messagingServiceSid'] = $messagingServiceSid; return $this; } /** * The text of the message you want to send. Can be up to 1,600 characters in length. * * @param string $body The text of the message you want to send. Can be up to * 1,600 characters in length. * @return $this Fluent Builder */ public function setBody($body) { $this->options['body'] = $body; return $this; } /** * The URL of the media to send with the message. The media can be of type `gif`, `png`, and `jpeg` and will be formatted correctly on the recipient's device. The media size limit is 5MB for supported file types (JPEG, PNG, GIF) and 500KB for [other types](https://www.twilio.com/docs/sms/accepted-mime-types) of accepted media. To send more than one image in the message body, provide multiple `media_url` parameters in the POST request. You can include up to 10 `media_url` parameters per message. You can send images in an SMS message in only the US and Canada. * * @param string $mediaUrl The URL of the media to send with the message * @return $this Fluent Builder */ public function setMediaUrl($mediaUrl) { $this->options['mediaUrl'] = $mediaUrl; return $this; } /** * The URL we should call using the `status_callback_method` to send status information to your application. If specified, we POST these message status changes to the URL: `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`. If you include this parameter with the `messaging_service_sid`, we use this URL instead of the Status Callback URL of the [Messaging Service](https://www.twilio.com/docs/sms/services/api). URLs must contain a valid hostname and underscores are not allowed. * * @param string $statusCallback The URL we should call to send status * information to your application * @return $this Fluent Builder */ public function setStatusCallback($statusCallback) { $this->options['statusCallback'] = $statusCallback; return $this; } /** * The SID of the application that should receive message status. We POST a `message_sid` parameter and a `message_status` parameter with a value of `sent` or `failed` to the [application](https://www.twilio.com/docs/usage/api/applications)'s `message_status_callback`. If a `status_callback` parameter is also passed, it will be ignored and the application's `message_status_callback` parameter will be used. * * @param string $applicationSid The application to use for callbacks * @return $this Fluent Builder */ public function setApplicationSid($applicationSid) { $this->options['applicationSid'] = $applicationSid; return $this; } /** * The maximum total price in US dollars that you will pay for the message to be delivered. Can be a decimal value that has up to 4 decimal places. All messages are queued for delivery and the message cost is checked before the message is sent. If the cost exceeds `max_price`, the message will fail and a status of `Failed` is sent to the status callback. If `MaxPrice` is not set, the message cost is not checked. * * @param string $maxPrice The total maximum price up to 4 decimal places in US * dollars acceptable for the message to be delivered. * @return $this Fluent Builder */ public function setMaxPrice($maxPrice) { $this->options['maxPrice'] = $maxPrice; return $this; } /** * Whether to confirm delivery of the message. 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-resource). This parameter is `false` by default. * * @param bool $provideFeedback Whether to confirm delivery of the message * @return $this Fluent Builder */ public function setProvideFeedback($provideFeedback) { $this->options['provideFeedback'] = $provideFeedback; return $this; } /** * How long in seconds the message can remain in our outgoing message queue. After this period elapses, the message fails and we call your status callback. Can be between 1 and the default value of 14,400 seconds. After a message has been accepted by a carrier, however, we cannot guarantee that the message will not be queued after this period. We recommend that this value be at least 5 seconds. * * @param int $validityPeriod The number of seconds that the message can remain * in our outgoing queue. * @return $this Fluent Builder */ public function setValidityPeriod($validityPeriod) { $this->options['validityPeriod'] = $validityPeriod; return $this; } /** * Reserved * * @param bool $forceDelivery Reserved * @return $this Fluent Builder */ public function setForceDelivery($forceDelivery) { $this->options['forceDelivery'] = $forceDelivery; return $this; } /** * Whether to detect Unicode characters that have a similar GSM-7 character and replace them. Can be: `true` or `false`. * * @param bool $smartEncoded Whether to detect Unicode characters that have a * similar GSM-7 character and replace them * @return $this Fluent Builder */ public function setSmartEncoded($smartEncoded) { $this->options['smartEncoded'] = $smartEncoded; return $this; } /** * Rich actions for Channels Messages. * * @param string $persistentAction Rich actions for Channels Messages. * @return $this Fluent Builder */ public function setPersistentAction($persistentAction) { $this->options['persistentAction'] = $persistentAction; 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 sent 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; } /** * Read messages sent to only this phone number. * * @param string $to Filter by messages sent to this number * @return $this Fluent Builder */ public function setTo($to) { $this->options['to'] = $to; return $this; } /** * Read messages sent from only 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; } /** * The date of the messages to show. Specify a date as `YYYY-MM-DD` in GMT to read only messages sent on this date. For example: `2009-07-06`. You can also specify an inequality, such as `DateSent<=YYYY-MM-DD`, to read messages sent on or before midnight on a date, and `DateSent>=YYYY-MM-DD` to read 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; } /** * The date of the messages to show. Specify a date as `YYYY-MM-DD` in GMT to read only messages sent on this date. For example: `2009-07-06`. You can also specify an inequality, such as `DateSent<=YYYY-MM-DD`, to read messages sent on or before midnight on a date, and `DateSent>=YYYY-MM-DD` to read 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; } /** * The date of the messages to show. Specify a date as `YYYY-MM-DD` in GMT to read only messages sent on this date. For example: `2009-07-06`. You can also specify an inequality, such as `DateSent<=YYYY-MM-DD`, to read messages sent on or before midnight on a date, and `DateSent>=YYYY-MM-DD` to read 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) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/NotificationOptions.php 0000644 00000007365 15002236443 0017642 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Options; use Twilio\Values; abstract class NotificationOptions { /** * @param int $log Filter by log level * @param string $messageDateBefore Filter by date * @param string $messageDate Filter by date * @param string $messageDateAfter Filter by date * @return ReadNotificationOptions Options builder */ public static function read($log = Values::NONE, $messageDateBefore = Values::NONE, $messageDate = Values::NONE, $messageDateAfter = Values::NONE) { return new ReadNotificationOptions($log, $messageDateBefore, $messageDate, $messageDateAfter); } } class ReadNotificationOptions extends Options { /** * @param int $log Filter by log level * @param string $messageDateBefore Filter by date * @param string $messageDate Filter by date * @param string $messageDateAfter Filter by date */ public function __construct($log = Values::NONE, $messageDateBefore = Values::NONE, $messageDate = Values::NONE, $messageDateAfter = Values::NONE) { $this->options['log'] = $log; $this->options['messageDateBefore'] = $messageDateBefore; $this->options['messageDate'] = $messageDate; $this->options['messageDateAfter'] = $messageDateAfter; } /** * Only read notifications of the specified log level. Can be: `0` to read only ERROR notifications or `1` to read only WARNING notifications. By default, all notifications are read. * * @param int $log Filter by log level * @return $this Fluent Builder */ public function setLog($log) { $this->options['log'] = $log; return $this; } /** * Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date. * * @param string $messageDateBefore Filter by date * @return $this Fluent Builder */ public function setMessageDateBefore($messageDateBefore) { $this->options['messageDateBefore'] = $messageDateBefore; return $this; } /** * Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date. * * @param string $messageDate Filter by date * @return $this Fluent Builder */ public function setMessageDate($messageDate) { $this->options['messageDate'] = $messageDate; return $this; } /** * Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date. * * @param string $messageDateAfter Filter by date * @return $this Fluent Builder */ public function setMessageDateAfter($messageDateAfter) { $this->options['messageDateAfter'] = $messageDateAfter; 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.ReadNotificationOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/ConnectAppList.php 0000644 00000011570 15002236443 0016517 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\ListResource; use Twilio\Values; use Twilio\Version; class ConnectAppList extends ListResource { /** * Construct the ConnectAppList * * @param Version $version Version that contains the resource * @param string $accountSid The SID of the Account that created the resource * @return \Twilio\Rest\Api\V2010\Account\ConnectAppList */ public function __construct(Version $version, $accountSid) { parent::__construct($version); // Path Solution $this->solution = array('accountSid' => $accountSid, ); $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/ConnectApps.json'; } /** * Streams ConnectAppInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads ConnectAppInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return ConnectAppInstance[] Array of results */ public function read($limit = null, $pageSize = null) { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of ConnectAppInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of ConnectAppInstance */ public function page($pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $params = Values::of(array( 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new ConnectAppPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of ConnectAppInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of ConnectAppInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new ConnectAppPage($this->version, $response, $this->solution); } /** * Constructs a ConnectAppContext * * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Api\V2010\Account\ConnectAppContext */ public function getContext($sid) { return new ConnectAppContext($this->version, $this->solution['accountSid'], $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010.ConnectAppList]'; } } sdk/src/Twilio/Rest/Api/V2010/Account/NewSigningKeyOptions.php 0000644 00000003077 15002236443 0017731 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Options; use Twilio\Values; abstract class NewSigningKeyOptions { /** * @param string $friendlyName A string to describe the resource * @return CreateNewSigningKeyOptions Options builder */ public static function create($friendlyName = Values::NONE) { return new CreateNewSigningKeyOptions($friendlyName); } } class CreateNewSigningKeyOptions extends Options { /** * @param string $friendlyName A string to describe the resource */ public function __construct($friendlyName = Values::NONE) { $this->options['friendlyName'] = $friendlyName; } /** * A descriptive string that you create to describe the resource. It can be up to 64 characters long. * * @param string $friendlyName A string to describe the resource * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; 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.CreateNewSigningKeyOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Api/V2010/Account/AuthorizedConnectAppContext.php 0000644 00000004105 15002236443 0021263 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; class AuthorizedConnectAppContext extends InstanceContext { /** * Initialize the AuthorizedConnectAppContext * * @param \Twilio\Version $version Version that contains the resource * @param string $accountSid The SID of the Account that created the resource * to fetch * @param string $connectAppSid The SID of the Connect App to fetch * @return \Twilio\Rest\Api\V2010\Account\AuthorizedConnectAppContext */ public function __construct(Version $version, $accountSid, $connectAppSid) { parent::__construct($version); // Path Solution $this->solution = array('accountSid' => $accountSid, 'connectAppSid' => $connectAppSid, ); $this->uri = '/Accounts/' . \rawurlencode($accountSid) . '/AuthorizedConnectApps/' . \rawurlencode($connectAppSid) . '.json'; } /** * Fetch a AuthorizedConnectAppInstance * * @return AuthorizedConnectAppInstance Fetched AuthorizedConnectAppInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new AuthorizedConnectAppInstance( $this->version, $payload, $this->solution['accountSid'], $this->solution['connectAppSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Api.V2010.AuthorizedConnectAppContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Api/V2010.php 0000644 00000026210 15002236443 0012232 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\Rest\Api\V2010\AccountContext; use Twilio\Rest\Api\V2010\AccountInstance; use Twilio\Rest\Api\V2010\AccountList; use Twilio\Version; /** * @property \Twilio\Rest\Api\V2010\AccountList $accounts * @method \Twilio\Rest\Api\V2010\AccountContext accounts(string $sid) * @property \Twilio\Rest\Api\V2010\AccountContext $account * @property \Twilio\Rest\Api\V2010\Account\AddressList $addresses * @property \Twilio\Rest\Api\V2010\Account\ApplicationList $applications * @property \Twilio\Rest\Api\V2010\Account\AuthorizedConnectAppList $authorizedConnectApps * @property \Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountryList $availablePhoneNumbers * @property \Twilio\Rest\Api\V2010\Account\BalanceList $balance * @property \Twilio\Rest\Api\V2010\Account\CallList $calls * @property \Twilio\Rest\Api\V2010\Account\ConferenceList $conferences * @property \Twilio\Rest\Api\V2010\Account\ConnectAppList $connectApps * @property \Twilio\Rest\Api\V2010\Account\IncomingPhoneNumberList $incomingPhoneNumbers * @property \Twilio\Rest\Api\V2010\Account\KeyList $keys * @property \Twilio\Rest\Api\V2010\Account\MessageList $messages * @property \Twilio\Rest\Api\V2010\Account\NewKeyList $newKeys * @property \Twilio\Rest\Api\V2010\Account\NewSigningKeyList $newSigningKeys * @property \Twilio\Rest\Api\V2010\Account\NotificationList $notifications * @property \Twilio\Rest\Api\V2010\Account\OutgoingCallerIdList $outgoingCallerIds * @property \Twilio\Rest\Api\V2010\Account\QueueList $queues * @property \Twilio\Rest\Api\V2010\Account\RecordingList $recordings * @property \Twilio\Rest\Api\V2010\Account\SigningKeyList $signingKeys * @property \Twilio\Rest\Api\V2010\Account\SipList $sip * @property \Twilio\Rest\Api\V2010\Account\ShortCodeList $shortCodes * @property \Twilio\Rest\Api\V2010\Account\TokenList $tokens * @property \Twilio\Rest\Api\V2010\Account\TranscriptionList $transcriptions * @property \Twilio\Rest\Api\V2010\Account\UsageList $usage * @property \Twilio\Rest\Api\V2010\Account\ValidationRequestList $validationRequests * @method \Twilio\Rest\Api\V2010\Account\AddressContext addresses(string $sid) * @method \Twilio\Rest\Api\V2010\Account\ApplicationContext applications(string $sid) * @method \Twilio\Rest\Api\V2010\Account\AuthorizedConnectAppContext authorizedConnectApps(string $connectAppSid) * @method \Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountryContext availablePhoneNumbers(string $countryCode) * @method \Twilio\Rest\Api\V2010\Account\CallContext calls(string $sid) * @method \Twilio\Rest\Api\V2010\Account\ConferenceContext conferences(string $sid) * @method \Twilio\Rest\Api\V2010\Account\ConnectAppContext connectApps(string $sid) * @method \Twilio\Rest\Api\V2010\Account\IncomingPhoneNumberContext incomingPhoneNumbers(string $sid) * @method \Twilio\Rest\Api\V2010\Account\KeyContext keys(string $sid) * @method \Twilio\Rest\Api\V2010\Account\MessageContext messages(string $sid) * @method \Twilio\Rest\Api\V2010\Account\NotificationContext notifications(string $sid) * @method \Twilio\Rest\Api\V2010\Account\OutgoingCallerIdContext outgoingCallerIds(string $sid) * @method \Twilio\Rest\Api\V2010\Account\QueueContext queues(string $sid) * @method \Twilio\Rest\Api\V2010\Account\RecordingContext recordings(string $sid) * @method \Twilio\Rest\Api\V2010\Account\SigningKeyContext signingKeys(string $sid) * @method \Twilio\Rest\Api\V2010\Account\ShortCodeContext shortCodes(string $sid) * @method \Twilio\Rest\Api\V2010\Account\TranscriptionContext transcriptions(string $sid) */ class V2010 extends Version { protected $_accounts = null; protected $_account = null; protected $_addresses = null; protected $_applications = null; protected $_authorizedConnectApps = null; protected $_availablePhoneNumbers = null; protected $_balance = null; protected $_calls = null; protected $_conferences = null; protected $_connectApps = null; protected $_incomingPhoneNumbers = null; protected $_keys = null; protected $_messages = null; protected $_newKeys = null; protected $_newSigningKeys = null; protected $_notifications = null; protected $_outgoingCallerIds = null; protected $_queues = null; protected $_recordings = null; protected $_signingKeys = null; protected $_sip = null; protected $_shortCodes = null; protected $_tokens = null; protected $_transcriptions = null; protected $_usage = null; protected $_validationRequests = null; /** * Construct the V2010 version of Api * * @param \Twilio\Domain $domain Domain that contains the version * @return \Twilio\Rest\Api\V2010 V2010 version of Api */ public function __construct(Domain $domain) { parent::__construct($domain); $this->version = '2010-04-01'; } /** * @return \Twilio\Rest\Api\V2010\AccountList */ protected function getAccounts() { if (!$this->_accounts) { $this->_accounts = new AccountList($this); } return $this->_accounts; } /** * @return \Twilio\Rest\Api\V2010\AccountContext Account provided as the * authenticating account */ protected function getAccount() { if (!$this->_account) { $this->_account = new AccountContext( $this, $this->domain->getClient()->getAccountSid() ); } return $this->_account; } /** * Setter to override the primary account * * @param AccountContext|AccountInstance $account account to use as the primary * account */ public function setAccount($account) { $this->_account = $account; } /** * @return \Twilio\Rest\Api\V2010\Account\AddressList */ protected function getAddresses() { return $this->account->addresses; } /** * @return \Twilio\Rest\Api\V2010\Account\ApplicationList */ protected function getApplications() { return $this->account->applications; } /** * @return \Twilio\Rest\Api\V2010\Account\AuthorizedConnectAppList */ protected function getAuthorizedConnectApps() { return $this->account->authorizedConnectApps; } /** * @return \Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountryList */ protected function getAvailablePhoneNumbers() { return $this->account->availablePhoneNumbers; } /** * @return \Twilio\Rest\Api\V2010\Account\BalanceList */ protected function getBalance() { return $this->account->balance; } /** * @return \Twilio\Rest\Api\V2010\Account\CallList */ protected function getCalls() { return $this->account->calls; } /** * @return \Twilio\Rest\Api\V2010\Account\ConferenceList */ protected function getConferences() { return $this->account->conferences; } /** * @return \Twilio\Rest\Api\V2010\Account\ConnectAppList */ protected function getConnectApps() { return $this->account->connectApps; } /** * @return \Twilio\Rest\Api\V2010\Account\IncomingPhoneNumberList */ protected function getIncomingPhoneNumbers() { return $this->account->incomingPhoneNumbers; } /** * @return \Twilio\Rest\Api\V2010\Account\KeyList */ protected function getKeys() { return $this->account->keys; } /** * @return \Twilio\Rest\Api\V2010\Account\MessageList */ protected function getMessages() { return $this->account->messages; } /** * @return \Twilio\Rest\Api\V2010\Account\NewKeyList */ protected function getNewKeys() { return $this->account->newKeys; } /** * @return \Twilio\Rest\Api\V2010\Account\NewSigningKeyList */ protected function getNewSigningKeys() { return $this->account->newSigningKeys; } /** * @return \Twilio\Rest\Api\V2010\Account\NotificationList */ protected function getNotifications() { return $this->account->notifications; } /** * @return \Twilio\Rest\Api\V2010\Account\OutgoingCallerIdList */ protected function getOutgoingCallerIds() { return $this->account->outgoingCallerIds; } /** * @return \Twilio\Rest\Api\V2010\Account\QueueList */ protected function getQueues() { return $this->account->queues; } /** * @return \Twilio\Rest\Api\V2010\Account\RecordingList */ protected function getRecordings() { return $this->account->recordings; } /** * @return \Twilio\Rest\Api\V2010\Account\SigningKeyList */ protected function getSigningKeys() { return $this->account->signingKeys; } /** * @return \Twilio\Rest\Api\V2010\Account\SipList */ protected function getSip() { return $this->account->sip; } /** * @return \Twilio\Rest\Api\V2010\Account\ShortCodeList */ protected function getShortCodes() { return $this->account->shortCodes; } /** * @return \Twilio\Rest\Api\V2010\Account\TokenList */ protected function getTokens() { return $this->account->tokens; } /** * @return \Twilio\Rest\Api\V2010\Account\TranscriptionList */ protected function getTranscriptions() { return $this->account->transcriptions; } /** * @return \Twilio\Rest\Api\V2010\Account\UsageList */ protected function getUsage() { return $this->account->usage; } /** * @return \Twilio\Rest\Api\V2010\Account\ValidationRequestList */ protected function getValidationRequests() { return $this->account->validationRequests; } /** * Magic getter to lazy load root resources * * @param string $name Resource to return * @return \Twilio\ListResource The requested resource * @throws TwilioException For unknown resource */ public function __get($name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown resource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Api.V2010]'; } } sdk/src/Twilio/Rest/Conversations/V1.php 0000644 00000005372 15002236443 0014142 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\Rest\Conversations\V1\ConversationList; use Twilio\Rest\Conversations\V1\WebhookList; use Twilio\Version; /** * @property \Twilio\Rest\Conversations\V1\ConversationList $conversations * @property \Twilio\Rest\Conversations\V1\WebhookList $webhooks * @method \Twilio\Rest\Conversations\V1\ConversationContext conversations(string $sid) */ class V1 extends Version { protected $_conversations = null; protected $_webhooks = null; /** * Construct the V1 version of Conversations * * @param \Twilio\Domain $domain Domain that contains the version * @return \Twilio\Rest\Conversations\V1 V1 version of Conversations */ public function __construct(Domain $domain) { parent::__construct($domain); $this->version = 'v1'; } /** * @return \Twilio\Rest\Conversations\V1\ConversationList */ protected function getConversations() { if (!$this->_conversations) { $this->_conversations = new ConversationList($this); } return $this->_conversations; } /** * @return \Twilio\Rest\Conversations\V1\WebhookList */ protected function getWebhooks() { if (!$this->_webhooks) { $this->_webhooks = new WebhookList($this); } return $this->_webhooks; } /** * Magic getter to lazy load root resources * * @param string $name Resource to return * @return \Twilio\ListResource The requested resource * @throws TwilioException For unknown resource */ public function __get($name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown resource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Conversations.V1]'; } } sdk/src/Twilio/Rest/Conversations/V1/WebhookInstance.php 0000644 00000007133 15002236443 0017222 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * * @property string $accountSid * @property string $method * @property string $filters * @property string $preWebhookUrl * @property string $postWebhookUrl * @property string $target * @property string $url */ class WebhookInstance extends InstanceResource { /** * Initialize the WebhookInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @return \Twilio\Rest\Conversations\V1\WebhookInstance */ public function __construct(Version $version, array $payload) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'accountSid' => Values::array_get($payload, 'account_sid'), 'method' => Values::array_get($payload, 'method'), 'filters' => Values::array_get($payload, 'filters'), 'preWebhookUrl' => Values::array_get($payload, 'pre_webhook_url'), 'postWebhookUrl' => Values::array_get($payload, 'post_webhook_url'), 'target' => Values::array_get($payload, 'target'), 'url' => Values::array_get($payload, 'url'), ); $this->solution = array(); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Conversations\V1\WebhookContext Context for this * WebhookInstance */ protected function proxy() { if (!$this->context) { $this->context = new WebhookContext($this->version); } return $this->context; } /** * Fetch a WebhookInstance * * @return WebhookInstance Fetched WebhookInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Update the WebhookInstance * * @param array|Options $options Optional Arguments * @return WebhookInstance Updated WebhookInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Conversations.V1.WebhookInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/Conversation/WebhookInstance.php 0000644 00000011223 15002236443 0021667 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1\Conversation; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * * @property string $sid * @property string $accountSid * @property string $conversationSid * @property string $target * @property string $url * @property array $configuration * @property \DateTime $dateCreated * @property \DateTime $dateUpdated */ class WebhookInstance extends InstanceResource { /** * Initialize the WebhookInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $conversationSid The unique id of the Conversation for this * webhook. * @param string $sid A 34 character string that uniquely identifies this * resource. * @return \Twilio\Rest\Conversations\V1\Conversation\WebhookInstance */ public function __construct(Version $version, array $payload, $conversationSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'conversationSid' => Values::array_get($payload, 'conversation_sid'), 'target' => Values::array_get($payload, 'target'), 'url' => Values::array_get($payload, 'url'), 'configuration' => Values::array_get($payload, 'configuration'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), ); $this->solution = array( 'conversationSid' => $conversationSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Conversations\V1\Conversation\WebhookContext Context * for this * WebhookInstance */ protected function proxy() { if (!$this->context) { $this->context = new WebhookContext( $this->version, $this->solution['conversationSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch a WebhookInstance * * @return WebhookInstance Fetched WebhookInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Update the WebhookInstance * * @param array|Options $options Optional Arguments * @return WebhookInstance Updated WebhookInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Deletes the WebhookInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Conversations.V1.WebhookInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/Conversation/ParticipantInstance.php 0000644 00000011264 15002236443 0022554 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1\Conversation; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * * @property string $accountSid * @property string $conversationSid * @property string $sid * @property string $identity * @property string $attributes * @property array $messagingBinding * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $url */ class ParticipantInstance extends InstanceResource { /** * Initialize the ParticipantInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $conversationSid The unique id of the Conversation for this * participant. * @param string $sid A 34 character string that uniquely identifies this * resource. * @return \Twilio\Rest\Conversations\V1\Conversation\ParticipantInstance */ public function __construct(Version $version, array $payload, $conversationSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'accountSid' => Values::array_get($payload, 'account_sid'), 'conversationSid' => Values::array_get($payload, 'conversation_sid'), 'sid' => Values::array_get($payload, 'sid'), 'identity' => Values::array_get($payload, 'identity'), 'attributes' => Values::array_get($payload, 'attributes'), 'messagingBinding' => Values::array_get($payload, 'messaging_binding'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), ); $this->solution = array( 'conversationSid' => $conversationSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Conversations\V1\Conversation\ParticipantContext Context for this ParticipantInstance */ protected function proxy() { if (!$this->context) { $this->context = new ParticipantContext( $this->version, $this->solution['conversationSid'], $this->solution['sid'] ); } return $this->context; } /** * Update the ParticipantInstance * * @param array|Options $options Optional Arguments * @return ParticipantInstance Updated ParticipantInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Deletes the ParticipantInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Fetch a ParticipantInstance * * @return ParticipantInstance Fetched ParticipantInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Conversations.V1.ParticipantInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/Conversation/MessageContext.php 0000644 00000006623 15002236443 0021545 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1\Conversation; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class MessageContext extends InstanceContext { /** * Initialize the MessageContext * * @param \Twilio\Version $version Version that contains the resource * @param string $conversationSid The unique id of the Conversation for this * message. * @param string $sid A 34 character string that uniquely identifies this * resource. * @return \Twilio\Rest\Conversations\V1\Conversation\MessageContext */ public function __construct(Version $version, $conversationSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array('conversationSid' => $conversationSid, 'sid' => $sid, ); $this->uri = '/Conversations/' . \rawurlencode($conversationSid) . '/Messages/' . \rawurlencode($sid) . ''; } /** * Update the MessageInstance * * @param array|Options $options Optional Arguments * @return MessageInstance Updated MessageInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { $options = new Values($options); $data = Values::of(array( 'Author' => $options['author'], 'Body' => $options['body'], 'DateCreated' => Serialize::iso8601DateTime($options['dateCreated']), 'DateUpdated' => Serialize::iso8601DateTime($options['dateUpdated']), 'Attributes' => $options['attributes'], )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new MessageInstance( $this->version, $payload, $this->solution['conversationSid'], $this->solution['sid'] ); } /** * Deletes the MessageInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Fetch a MessageInstance * * @return MessageInstance Fetched MessageInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new MessageInstance( $this->version, $payload, $this->solution['conversationSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Conversations.V1.MessageContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/Conversation/ParticipantList.php 0000644 00000014562 15002236443 0021727 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1\Conversation; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class ParticipantList extends ListResource { /** * Construct the ParticipantList * * @param Version $version Version that contains the resource * @param string $conversationSid The unique id of the Conversation for this * participant. * @return \Twilio\Rest\Conversations\V1\Conversation\ParticipantList */ public function __construct(Version $version, $conversationSid) { parent::__construct($version); // Path Solution $this->solution = array('conversationSid' => $conversationSid, ); $this->uri = '/Conversations/' . \rawurlencode($conversationSid) . '/Participants'; } /** * Create a new ParticipantInstance * * @param array|Options $options Optional Arguments * @return ParticipantInstance Newly created ParticipantInstance * @throws TwilioException When an HTTP error occurs. */ public function create($options = array()) { $options = new Values($options); $data = Values::of(array( 'Identity' => $options['identity'], 'MessagingBinding.Address' => $options['messagingBindingAddress'], 'MessagingBinding.ProxyAddress' => $options['messagingBindingProxyAddress'], 'DateCreated' => Serialize::iso8601DateTime($options['dateCreated']), 'DateUpdated' => Serialize::iso8601DateTime($options['dateUpdated']), 'Attributes' => $options['attributes'], 'MessagingBinding.ProjectedAddress' => $options['messagingBindingProjectedAddress'], )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new ParticipantInstance($this->version, $payload, $this->solution['conversationSid']); } /** * Streams ParticipantInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads ParticipantInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return ParticipantInstance[] Array of results */ public function read($limit = null, $pageSize = null) { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of ParticipantInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of ParticipantInstance */ public function page($pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $params = Values::of(array( 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new ParticipantPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of ParticipantInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of ParticipantInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new ParticipantPage($this->version, $response, $this->solution); } /** * Constructs a ParticipantContext * * @param string $sid A 34 character string that uniquely identifies this * resource. * @return \Twilio\Rest\Conversations\V1\Conversation\ParticipantContext */ public function getContext($sid) { return new ParticipantContext($this->version, $this->solution['conversationSid'], $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Conversations.V1.ParticipantList]'; } } sdk/src/Twilio/Rest/Conversations/V1/Conversation/WebhookOptions.php 0000644 00000026754 15002236443 0021575 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1\Conversation; 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 WebhookOptions { /** * @param string $configurationUrl The absolute url the webhook request should * be sent to. * @param string $configurationMethod The HTTP method to be used when sending a * webhook request. * @param string $configurationFilters The list of events, firing webhook event * for this Conversation. * @param string $configurationTriggers The list of keywords, firing webhook * event for this Conversation. * @param string $configurationFlowSid The studio flow sid, where the webhook * should be sent to. * @param int $configurationReplayAfter The message index for which and it's * successors the webhook will be replayed. * @return CreateWebhookOptions Options builder */ public static function create($configurationUrl = Values::NONE, $configurationMethod = Values::NONE, $configurationFilters = Values::NONE, $configurationTriggers = Values::NONE, $configurationFlowSid = Values::NONE, $configurationReplayAfter = Values::NONE) { return new CreateWebhookOptions($configurationUrl, $configurationMethod, $configurationFilters, $configurationTriggers, $configurationFlowSid, $configurationReplayAfter); } /** * @param string $configurationUrl The absolute url the webhook request should * be sent to. * @param string $configurationMethod The HTTP method to be used when sending a * webhook request. * @param string $configurationFilters The list of events, firing webhook event * for this Conversation. * @param string $configurationTriggers The list of keywords, firing webhook * event for this Conversation. * @param string $configurationFlowSid The studio flow sid, where the webhook * should be sent to. * @return UpdateWebhookOptions Options builder */ public static function update($configurationUrl = Values::NONE, $configurationMethod = Values::NONE, $configurationFilters = Values::NONE, $configurationTriggers = Values::NONE, $configurationFlowSid = Values::NONE) { return new UpdateWebhookOptions($configurationUrl, $configurationMethod, $configurationFilters, $configurationTriggers, $configurationFlowSid); } } class CreateWebhookOptions extends Options { /** * @param string $configurationUrl The absolute url the webhook request should * be sent to. * @param string $configurationMethod The HTTP method to be used when sending a * webhook request. * @param string $configurationFilters The list of events, firing webhook event * for this Conversation. * @param string $configurationTriggers The list of keywords, firing webhook * event for this Conversation. * @param string $configurationFlowSid The studio flow sid, where the webhook * should be sent to. * @param int $configurationReplayAfter The message index for which and it's * successors the webhook will be replayed. */ public function __construct($configurationUrl = Values::NONE, $configurationMethod = Values::NONE, $configurationFilters = Values::NONE, $configurationTriggers = Values::NONE, $configurationFlowSid = Values::NONE, $configurationReplayAfter = Values::NONE) { $this->options['configurationUrl'] = $configurationUrl; $this->options['configurationMethod'] = $configurationMethod; $this->options['configurationFilters'] = $configurationFilters; $this->options['configurationTriggers'] = $configurationTriggers; $this->options['configurationFlowSid'] = $configurationFlowSid; $this->options['configurationReplayAfter'] = $configurationReplayAfter; } /** * The absolute url the webhook request should be sent to. * * @param string $configurationUrl The absolute url the webhook request should * be sent to. * @return $this Fluent Builder */ public function setConfigurationUrl($configurationUrl) { $this->options['configurationUrl'] = $configurationUrl; return $this; } /** * The HTTP method to be used when sending a webhook request. * * @param string $configurationMethod The HTTP method to be used when sending a * webhook request. * @return $this Fluent Builder */ public function setConfigurationMethod($configurationMethod) { $this->options['configurationMethod'] = $configurationMethod; return $this; } /** * The list of events, firing webhook event for this Conversation. * * @param string $configurationFilters The list of events, firing webhook event * for this Conversation. * @return $this Fluent Builder */ public function setConfigurationFilters($configurationFilters) { $this->options['configurationFilters'] = $configurationFilters; return $this; } /** * The list of keywords, firing webhook event for this Conversation. * * @param string $configurationTriggers The list of keywords, firing webhook * event for this Conversation. * @return $this Fluent Builder */ public function setConfigurationTriggers($configurationTriggers) { $this->options['configurationTriggers'] = $configurationTriggers; return $this; } /** * The studio flow sid, where the webhook should be sent to. * * @param string $configurationFlowSid The studio flow sid, where the webhook * should be sent to. * @return $this Fluent Builder */ public function setConfigurationFlowSid($configurationFlowSid) { $this->options['configurationFlowSid'] = $configurationFlowSid; return $this; } /** * The message index for which and it's successors the webhook will be replayed. Not set by default * * @param int $configurationReplayAfter The message index for which and it's * successors the webhook will be replayed. * @return $this Fluent Builder */ public function setConfigurationReplayAfter($configurationReplayAfter) { $this->options['configurationReplayAfter'] = $configurationReplayAfter; 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.Conversations.V1.CreateWebhookOptions ' . \implode(' ', $options) . ']'; } } class UpdateWebhookOptions extends Options { /** * @param string $configurationUrl The absolute url the webhook request should * be sent to. * @param string $configurationMethod The HTTP method to be used when sending a * webhook request. * @param string $configurationFilters The list of events, firing webhook event * for this Conversation. * @param string $configurationTriggers The list of keywords, firing webhook * event for this Conversation. * @param string $configurationFlowSid The studio flow sid, where the webhook * should be sent to. */ public function __construct($configurationUrl = Values::NONE, $configurationMethod = Values::NONE, $configurationFilters = Values::NONE, $configurationTriggers = Values::NONE, $configurationFlowSid = Values::NONE) { $this->options['configurationUrl'] = $configurationUrl; $this->options['configurationMethod'] = $configurationMethod; $this->options['configurationFilters'] = $configurationFilters; $this->options['configurationTriggers'] = $configurationTriggers; $this->options['configurationFlowSid'] = $configurationFlowSid; } /** * The absolute url the webhook request should be sent to. * * @param string $configurationUrl The absolute url the webhook request should * be sent to. * @return $this Fluent Builder */ public function setConfigurationUrl($configurationUrl) { $this->options['configurationUrl'] = $configurationUrl; return $this; } /** * The HTTP method to be used when sending a webhook request. * * @param string $configurationMethod The HTTP method to be used when sending a * webhook request. * @return $this Fluent Builder */ public function setConfigurationMethod($configurationMethod) { $this->options['configurationMethod'] = $configurationMethod; return $this; } /** * The list of events, firing webhook event for this Conversation. * * @param string $configurationFilters The list of events, firing webhook event * for this Conversation. * @return $this Fluent Builder */ public function setConfigurationFilters($configurationFilters) { $this->options['configurationFilters'] = $configurationFilters; return $this; } /** * The list of keywords, firing webhook event for this Conversation. * * @param string $configurationTriggers The list of keywords, firing webhook * event for this Conversation. * @return $this Fluent Builder */ public function setConfigurationTriggers($configurationTriggers) { $this->options['configurationTriggers'] = $configurationTriggers; return $this; } /** * The studio flow sid, where the webhook should be sent to. * * @param string $configurationFlowSid The studio flow sid, where the webhook * should be sent to. * @return $this Fluent Builder */ public function setConfigurationFlowSid($configurationFlowSid) { $this->options['configurationFlowSid'] = $configurationFlowSid; 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.Conversations.V1.UpdateWebhookOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/Conversation/MessageList.php 0000644 00000014145 15002236443 0021032 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1\Conversation; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class MessageList extends ListResource { /** * Construct the MessageList * * @param Version $version Version that contains the resource * @param string $conversationSid The unique id of the Conversation for this * message. * @return \Twilio\Rest\Conversations\V1\Conversation\MessageList */ public function __construct(Version $version, $conversationSid) { parent::__construct($version); // Path Solution $this->solution = array('conversationSid' => $conversationSid, ); $this->uri = '/Conversations/' . \rawurlencode($conversationSid) . '/Messages'; } /** * Create a new MessageInstance * * @param array|Options $options Optional Arguments * @return MessageInstance Newly created MessageInstance * @throws TwilioException When an HTTP error occurs. */ public function create($options = array()) { $options = new Values($options); $data = Values::of(array( 'Author' => $options['author'], 'Body' => $options['body'], 'DateCreated' => Serialize::iso8601DateTime($options['dateCreated']), 'DateUpdated' => Serialize::iso8601DateTime($options['dateUpdated']), 'Attributes' => $options['attributes'], 'MediaSid' => $options['mediaSid'], )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new MessageInstance($this->version, $payload, $this->solution['conversationSid']); } /** * Streams MessageInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads MessageInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return MessageInstance[] Array of results */ public function read($limit = null, $pageSize = null) { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of MessageInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of MessageInstance */ public function page($pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $params = Values::of(array( 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new MessagePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of MessageInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of MessageInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new MessagePage($this->version, $response, $this->solution); } /** * Constructs a MessageContext * * @param string $sid A 34 character string that uniquely identifies this * resource. * @return \Twilio\Rest\Conversations\V1\Conversation\MessageContext */ public function getContext($sid) { return new MessageContext($this->version, $this->solution['conversationSid'], $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Conversations.V1.MessageList]'; } } sdk/src/Twilio/Rest/Conversations/V1/Conversation/MessageInstance.php 0000644 00000012000 15002236443 0021647 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1\Conversation; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * * @property string $accountSid * @property string $conversationSid * @property string $sid * @property int $index * @property string $author * @property string $body * @property array $media * @property string $attributes * @property string $participantSid * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $url */ class MessageInstance extends InstanceResource { /** * Initialize the MessageInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $conversationSid The unique id of the Conversation for this * message. * @param string $sid A 34 character string that uniquely identifies this * resource. * @return \Twilio\Rest\Conversations\V1\Conversation\MessageInstance */ public function __construct(Version $version, array $payload, $conversationSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'accountSid' => Values::array_get($payload, 'account_sid'), 'conversationSid' => Values::array_get($payload, 'conversation_sid'), 'sid' => Values::array_get($payload, 'sid'), 'index' => Values::array_get($payload, 'index'), 'author' => Values::array_get($payload, 'author'), 'body' => Values::array_get($payload, 'body'), 'media' => Values::array_get($payload, 'media'), 'attributes' => Values::array_get($payload, 'attributes'), 'participantSid' => Values::array_get($payload, 'participant_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), ); $this->solution = array( 'conversationSid' => $conversationSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Conversations\V1\Conversation\MessageContext Context * for this * MessageInstance */ protected function proxy() { if (!$this->context) { $this->context = new MessageContext( $this->version, $this->solution['conversationSid'], $this->solution['sid'] ); } return $this->context; } /** * Update the MessageInstance * * @param array|Options $options Optional Arguments * @return MessageInstance Updated MessageInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Deletes the MessageInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Fetch a MessageInstance * * @return MessageInstance Fetched MessageInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Conversations.V1.MessageInstance ' . \implode(' ', $context) . ']'; } }sdk/src/Twilio/Rest/Conversations/V1/Conversation/WebhookPage.php 0000644 00000001576 15002236443 0021011 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1\Conversation; use Twilio\Page; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class WebhookPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new WebhookInstance($this->version, $payload, $this->solution['conversationSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Conversations.V1.WebhookPage]'; } } sdk/src/Twilio/Rest/Conversations/V1/Conversation/WebhookList.php 0000644 00000014574 15002236443 0021052 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1\Conversation; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class WebhookList extends ListResource { /** * Construct the WebhookList * * @param Version $version Version that contains the resource * @param string $conversationSid The unique id of the Conversation for this * webhook. * @return \Twilio\Rest\Conversations\V1\Conversation\WebhookList */ public function __construct(Version $version, $conversationSid) { parent::__construct($version); // Path Solution $this->solution = array('conversationSid' => $conversationSid, ); $this->uri = '/Conversations/' . \rawurlencode($conversationSid) . '/Webhooks'; } /** * Streams WebhookInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads WebhookInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return WebhookInstance[] Array of results */ public function read($limit = null, $pageSize = null) { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of WebhookInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of WebhookInstance */ public function page($pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $params = Values::of(array( 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new WebhookPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of WebhookInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of WebhookInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new WebhookPage($this->version, $response, $this->solution); } /** * Create a new WebhookInstance * * @param string $target The target of this webhook. * @param array|Options $options Optional Arguments * @return WebhookInstance Newly created WebhookInstance * @throws TwilioException When an HTTP error occurs. */ public function create($target, $options = array()) { $options = new Values($options); $data = Values::of(array( 'Target' => $target, 'Configuration.Url' => $options['configurationUrl'], 'Configuration.Method' => $options['configurationMethod'], 'Configuration.Filters' => Serialize::map($options['configurationFilters'], function($e) { return $e; }), 'Configuration.Triggers' => Serialize::map($options['configurationTriggers'], function($e) { return $e; }), 'Configuration.FlowSid' => $options['configurationFlowSid'], 'Configuration.ReplayAfter' => $options['configurationReplayAfter'], )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new WebhookInstance($this->version, $payload, $this->solution['conversationSid']); } /** * Constructs a WebhookContext * * @param string $sid A 34 character string that uniquely identifies this * resource. * @return \Twilio\Rest\Conversations\V1\Conversation\WebhookContext */ public function getContext($sid) { return new WebhookContext($this->version, $this->solution['conversationSid'], $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Conversations.V1.WebhookList]'; } } sdk/src/Twilio/Rest/Conversations/V1/Conversation/MessagePage.php 0000644 00000001576 15002236443 0020777 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1\Conversation; use Twilio\Page; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class MessagePage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new MessageInstance($this->version, $payload, $this->solution['conversationSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Conversations.V1.MessagePage]'; } } sdk/src/Twilio/Rest/Conversations/V1/Conversation/ParticipantContext.php 0000644 00000006573 15002236443 0022443 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1\Conversation; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class ParticipantContext extends InstanceContext { /** * Initialize the ParticipantContext * * @param \Twilio\Version $version Version that contains the resource * @param string $conversationSid The unique id of the Conversation for this * participant. * @param string $sid A 34 character string that uniquely identifies this * resource. * @return \Twilio\Rest\Conversations\V1\Conversation\ParticipantContext */ public function __construct(Version $version, $conversationSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array('conversationSid' => $conversationSid, 'sid' => $sid, ); $this->uri = '/Conversations/' . \rawurlencode($conversationSid) . '/Participants/' . \rawurlencode($sid) . ''; } /** * Update the ParticipantInstance * * @param array|Options $options Optional Arguments * @return ParticipantInstance Updated ParticipantInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { $options = new Values($options); $data = Values::of(array( 'DateCreated' => Serialize::iso8601DateTime($options['dateCreated']), 'DateUpdated' => Serialize::iso8601DateTime($options['dateUpdated']), 'Attributes' => $options['attributes'], )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new ParticipantInstance( $this->version, $payload, $this->solution['conversationSid'], $this->solution['sid'] ); } /** * Deletes the ParticipantInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Fetch a ParticipantInstance * * @return ParticipantInstance Fetched ParticipantInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new ParticipantInstance( $this->version, $payload, $this->solution['conversationSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Conversations.V1.ParticipantContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/Conversation/ParticipantPage.php 0000644 00000001612 15002236443 0021660 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1\Conversation; use Twilio\Page; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class ParticipantPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new ParticipantInstance($this->version, $payload, $this->solution['conversationSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Conversations.V1.ParticipantPage]'; } } sdk/src/Twilio/Rest/Conversations/V1/Conversation/WebhookContext.php 0000644 00000007046 15002236443 0021557 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1\Conversation; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class WebhookContext extends InstanceContext { /** * Initialize the WebhookContext * * @param \Twilio\Version $version Version that contains the resource * @param string $conversationSid The unique id of the Conversation for this * webhook. * @param string $sid A 34 character string that uniquely identifies this * resource. * @return \Twilio\Rest\Conversations\V1\Conversation\WebhookContext */ public function __construct(Version $version, $conversationSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array('conversationSid' => $conversationSid, 'sid' => $sid, ); $this->uri = '/Conversations/' . \rawurlencode($conversationSid) . '/Webhooks/' . \rawurlencode($sid) . ''; } /** * Fetch a WebhookInstance * * @return WebhookInstance Fetched WebhookInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new WebhookInstance( $this->version, $payload, $this->solution['conversationSid'], $this->solution['sid'] ); } /** * Update the WebhookInstance * * @param array|Options $options Optional Arguments * @return WebhookInstance Updated WebhookInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { $options = new Values($options); $data = Values::of(array( 'Configuration.Url' => $options['configurationUrl'], 'Configuration.Method' => $options['configurationMethod'], 'Configuration.Filters' => Serialize::map($options['configurationFilters'], function($e) { return $e; }), 'Configuration.Triggers' => Serialize::map($options['configurationTriggers'], function($e) { return $e; }), 'Configuration.FlowSid' => $options['configurationFlowSid'], )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new WebhookInstance( $this->version, $payload, $this->solution['conversationSid'], $this->solution['sid'] ); } /** * Deletes the WebhookInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Conversations.V1.WebhookContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/Conversation/ParticipantOptions.php 0000644 00000025375 15002236443 0022453 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1\Conversation; 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 ParticipantOptions { /** * @param string $identity A unique string identifier for the conversation * participant as Chat User. * @param string $messagingBindingAddress The address of the participant's * device. * @param string $messagingBindingProxyAddress The address of the Twilio phone * number that the participant is * in contact with. * @param \DateTime $dateCreated The date that this resource was created. * @param \DateTime $dateUpdated The date that this resource was last updated. * @param string $attributes An optional string metadata field you can use to * store any data you wish. * @param string $messagingBindingProjectedAddress The address of the Twilio * phone number that is used in * Group MMS. * @return CreateParticipantOptions Options builder */ public static function create($identity = Values::NONE, $messagingBindingAddress = Values::NONE, $messagingBindingProxyAddress = Values::NONE, $dateCreated = Values::NONE, $dateUpdated = Values::NONE, $attributes = Values::NONE, $messagingBindingProjectedAddress = Values::NONE) { return new CreateParticipantOptions($identity, $messagingBindingAddress, $messagingBindingProxyAddress, $dateCreated, $dateUpdated, $attributes, $messagingBindingProjectedAddress); } /** * @param \DateTime $dateCreated The date that this resource was created. * @param \DateTime $dateUpdated The date that this resource was last updated. * @param string $attributes An optional string metadata field you can use to * store any data you wish. * @return UpdateParticipantOptions Options builder */ public static function update($dateCreated = Values::NONE, $dateUpdated = Values::NONE, $attributes = Values::NONE) { return new UpdateParticipantOptions($dateCreated, $dateUpdated, $attributes); } } class CreateParticipantOptions extends Options { /** * @param string $identity A unique string identifier for the conversation * participant as Chat User. * @param string $messagingBindingAddress The address of the participant's * device. * @param string $messagingBindingProxyAddress The address of the Twilio phone * number that the participant is * in contact with. * @param \DateTime $dateCreated The date that this resource was created. * @param \DateTime $dateUpdated The date that this resource was last updated. * @param string $attributes An optional string metadata field you can use to * store any data you wish. * @param string $messagingBindingProjectedAddress The address of the Twilio * phone number that is used in * Group MMS. */ public function __construct($identity = Values::NONE, $messagingBindingAddress = Values::NONE, $messagingBindingProxyAddress = Values::NONE, $dateCreated = Values::NONE, $dateUpdated = Values::NONE, $attributes = Values::NONE, $messagingBindingProjectedAddress = Values::NONE) { $this->options['identity'] = $identity; $this->options['messagingBindingAddress'] = $messagingBindingAddress; $this->options['messagingBindingProxyAddress'] = $messagingBindingProxyAddress; $this->options['dateCreated'] = $dateCreated; $this->options['dateUpdated'] = $dateUpdated; $this->options['attributes'] = $attributes; $this->options['messagingBindingProjectedAddress'] = $messagingBindingProjectedAddress; } /** * A unique string identifier for the conversation participant as [Chat User](https://www.twilio.com/docs/chat/rest/user-resource). This parameter is non-null if (and only if) the participant is using the Programmable Chat SDK to communicate. Limited to 256 characters. * * @param string $identity A unique string identifier for the conversation * participant as Chat User. * @return $this Fluent Builder */ public function setIdentity($identity) { $this->options['identity'] = $identity; return $this; } /** * The address of the participant's device, e.g. a phone number or Messenger ID. Together with the Proxy address, this determines a participant uniquely. This field (with proxy_address) is only null when the participant is interacting from a Chat endpoint (see the 'identity' field). * * @param string $messagingBindingAddress The address of the participant's * device. * @return $this Fluent Builder */ public function setMessagingBindingAddress($messagingBindingAddress) { $this->options['messagingBindingAddress'] = $messagingBindingAddress; return $this; } /** * The address of the Twilio phone number (or WhatsApp number, or Messenger Page ID) that the participant is in contact with. This field, together with participant address, is only null when the participant is interacting from a Chat endpoint (see the 'identity' field). * * @param string $messagingBindingProxyAddress The address of the Twilio phone * number that the participant is * in contact with. * @return $this Fluent Builder */ public function setMessagingBindingProxyAddress($messagingBindingProxyAddress) { $this->options['messagingBindingProxyAddress'] = $messagingBindingProxyAddress; return $this; } /** * The date that this resource was created. * * @param \DateTime $dateCreated The date that this resource was created. * @return $this Fluent Builder */ public function setDateCreated($dateCreated) { $this->options['dateCreated'] = $dateCreated; return $this; } /** * The date that this resource was last updated. * * @param \DateTime $dateUpdated The date that this resource was last updated. * @return $this Fluent Builder */ public function setDateUpdated($dateUpdated) { $this->options['dateUpdated'] = $dateUpdated; return $this; } /** * An optional string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set "{}" will be returned. * * @param string $attributes An optional string metadata field you can use to * store any data you wish. * @return $this Fluent Builder */ public function setAttributes($attributes) { $this->options['attributes'] = $attributes; return $this; } /** * The address of the Twilio phone number that is used in Group MMS. Communication mask for the Chat participant with Identity. * * @param string $messagingBindingProjectedAddress The address of the Twilio * phone number that is used in * Group MMS. * @return $this Fluent Builder */ public function setMessagingBindingProjectedAddress($messagingBindingProjectedAddress) { $this->options['messagingBindingProjectedAddress'] = $messagingBindingProjectedAddress; 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.Conversations.V1.CreateParticipantOptions ' . \implode(' ', $options) . ']'; } } class UpdateParticipantOptions extends Options { /** * @param \DateTime $dateCreated The date that this resource was created. * @param \DateTime $dateUpdated The date that this resource was last updated. * @param string $attributes An optional string metadata field you can use to * store any data you wish. */ public function __construct($dateCreated = Values::NONE, $dateUpdated = Values::NONE, $attributes = Values::NONE) { $this->options['dateCreated'] = $dateCreated; $this->options['dateUpdated'] = $dateUpdated; $this->options['attributes'] = $attributes; } /** * The date that this resource was created. * * @param \DateTime $dateCreated The date that this resource was created. * @return $this Fluent Builder */ public function setDateCreated($dateCreated) { $this->options['dateCreated'] = $dateCreated; return $this; } /** * The date that this resource was last updated. * * @param \DateTime $dateUpdated The date that this resource was last updated. * @return $this Fluent Builder */ public function setDateUpdated($dateUpdated) { $this->options['dateUpdated'] = $dateUpdated; return $this; } /** * An optional string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set "{}" will be returned. * * @param string $attributes An optional string metadata field you can use to * store any data you wish. * @return $this Fluent Builder */ public function setAttributes($attributes) { $this->options['attributes'] = $attributes; 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.Conversations.V1.UpdateParticipantOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/Conversation/MessageOptions.php 0000644 00000021602 15002236443 0021546 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1\Conversation; 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 MessageOptions { /** * @param string $author The channel specific identifier of the message's * author. * @param string $body The content of the message. * @param \DateTime $dateCreated The date that this resource was created. * @param \DateTime $dateUpdated The date that this resource was last updated. * @param string $attributes A string metadata field you can use to store any * data you wish. * @param string $mediaSid The Media Sid to be attached to the new Message. * @return CreateMessageOptions Options builder */ public static function create($author = Values::NONE, $body = Values::NONE, $dateCreated = Values::NONE, $dateUpdated = Values::NONE, $attributes = Values::NONE, $mediaSid = Values::NONE) { return new CreateMessageOptions($author, $body, $dateCreated, $dateUpdated, $attributes, $mediaSid); } /** * @param string $author The channel specific identifier of the message's * author. * @param string $body The content of the message. * @param \DateTime $dateCreated The date that this resource was created. * @param \DateTime $dateUpdated The date that this resource was last updated. * @param string $attributes A string metadata field you can use to store any * data you wish. * @return UpdateMessageOptions Options builder */ public static function update($author = Values::NONE, $body = Values::NONE, $dateCreated = Values::NONE, $dateUpdated = Values::NONE, $attributes = Values::NONE) { return new UpdateMessageOptions($author, $body, $dateCreated, $dateUpdated, $attributes); } } class CreateMessageOptions extends Options { /** * @param string $author The channel specific identifier of the message's * author. * @param string $body The content of the message. * @param \DateTime $dateCreated The date that this resource was created. * @param \DateTime $dateUpdated The date that this resource was last updated. * @param string $attributes A string metadata field you can use to store any * data you wish. * @param string $mediaSid The Media Sid to be attached to the new Message. */ public function __construct($author = Values::NONE, $body = Values::NONE, $dateCreated = Values::NONE, $dateUpdated = Values::NONE, $attributes = Values::NONE, $mediaSid = Values::NONE) { $this->options['author'] = $author; $this->options['body'] = $body; $this->options['dateCreated'] = $dateCreated; $this->options['dateUpdated'] = $dateUpdated; $this->options['attributes'] = $attributes; $this->options['mediaSid'] = $mediaSid; } /** * The channel specific identifier of the message's author. Defaults to `system`. * * @param string $author The channel specific identifier of the message's * author. * @return $this Fluent Builder */ public function setAuthor($author) { $this->options['author'] = $author; return $this; } /** * The content of the message, can be up to 1,600 characters long. * * @param string $body The content of the message. * @return $this Fluent Builder */ public function setBody($body) { $this->options['body'] = $body; return $this; } /** * The date that this resource was created. * * @param \DateTime $dateCreated The date that this resource was created. * @return $this Fluent Builder */ public function setDateCreated($dateCreated) { $this->options['dateCreated'] = $dateCreated; return $this; } /** * The date that this resource was last updated. `null` if the message has not been edited. * * @param \DateTime $dateUpdated The date that this resource was last updated. * @return $this Fluent Builder */ public function setDateUpdated($dateUpdated) { $this->options['dateUpdated'] = $dateUpdated; return $this; } /** * A string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set "{}" will be returned. * * @param string $attributes A string metadata field you can use to store any * data you wish. * @return $this Fluent Builder */ public function setAttributes($attributes) { $this->options['attributes'] = $attributes; return $this; } /** * The Media Sid to be attached to the new Message. * * @param string $mediaSid The Media Sid to be attached to the new Message. * @return $this Fluent Builder */ public function setMediaSid($mediaSid) { $this->options['mediaSid'] = $mediaSid; 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.Conversations.V1.CreateMessageOptions ' . \implode(' ', $options) . ']'; } } class UpdateMessageOptions extends Options { /** * @param string $author The channel specific identifier of the message's * author. * @param string $body The content of the message. * @param \DateTime $dateCreated The date that this resource was created. * @param \DateTime $dateUpdated The date that this resource was last updated. * @param string $attributes A string metadata field you can use to store any * data you wish. */ public function __construct($author = Values::NONE, $body = Values::NONE, $dateCreated = Values::NONE, $dateUpdated = Values::NONE, $attributes = Values::NONE) { $this->options['author'] = $author; $this->options['body'] = $body; $this->options['dateCreated'] = $dateCreated; $this->options['dateUpdated'] = $dateUpdated; $this->options['attributes'] = $attributes; } /** * The channel specific identifier of the message's author. Defaults to `system`. * * @param string $author The channel specific identifier of the message's * author. * @return $this Fluent Builder */ public function setAuthor($author) { $this->options['author'] = $author; return $this; } /** * The content of the message, can be up to 1,600 characters long. * * @param string $body The content of the message. * @return $this Fluent Builder */ public function setBody($body) { $this->options['body'] = $body; return $this; } /** * The date that this resource was created. * * @param \DateTime $dateCreated The date that this resource was created. * @return $this Fluent Builder */ public function setDateCreated($dateCreated) { $this->options['dateCreated'] = $dateCreated; return $this; } /** * The date that this resource was last updated. `null` if the message has not been edited. * * @param \DateTime $dateUpdated The date that this resource was last updated. * @return $this Fluent Builder */ public function setDateUpdated($dateUpdated) { $this->options['dateUpdated'] = $dateUpdated; return $this; } /** * A string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set "{}" will be returned. * * @param string $attributes A string metadata field you can use to store any * data you wish. * @return $this Fluent Builder */ public function setAttributes($attributes) { $this->options['attributes'] = $attributes; 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.Conversations.V1.UpdateMessageOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/WebhookOptions.php 0000644 00000011424 15002236443 0017107 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1; 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 WebhookOptions { /** * @param string $method The HTTP method to be used when sending a webhook * request. * @param string $filters The list of webhook event triggers that are enabled * for this Service. * @param string $preWebhookUrl The absolute url the pre-event webhook request * should be sent to. * @param string $postWebhookUrl The absolute url the post-event webhook * request should be sent to. * @param string $target The routing target of the webhook. * @return UpdateWebhookOptions Options builder */ public static function update($method = Values::NONE, $filters = Values::NONE, $preWebhookUrl = Values::NONE, $postWebhookUrl = Values::NONE, $target = Values::NONE) { return new UpdateWebhookOptions($method, $filters, $preWebhookUrl, $postWebhookUrl, $target); } } class UpdateWebhookOptions extends Options { /** * @param string $method The HTTP method to be used when sending a webhook * request. * @param string $filters The list of webhook event triggers that are enabled * for this Service. * @param string $preWebhookUrl The absolute url the pre-event webhook request * should be sent to. * @param string $postWebhookUrl The absolute url the post-event webhook * request should be sent to. * @param string $target The routing target of the webhook. */ public function __construct($method = Values::NONE, $filters = Values::NONE, $preWebhookUrl = Values::NONE, $postWebhookUrl = Values::NONE, $target = Values::NONE) { $this->options['method'] = $method; $this->options['filters'] = $filters; $this->options['preWebhookUrl'] = $preWebhookUrl; $this->options['postWebhookUrl'] = $postWebhookUrl; $this->options['target'] = $target; } /** * The HTTP method to be used when sending a webhook request. * * @param string $method The HTTP method to be used when sending a webhook * request. * @return $this Fluent Builder */ public function setMethod($method) { $this->options['method'] = $method; return $this; } /** * The list of webhook event triggers that are enabled for this Service: `onMessageAdded`, `onMessageUpdated`, `onMessageRemoved`, `onConversationUpdated`, `onConversationRemoved`, `onParticipantAdded`, `onParticipantUpdated`, `onParticipantRemoved` * * @param string $filters The list of webhook event triggers that are enabled * for this Service. * @return $this Fluent Builder */ public function setFilters($filters) { $this->options['filters'] = $filters; return $this; } /** * The absolute url the pre-event webhook request should be sent to. * * @param string $preWebhookUrl The absolute url the pre-event webhook request * should be sent to. * @return $this Fluent Builder */ public function setPreWebhookUrl($preWebhookUrl) { $this->options['preWebhookUrl'] = $preWebhookUrl; return $this; } /** * The absolute url the post-event webhook request should be sent to. * * @param string $postWebhookUrl The absolute url the post-event webhook * request should be sent to. * @return $this Fluent Builder */ public function setPostWebhookUrl($postWebhookUrl) { $this->options['postWebhookUrl'] = $postWebhookUrl; return $this; } /** * The routing target of the webhook. Can be ordinary or route internally to Flex * * @param string $target The routing target of the webhook. * @return $this Fluent Builder */ public function setTarget($target) { $this->options['target'] = $target; 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.Conversations.V1.UpdateWebhookOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/ConversationOptions.php 0000644 00000022214 15002236443 0020162 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1; 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 ConversationOptions { /** * @param string $friendlyName The human-readable name of this conversation. * @param \DateTime $dateCreated The date that this resource was created. * @param \DateTime $dateUpdated The date that this resource was last updated. * @param string $messagingServiceSid The unique id of the SMS Service this * conversation belongs to. * @param string $attributes An optional string metadata field you can use to * store any data you wish. * @return CreateConversationOptions Options builder */ public static function create($friendlyName = Values::NONE, $dateCreated = Values::NONE, $dateUpdated = Values::NONE, $messagingServiceSid = Values::NONE, $attributes = Values::NONE) { return new CreateConversationOptions($friendlyName, $dateCreated, $dateUpdated, $messagingServiceSid, $attributes); } /** * @param string $friendlyName The human-readable name of this conversation. * @param \DateTime $dateCreated The date that this resource was created. * @param \DateTime $dateUpdated The date that this resource was last updated. * @param string $attributes An optional string metadata field you can use to * store any data you wish. * @param string $messagingServiceSid The unique id of the SMS Service this * conversation belongs to. * @return UpdateConversationOptions Options builder */ public static function update($friendlyName = Values::NONE, $dateCreated = Values::NONE, $dateUpdated = Values::NONE, $attributes = Values::NONE, $messagingServiceSid = Values::NONE) { return new UpdateConversationOptions($friendlyName, $dateCreated, $dateUpdated, $attributes, $messagingServiceSid); } } class CreateConversationOptions extends Options { /** * @param string $friendlyName The human-readable name of this conversation. * @param \DateTime $dateCreated The date that this resource was created. * @param \DateTime $dateUpdated The date that this resource was last updated. * @param string $messagingServiceSid The unique id of the SMS Service this * conversation belongs to. * @param string $attributes An optional string metadata field you can use to * store any data you wish. */ public function __construct($friendlyName = Values::NONE, $dateCreated = Values::NONE, $dateUpdated = Values::NONE, $messagingServiceSid = Values::NONE, $attributes = Values::NONE) { $this->options['friendlyName'] = $friendlyName; $this->options['dateCreated'] = $dateCreated; $this->options['dateUpdated'] = $dateUpdated; $this->options['messagingServiceSid'] = $messagingServiceSid; $this->options['attributes'] = $attributes; } /** * The human-readable name of this conversation, limited to 256 characters. Optional. * * @param string $friendlyName The human-readable name of this conversation. * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The date that this resource was created. * * @param \DateTime $dateCreated The date that this resource was created. * @return $this Fluent Builder */ public function setDateCreated($dateCreated) { $this->options['dateCreated'] = $dateCreated; return $this; } /** * The date that this resource was last updated. * * @param \DateTime $dateUpdated The date that this resource was last updated. * @return $this Fluent Builder */ public function setDateUpdated($dateUpdated) { $this->options['dateUpdated'] = $dateUpdated; return $this; } /** * The unique id of the [SMS Service](https://www.twilio.com/docs/sms/services/api) this conversation belongs to. * * @param string $messagingServiceSid The unique id of the SMS Service this * conversation belongs to. * @return $this Fluent Builder */ public function setMessagingServiceSid($messagingServiceSid) { $this->options['messagingServiceSid'] = $messagingServiceSid; return $this; } /** * An optional string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set "{}" will be returned. * * @param string $attributes An optional string metadata field you can use to * store any data you wish. * @return $this Fluent Builder */ public function setAttributes($attributes) { $this->options['attributes'] = $attributes; 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.Conversations.V1.CreateConversationOptions ' . \implode(' ', $options) . ']'; } } class UpdateConversationOptions extends Options { /** * @param string $friendlyName The human-readable name of this conversation. * @param \DateTime $dateCreated The date that this resource was created. * @param \DateTime $dateUpdated The date that this resource was last updated. * @param string $attributes An optional string metadata field you can use to * store any data you wish. * @param string $messagingServiceSid The unique id of the SMS Service this * conversation belongs to. */ public function __construct($friendlyName = Values::NONE, $dateCreated = Values::NONE, $dateUpdated = Values::NONE, $attributes = Values::NONE, $messagingServiceSid = Values::NONE) { $this->options['friendlyName'] = $friendlyName; $this->options['dateCreated'] = $dateCreated; $this->options['dateUpdated'] = $dateUpdated; $this->options['attributes'] = $attributes; $this->options['messagingServiceSid'] = $messagingServiceSid; } /** * The human-readable name of this conversation, limited to 256 characters. Optional. * * @param string $friendlyName The human-readable name of this conversation. * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The date that this resource was created. * * @param \DateTime $dateCreated The date that this resource was created. * @return $this Fluent Builder */ public function setDateCreated($dateCreated) { $this->options['dateCreated'] = $dateCreated; return $this; } /** * The date that this resource was last updated. * * @param \DateTime $dateUpdated The date that this resource was last updated. * @return $this Fluent Builder */ public function setDateUpdated($dateUpdated) { $this->options['dateUpdated'] = $dateUpdated; return $this; } /** * An optional string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set "{}" will be returned. * * @param string $attributes An optional string metadata field you can use to * store any data you wish. * @return $this Fluent Builder */ public function setAttributes($attributes) { $this->options['attributes'] = $attributes; return $this; } /** * The unique id of the [SMS Service](https://www.twilio.com/docs/sms/services/api) this conversation belongs to. * * @param string $messagingServiceSid The unique id of the SMS Service this * conversation belongs to. * @return $this Fluent Builder */ public function setMessagingServiceSid($messagingServiceSid) { $this->options['messagingServiceSid'] = $messagingServiceSid; 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.Conversations.V1.UpdateConversationOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/ConversationContext.php 0000644 00000013650 15002236443 0020157 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Rest\Conversations\V1\Conversation\MessageList; use Twilio\Rest\Conversations\V1\Conversation\ParticipantList; use Twilio\Rest\Conversations\V1\Conversation\WebhookList; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * * @property \Twilio\Rest\Conversations\V1\Conversation\ParticipantList $participants * @property \Twilio\Rest\Conversations\V1\Conversation\MessageList $messages * @property \Twilio\Rest\Conversations\V1\Conversation\WebhookList $webhooks * @method \Twilio\Rest\Conversations\V1\Conversation\ParticipantContext participants(string $sid) * @method \Twilio\Rest\Conversations\V1\Conversation\MessageContext messages(string $sid) * @method \Twilio\Rest\Conversations\V1\Conversation\WebhookContext webhooks(string $sid) */ class ConversationContext extends InstanceContext { protected $_participants = null; protected $_messages = null; protected $_webhooks = null; /** * Initialize the ConversationContext * * @param \Twilio\Version $version Version that contains the resource * @param string $sid A 34 character string that uniquely identifies this * resource. * @return \Twilio\Rest\Conversations\V1\ConversationContext */ public function __construct(Version $version, $sid) { parent::__construct($version); // Path Solution $this->solution = array('sid' => $sid, ); $this->uri = '/Conversations/' . \rawurlencode($sid) . ''; } /** * Update the ConversationInstance * * @param array|Options $options Optional Arguments * @return ConversationInstance Updated ConversationInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { $options = new Values($options); $data = Values::of(array( 'FriendlyName' => $options['friendlyName'], 'DateCreated' => Serialize::iso8601DateTime($options['dateCreated']), 'DateUpdated' => Serialize::iso8601DateTime($options['dateUpdated']), 'Attributes' => $options['attributes'], 'MessagingServiceSid' => $options['messagingServiceSid'], )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new ConversationInstance($this->version, $payload, $this->solution['sid']); } /** * Deletes the ConversationInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Fetch a ConversationInstance * * @return ConversationInstance Fetched ConversationInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new ConversationInstance($this->version, $payload, $this->solution['sid']); } /** * Access the participants * * @return \Twilio\Rest\Conversations\V1\Conversation\ParticipantList */ protected function getParticipants() { if (!$this->_participants) { $this->_participants = new ParticipantList($this->version, $this->solution['sid']); } return $this->_participants; } /** * Access the messages * * @return \Twilio\Rest\Conversations\V1\Conversation\MessageList */ protected function getMessages() { if (!$this->_messages) { $this->_messages = new MessageList($this->version, $this->solution['sid']); } return $this->_messages; } /** * Access the webhooks * * @return \Twilio\Rest\Conversations\V1\Conversation\WebhookList */ protected function getWebhooks() { if (!$this->_webhooks) { $this->_webhooks = new WebhookList($this->version, $this->solution['sid']); } return $this->_webhooks; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get($name) { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Conversations.V1.ConversationContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/ConversationPage.php 0000644 00000001534 15002236443 0017405 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1; use Twilio\Page; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class ConversationPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new ConversationInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Conversations.V1.ConversationPage]'; } } sdk/src/Twilio/Rest/Conversations/V1/WebhookPage.php 0000644 00000001515 15002236443 0016330 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1; use Twilio\Page; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class WebhookPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new WebhookInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Conversations.V1.WebhookPage]'; } } sdk/src/Twilio/Rest/Conversations/V1/ConversationList.php 0000644 00000013552 15002236443 0017447 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class ConversationList extends ListResource { /** * Construct the ConversationList * * @param Version $version Version that contains the resource * @return \Twilio\Rest\Conversations\V1\ConversationList */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = array(); $this->uri = '/Conversations'; } /** * Create a new ConversationInstance * * @param array|Options $options Optional Arguments * @return ConversationInstance Newly created ConversationInstance * @throws TwilioException When an HTTP error occurs. */ public function create($options = array()) { $options = new Values($options); $data = Values::of(array( 'FriendlyName' => $options['friendlyName'], 'DateCreated' => Serialize::iso8601DateTime($options['dateCreated']), 'DateUpdated' => Serialize::iso8601DateTime($options['dateUpdated']), 'MessagingServiceSid' => $options['messagingServiceSid'], 'Attributes' => $options['attributes'], )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new ConversationInstance($this->version, $payload); } /** * Streams ConversationInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads ConversationInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return ConversationInstance[] Array of results */ public function read($limit = null, $pageSize = null) { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of ConversationInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of ConversationInstance */ public function page($pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $params = Values::of(array( 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new ConversationPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of ConversationInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of ConversationInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new ConversationPage($this->version, $response, $this->solution); } /** * Constructs a ConversationContext * * @param string $sid A 34 character string that uniquely identifies this * resource. * @return \Twilio\Rest\Conversations\V1\ConversationContext */ public function getContext($sid) { return new ConversationContext($this->version, $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Conversations.V1.ConversationList]'; } } sdk/src/Twilio/Rest/Conversations/V1/WebhookList.php 0000644 00000002143 15002236443 0016365 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1; use Twilio\ListResource; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class WebhookList extends ListResource { /** * Construct the WebhookList * * @param Version $version Version that contains the resource * @return \Twilio\Rest\Conversations\V1\WebhookList */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = array(); } /** * Constructs a WebhookContext * * @return \Twilio\Rest\Conversations\V1\WebhookContext */ public function getContext() { return new WebhookContext($this->version); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Conversations.V1.WebhookList]'; } } sdk/src/Twilio/Rest/Conversations/V1/WebhookContext.php 0000644 00000004757 15002236443 0017113 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class WebhookContext extends InstanceContext { /** * Initialize the WebhookContext * * @param \Twilio\Version $version Version that contains the resource * @return \Twilio\Rest\Conversations\V1\WebhookContext */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = array(); $this->uri = '/Conversations/Webhooks'; } /** * Fetch a WebhookInstance * * @return WebhookInstance Fetched WebhookInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new WebhookInstance($this->version, $payload); } /** * Update the WebhookInstance * * @param array|Options $options Optional Arguments * @return WebhookInstance Updated WebhookInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { $options = new Values($options); $data = Values::of(array( 'Method' => $options['method'], 'Filters' => Serialize::map($options['filters'], function($e) { return $e; }), 'PreWebhookUrl' => $options['preWebhookUrl'], 'PostWebhookUrl' => $options['postWebhookUrl'], 'Target' => $options['target'], )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new WebhookInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Conversations.V1.WebhookContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Conversations/V1/ConversationInstance.php 0000644 00000012356 15002236443 0020301 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Conversations\V1; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * * @property string $accountSid * @property string $chatServiceSid * @property string $messagingServiceSid * @property string $sid * @property string $friendlyName * @property string $attributes * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $url * @property array $links */ class ConversationInstance extends InstanceResource { protected $_participants = null; protected $_messages = null; protected $_webhooks = null; /** * Initialize the ConversationInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid A 34 character string that uniquely identifies this * resource. * @return \Twilio\Rest\Conversations\V1\ConversationInstance */ public function __construct(Version $version, array $payload, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'accountSid' => Values::array_get($payload, 'account_sid'), 'chatServiceSid' => Values::array_get($payload, 'chat_service_sid'), 'messagingServiceSid' => Values::array_get($payload, 'messaging_service_sid'), 'sid' => Values::array_get($payload, 'sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'attributes' => Values::array_get($payload, 'attributes'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ); $this->solution = array('sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Conversations\V1\ConversationContext Context for this * ConversationInstance */ protected function proxy() { if (!$this->context) { $this->context = new ConversationContext($this->version, $this->solution['sid']); } return $this->context; } /** * Update the ConversationInstance * * @param array|Options $options Optional Arguments * @return ConversationInstance Updated ConversationInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Deletes the ConversationInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Fetch a ConversationInstance * * @return ConversationInstance Fetched ConversationInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Access the participants * * @return \Twilio\Rest\Conversations\V1\Conversation\ParticipantList */ protected function getParticipants() { return $this->proxy()->participants; } /** * Access the messages * * @return \Twilio\Rest\Conversations\V1\Conversation\MessageList */ protected function getMessages() { return $this->proxy()->messages; } /** * Access the webhooks * * @return \Twilio\Rest\Conversations\V1\Conversation\WebhookList */ protected function getWebhooks() { return $this->proxy()->webhooks; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Conversations.V1.ConversationInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V1.php 0000644 00000005426 15002236443 0013513 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\Rest\IpMessaging\V1\CredentialList; use Twilio\Rest\IpMessaging\V1\ServiceList; use Twilio\Version; /** * @property \Twilio\Rest\IpMessaging\V1\CredentialList $credentials * @property \Twilio\Rest\IpMessaging\V1\ServiceList $services * @method \Twilio\Rest\IpMessaging\V1\CredentialContext credentials(string $sid) * @method \Twilio\Rest\IpMessaging\V1\ServiceContext services(string $sid) */ class V1 extends Version { protected $_credentials = null; protected $_services = null; /** * Construct the V1 version of IpMessaging * * @param \Twilio\Domain $domain Domain that contains the version * @return \Twilio\Rest\IpMessaging\V1 V1 version of IpMessaging */ public function __construct(Domain $domain) { parent::__construct($domain); $this->version = 'v1'; } /** * @return \Twilio\Rest\IpMessaging\V1\CredentialList */ protected function getCredentials() { if (!$this->_credentials) { $this->_credentials = new CredentialList($this); } return $this->_credentials; } /** * @return \Twilio\Rest\IpMessaging\V1\ServiceList */ protected function getServices() { if (!$this->_services) { $this->_services = new ServiceList($this); } return $this->_services; } /** * Magic getter to lazy load root resources * * @param string $name Resource to return * @return \Twilio\ListResource The requested resource * @throws TwilioException For unknown resource */ public function __get($name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown resource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.IpMessaging.V1]'; } } sdk/src/Twilio/Rest/IpMessaging/V1/CredentialInstance.php 0000644 00000010110 15002236443 0017234 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V1; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $accountSid * @property string $friendlyName * @property string $type * @property string $sandbox * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $url */ class CredentialInstance extends InstanceResource { /** * Initialize the CredentialInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\IpMessaging\V1\CredentialInstance */ public function __construct(Version $version, array $payload, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'type' => Values::array_get($payload, 'type'), 'sandbox' => Values::array_get($payload, 'sandbox'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), ); $this->solution = array('sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\IpMessaging\V1\CredentialContext Context for this * CredentialInstance */ protected function proxy() { if (!$this->context) { $this->context = new CredentialContext($this->version, $this->solution['sid']); } return $this->context; } /** * Fetch a CredentialInstance * * @return CredentialInstance Fetched CredentialInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Update the CredentialInstance * * @param array|Options $options Optional Arguments * @return CredentialInstance Updated CredentialInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Deletes the CredentialInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.IpMessaging.V1.CredentialInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V1/ServiceOptions.php 0000644 00000201025 15002236443 0016460 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V1; use Twilio\Options; use Twilio\Values; abstract class ServiceOptions { /** * @param string $friendlyName A string to describe the resource * @param string $defaultServiceRoleSid The service role assigned to users when * they are added to the service * @param string $defaultChannelRoleSid The channel role assigned to users when * they are added to a channel * @param string $defaultChannelCreatorRoleSid The channel role assigned to a * channel creator when they join a * new channel * @param bool $readStatusEnabled Whether to enable the Message Consumption * Horizon feature * @param bool $reachabilityEnabled Whether to enable the Reachability * Indicator feature for this Service instance * @param int $typingIndicatorTimeout How long in seconds to wait before * assuming the user is no longer typing * @param int $consumptionReportInterval DEPRECATED * @param bool $notificationsNewMessageEnabled Whether to send a notification * when a new message is added to a * channel * @param string $notificationsNewMessageTemplate The template to use to create * the notification text * displayed when a new message * is added to a channel * @param bool $notificationsAddedToChannelEnabled Whether to send a * notification when a member * is added to a channel * @param string $notificationsAddedToChannelTemplate The template to use to * create the notification * text displayed when a * member is added to a * channel * @param bool $notificationsRemovedFromChannelEnabled Whether to send a * notification to a user * when they are removed * from a channel * @param string $notificationsRemovedFromChannelTemplate The template to use * to create the * notification text * displayed to a user * when they are removed * @param bool $notificationsInvitedToChannelEnabled Whether to send a * notification when a user * is invited to a channel * @param string $notificationsInvitedToChannelTemplate The template to use to * create the notification * text displayed when a * user is invited to a * channel * @param string $preWebhookUrl The webhook URL for pre-event webhooks * @param string $postWebhookUrl The URL for post-event webhooks * @param string $webhookMethod The HTTP method to use for both PRE and POST * webhooks * @param string $webhookFilters The list of WebHook events that are enabled * for this Service instance * @param string $webhooksOnMessageSendUrl The URL of the webhook to call in * response to the on_message_send event * @param string $webhooksOnMessageSendMethod The HTTP method to use when * calling the * webhooks.on_message_send.url * @param string $webhooksOnMessageUpdateUrl The URL of the webhook to call in * response to the on_message_update * event * @param string $webhooksOnMessageUpdateMethod The HTTP method to use when * calling the * webhooks.on_message_update.url * @param string $webhooksOnMessageRemoveUrl The URL of the webhook to call in * response to the on_message_remove * event * @param string $webhooksOnMessageRemoveMethod The HTTP method to use when * calling the * webhooks.on_message_remove.url * @param string $webhooksOnChannelAddUrl The URL of the webhook to call in * response to the on_channel_add event * @param string $webhooksOnChannelAddMethod The HTTP method to use when * calling the * webhooks.on_channel_add.url * @param string $webhooksOnChannelDestroyUrl The URL of the webhook to call in * response to the * on_channel_destroy event * @param string $webhooksOnChannelDestroyMethod The HTTP method to use when * calling the * webhooks.on_channel_destroy.url * @param string $webhooksOnChannelUpdateUrl The URL of the webhook to call in * response to the on_channel_update * event * @param string $webhooksOnChannelUpdateMethod The HTTP method to use when * calling the * webhooks.on_channel_update.url * @param string $webhooksOnMemberAddUrl The URL of the webhook to call in * response to the on_member_add event * @param string $webhooksOnMemberAddMethod The HTTP method to use when calling * the webhooks.on_member_add.url * @param string $webhooksOnMemberRemoveUrl The URL of the webhook to call in * response to the on_member_remove * event * @param string $webhooksOnMemberRemoveMethod The HTTP method to use when * calling the * webhooks.on_member_remove.url * @param string $webhooksOnMessageSentUrl The URL of the webhook to call in * response to the on_message_sent event * @param string $webhooksOnMessageSentMethod The URL of the webhook to call in * response to the on_message_sent * event * @param string $webhooksOnMessageUpdatedUrl The URL of the webhook to call in * response to the * on_message_updated event * @param string $webhooksOnMessageUpdatedMethod The HTTP method to use when * calling the * webhooks.on_message_updated.url * @param string $webhooksOnMessageRemovedUrl The URL of the webhook to call in * response to the * on_message_removed event * @param string $webhooksOnMessageRemovedMethod The HTTP method to use when * calling the * webhooks.on_message_removed.url * @param string $webhooksOnChannelAddedUrl The URL of the webhook to call in * response to the on_channel_added * event * @param string $webhooksOnChannelAddedMethod The URL of the webhook to call * in response to the * on_channel_added event * @param string $webhooksOnChannelDestroyedUrl The URL of the webhook to call * in response to the * on_channel_added event * @param string $webhooksOnChannelDestroyedMethod The HTTP method to use when * calling the * webhooks.on_channel_destroyed.url * @param string $webhooksOnChannelUpdatedUrl he URL of the webhook to call in * response to the * on_channel_updated event * @param string $webhooksOnChannelUpdatedMethod The HTTP method to use when * calling the * webhooks.on_channel_updated.url * @param string $webhooksOnMemberAddedUrl The URL of the webhook to call in * response to the on_channel_updated * event * @param string $webhooksOnMemberAddedMethod he HTTP method to use when * calling the * webhooks.on_channel_updated.url * @param string $webhooksOnMemberRemovedUrl The URL of the webhook to call in * response to the on_member_removed * event * @param string $webhooksOnMemberRemovedMethod The HTTP method to use when * calling the * webhooks.on_member_removed.url * @param int $limitsChannelMembers The maximum number of Members that can be * added to Channels within this Service * @param int $limitsUserChannels The maximum number of Channels Users can be a * Member of within this Service * @return UpdateServiceOptions Options builder */ public static function update($friendlyName = Values::NONE, $defaultServiceRoleSid = Values::NONE, $defaultChannelRoleSid = Values::NONE, $defaultChannelCreatorRoleSid = Values::NONE, $readStatusEnabled = Values::NONE, $reachabilityEnabled = Values::NONE, $typingIndicatorTimeout = Values::NONE, $consumptionReportInterval = Values::NONE, $notificationsNewMessageEnabled = Values::NONE, $notificationsNewMessageTemplate = Values::NONE, $notificationsAddedToChannelEnabled = Values::NONE, $notificationsAddedToChannelTemplate = Values::NONE, $notificationsRemovedFromChannelEnabled = Values::NONE, $notificationsRemovedFromChannelTemplate = Values::NONE, $notificationsInvitedToChannelEnabled = Values::NONE, $notificationsInvitedToChannelTemplate = Values::NONE, $preWebhookUrl = Values::NONE, $postWebhookUrl = Values::NONE, $webhookMethod = Values::NONE, $webhookFilters = Values::NONE, $webhooksOnMessageSendUrl = Values::NONE, $webhooksOnMessageSendMethod = Values::NONE, $webhooksOnMessageUpdateUrl = Values::NONE, $webhooksOnMessageUpdateMethod = Values::NONE, $webhooksOnMessageRemoveUrl = Values::NONE, $webhooksOnMessageRemoveMethod = Values::NONE, $webhooksOnChannelAddUrl = Values::NONE, $webhooksOnChannelAddMethod = Values::NONE, $webhooksOnChannelDestroyUrl = Values::NONE, $webhooksOnChannelDestroyMethod = Values::NONE, $webhooksOnChannelUpdateUrl = Values::NONE, $webhooksOnChannelUpdateMethod = Values::NONE, $webhooksOnMemberAddUrl = Values::NONE, $webhooksOnMemberAddMethod = Values::NONE, $webhooksOnMemberRemoveUrl = Values::NONE, $webhooksOnMemberRemoveMethod = Values::NONE, $webhooksOnMessageSentUrl = Values::NONE, $webhooksOnMessageSentMethod = Values::NONE, $webhooksOnMessageUpdatedUrl = Values::NONE, $webhooksOnMessageUpdatedMethod = Values::NONE, $webhooksOnMessageRemovedUrl = Values::NONE, $webhooksOnMessageRemovedMethod = Values::NONE, $webhooksOnChannelAddedUrl = Values::NONE, $webhooksOnChannelAddedMethod = Values::NONE, $webhooksOnChannelDestroyedUrl = Values::NONE, $webhooksOnChannelDestroyedMethod = Values::NONE, $webhooksOnChannelUpdatedUrl = Values::NONE, $webhooksOnChannelUpdatedMethod = Values::NONE, $webhooksOnMemberAddedUrl = Values::NONE, $webhooksOnMemberAddedMethod = Values::NONE, $webhooksOnMemberRemovedUrl = Values::NONE, $webhooksOnMemberRemovedMethod = Values::NONE, $limitsChannelMembers = Values::NONE, $limitsUserChannels = Values::NONE) { return new UpdateServiceOptions($friendlyName, $defaultServiceRoleSid, $defaultChannelRoleSid, $defaultChannelCreatorRoleSid, $readStatusEnabled, $reachabilityEnabled, $typingIndicatorTimeout, $consumptionReportInterval, $notificationsNewMessageEnabled, $notificationsNewMessageTemplate, $notificationsAddedToChannelEnabled, $notificationsAddedToChannelTemplate, $notificationsRemovedFromChannelEnabled, $notificationsRemovedFromChannelTemplate, $notificationsInvitedToChannelEnabled, $notificationsInvitedToChannelTemplate, $preWebhookUrl, $postWebhookUrl, $webhookMethod, $webhookFilters, $webhooksOnMessageSendUrl, $webhooksOnMessageSendMethod, $webhooksOnMessageUpdateUrl, $webhooksOnMessageUpdateMethod, $webhooksOnMessageRemoveUrl, $webhooksOnMessageRemoveMethod, $webhooksOnChannelAddUrl, $webhooksOnChannelAddMethod, $webhooksOnChannelDestroyUrl, $webhooksOnChannelDestroyMethod, $webhooksOnChannelUpdateUrl, $webhooksOnChannelUpdateMethod, $webhooksOnMemberAddUrl, $webhooksOnMemberAddMethod, $webhooksOnMemberRemoveUrl, $webhooksOnMemberRemoveMethod, $webhooksOnMessageSentUrl, $webhooksOnMessageSentMethod, $webhooksOnMessageUpdatedUrl, $webhooksOnMessageUpdatedMethod, $webhooksOnMessageRemovedUrl, $webhooksOnMessageRemovedMethod, $webhooksOnChannelAddedUrl, $webhooksOnChannelAddedMethod, $webhooksOnChannelDestroyedUrl, $webhooksOnChannelDestroyedMethod, $webhooksOnChannelUpdatedUrl, $webhooksOnChannelUpdatedMethod, $webhooksOnMemberAddedUrl, $webhooksOnMemberAddedMethod, $webhooksOnMemberRemovedUrl, $webhooksOnMemberRemovedMethod, $limitsChannelMembers, $limitsUserChannels); } } class UpdateServiceOptions extends Options { /** * @param string $friendlyName A string to describe the resource * @param string $defaultServiceRoleSid The service role assigned to users when * they are added to the service * @param string $defaultChannelRoleSid The channel role assigned to users when * they are added to a channel * @param string $defaultChannelCreatorRoleSid The channel role assigned to a * channel creator when they join a * new channel * @param bool $readStatusEnabled Whether to enable the Message Consumption * Horizon feature * @param bool $reachabilityEnabled Whether to enable the Reachability * Indicator feature for this Service instance * @param int $typingIndicatorTimeout How long in seconds to wait before * assuming the user is no longer typing * @param int $consumptionReportInterval DEPRECATED * @param bool $notificationsNewMessageEnabled Whether to send a notification * when a new message is added to a * channel * @param string $notificationsNewMessageTemplate The template to use to create * the notification text * displayed when a new message * is added to a channel * @param bool $notificationsAddedToChannelEnabled Whether to send a * notification when a member * is added to a channel * @param string $notificationsAddedToChannelTemplate The template to use to * create the notification * text displayed when a * member is added to a * channel * @param bool $notificationsRemovedFromChannelEnabled Whether to send a * notification to a user * when they are removed * from a channel * @param string $notificationsRemovedFromChannelTemplate The template to use * to create the * notification text * displayed to a user * when they are removed * @param bool $notificationsInvitedToChannelEnabled Whether to send a * notification when a user * is invited to a channel * @param string $notificationsInvitedToChannelTemplate The template to use to * create the notification * text displayed when a * user is invited to a * channel * @param string $preWebhookUrl The webhook URL for pre-event webhooks * @param string $postWebhookUrl The URL for post-event webhooks * @param string $webhookMethod The HTTP method to use for both PRE and POST * webhooks * @param string $webhookFilters The list of WebHook events that are enabled * for this Service instance * @param string $webhooksOnMessageSendUrl The URL of the webhook to call in * response to the on_message_send event * @param string $webhooksOnMessageSendMethod The HTTP method to use when * calling the * webhooks.on_message_send.url * @param string $webhooksOnMessageUpdateUrl The URL of the webhook to call in * response to the on_message_update * event * @param string $webhooksOnMessageUpdateMethod The HTTP method to use when * calling the * webhooks.on_message_update.url * @param string $webhooksOnMessageRemoveUrl The URL of the webhook to call in * response to the on_message_remove * event * @param string $webhooksOnMessageRemoveMethod The HTTP method to use when * calling the * webhooks.on_message_remove.url * @param string $webhooksOnChannelAddUrl The URL of the webhook to call in * response to the on_channel_add event * @param string $webhooksOnChannelAddMethod The HTTP method to use when * calling the * webhooks.on_channel_add.url * @param string $webhooksOnChannelDestroyUrl The URL of the webhook to call in * response to the * on_channel_destroy event * @param string $webhooksOnChannelDestroyMethod The HTTP method to use when * calling the * webhooks.on_channel_destroy.url * @param string $webhooksOnChannelUpdateUrl The URL of the webhook to call in * response to the on_channel_update * event * @param string $webhooksOnChannelUpdateMethod The HTTP method to use when * calling the * webhooks.on_channel_update.url * @param string $webhooksOnMemberAddUrl The URL of the webhook to call in * response to the on_member_add event * @param string $webhooksOnMemberAddMethod The HTTP method to use when calling * the webhooks.on_member_add.url * @param string $webhooksOnMemberRemoveUrl The URL of the webhook to call in * response to the on_member_remove * event * @param string $webhooksOnMemberRemoveMethod The HTTP method to use when * calling the * webhooks.on_member_remove.url * @param string $webhooksOnMessageSentUrl The URL of the webhook to call in * response to the on_message_sent event * @param string $webhooksOnMessageSentMethod The URL of the webhook to call in * response to the on_message_sent * event * @param string $webhooksOnMessageUpdatedUrl The URL of the webhook to call in * response to the * on_message_updated event * @param string $webhooksOnMessageUpdatedMethod The HTTP method to use when * calling the * webhooks.on_message_updated.url * @param string $webhooksOnMessageRemovedUrl The URL of the webhook to call in * response to the * on_message_removed event * @param string $webhooksOnMessageRemovedMethod The HTTP method to use when * calling the * webhooks.on_message_removed.url * @param string $webhooksOnChannelAddedUrl The URL of the webhook to call in * response to the on_channel_added * event * @param string $webhooksOnChannelAddedMethod The URL of the webhook to call * in response to the * on_channel_added event * @param string $webhooksOnChannelDestroyedUrl The URL of the webhook to call * in response to the * on_channel_added event * @param string $webhooksOnChannelDestroyedMethod The HTTP method to use when * calling the * webhooks.on_channel_destroyed.url * @param string $webhooksOnChannelUpdatedUrl he URL of the webhook to call in * response to the * on_channel_updated event * @param string $webhooksOnChannelUpdatedMethod The HTTP method to use when * calling the * webhooks.on_channel_updated.url * @param string $webhooksOnMemberAddedUrl The URL of the webhook to call in * response to the on_channel_updated * event * @param string $webhooksOnMemberAddedMethod he HTTP method to use when * calling the * webhooks.on_channel_updated.url * @param string $webhooksOnMemberRemovedUrl The URL of the webhook to call in * response to the on_member_removed * event * @param string $webhooksOnMemberRemovedMethod The HTTP method to use when * calling the * webhooks.on_member_removed.url * @param int $limitsChannelMembers The maximum number of Members that can be * added to Channels within this Service * @param int $limitsUserChannels The maximum number of Channels Users can be a * Member of within this Service */ public function __construct($friendlyName = Values::NONE, $defaultServiceRoleSid = Values::NONE, $defaultChannelRoleSid = Values::NONE, $defaultChannelCreatorRoleSid = Values::NONE, $readStatusEnabled = Values::NONE, $reachabilityEnabled = Values::NONE, $typingIndicatorTimeout = Values::NONE, $consumptionReportInterval = Values::NONE, $notificationsNewMessageEnabled = Values::NONE, $notificationsNewMessageTemplate = Values::NONE, $notificationsAddedToChannelEnabled = Values::NONE, $notificationsAddedToChannelTemplate = Values::NONE, $notificationsRemovedFromChannelEnabled = Values::NONE, $notificationsRemovedFromChannelTemplate = Values::NONE, $notificationsInvitedToChannelEnabled = Values::NONE, $notificationsInvitedToChannelTemplate = Values::NONE, $preWebhookUrl = Values::NONE, $postWebhookUrl = Values::NONE, $webhookMethod = Values::NONE, $webhookFilters = Values::NONE, $webhooksOnMessageSendUrl = Values::NONE, $webhooksOnMessageSendMethod = Values::NONE, $webhooksOnMessageUpdateUrl = Values::NONE, $webhooksOnMessageUpdateMethod = Values::NONE, $webhooksOnMessageRemoveUrl = Values::NONE, $webhooksOnMessageRemoveMethod = Values::NONE, $webhooksOnChannelAddUrl = Values::NONE, $webhooksOnChannelAddMethod = Values::NONE, $webhooksOnChannelDestroyUrl = Values::NONE, $webhooksOnChannelDestroyMethod = Values::NONE, $webhooksOnChannelUpdateUrl = Values::NONE, $webhooksOnChannelUpdateMethod = Values::NONE, $webhooksOnMemberAddUrl = Values::NONE, $webhooksOnMemberAddMethod = Values::NONE, $webhooksOnMemberRemoveUrl = Values::NONE, $webhooksOnMemberRemoveMethod = Values::NONE, $webhooksOnMessageSentUrl = Values::NONE, $webhooksOnMessageSentMethod = Values::NONE, $webhooksOnMessageUpdatedUrl = Values::NONE, $webhooksOnMessageUpdatedMethod = Values::NONE, $webhooksOnMessageRemovedUrl = Values::NONE, $webhooksOnMessageRemovedMethod = Values::NONE, $webhooksOnChannelAddedUrl = Values::NONE, $webhooksOnChannelAddedMethod = Values::NONE, $webhooksOnChannelDestroyedUrl = Values::NONE, $webhooksOnChannelDestroyedMethod = Values::NONE, $webhooksOnChannelUpdatedUrl = Values::NONE, $webhooksOnChannelUpdatedMethod = Values::NONE, $webhooksOnMemberAddedUrl = Values::NONE, $webhooksOnMemberAddedMethod = Values::NONE, $webhooksOnMemberRemovedUrl = Values::NONE, $webhooksOnMemberRemovedMethod = Values::NONE, $limitsChannelMembers = Values::NONE, $limitsUserChannels = Values::NONE) { $this->options['friendlyName'] = $friendlyName; $this->options['defaultServiceRoleSid'] = $defaultServiceRoleSid; $this->options['defaultChannelRoleSid'] = $defaultChannelRoleSid; $this->options['defaultChannelCreatorRoleSid'] = $defaultChannelCreatorRoleSid; $this->options['readStatusEnabled'] = $readStatusEnabled; $this->options['reachabilityEnabled'] = $reachabilityEnabled; $this->options['typingIndicatorTimeout'] = $typingIndicatorTimeout; $this->options['consumptionReportInterval'] = $consumptionReportInterval; $this->options['notificationsNewMessageEnabled'] = $notificationsNewMessageEnabled; $this->options['notificationsNewMessageTemplate'] = $notificationsNewMessageTemplate; $this->options['notificationsAddedToChannelEnabled'] = $notificationsAddedToChannelEnabled; $this->options['notificationsAddedToChannelTemplate'] = $notificationsAddedToChannelTemplate; $this->options['notificationsRemovedFromChannelEnabled'] = $notificationsRemovedFromChannelEnabled; $this->options['notificationsRemovedFromChannelTemplate'] = $notificationsRemovedFromChannelTemplate; $this->options['notificationsInvitedToChannelEnabled'] = $notificationsInvitedToChannelEnabled; $this->options['notificationsInvitedToChannelTemplate'] = $notificationsInvitedToChannelTemplate; $this->options['preWebhookUrl'] = $preWebhookUrl; $this->options['postWebhookUrl'] = $postWebhookUrl; $this->options['webhookMethod'] = $webhookMethod; $this->options['webhookFilters'] = $webhookFilters; $this->options['webhooksOnMessageSendUrl'] = $webhooksOnMessageSendUrl; $this->options['webhooksOnMessageSendMethod'] = $webhooksOnMessageSendMethod; $this->options['webhooksOnMessageUpdateUrl'] = $webhooksOnMessageUpdateUrl; $this->options['webhooksOnMessageUpdateMethod'] = $webhooksOnMessageUpdateMethod; $this->options['webhooksOnMessageRemoveUrl'] = $webhooksOnMessageRemoveUrl; $this->options['webhooksOnMessageRemoveMethod'] = $webhooksOnMessageRemoveMethod; $this->options['webhooksOnChannelAddUrl'] = $webhooksOnChannelAddUrl; $this->options['webhooksOnChannelAddMethod'] = $webhooksOnChannelAddMethod; $this->options['webhooksOnChannelDestroyUrl'] = $webhooksOnChannelDestroyUrl; $this->options['webhooksOnChannelDestroyMethod'] = $webhooksOnChannelDestroyMethod; $this->options['webhooksOnChannelUpdateUrl'] = $webhooksOnChannelUpdateUrl; $this->options['webhooksOnChannelUpdateMethod'] = $webhooksOnChannelUpdateMethod; $this->options['webhooksOnMemberAddUrl'] = $webhooksOnMemberAddUrl; $this->options['webhooksOnMemberAddMethod'] = $webhooksOnMemberAddMethod; $this->options['webhooksOnMemberRemoveUrl'] = $webhooksOnMemberRemoveUrl; $this->options['webhooksOnMemberRemoveMethod'] = $webhooksOnMemberRemoveMethod; $this->options['webhooksOnMessageSentUrl'] = $webhooksOnMessageSentUrl; $this->options['webhooksOnMessageSentMethod'] = $webhooksOnMessageSentMethod; $this->options['webhooksOnMessageUpdatedUrl'] = $webhooksOnMessageUpdatedUrl; $this->options['webhooksOnMessageUpdatedMethod'] = $webhooksOnMessageUpdatedMethod; $this->options['webhooksOnMessageRemovedUrl'] = $webhooksOnMessageRemovedUrl; $this->options['webhooksOnMessageRemovedMethod'] = $webhooksOnMessageRemovedMethod; $this->options['webhooksOnChannelAddedUrl'] = $webhooksOnChannelAddedUrl; $this->options['webhooksOnChannelAddedMethod'] = $webhooksOnChannelAddedMethod; $this->options['webhooksOnChannelDestroyedUrl'] = $webhooksOnChannelDestroyedUrl; $this->options['webhooksOnChannelDestroyedMethod'] = $webhooksOnChannelDestroyedMethod; $this->options['webhooksOnChannelUpdatedUrl'] = $webhooksOnChannelUpdatedUrl; $this->options['webhooksOnChannelUpdatedMethod'] = $webhooksOnChannelUpdatedMethod; $this->options['webhooksOnMemberAddedUrl'] = $webhooksOnMemberAddedUrl; $this->options['webhooksOnMemberAddedMethod'] = $webhooksOnMemberAddedMethod; $this->options['webhooksOnMemberRemovedUrl'] = $webhooksOnMemberRemovedUrl; $this->options['webhooksOnMemberRemovedMethod'] = $webhooksOnMemberRemovedMethod; $this->options['limitsChannelMembers'] = $limitsChannelMembers; $this->options['limitsUserChannels'] = $limitsUserChannels; } /** * A descriptive string that you create to describe the resource. It can be up to 64 characters long. * * @param string $friendlyName A string to describe the resource * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The service role assigned to users when they are added to the service. See the [Roles endpoint](https://www.twilio.com/docs/chat/api/roles) for more details. * * @param string $defaultServiceRoleSid The service role assigned to users when * they are added to the service * @return $this Fluent Builder */ public function setDefaultServiceRoleSid($defaultServiceRoleSid) { $this->options['defaultServiceRoleSid'] = $defaultServiceRoleSid; return $this; } /** * The channel role assigned to users when they are added to a channel. See the [Roles endpoint](https://www.twilio.com/docs/chat/api/roles) for more details. * * @param string $defaultChannelRoleSid The channel role assigned to users when * they are added to a channel * @return $this Fluent Builder */ public function setDefaultChannelRoleSid($defaultChannelRoleSid) { $this->options['defaultChannelRoleSid'] = $defaultChannelRoleSid; return $this; } /** * The channel role assigned to a channel creator when they join a new channel. See the [Roles endpoint](https://www.twilio.com/docs/chat/api/roles) for more details. * * @param string $defaultChannelCreatorRoleSid The channel role assigned to a * channel creator when they join a * new channel * @return $this Fluent Builder */ public function setDefaultChannelCreatorRoleSid($defaultChannelCreatorRoleSid) { $this->options['defaultChannelCreatorRoleSid'] = $defaultChannelCreatorRoleSid; return $this; } /** * Whether to enable the [Message Consumption Horizon](https://www.twilio.com/docs/chat/consumption-horizon) feature. The default is `true`. * * @param bool $readStatusEnabled Whether to enable the Message Consumption * Horizon feature * @return $this Fluent Builder */ public function setReadStatusEnabled($readStatusEnabled) { $this->options['readStatusEnabled'] = $readStatusEnabled; return $this; } /** * Whether to enable the [Reachability Indicator](https://www.twilio.com/docs/chat/reachability-indicator) for this Service instance. The default is `false`. * * @param bool $reachabilityEnabled Whether to enable the Reachability * Indicator feature for this Service instance * @return $this Fluent Builder */ public function setReachabilityEnabled($reachabilityEnabled) { $this->options['reachabilityEnabled'] = $reachabilityEnabled; return $this; } /** * How long in seconds after a `started typing` event until clients should assume that user is no longer typing, even if no `ended typing` message was received. The default is 5 seconds. * * @param int $typingIndicatorTimeout How long in seconds to wait before * assuming the user is no longer typing * @return $this Fluent Builder */ public function setTypingIndicatorTimeout($typingIndicatorTimeout) { $this->options['typingIndicatorTimeout'] = $typingIndicatorTimeout; return $this; } /** * DEPRECATED. The interval in seconds between consumption reports submission batches from client endpoints. * * @param int $consumptionReportInterval DEPRECATED * @return $this Fluent Builder */ public function setConsumptionReportInterval($consumptionReportInterval) { $this->options['consumptionReportInterval'] = $consumptionReportInterval; return $this; } /** * Whether to send a notification when a new message is added to a channel. Can be: `true` or `false` and the default is `false`. * * @param bool $notificationsNewMessageEnabled Whether to send a notification * when a new message is added to a * channel * @return $this Fluent Builder */ public function setNotificationsNewMessageEnabled($notificationsNewMessageEnabled) { $this->options['notificationsNewMessageEnabled'] = $notificationsNewMessageEnabled; return $this; } /** * The template to use to create the notification text displayed when a new message is added to a channel and `notifications.new_message.enabled` is `true`. * * @param string $notificationsNewMessageTemplate The template to use to create * the notification text * displayed when a new message * is added to a channel * @return $this Fluent Builder */ public function setNotificationsNewMessageTemplate($notificationsNewMessageTemplate) { $this->options['notificationsNewMessageTemplate'] = $notificationsNewMessageTemplate; return $this; } /** * Whether to send a notification when a member is added to a channel. Can be: `true` or `false` and the default is `false`. * * @param bool $notificationsAddedToChannelEnabled Whether to send a * notification when a member * is added to a channel * @return $this Fluent Builder */ public function setNotificationsAddedToChannelEnabled($notificationsAddedToChannelEnabled) { $this->options['notificationsAddedToChannelEnabled'] = $notificationsAddedToChannelEnabled; return $this; } /** * The template to use to create the notification text displayed when a member is added to a channel and `notifications.added_to_channel.enabled` is `true`. * * @param string $notificationsAddedToChannelTemplate The template to use to * create the notification * text displayed when a * member is added to a * channel * @return $this Fluent Builder */ public function setNotificationsAddedToChannelTemplate($notificationsAddedToChannelTemplate) { $this->options['notificationsAddedToChannelTemplate'] = $notificationsAddedToChannelTemplate; return $this; } /** * Whether to send a notification to a user when they are removed from a channel. Can be: `true` or `false` and the default is `false`. * * @param bool $notificationsRemovedFromChannelEnabled Whether to send a * notification to a user * when they are removed * from a channel * @return $this Fluent Builder */ public function setNotificationsRemovedFromChannelEnabled($notificationsRemovedFromChannelEnabled) { $this->options['notificationsRemovedFromChannelEnabled'] = $notificationsRemovedFromChannelEnabled; return $this; } /** * The template to use to create the notification text displayed to a user when they are removed from a channel and `notifications.removed_from_channel.enabled` is `true`. * * @param string $notificationsRemovedFromChannelTemplate The template to use * to create the * notification text * displayed to a user * when they are removed * @return $this Fluent Builder */ public function setNotificationsRemovedFromChannelTemplate($notificationsRemovedFromChannelTemplate) { $this->options['notificationsRemovedFromChannelTemplate'] = $notificationsRemovedFromChannelTemplate; return $this; } /** * Whether to send a notification when a user is invited to a channel. Can be: `true` or `false` and the default is `false`. * * @param bool $notificationsInvitedToChannelEnabled Whether to send a * notification when a user * is invited to a channel * @return $this Fluent Builder */ public function setNotificationsInvitedToChannelEnabled($notificationsInvitedToChannelEnabled) { $this->options['notificationsInvitedToChannelEnabled'] = $notificationsInvitedToChannelEnabled; return $this; } /** * The template to use to create the notification text displayed when a user is invited to a channel and `notifications.invited_to_channel.enabled` is `true`. * * @param string $notificationsInvitedToChannelTemplate The template to use to * create the notification * text displayed when a * user is invited to a * channel * @return $this Fluent Builder */ public function setNotificationsInvitedToChannelTemplate($notificationsInvitedToChannelTemplate) { $this->options['notificationsInvitedToChannelTemplate'] = $notificationsInvitedToChannelTemplate; return $this; } /** * The URL for pre-event webhooks, which are called by using the `webhook_method`. See [Webhook Events](https://www.twilio.com/docs/api/chat/webhooks) for more details. * * @param string $preWebhookUrl The webhook URL for pre-event webhooks * @return $this Fluent Builder */ public function setPreWebhookUrl($preWebhookUrl) { $this->options['preWebhookUrl'] = $preWebhookUrl; return $this; } /** * The URL for post-event webhooks, which are called by using the `webhook_method`. See [Webhook Events](https://www.twilio.com/docs/api/chat/webhooks) for more details. * * @param string $postWebhookUrl The URL for post-event webhooks * @return $this Fluent Builder */ public function setPostWebhookUrl($postWebhookUrl) { $this->options['postWebhookUrl'] = $postWebhookUrl; return $this; } /** * The HTTP method to use for calls to the `pre_webhook_url` and `post_webhook_url` webhooks. Can be: `POST` or `GET` and the default is `POST`. See [Webhook Events](https://www.twilio.com/docs/chat/webhook-events) for more details. * * @param string $webhookMethod The HTTP method to use for both PRE and POST * webhooks * @return $this Fluent Builder */ public function setWebhookMethod($webhookMethod) { $this->options['webhookMethod'] = $webhookMethod; return $this; } /** * The list of WebHook events that are enabled for this Service instance. See [Webhook Events](https://www.twilio.com/docs/chat/webhook-events) for more details. * * @param string $webhookFilters The list of WebHook events that are enabled * for this Service instance * @return $this Fluent Builder */ public function setWebhookFilters($webhookFilters) { $this->options['webhookFilters'] = $webhookFilters; return $this; } /** * The URL of the webhook to call in response to the `on_message_send` event using the `webhooks.on_message_send.method` HTTP method. * * @param string $webhooksOnMessageSendUrl The URL of the webhook to call in * response to the on_message_send event * @return $this Fluent Builder */ public function setWebhooksOnMessageSendUrl($webhooksOnMessageSendUrl) { $this->options['webhooksOnMessageSendUrl'] = $webhooksOnMessageSendUrl; return $this; } /** * The HTTP method to use when calling the `webhooks.on_message_send.url`. * * @param string $webhooksOnMessageSendMethod The HTTP method to use when * calling the * webhooks.on_message_send.url * @return $this Fluent Builder */ public function setWebhooksOnMessageSendMethod($webhooksOnMessageSendMethod) { $this->options['webhooksOnMessageSendMethod'] = $webhooksOnMessageSendMethod; return $this; } /** * The URL of the webhook to call in response to the `on_message_update` event using the `webhooks.on_message_update.method` HTTP method. * * @param string $webhooksOnMessageUpdateUrl The URL of the webhook to call in * response to the on_message_update * event * @return $this Fluent Builder */ public function setWebhooksOnMessageUpdateUrl($webhooksOnMessageUpdateUrl) { $this->options['webhooksOnMessageUpdateUrl'] = $webhooksOnMessageUpdateUrl; return $this; } /** * The HTTP method to use when calling the `webhooks.on_message_update.url`. * * @param string $webhooksOnMessageUpdateMethod The HTTP method to use when * calling the * webhooks.on_message_update.url * @return $this Fluent Builder */ public function setWebhooksOnMessageUpdateMethod($webhooksOnMessageUpdateMethod) { $this->options['webhooksOnMessageUpdateMethod'] = $webhooksOnMessageUpdateMethod; return $this; } /** * The URL of the webhook to call in response to the `on_message_remove` event using the `webhooks.on_message_remove.method` HTTP method. * * @param string $webhooksOnMessageRemoveUrl The URL of the webhook to call in * response to the on_message_remove * event * @return $this Fluent Builder */ public function setWebhooksOnMessageRemoveUrl($webhooksOnMessageRemoveUrl) { $this->options['webhooksOnMessageRemoveUrl'] = $webhooksOnMessageRemoveUrl; return $this; } /** * The HTTP method to use when calling the `webhooks.on_message_remove.url`. * * @param string $webhooksOnMessageRemoveMethod The HTTP method to use when * calling the * webhooks.on_message_remove.url * @return $this Fluent Builder */ public function setWebhooksOnMessageRemoveMethod($webhooksOnMessageRemoveMethod) { $this->options['webhooksOnMessageRemoveMethod'] = $webhooksOnMessageRemoveMethod; return $this; } /** * The URL of the webhook to call in response to the `on_channel_add` event using the `webhooks.on_channel_add.method` HTTP method. * * @param string $webhooksOnChannelAddUrl The URL of the webhook to call in * response to the on_channel_add event * @return $this Fluent Builder */ public function setWebhooksOnChannelAddUrl($webhooksOnChannelAddUrl) { $this->options['webhooksOnChannelAddUrl'] = $webhooksOnChannelAddUrl; return $this; } /** * The HTTP method to use when calling the `webhooks.on_channel_add.url`. * * @param string $webhooksOnChannelAddMethod The HTTP method to use when * calling the * webhooks.on_channel_add.url * @return $this Fluent Builder */ public function setWebhooksOnChannelAddMethod($webhooksOnChannelAddMethod) { $this->options['webhooksOnChannelAddMethod'] = $webhooksOnChannelAddMethod; return $this; } /** * The URL of the webhook to call in response to the `on_channel_destroy` event using the `webhooks.on_channel_destroy.method` HTTP method. * * @param string $webhooksOnChannelDestroyUrl The URL of the webhook to call in * response to the * on_channel_destroy event * @return $this Fluent Builder */ public function setWebhooksOnChannelDestroyUrl($webhooksOnChannelDestroyUrl) { $this->options['webhooksOnChannelDestroyUrl'] = $webhooksOnChannelDestroyUrl; return $this; } /** * The HTTP method to use when calling the `webhooks.on_channel_destroy.url`. * * @param string $webhooksOnChannelDestroyMethod The HTTP method to use when * calling the * webhooks.on_channel_destroy.url * @return $this Fluent Builder */ public function setWebhooksOnChannelDestroyMethod($webhooksOnChannelDestroyMethod) { $this->options['webhooksOnChannelDestroyMethod'] = $webhooksOnChannelDestroyMethod; return $this; } /** * The URL of the webhook to call in response to the `on_channel_update` event using the `webhooks.on_channel_update.method` HTTP method. * * @param string $webhooksOnChannelUpdateUrl The URL of the webhook to call in * response to the on_channel_update * event * @return $this Fluent Builder */ public function setWebhooksOnChannelUpdateUrl($webhooksOnChannelUpdateUrl) { $this->options['webhooksOnChannelUpdateUrl'] = $webhooksOnChannelUpdateUrl; return $this; } /** * The HTTP method to use when calling the `webhooks.on_channel_update.url`. * * @param string $webhooksOnChannelUpdateMethod The HTTP method to use when * calling the * webhooks.on_channel_update.url * @return $this Fluent Builder */ public function setWebhooksOnChannelUpdateMethod($webhooksOnChannelUpdateMethod) { $this->options['webhooksOnChannelUpdateMethod'] = $webhooksOnChannelUpdateMethod; return $this; } /** * The URL of the webhook to call in response to the `on_member_add` event using the `webhooks.on_member_add.method` HTTP method. * * @param string $webhooksOnMemberAddUrl The URL of the webhook to call in * response to the on_member_add event * @return $this Fluent Builder */ public function setWebhooksOnMemberAddUrl($webhooksOnMemberAddUrl) { $this->options['webhooksOnMemberAddUrl'] = $webhooksOnMemberAddUrl; return $this; } /** * The HTTP method to use when calling the `webhooks.on_member_add.url`. * * @param string $webhooksOnMemberAddMethod The HTTP method to use when calling * the webhooks.on_member_add.url * @return $this Fluent Builder */ public function setWebhooksOnMemberAddMethod($webhooksOnMemberAddMethod) { $this->options['webhooksOnMemberAddMethod'] = $webhooksOnMemberAddMethod; return $this; } /** * The URL of the webhook to call in response to the `on_member_remove` event using the `webhooks.on_member_remove.method` HTTP method. * * @param string $webhooksOnMemberRemoveUrl The URL of the webhook to call in * response to the on_member_remove * event * @return $this Fluent Builder */ public function setWebhooksOnMemberRemoveUrl($webhooksOnMemberRemoveUrl) { $this->options['webhooksOnMemberRemoveUrl'] = $webhooksOnMemberRemoveUrl; return $this; } /** * The HTTP method to use when calling the `webhooks.on_member_remove.url`. * * @param string $webhooksOnMemberRemoveMethod The HTTP method to use when * calling the * webhooks.on_member_remove.url * @return $this Fluent Builder */ public function setWebhooksOnMemberRemoveMethod($webhooksOnMemberRemoveMethod) { $this->options['webhooksOnMemberRemoveMethod'] = $webhooksOnMemberRemoveMethod; return $this; } /** * The URL of the webhook to call in response to the `on_message_sent` event using the `webhooks.on_message_sent.method` HTTP method. * * @param string $webhooksOnMessageSentUrl The URL of the webhook to call in * response to the on_message_sent event * @return $this Fluent Builder */ public function setWebhooksOnMessageSentUrl($webhooksOnMessageSentUrl) { $this->options['webhooksOnMessageSentUrl'] = $webhooksOnMessageSentUrl; return $this; } /** * The URL of the webhook to call in response to the `on_message_sent` event`. * * @param string $webhooksOnMessageSentMethod The URL of the webhook to call in * response to the on_message_sent * event * @return $this Fluent Builder */ public function setWebhooksOnMessageSentMethod($webhooksOnMessageSentMethod) { $this->options['webhooksOnMessageSentMethod'] = $webhooksOnMessageSentMethod; return $this; } /** * The URL of the webhook to call in response to the `on_message_updated` event using the `webhooks.on_message_updated.method` HTTP method. * * @param string $webhooksOnMessageUpdatedUrl The URL of the webhook to call in * response to the * on_message_updated event * @return $this Fluent Builder */ public function setWebhooksOnMessageUpdatedUrl($webhooksOnMessageUpdatedUrl) { $this->options['webhooksOnMessageUpdatedUrl'] = $webhooksOnMessageUpdatedUrl; return $this; } /** * The HTTP method to use when calling the `webhooks.on_message_updated.url`. * * @param string $webhooksOnMessageUpdatedMethod The HTTP method to use when * calling the * webhooks.on_message_updated.url * @return $this Fluent Builder */ public function setWebhooksOnMessageUpdatedMethod($webhooksOnMessageUpdatedMethod) { $this->options['webhooksOnMessageUpdatedMethod'] = $webhooksOnMessageUpdatedMethod; return $this; } /** * The URL of the webhook to call in response to the `on_message_removed` event using the `webhooks.on_message_removed.method` HTTP method. * * @param string $webhooksOnMessageRemovedUrl The URL of the webhook to call in * response to the * on_message_removed event * @return $this Fluent Builder */ public function setWebhooksOnMessageRemovedUrl($webhooksOnMessageRemovedUrl) { $this->options['webhooksOnMessageRemovedUrl'] = $webhooksOnMessageRemovedUrl; return $this; } /** * The HTTP method to use when calling the `webhooks.on_message_removed.url`. * * @param string $webhooksOnMessageRemovedMethod The HTTP method to use when * calling the * webhooks.on_message_removed.url * @return $this Fluent Builder */ public function setWebhooksOnMessageRemovedMethod($webhooksOnMessageRemovedMethod) { $this->options['webhooksOnMessageRemovedMethod'] = $webhooksOnMessageRemovedMethod; return $this; } /** * The URL of the webhook to call in response to the `on_channel_added` event using the `webhooks.on_channel_added.method` HTTP method. * * @param string $webhooksOnChannelAddedUrl The URL of the webhook to call in * response to the on_channel_added * event * @return $this Fluent Builder */ public function setWebhooksOnChannelAddedUrl($webhooksOnChannelAddedUrl) { $this->options['webhooksOnChannelAddedUrl'] = $webhooksOnChannelAddedUrl; return $this; } /** * The URL of the webhook to call in response to the `on_channel_added` event`. * * @param string $webhooksOnChannelAddedMethod The URL of the webhook to call * in response to the * on_channel_added event * @return $this Fluent Builder */ public function setWebhooksOnChannelAddedMethod($webhooksOnChannelAddedMethod) { $this->options['webhooksOnChannelAddedMethod'] = $webhooksOnChannelAddedMethod; return $this; } /** * The URL of the webhook to call in response to the `on_channel_added` event using the `webhooks.on_channel_destroyed.method` HTTP method. * * @param string $webhooksOnChannelDestroyedUrl The URL of the webhook to call * in response to the * on_channel_added event * @return $this Fluent Builder */ public function setWebhooksOnChannelDestroyedUrl($webhooksOnChannelDestroyedUrl) { $this->options['webhooksOnChannelDestroyedUrl'] = $webhooksOnChannelDestroyedUrl; return $this; } /** * The HTTP method to use when calling the `webhooks.on_channel_destroyed.url`. * * @param string $webhooksOnChannelDestroyedMethod The HTTP method to use when * calling the * webhooks.on_channel_destroyed.url * @return $this Fluent Builder */ public function setWebhooksOnChannelDestroyedMethod($webhooksOnChannelDestroyedMethod) { $this->options['webhooksOnChannelDestroyedMethod'] = $webhooksOnChannelDestroyedMethod; return $this; } /** * The URL of the webhook to call in response to the `on_channel_updated` event using the `webhooks.on_channel_updated.method` HTTP method. * * @param string $webhooksOnChannelUpdatedUrl he URL of the webhook to call in * response to the * on_channel_updated event * @return $this Fluent Builder */ public function setWebhooksOnChannelUpdatedUrl($webhooksOnChannelUpdatedUrl) { $this->options['webhooksOnChannelUpdatedUrl'] = $webhooksOnChannelUpdatedUrl; return $this; } /** * The HTTP method to use when calling the `webhooks.on_channel_updated.url`. * * @param string $webhooksOnChannelUpdatedMethod The HTTP method to use when * calling the * webhooks.on_channel_updated.url * @return $this Fluent Builder */ public function setWebhooksOnChannelUpdatedMethod($webhooksOnChannelUpdatedMethod) { $this->options['webhooksOnChannelUpdatedMethod'] = $webhooksOnChannelUpdatedMethod; return $this; } /** * The URL of the webhook to call in response to the `on_channel_updated` event using the `webhooks.on_channel_updated.method` HTTP method. * * @param string $webhooksOnMemberAddedUrl The URL of the webhook to call in * response to the on_channel_updated * event * @return $this Fluent Builder */ public function setWebhooksOnMemberAddedUrl($webhooksOnMemberAddedUrl) { $this->options['webhooksOnMemberAddedUrl'] = $webhooksOnMemberAddedUrl; return $this; } /** * The HTTP method to use when calling the `webhooks.on_channel_updated.url`. * * @param string $webhooksOnMemberAddedMethod he HTTP method to use when * calling the * webhooks.on_channel_updated.url * @return $this Fluent Builder */ public function setWebhooksOnMemberAddedMethod($webhooksOnMemberAddedMethod) { $this->options['webhooksOnMemberAddedMethod'] = $webhooksOnMemberAddedMethod; return $this; } /** * The URL of the webhook to call in response to the `on_member_removed` event using the `webhooks.on_member_removed.method` HTTP method. * * @param string $webhooksOnMemberRemovedUrl The URL of the webhook to call in * response to the on_member_removed * event * @return $this Fluent Builder */ public function setWebhooksOnMemberRemovedUrl($webhooksOnMemberRemovedUrl) { $this->options['webhooksOnMemberRemovedUrl'] = $webhooksOnMemberRemovedUrl; return $this; } /** * The HTTP method to use when calling the `webhooks.on_member_removed.url`. * * @param string $webhooksOnMemberRemovedMethod The HTTP method to use when * calling the * webhooks.on_member_removed.url * @return $this Fluent Builder */ public function setWebhooksOnMemberRemovedMethod($webhooksOnMemberRemovedMethod) { $this->options['webhooksOnMemberRemovedMethod'] = $webhooksOnMemberRemovedMethod; return $this; } /** * The maximum number of Members that can be added to Channels within this Service. Can be up to 1,000. * * @param int $limitsChannelMembers The maximum number of Members that can be * added to Channels within this Service * @return $this Fluent Builder */ public function setLimitsChannelMembers($limitsChannelMembers) { $this->options['limitsChannelMembers'] = $limitsChannelMembers; return $this; } /** * The maximum number of Channels Users can be a Member of within this Service. Can be up to 1,000. * * @param int $limitsUserChannels The maximum number of Channels Users can be a * Member of within this Service * @return $this Fluent Builder */ public function setLimitsUserChannels($limitsUserChannels) { $this->options['limitsUserChannels'] = $limitsUserChannels; 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.IpMessaging.V1.UpdateServiceOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V1/CredentialContext.php 0000644 00000005560 15002236443 0017131 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class CredentialContext extends InstanceContext { /** * Initialize the CredentialContext * * @param \Twilio\Version $version Version that contains the resource * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\IpMessaging\V1\CredentialContext */ public function __construct(Version $version, $sid) { parent::__construct($version); // Path Solution $this->solution = array('sid' => $sid, ); $this->uri = '/Credentials/' . \rawurlencode($sid) . ''; } /** * Fetch a CredentialInstance * * @return CredentialInstance Fetched CredentialInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new CredentialInstance($this->version, $payload, $this->solution['sid']); } /** * Update the CredentialInstance * * @param array|Options $options Optional Arguments * @return CredentialInstance Updated CredentialInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { $options = new Values($options); $data = Values::of(array( 'FriendlyName' => $options['friendlyName'], 'Certificate' => $options['certificate'], 'PrivateKey' => $options['privateKey'], 'Sandbox' => Serialize::booleanToString($options['sandbox']), 'ApiKey' => $options['apiKey'], 'Secret' => $options['secret'], )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new CredentialInstance($this->version, $payload, $this->solution['sid']); } /** * Deletes the CredentialInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.IpMessaging.V1.CredentialContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V1/CredentialOptions.php 0000644 00000027105 15002236443 0017137 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V1; use Twilio\Options; use Twilio\Values; abstract class CredentialOptions { /** * @param string $friendlyName A string to describe the resource * @param string $certificate [APN only] The URL encoded representation of the * certificate * @param string $privateKey [APN only] The URL encoded representation of the * private key * @param bool $sandbox [APN only] Whether to send the credential to sandbox * APNs * @param string $apiKey [GCM only] The API key for the project that was * obtained from the Google Developer console for your * GCM Service application credential * @param string $secret [FCM only] The Server key of your project from * Firebase console * @return CreateCredentialOptions Options builder */ public static function create($friendlyName = Values::NONE, $certificate = Values::NONE, $privateKey = Values::NONE, $sandbox = Values::NONE, $apiKey = Values::NONE, $secret = Values::NONE) { return new CreateCredentialOptions($friendlyName, $certificate, $privateKey, $sandbox, $apiKey, $secret); } /** * @param string $friendlyName A string to describe the resource * @param string $certificate [APN only] The URL encoded representation of the * certificate * @param string $privateKey [APN only] The URL encoded representation of the * private key * @param bool $sandbox [APN only] Whether to send the credential to sandbox * APNs * @param string $apiKey [GCM only] The API key for the project that was * obtained from the Google Developer console for your * GCM Service application credential * @param string $secret [FCM only] The Server key of your project from * Firebase console * @return UpdateCredentialOptions Options builder */ public static function update($friendlyName = Values::NONE, $certificate = Values::NONE, $privateKey = Values::NONE, $sandbox = Values::NONE, $apiKey = Values::NONE, $secret = Values::NONE) { return new UpdateCredentialOptions($friendlyName, $certificate, $privateKey, $sandbox, $apiKey, $secret); } } class CreateCredentialOptions extends Options { /** * @param string $friendlyName A string to describe the resource * @param string $certificate [APN only] The URL encoded representation of the * certificate * @param string $privateKey [APN only] The URL encoded representation of the * private key * @param bool $sandbox [APN only] Whether to send the credential to sandbox * APNs * @param string $apiKey [GCM only] The API key for the project that was * obtained from the Google Developer console for your * GCM Service application credential * @param string $secret [FCM only] The Server key of your project from * Firebase console */ public function __construct($friendlyName = Values::NONE, $certificate = Values::NONE, $privateKey = Values::NONE, $sandbox = Values::NONE, $apiKey = Values::NONE, $secret = Values::NONE) { $this->options['friendlyName'] = $friendlyName; $this->options['certificate'] = $certificate; $this->options['privateKey'] = $privateKey; $this->options['sandbox'] = $sandbox; $this->options['apiKey'] = $apiKey; $this->options['secret'] = $secret; } /** * A descriptive string that you create to describe the new resource. It can be up to 64 characters long. * * @param string $friendlyName A string to describe the resource * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * [APN only] The URL encoded representation of the certificate. For example, `-----BEGIN CERTIFICATE----- MIIFnTCCBIWgAwIBAgIIAjy9H849+E8wDQYJKoZIhvcNAQEFBQAwgZYxCzAJBgNV.....A== -----END CERTIFICATE-----` * * @param string $certificate [APN only] The URL encoded representation of the * certificate * @return $this Fluent Builder */ public function setCertificate($certificate) { $this->options['certificate'] = $certificate; return $this; } /** * [APN only] The URL encoded representation of the private key. For example, `-----BEGIN RSA PRIVATE KEY----- MIIEpQIBAAKCAQEAuyf/lNrH9ck8DmNyo3fGgvCI1l9s+cmBY3WIz+cUDqmxiieR. -----END RSA PRIVATE KEY-----` * * @param string $privateKey [APN only] The URL encoded representation of the * private key * @return $this Fluent Builder */ public function setPrivateKey($privateKey) { $this->options['privateKey'] = $privateKey; return $this; } /** * [APN only] Whether to send the credential to sandbox APNs. Can be `true` to send to sandbox APNs or `false` to send to production. * * @param bool $sandbox [APN only] Whether to send the credential to sandbox * APNs * @return $this Fluent Builder */ public function setSandbox($sandbox) { $this->options['sandbox'] = $sandbox; return $this; } /** * [GCM only] The API key for the project that was obtained from the Google Developer console for your GCM Service application credential. * * @param string $apiKey [GCM only] The API key for the project that was * obtained from the Google Developer console for your * GCM Service application credential * @return $this Fluent Builder */ public function setApiKey($apiKey) { $this->options['apiKey'] = $apiKey; return $this; } /** * [FCM only] The **Server key** of your project from the Firebase console, found under Settings / Cloud messaging. * * @param string $secret [FCM only] The Server key of your project from * Firebase console * @return $this Fluent Builder */ public function setSecret($secret) { $this->options['secret'] = $secret; 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.IpMessaging.V1.CreateCredentialOptions ' . \implode(' ', $options) . ']'; } } class UpdateCredentialOptions extends Options { /** * @param string $friendlyName A string to describe the resource * @param string $certificate [APN only] The URL encoded representation of the * certificate * @param string $privateKey [APN only] The URL encoded representation of the * private key * @param bool $sandbox [APN only] Whether to send the credential to sandbox * APNs * @param string $apiKey [GCM only] The API key for the project that was * obtained from the Google Developer console for your * GCM Service application credential * @param string $secret [FCM only] The Server key of your project from * Firebase console */ public function __construct($friendlyName = Values::NONE, $certificate = Values::NONE, $privateKey = Values::NONE, $sandbox = Values::NONE, $apiKey = Values::NONE, $secret = Values::NONE) { $this->options['friendlyName'] = $friendlyName; $this->options['certificate'] = $certificate; $this->options['privateKey'] = $privateKey; $this->options['sandbox'] = $sandbox; $this->options['apiKey'] = $apiKey; $this->options['secret'] = $secret; } /** * A descriptive string that you create to describe the resource. It can be up to 64 characters long. * * @param string $friendlyName A string to describe the resource * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * [APN only] The URL encoded representation of the certificate. For example, `-----BEGIN CERTIFICATE----- MIIFnTCCBIWgAwIBAgIIAjy9H849+E8wDQYJKoZIhvcNAQEFBQAwgZYxCzAJBgNV.....A== -----END CERTIFICATE-----` * * @param string $certificate [APN only] The URL encoded representation of the * certificate * @return $this Fluent Builder */ public function setCertificate($certificate) { $this->options['certificate'] = $certificate; return $this; } /** * [APN only] The URL encoded representation of the private key. For example, `-----BEGIN RSA PRIVATE KEY----- MIIEpQIBAAKCAQEAuyf/lNrH9ck8DmNyo3fGgvCI1l9s+cmBY3WIz+cUDqmxiieR. -----END RSA PRIVATE KEY-----` * * @param string $privateKey [APN only] The URL encoded representation of the * private key * @return $this Fluent Builder */ public function setPrivateKey($privateKey) { $this->options['privateKey'] = $privateKey; return $this; } /** * [APN only] Whether to send the credential to sandbox APNs. Can be `true` to send to sandbox APNs or `false` to send to production. * * @param bool $sandbox [APN only] Whether to send the credential to sandbox * APNs * @return $this Fluent Builder */ public function setSandbox($sandbox) { $this->options['sandbox'] = $sandbox; return $this; } /** * [GCM only] The API key for the project that was obtained from the Google Developer console for your GCM Service application credential. * * @param string $apiKey [GCM only] The API key for the project that was * obtained from the Google Developer console for your * GCM Service application credential * @return $this Fluent Builder */ public function setApiKey($apiKey) { $this->options['apiKey'] = $apiKey; return $this; } /** * [FCM only] The **Server key** of your project from the Firebase console, found under Settings / Cloud messaging. * * @param string $secret [FCM only] The Server key of your project from * Firebase console * @return $this Fluent Builder */ public function setSecret($secret) { $this->options['secret'] = $secret; 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.IpMessaging.V1.UpdateCredentialOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V1/ServiceList.php 0000644 00000012325 15002236443 0015743 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Values; use Twilio\Version; class ServiceList extends ListResource { /** * Construct the ServiceList * * @param Version $version Version that contains the resource * @return \Twilio\Rest\IpMessaging\V1\ServiceList */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = array(); $this->uri = '/Services'; } /** * Create a new ServiceInstance * * @param string $friendlyName A string to describe the resource * @return ServiceInstance Newly created ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function create($friendlyName) { $data = Values::of(array('FriendlyName' => $friendlyName, )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new ServiceInstance($this->version, $payload); } /** * Streams ServiceInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads ServiceInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return ServiceInstance[] Array of results */ public function read($limit = null, $pageSize = null) { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of ServiceInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of ServiceInstance */ public function page($pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $params = Values::of(array( 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new ServicePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of ServiceInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of ServiceInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new ServicePage($this->version, $response, $this->solution); } /** * Constructs a ServiceContext * * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\IpMessaging\V1\ServiceContext */ public function getContext($sid) { return new ServiceContext($this->version, $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.IpMessaging.V1.ServiceList]'; } } sdk/src/Twilio/Rest/IpMessaging/V1/CredentialList.php 0000644 00000013442 15002236443 0016416 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class CredentialList extends ListResource { /** * Construct the CredentialList * * @param Version $version Version that contains the resource * @return \Twilio\Rest\IpMessaging\V1\CredentialList */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = array(); $this->uri = '/Credentials'; } /** * Streams CredentialInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads CredentialInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return CredentialInstance[] Array of results */ public function read($limit = null, $pageSize = null) { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of CredentialInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of CredentialInstance */ public function page($pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $params = Values::of(array( 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new CredentialPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of CredentialInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of CredentialInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new CredentialPage($this->version, $response, $this->solution); } /** * Create a new CredentialInstance * * @param string $type The type of push-notification service the credential is * for * @param array|Options $options Optional Arguments * @return CredentialInstance Newly created CredentialInstance * @throws TwilioException When an HTTP error occurs. */ public function create($type, $options = array()) { $options = new Values($options); $data = Values::of(array( 'Type' => $type, 'FriendlyName' => $options['friendlyName'], 'Certificate' => $options['certificate'], 'PrivateKey' => $options['privateKey'], 'Sandbox' => Serialize::booleanToString($options['sandbox']), 'ApiKey' => $options['apiKey'], 'Secret' => $options['secret'], )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new CredentialInstance($this->version, $payload); } /** * Constructs a CredentialContext * * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\IpMessaging\V1\CredentialContext */ public function getContext($sid) { return new CredentialContext($this->version, $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.IpMessaging.V1.CredentialList]'; } } sdk/src/Twilio/Rest/IpMessaging/V1/ServicePage.php 0000644 00000001330 15002236443 0015676 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V1; use Twilio\Page; class ServicePage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new ServiceInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.IpMessaging.V1.ServicePage]'; } } sdk/src/Twilio/Rest/IpMessaging/V1/CredentialPage.php 0000644 00000001341 15002236443 0016352 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V1; use Twilio\Page; class CredentialPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new CredentialInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.IpMessaging.V1.CredentialPage]'; } } sdk/src/Twilio/Rest/IpMessaging/V1/ServiceInstance.php 0000644 00000014443 15002236443 0016577 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V1; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $accountSid * @property string $friendlyName * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $defaultServiceRoleSid * @property string $defaultChannelRoleSid * @property string $defaultChannelCreatorRoleSid * @property bool $readStatusEnabled * @property bool $reachabilityEnabled * @property int $typingIndicatorTimeout * @property int $consumptionReportInterval * @property array $limits * @property array $webhooks * @property string $preWebhookUrl * @property string $postWebhookUrl * @property string $webhookMethod * @property string $webhookFilters * @property array $notifications * @property string $url * @property array $links */ class ServiceInstance extends InstanceResource { protected $_channels = null; protected $_roles = null; protected $_users = null; /** * Initialize the ServiceInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\IpMessaging\V1\ServiceInstance */ public function __construct(Version $version, array $payload, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'defaultServiceRoleSid' => Values::array_get($payload, 'default_service_role_sid'), 'defaultChannelRoleSid' => Values::array_get($payload, 'default_channel_role_sid'), 'defaultChannelCreatorRoleSid' => Values::array_get($payload, 'default_channel_creator_role_sid'), 'readStatusEnabled' => Values::array_get($payload, 'read_status_enabled'), 'reachabilityEnabled' => Values::array_get($payload, 'reachability_enabled'), 'typingIndicatorTimeout' => Values::array_get($payload, 'typing_indicator_timeout'), 'consumptionReportInterval' => Values::array_get($payload, 'consumption_report_interval'), 'limits' => Values::array_get($payload, 'limits'), 'webhooks' => Values::array_get($payload, 'webhooks'), 'preWebhookUrl' => Values::array_get($payload, 'pre_webhook_url'), 'postWebhookUrl' => Values::array_get($payload, 'post_webhook_url'), 'webhookMethod' => Values::array_get($payload, 'webhook_method'), 'webhookFilters' => Values::array_get($payload, 'webhook_filters'), 'notifications' => Values::array_get($payload, 'notifications'), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ); $this->solution = array('sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\IpMessaging\V1\ServiceContext Context for this * ServiceInstance */ protected function proxy() { if (!$this->context) { $this->context = new ServiceContext($this->version, $this->solution['sid']); } return $this->context; } /** * Fetch a ServiceInstance * * @return ServiceInstance Fetched ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the ServiceInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Update the ServiceInstance * * @param array|Options $options Optional Arguments * @return ServiceInstance Updated ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Access the channels * * @return \Twilio\Rest\IpMessaging\V1\Service\ChannelList */ protected function getChannels() { return $this->proxy()->channels; } /** * Access the roles * * @return \Twilio\Rest\IpMessaging\V1\Service\RoleList */ protected function getRoles() { return $this->proxy()->roles; } /** * Access the users * * @return \Twilio\Rest\IpMessaging\V1\Service\UserList */ protected function getUsers() { return $this->proxy()->users; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.IpMessaging.V1.ServiceInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V1/Service/UserContext.php 0000644 00000011212 15002236443 0017364 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Rest\IpMessaging\V1\Service\User\UserChannelList; use Twilio\Values; use Twilio\Version; /** * @property \Twilio\Rest\IpMessaging\V1\Service\User\UserChannelList $userChannels */ class UserContext extends InstanceContext { protected $_userChannels = null; /** * Initialize the UserContext * * @param \Twilio\Version $version Version that contains the resource * @param string $serviceSid The SID of the Service to fetch the resource from * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\IpMessaging\V1\Service\UserContext */ public function __construct(Version $version, $serviceSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, 'sid' => $sid, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Users/' . \rawurlencode($sid) . ''; } /** * Fetch a UserInstance * * @return UserInstance Fetched UserInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new UserInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Deletes the UserInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Update the UserInstance * * @param array|Options $options Optional Arguments * @return UserInstance Updated UserInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { $options = new Values($options); $data = Values::of(array( 'RoleSid' => $options['roleSid'], 'Attributes' => $options['attributes'], 'FriendlyName' => $options['friendlyName'], )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new UserInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Access the userChannels * * @return \Twilio\Rest\IpMessaging\V1\Service\User\UserChannelList */ protected function getUserChannels() { if (!$this->_userChannels) { $this->_userChannels = new UserChannelList( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->_userChannels; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get($name) { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.IpMessaging.V1.UserContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V1/Service/User/UserChannelPage.php 0000644 00000001546 15002236443 0021034 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V1\Service\User; use Twilio\Page; class UserChannelPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new UserChannelInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['userSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.IpMessaging.V1.UserChannelPage]'; } } sdk/src/Twilio/Rest/IpMessaging/V1/Service/User/UserChannelList.php 0000644 00000011407 15002236443 0021070 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V1\Service\User; use Twilio\ListResource; use Twilio\Values; use Twilio\Version; class UserChannelList extends ListResource { /** * Construct the UserChannelList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Service that the resource is * associated with * @param string $userSid The unique string that identifies the resource * @return \Twilio\Rest\IpMessaging\V1\Service\User\UserChannelList */ public function __construct(Version $version, $serviceSid, $userSid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, 'userSid' => $userSid, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Users/' . \rawurlencode($userSid) . '/Channels'; } /** * Streams UserChannelInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads UserChannelInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return UserChannelInstance[] Array of results */ public function read($limit = null, $pageSize = null) { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of UserChannelInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of UserChannelInstance */ public function page($pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $params = Values::of(array( 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new UserChannelPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of UserChannelInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of UserChannelInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new UserChannelPage($this->version, $response, $this->solution); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.IpMessaging.V1.UserChannelList]'; } } sdk/src/Twilio/Rest/IpMessaging/V1/Service/User/UserChannelInstance.php 0000644 00000005330 15002236443 0021717 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V1\Service\User; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property string $serviceSid * @property string $channelSid * @property string $memberSid * @property string $status * @property int $lastConsumedMessageIndex * @property int $unreadMessagesCount * @property array $links */ class UserChannelInstance extends InstanceResource { /** * Initialize the UserChannelInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the Service that the resource is * associated with * @param string $userSid The unique string that identifies the resource * @return \Twilio\Rest\IpMessaging\V1\Service\User\UserChannelInstance */ public function __construct(Version $version, array $payload, $serviceSid, $userSid) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'channelSid' => Values::array_get($payload, 'channel_sid'), 'memberSid' => Values::array_get($payload, 'member_sid'), 'status' => Values::array_get($payload, 'status'), 'lastConsumedMessageIndex' => Values::array_get($payload, 'last_consumed_message_index'), 'unreadMessagesCount' => Values::array_get($payload, 'unread_messages_count'), 'links' => Values::array_get($payload, 'links'), ); $this->solution = array('serviceSid' => $serviceSid, 'userSid' => $userSid, ); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.IpMessaging.V1.UserChannelInstance]'; } } sdk/src/Twilio/Rest/IpMessaging/V1/Service/RoleInstance.php 0000644 00000010572 15002236443 0017477 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V1\Service; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $accountSid * @property string $serviceSid * @property string $friendlyName * @property string $type * @property string $permissions * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $url */ class RoleInstance extends InstanceResource { /** * Initialize the RoleInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the Service that the resource is * associated with * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\IpMessaging\V1\Service\RoleInstance */ public function __construct(Version $version, array $payload, $serviceSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'type' => Values::array_get($payload, 'type'), 'permissions' => Values::array_get($payload, 'permissions'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), ); $this->solution = array('serviceSid' => $serviceSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\IpMessaging\V1\Service\RoleContext Context for this * RoleInstance */ protected function proxy() { if (!$this->context) { $this->context = new RoleContext( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch a RoleInstance * * @return RoleInstance Fetched RoleInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the RoleInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Update the RoleInstance * * @param string $permission A permission the role should have * @return RoleInstance Updated RoleInstance * @throws TwilioException When an HTTP error occurs. */ public function update($permission) { return $this->proxy()->update($permission); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.IpMessaging.V1.RoleInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V1/Service/ChannelInstance.php 0000644 00000013170 15002236443 0020143 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V1\Service; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $accountSid * @property string $serviceSid * @property string $friendlyName * @property string $uniqueName * @property string $attributes * @property string $type * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $createdBy * @property int $membersCount * @property int $messagesCount * @property string $url * @property array $links */ class ChannelInstance extends InstanceResource { protected $_members = null; protected $_messages = null; protected $_invites = null; /** * Initialize the ChannelInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the Service that the resource is * associated with * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\IpMessaging\V1\Service\ChannelInstance */ public function __construct(Version $version, array $payload, $serviceSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'uniqueName' => Values::array_get($payload, 'unique_name'), 'attributes' => Values::array_get($payload, 'attributes'), 'type' => Values::array_get($payload, 'type'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'createdBy' => Values::array_get($payload, 'created_by'), 'membersCount' => Values::array_get($payload, 'members_count'), 'messagesCount' => Values::array_get($payload, 'messages_count'), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ); $this->solution = array('serviceSid' => $serviceSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\IpMessaging\V1\Service\ChannelContext Context for this * ChannelInstance */ protected function proxy() { if (!$this->context) { $this->context = new ChannelContext( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch a ChannelInstance * * @return ChannelInstance Fetched ChannelInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the ChannelInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Update the ChannelInstance * * @param array|Options $options Optional Arguments * @return ChannelInstance Updated ChannelInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Access the members * * @return \Twilio\Rest\IpMessaging\V1\Service\Channel\MemberList */ protected function getMembers() { return $this->proxy()->members; } /** * Access the messages * * @return \Twilio\Rest\IpMessaging\V1\Service\Channel\MessageList */ protected function getMessages() { return $this->proxy()->messages; } /** * Access the invites * * @return \Twilio\Rest\IpMessaging\V1\Service\Channel\InviteList */ protected function getInvites() { return $this->proxy()->invites; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.IpMessaging.V1.ChannelInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V1/Service/UserList.php 0000644 00000013443 15002236443 0016663 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; class UserList extends ListResource { /** * Construct the UserList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Service that the resource is * associated with * @return \Twilio\Rest\IpMessaging\V1\Service\UserList */ public function __construct(Version $version, $serviceSid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Users'; } /** * Create a new UserInstance * * @param string $identity The `identity` value that identifies the new * resource's User * @param array|Options $options Optional Arguments * @return UserInstance Newly created UserInstance * @throws TwilioException When an HTTP error occurs. */ public function create($identity, $options = array()) { $options = new Values($options); $data = Values::of(array( 'Identity' => $identity, 'RoleSid' => $options['roleSid'], 'Attributes' => $options['attributes'], 'FriendlyName' => $options['friendlyName'], )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new UserInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Streams UserInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads UserInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return UserInstance[] Array of results */ public function read($limit = null, $pageSize = null) { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of UserInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of UserInstance */ public function page($pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $params = Values::of(array( 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new UserPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of UserInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of UserInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new UserPage($this->version, $response, $this->solution); } /** * Constructs a UserContext * * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\IpMessaging\V1\Service\UserContext */ public function getContext($sid) { return new UserContext($this->version, $this->solution['serviceSid'], $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.IpMessaging.V1.UserList]'; } } sdk/src/Twilio/Rest/IpMessaging/V1/Service/UserPage.php 0000644 00000001366 15002236443 0016625 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V1\Service; use Twilio\Page; class UserPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new UserInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.IpMessaging.V1.UserPage]'; } } sdk/src/Twilio/Rest/IpMessaging/V1/Service/UserOptions.php 0000644 00000013021 15002236443 0017373 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V1\Service; use Twilio\Options; use Twilio\Values; abstract class UserOptions { /** * @param string $roleSid The SID of the Role assigned to this user * @param string $attributes A valid JSON string that contains * application-specific data * @param string $friendlyName A string to describe the new resource * @return CreateUserOptions Options builder */ public static function create($roleSid = Values::NONE, $attributes = Values::NONE, $friendlyName = Values::NONE) { return new CreateUserOptions($roleSid, $attributes, $friendlyName); } /** * @param string $roleSid The SID id of the Role assigned to this user * @param string $attributes A valid JSON string that contains * application-specific data * @param string $friendlyName A string to describe the resource * @return UpdateUserOptions Options builder */ public static function update($roleSid = Values::NONE, $attributes = Values::NONE, $friendlyName = Values::NONE) { return new UpdateUserOptions($roleSid, $attributes, $friendlyName); } } class CreateUserOptions extends Options { /** * @param string $roleSid The SID of the Role assigned to this user * @param string $attributes A valid JSON string that contains * application-specific data * @param string $friendlyName A string to describe the new resource */ public function __construct($roleSid = Values::NONE, $attributes = Values::NONE, $friendlyName = Values::NONE) { $this->options['roleSid'] = $roleSid; $this->options['attributes'] = $attributes; $this->options['friendlyName'] = $friendlyName; } /** * The SID of the [Role](https://www.twilio.com/docs/api/chat/rest/roles) assigned to the new User. * * @param string $roleSid The SID of the Role assigned to this user * @return $this Fluent Builder */ public function setRoleSid($roleSid) { $this->options['roleSid'] = $roleSid; return $this; } /** * A valid JSON string that contains application-specific data. * * @param string $attributes A valid JSON string that contains * application-specific data * @return $this Fluent Builder */ public function setAttributes($attributes) { $this->options['attributes'] = $attributes; return $this; } /** * A descriptive string that you create to describe the new resource. This value is often used for display purposes. * * @param string $friendlyName A string to describe the new resource * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; 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.IpMessaging.V1.CreateUserOptions ' . \implode(' ', $options) . ']'; } } class UpdateUserOptions extends Options { /** * @param string $roleSid The SID id of the Role assigned to this user * @param string $attributes A valid JSON string that contains * application-specific data * @param string $friendlyName A string to describe the resource */ public function __construct($roleSid = Values::NONE, $attributes = Values::NONE, $friendlyName = Values::NONE) { $this->options['roleSid'] = $roleSid; $this->options['attributes'] = $attributes; $this->options['friendlyName'] = $friendlyName; } /** * The SID of the [Role](https://www.twilio.com/docs/api/chat/rest/roles) assigned to this user. * * @param string $roleSid The SID id of the Role assigned to this user * @return $this Fluent Builder */ public function setRoleSid($roleSid) { $this->options['roleSid'] = $roleSid; return $this; } /** * A valid JSON string that contains application-specific data. * * @param string $attributes A valid JSON string that contains * application-specific data * @return $this Fluent Builder */ public function setAttributes($attributes) { $this->options['attributes'] = $attributes; return $this; } /** * A descriptive string that you create to describe the resource. It is often used for display purposes. * * @param string $friendlyName A string to describe the resource * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; 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.IpMessaging.V1.UpdateUserOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V1/Service/RolePage.php 0000644 00000001366 15002236443 0016610 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V1\Service; use Twilio\Page; class RolePage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new RoleInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.IpMessaging.V1.RolePage]'; } } sdk/src/Twilio/Rest/IpMessaging/V1/Service/RoleContext.php 0000644 00000005512 15002236443 0017355 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class RoleContext extends InstanceContext { /** * Initialize the RoleContext * * @param \Twilio\Version $version Version that contains the resource * @param string $serviceSid The SID of the Service to fetch the resource from * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\IpMessaging\V1\Service\RoleContext */ public function __construct(Version $version, $serviceSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, 'sid' => $sid, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Roles/' . \rawurlencode($sid) . ''; } /** * Fetch a RoleInstance * * @return RoleInstance Fetched RoleInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new RoleInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Deletes the RoleInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Update the RoleInstance * * @param string $permission A permission the role should have * @return RoleInstance Updated RoleInstance * @throws TwilioException When an HTTP error occurs. */ public function update($permission) { $data = Values::of(array('Permission' => Serialize::map($permission, function($e) { return $e; }), )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new RoleInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.IpMessaging.V1.RoleContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V1/Service/ChannelList.php 0000644 00000014161 15002236443 0017313 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class ChannelList extends ListResource { /** * Construct the ChannelList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Service that the resource is * associated with * @return \Twilio\Rest\IpMessaging\V1\Service\ChannelList */ public function __construct(Version $version, $serviceSid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Channels'; } /** * Create a new ChannelInstance * * @param array|Options $options Optional Arguments * @return ChannelInstance Newly created ChannelInstance * @throws TwilioException When an HTTP error occurs. */ public function create($options = array()) { $options = new Values($options); $data = Values::of(array( 'FriendlyName' => $options['friendlyName'], 'UniqueName' => $options['uniqueName'], 'Attributes' => $options['attributes'], 'Type' => $options['type'], )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new ChannelInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Streams ChannelInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($options = array(), $limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads ChannelInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return ChannelInstance[] Array of results */ public function read($options = array(), $limit = null, $pageSize = null) { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Retrieve a single page of ChannelInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of ChannelInstance */ public function page($options = array(), $pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $options = new Values($options); $params = Values::of(array( 'Type' => Serialize::map($options['type'], function($e) { return $e; }), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new ChannelPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of ChannelInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of ChannelInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new ChannelPage($this->version, $response, $this->solution); } /** * Constructs a ChannelContext * * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\IpMessaging\V1\Service\ChannelContext */ public function getContext($sid) { return new ChannelContext($this->version, $this->solution['serviceSid'], $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.IpMessaging.V1.ChannelList]'; } } sdk/src/Twilio/Rest/IpMessaging/V1/Service/ChannelContext.php 0000644 00000014073 15002236443 0020026 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Rest\IpMessaging\V1\Service\Channel\InviteList; use Twilio\Rest\IpMessaging\V1\Service\Channel\MemberList; use Twilio\Rest\IpMessaging\V1\Service\Channel\MessageList; use Twilio\Values; use Twilio\Version; /** * @property \Twilio\Rest\IpMessaging\V1\Service\Channel\MemberList $members * @property \Twilio\Rest\IpMessaging\V1\Service\Channel\MessageList $messages * @property \Twilio\Rest\IpMessaging\V1\Service\Channel\InviteList $invites * @method \Twilio\Rest\IpMessaging\V1\Service\Channel\MemberContext members(string $sid) * @method \Twilio\Rest\IpMessaging\V1\Service\Channel\MessageContext messages(string $sid) * @method \Twilio\Rest\IpMessaging\V1\Service\Channel\InviteContext invites(string $sid) */ class ChannelContext extends InstanceContext { protected $_members = null; protected $_messages = null; protected $_invites = null; /** * Initialize the ChannelContext * * @param \Twilio\Version $version Version that contains the resource * @param string $serviceSid The SID of the Service to fetch the resource from * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\IpMessaging\V1\Service\ChannelContext */ public function __construct(Version $version, $serviceSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, 'sid' => $sid, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Channels/' . \rawurlencode($sid) . ''; } /** * Fetch a ChannelInstance * * @return ChannelInstance Fetched ChannelInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new ChannelInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Deletes the ChannelInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Update the ChannelInstance * * @param array|Options $options Optional Arguments * @return ChannelInstance Updated ChannelInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { $options = new Values($options); $data = Values::of(array( 'FriendlyName' => $options['friendlyName'], 'UniqueName' => $options['uniqueName'], 'Attributes' => $options['attributes'], )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new ChannelInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Access the members * * @return \Twilio\Rest\IpMessaging\V1\Service\Channel\MemberList */ protected function getMembers() { if (!$this->_members) { $this->_members = new MemberList( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->_members; } /** * Access the messages * * @return \Twilio\Rest\IpMessaging\V1\Service\Channel\MessageList */ protected function getMessages() { if (!$this->_messages) { $this->_messages = new MessageList( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->_messages; } /** * Access the invites * * @return \Twilio\Rest\IpMessaging\V1\Service\Channel\InviteList */ protected function getInvites() { if (!$this->_invites) { $this->_invites = new InviteList( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->_invites; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get($name) { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.IpMessaging.V1.ChannelContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V1/Service/ChannelPage.php 0000644 00000001377 15002236443 0017261 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V1\Service; use Twilio\Page; class ChannelPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new ChannelInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.IpMessaging.V1.ChannelPage]'; } } sdk/src/Twilio/Rest/IpMessaging/V1/Service/UserInstance.php 0000644 00000012226 15002236443 0017512 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V1\Service; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $accountSid * @property string $serviceSid * @property string $attributes * @property string $friendlyName * @property string $roleSid * @property string $identity * @property bool $isOnline * @property bool $isNotifiable * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property int $joinedChannelsCount * @property array $links * @property string $url */ class UserInstance extends InstanceResource { protected $_userChannels = null; /** * Initialize the UserInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the Service that the resource is * associated with * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\IpMessaging\V1\Service\UserInstance */ public function __construct(Version $version, array $payload, $serviceSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'attributes' => Values::array_get($payload, 'attributes'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'roleSid' => Values::array_get($payload, 'role_sid'), 'identity' => Values::array_get($payload, 'identity'), 'isOnline' => Values::array_get($payload, 'is_online'), 'isNotifiable' => Values::array_get($payload, 'is_notifiable'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'joinedChannelsCount' => Values::array_get($payload, 'joined_channels_count'), 'links' => Values::array_get($payload, 'links'), 'url' => Values::array_get($payload, 'url'), ); $this->solution = array('serviceSid' => $serviceSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\IpMessaging\V1\Service\UserContext Context for this * UserInstance */ protected function proxy() { if (!$this->context) { $this->context = new UserContext( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch a UserInstance * * @return UserInstance Fetched UserInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the UserInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Update the UserInstance * * @param array|Options $options Optional Arguments * @return UserInstance Updated UserInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Access the userChannels * * @return \Twilio\Rest\IpMessaging\V1\Service\User\UserChannelList */ protected function getUserChannels() { return $this->proxy()->userChannels; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.IpMessaging.V1.UserInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V1/Service/ChannelOptions.php 0000644 00000017703 15002236443 0020040 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V1\Service; use Twilio\Options; use Twilio\Values; abstract class ChannelOptions { /** * @param string $friendlyName A string to describe the new resource * @param string $uniqueName An application-defined string that uniquely * identifies the resource * @param string $attributes A valid JSON string that contains * application-specific data * @param string $type The visibility of the channel * @return CreateChannelOptions Options builder */ public static function create($friendlyName = Values::NONE, $uniqueName = Values::NONE, $attributes = Values::NONE, $type = Values::NONE) { return new CreateChannelOptions($friendlyName, $uniqueName, $attributes, $type); } /** * @param string $type The visibility of the channel to read * @return ReadChannelOptions Options builder */ public static function read($type = Values::NONE) { return new ReadChannelOptions($type); } /** * @param string $friendlyName A string to describe the resource * @param string $uniqueName An application-defined string that uniquely * identifies the resource * @param string $attributes A valid JSON string that contains * application-specific data * @return UpdateChannelOptions Options builder */ public static function update($friendlyName = Values::NONE, $uniqueName = Values::NONE, $attributes = Values::NONE) { return new UpdateChannelOptions($friendlyName, $uniqueName, $attributes); } } class CreateChannelOptions extends Options { /** * @param string $friendlyName A string to describe the new resource * @param string $uniqueName An application-defined string that uniquely * identifies the resource * @param string $attributes A valid JSON string that contains * application-specific data * @param string $type The visibility of the channel */ public function __construct($friendlyName = Values::NONE, $uniqueName = Values::NONE, $attributes = Values::NONE, $type = Values::NONE) { $this->options['friendlyName'] = $friendlyName; $this->options['uniqueName'] = $uniqueName; $this->options['attributes'] = $attributes; $this->options['type'] = $type; } /** * A descriptive string that you create to describe the new resource. It can be up to 64 characters long. * * @param string $friendlyName A string to describe the new resource * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * An application-defined string that uniquely identifies the resource. It can be used to address the resource in place of the resource's `sid` in the URL. This value must be 64 characters or less in length and be unique within the Service. * * @param string $uniqueName An application-defined string that uniquely * identifies the resource * @return $this Fluent Builder */ public function setUniqueName($uniqueName) { $this->options['uniqueName'] = $uniqueName; return $this; } /** * A valid JSON string that contains application-specific data. * * @param string $attributes A valid JSON string that contains * application-specific data * @return $this Fluent Builder */ public function setAttributes($attributes) { $this->options['attributes'] = $attributes; return $this; } /** * The visibility of the channel. Can be: `public` or `private` and defaults to `public`. * * @param string $type The visibility of the channel * @return $this Fluent Builder */ public function setType($type) { $this->options['type'] = $type; 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.IpMessaging.V1.CreateChannelOptions ' . \implode(' ', $options) . ']'; } } class ReadChannelOptions extends Options { /** * @param string $type The visibility of the channel to read */ public function __construct($type = Values::NONE) { $this->options['type'] = $type; } /** * The visibility of the Channels to read. Can be: `public` or `private` and defaults to `public`. * * @param string $type The visibility of the channel to read * @return $this Fluent Builder */ public function setType($type) { $this->options['type'] = $type; 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.IpMessaging.V1.ReadChannelOptions ' . \implode(' ', $options) . ']'; } } class UpdateChannelOptions extends Options { /** * @param string $friendlyName A string to describe the resource * @param string $uniqueName An application-defined string that uniquely * identifies the resource * @param string $attributes A valid JSON string that contains * application-specific data */ public function __construct($friendlyName = Values::NONE, $uniqueName = Values::NONE, $attributes = Values::NONE) { $this->options['friendlyName'] = $friendlyName; $this->options['uniqueName'] = $uniqueName; $this->options['attributes'] = $attributes; } /** * A descriptive string that you create to describe the resource. It can be up to 64 characters long. * * @param string $friendlyName A string to describe the resource * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * An application-defined string that uniquely identifies the resource. It can be used to address the resource in place of the resource's `sid` in the URL. This value must be 64 characters or less in length and be unique within the Service. * * @param string $uniqueName An application-defined string that uniquely * identifies the resource * @return $this Fluent Builder */ public function setUniqueName($uniqueName) { $this->options['uniqueName'] = $uniqueName; return $this; } /** * A valid JSON string that contains application-specific data. * * @param string $attributes A valid JSON string that contains * application-specific data * @return $this Fluent Builder */ public function setAttributes($attributes) { $this->options['attributes'] = $attributes; 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.IpMessaging.V1.UpdateChannelOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V1/Service/RoleList.php 0000644 00000013345 15002236443 0016647 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class RoleList extends ListResource { /** * Construct the RoleList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Service that the resource is * associated with * @return \Twilio\Rest\IpMessaging\V1\Service\RoleList */ public function __construct(Version $version, $serviceSid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Roles'; } /** * Create a new RoleInstance * * @param string $friendlyName A string to describe the new resource * @param string $type The type of role * @param string $permission A permission the role should have * @return RoleInstance Newly created RoleInstance * @throws TwilioException When an HTTP error occurs. */ public function create($friendlyName, $type, $permission) { $data = Values::of(array( 'FriendlyName' => $friendlyName, 'Type' => $type, 'Permission' => Serialize::map($permission, function($e) { return $e; }), )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new RoleInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Streams RoleInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads RoleInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return RoleInstance[] Array of results */ public function read($limit = null, $pageSize = null) { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of RoleInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of RoleInstance */ public function page($pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $params = Values::of(array( 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new RolePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of RoleInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of RoleInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new RolePage($this->version, $response, $this->solution); } /** * Constructs a RoleContext * * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\IpMessaging\V1\Service\RoleContext */ public function getContext($sid) { return new RoleContext($this->version, $this->solution['serviceSid'], $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.IpMessaging.V1.RoleList]'; } } sdk/src/Twilio/Rest/IpMessaging/V1/Service/Channel/MessageContext.php 0000644 00000006315 15002236443 0021412 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V1\Service\Channel; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Values; use Twilio\Version; class MessageContext extends InstanceContext { /** * Initialize the MessageContext * * @param \Twilio\Version $version Version that contains the resource * @param string $serviceSid The SID of the Service to fetch the resource from * @param string $channelSid The unique ID of the Channel the message to fetch * belongs to * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\IpMessaging\V1\Service\Channel\MessageContext */ public function __construct(Version $version, $serviceSid, $channelSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, 'channelSid' => $channelSid, 'sid' => $sid, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Channels/' . \rawurlencode($channelSid) . '/Messages/' . \rawurlencode($sid) . ''; } /** * Fetch a MessageInstance * * @return MessageInstance Fetched MessageInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new MessageInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid'], $this->solution['sid'] ); } /** * Deletes the MessageInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Update the MessageInstance * * @param array|Options $options Optional Arguments * @return MessageInstance Updated MessageInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { $options = new Values($options); $data = Values::of(array('Body' => $options['body'], 'Attributes' => $options['attributes'], )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new MessageInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.IpMessaging.V1.MessageContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V1/Service/Channel/MemberOptions.php 0000644 00000012717 15002236443 0021247 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V1\Service\Channel; use Twilio\Options; use Twilio\Values; abstract class MemberOptions { /** * @param string $roleSid The SID of the Role to assign to the member * @return CreateMemberOptions Options builder */ public static function create($roleSid = Values::NONE) { return new CreateMemberOptions($roleSid); } /** * @param string $identity The `identity` value of the resources to read * @return ReadMemberOptions Options builder */ public static function read($identity = Values::NONE) { return new ReadMemberOptions($identity); } /** * @param string $roleSid The SID of the Role to assign to the member * @param int $lastConsumedMessageIndex The index of the last consumed Message * for the Channel for the Member * @return UpdateMemberOptions Options builder */ public static function update($roleSid = Values::NONE, $lastConsumedMessageIndex = Values::NONE) { return new UpdateMemberOptions($roleSid, $lastConsumedMessageIndex); } } class CreateMemberOptions extends Options { /** * @param string $roleSid The SID of the Role to assign to the member */ public function __construct($roleSid = Values::NONE) { $this->options['roleSid'] = $roleSid; } /** * The SID of the [Role](https://www.twilio.com/docs/api/chat/rest/roles) to assign to the member. The default roles are those specified on the [Service](https://www.twilio.com/docs/chat/api/services). * * @param string $roleSid The SID of the Role to assign to the member * @return $this Fluent Builder */ public function setRoleSid($roleSid) { $this->options['roleSid'] = $roleSid; 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.IpMessaging.V1.CreateMemberOptions ' . \implode(' ', $options) . ']'; } } class ReadMemberOptions extends Options { /** * @param string $identity The `identity` value of the resources to read */ public function __construct($identity = Values::NONE) { $this->options['identity'] = $identity; } /** * The [User](https://www.twilio.com/docs/api/chat/rest/v1/user)'s `identity` value of the resources to read. See [access tokens](https://www.twilio.com/docs/api/chat/guides/create-tokens) for more details. * * @param string $identity The `identity` value of the resources to read * @return $this Fluent Builder */ public function setIdentity($identity) { $this->options['identity'] = $identity; 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.IpMessaging.V1.ReadMemberOptions ' . \implode(' ', $options) . ']'; } } class UpdateMemberOptions extends Options { /** * @param string $roleSid The SID of the Role to assign to the member * @param int $lastConsumedMessageIndex The index of the last consumed Message * for the Channel for the Member */ public function __construct($roleSid = Values::NONE, $lastConsumedMessageIndex = Values::NONE) { $this->options['roleSid'] = $roleSid; $this->options['lastConsumedMessageIndex'] = $lastConsumedMessageIndex; } /** * The SID of the [Role](https://www.twilio.com/docs/api/chat/rest/roles) to assign to the member. The default roles are those specified on the [Service](https://www.twilio.com/docs/chat/api/services). * * @param string $roleSid The SID of the Role to assign to the member * @return $this Fluent Builder */ public function setRoleSid($roleSid) { $this->options['roleSid'] = $roleSid; return $this; } /** * The index of the last [Message](https://www.twilio.com/docs/api/chat/rest/messages) that the Member has read within the [Channel](https://www.twilio.com/docs/api/chat/rest/channels). * * @param int $lastConsumedMessageIndex The index of the last consumed Message * for the Channel for the Member * @return $this Fluent Builder */ public function setLastConsumedMessageIndex($lastConsumedMessageIndex) { $this->options['lastConsumedMessageIndex'] = $lastConsumedMessageIndex; 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.IpMessaging.V1.UpdateMemberOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V1/Service/Channel/MemberContext.php 0000644 00000006327 15002236443 0021240 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V1\Service\Channel; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Values; use Twilio\Version; class MemberContext extends InstanceContext { /** * Initialize the MemberContext * * @param \Twilio\Version $version Version that contains the resource * @param string $serviceSid The SID of the Service to fetch the resource from * @param string $channelSid The unique ID of the channel the member belongs to * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\IpMessaging\V1\Service\Channel\MemberContext */ public function __construct(Version $version, $serviceSid, $channelSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, 'channelSid' => $channelSid, 'sid' => $sid, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Channels/' . \rawurlencode($channelSid) . '/Members/' . \rawurlencode($sid) . ''; } /** * Fetch a MemberInstance * * @return MemberInstance Fetched MemberInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new MemberInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid'], $this->solution['sid'] ); } /** * Deletes the MemberInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Update the MemberInstance * * @param array|Options $options Optional Arguments * @return MemberInstance Updated MemberInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { $options = new Values($options); $data = Values::of(array( 'RoleSid' => $options['roleSid'], 'LastConsumedMessageIndex' => $options['lastConsumedMessageIndex'], )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new MemberInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.IpMessaging.V1.MemberContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V1/Service/Channel/MessageList.php 0000644 00000014705 15002236443 0020703 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V1\Service\Channel; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; class MessageList extends ListResource { /** * Construct the MessageList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Service that the resource is * associated with * @param string $channelSid The unique ID of the Channel the Message resource * belongs to * @return \Twilio\Rest\IpMessaging\V1\Service\Channel\MessageList */ public function __construct(Version $version, $serviceSid, $channelSid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, 'channelSid' => $channelSid, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Channels/' . \rawurlencode($channelSid) . '/Messages'; } /** * Create a new MessageInstance * * @param string $body The message to send to the channel * @param array|Options $options Optional Arguments * @return MessageInstance Newly created MessageInstance * @throws TwilioException When an HTTP error occurs. */ public function create($body, $options = array()) { $options = new Values($options); $data = Values::of(array( 'Body' => $body, 'From' => $options['from'], 'Attributes' => $options['attributes'], )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new MessageInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid'] ); } /** * Streams MessageInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($options = array(), $limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads MessageInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return MessageInstance[] Array of results */ public function read($options = array(), $limit = null, $pageSize = null) { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Retrieve a single page of MessageInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of MessageInstance */ public function page($options = array(), $pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $options = new Values($options); $params = Values::of(array( 'Order' => $options['order'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new MessagePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of MessageInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of MessageInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new MessagePage($this->version, $response, $this->solution); } /** * Constructs a MessageContext * * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\IpMessaging\V1\Service\Channel\MessageContext */ public function getContext($sid) { return new MessageContext( $this->version, $this->solution['serviceSid'], $this->solution['channelSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.IpMessaging.V1.MessageList]'; } } sdk/src/Twilio/Rest/IpMessaging/V1/Service/Channel/MessageInstance.php 0000644 00000012166 15002236443 0021533 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V1\Service\Channel; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $accountSid * @property string $attributes * @property string $serviceSid * @property string $to * @property string $channelSid * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property bool $wasEdited * @property string $from * @property string $body * @property int $index * @property string $url */ class MessageInstance extends InstanceResource { /** * Initialize the MessageInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the Service that the resource is * associated with * @param string $channelSid The unique ID of the Channel the Message resource * belongs to * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\IpMessaging\V1\Service\Channel\MessageInstance */ public function __construct(Version $version, array $payload, $serviceSid, $channelSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'attributes' => Values::array_get($payload, 'attributes'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'to' => Values::array_get($payload, 'to'), 'channelSid' => Values::array_get($payload, 'channel_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'wasEdited' => Values::array_get($payload, 'was_edited'), 'from' => Values::array_get($payload, 'from'), 'body' => Values::array_get($payload, 'body'), 'index' => Values::array_get($payload, 'index'), 'url' => Values::array_get($payload, 'url'), ); $this->solution = array( 'serviceSid' => $serviceSid, 'channelSid' => $channelSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\IpMessaging\V1\Service\Channel\MessageContext Context * for this * MessageInstance */ protected function proxy() { if (!$this->context) { $this->context = new MessageContext( $this->version, $this->solution['serviceSid'], $this->solution['channelSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch a MessageInstance * * @return MessageInstance Fetched MessageInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the MessageInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Update the MessageInstance * * @param array|Options $options Optional Arguments * @return MessageInstance Updated MessageInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.IpMessaging.V1.MessageInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V1/Service/Channel/MemberList.php 0000644 00000014701 15002236443 0020522 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V1\Service\Channel; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class MemberList extends ListResource { /** * Construct the MemberList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Service that the resource is * associated with * @param string $channelSid The unique ID of the Channel for the member * @return \Twilio\Rest\IpMessaging\V1\Service\Channel\MemberList */ public function __construct(Version $version, $serviceSid, $channelSid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, 'channelSid' => $channelSid, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Channels/' . \rawurlencode($channelSid) . '/Members'; } /** * Create a new MemberInstance * * @param string $identity The `identity` value that identifies the new * resource's User * @param array|Options $options Optional Arguments * @return MemberInstance Newly created MemberInstance * @throws TwilioException When an HTTP error occurs. */ public function create($identity, $options = array()) { $options = new Values($options); $data = Values::of(array('Identity' => $identity, 'RoleSid' => $options['roleSid'], )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new MemberInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid'] ); } /** * Streams MemberInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($options = array(), $limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads MemberInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return MemberInstance[] Array of results */ public function read($options = array(), $limit = null, $pageSize = null) { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Retrieve a single page of MemberInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of MemberInstance */ public function page($options = array(), $pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $options = new Values($options); $params = Values::of(array( 'Identity' => Serialize::map($options['identity'], function($e) { return $e; }), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new MemberPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of MemberInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of MemberInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new MemberPage($this->version, $response, $this->solution); } /** * Constructs a MemberContext * * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\IpMessaging\V1\Service\Channel\MemberContext */ public function getContext($sid) { return new MemberContext( $this->version, $this->solution['serviceSid'], $this->solution['channelSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.IpMessaging.V1.MemberList]'; } } sdk/src/Twilio/Rest/IpMessaging/V1/Service/Channel/InviteContext.php 0000644 00000004630 15002236443 0021262 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V1\Service\Channel; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; class InviteContext extends InstanceContext { /** * Initialize the InviteContext * * @param \Twilio\Version $version Version that contains the resource * @param string $serviceSid The SID of the Service to fetch the resource from * @param string $channelSid The SID of the Channel the resource to fetch * belongs to * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\IpMessaging\V1\Service\Channel\InviteContext */ public function __construct(Version $version, $serviceSid, $channelSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, 'channelSid' => $channelSid, 'sid' => $sid, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Channels/' . \rawurlencode($channelSid) . '/Invites/' . \rawurlencode($sid) . ''; } /** * Fetch a InviteInstance * * @return InviteInstance Fetched InviteInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new InviteInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid'], $this->solution['sid'] ); } /** * Deletes the InviteInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.IpMessaging.V1.InviteContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V1/Service/Channel/MemberPage.php 0000644 00000001535 15002236443 0020464 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V1\Service\Channel; use Twilio\Page; class MemberPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new MemberInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.IpMessaging.V1.MemberPage]'; } } sdk/src/Twilio/Rest/IpMessaging/V1/Service/Channel/InviteList.php 0000644 00000014710 15002236443 0020551 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V1\Service\Channel; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class InviteList extends ListResource { /** * Construct the InviteList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Service that the resource is * associated with * @param string $channelSid The SID of the Channel the new resource belongs to * @return \Twilio\Rest\IpMessaging\V1\Service\Channel\InviteList */ public function __construct(Version $version, $serviceSid, $channelSid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, 'channelSid' => $channelSid, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Channels/' . \rawurlencode($channelSid) . '/Invites'; } /** * Create a new InviteInstance * * @param string $identity The `identity` value that identifies the new * resource's User * @param array|Options $options Optional Arguments * @return InviteInstance Newly created InviteInstance * @throws TwilioException When an HTTP error occurs. */ public function create($identity, $options = array()) { $options = new Values($options); $data = Values::of(array('Identity' => $identity, 'RoleSid' => $options['roleSid'], )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new InviteInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid'] ); } /** * Streams InviteInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($options = array(), $limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads InviteInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return InviteInstance[] Array of results */ public function read($options = array(), $limit = null, $pageSize = null) { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Retrieve a single page of InviteInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of InviteInstance */ public function page($options = array(), $pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $options = new Values($options); $params = Values::of(array( 'Identity' => Serialize::map($options['identity'], function($e) { return $e; }), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new InvitePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of InviteInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of InviteInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new InvitePage($this->version, $response, $this->solution); } /** * Constructs a InviteContext * * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\IpMessaging\V1\Service\Channel\InviteContext */ public function getContext($sid) { return new InviteContext( $this->version, $this->solution['serviceSid'], $this->solution['channelSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.IpMessaging.V1.InviteList]'; } } sdk/src/Twilio/Rest/IpMessaging/V1/Service/Channel/MessagePage.php 0000644 00000001540 15002236443 0020635 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V1\Service\Channel; use Twilio\Page; class MessagePage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new MessageInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.IpMessaging.V1.MessagePage]'; } } sdk/src/Twilio/Rest/IpMessaging/V1/Service/Channel/InvitePage.php 0000644 00000001535 15002236443 0020513 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V1\Service\Channel; use Twilio\Page; class InvitePage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new InviteInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.IpMessaging.V1.InvitePage]'; } } sdk/src/Twilio/Rest/IpMessaging/V1/Service/Channel/InviteOptions.php 0000644 00000005606 15002236443 0021275 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V1\Service\Channel; use Twilio\Options; use Twilio\Values; abstract class InviteOptions { /** * @param string $roleSid The Role assigned to the new member * @return CreateInviteOptions Options builder */ public static function create($roleSid = Values::NONE) { return new CreateInviteOptions($roleSid); } /** * @param string $identity The `identity` value of the resources to read * @return ReadInviteOptions Options builder */ public static function read($identity = Values::NONE) { return new ReadInviteOptions($identity); } } class CreateInviteOptions extends Options { /** * @param string $roleSid The Role assigned to the new member */ public function __construct($roleSid = Values::NONE) { $this->options['roleSid'] = $roleSid; } /** * The SID of the [Role](https://www.twilio.com/docs/api/chat/rest/roles) assigned to the new member. * * @param string $roleSid The Role assigned to the new member * @return $this Fluent Builder */ public function setRoleSid($roleSid) { $this->options['roleSid'] = $roleSid; 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.IpMessaging.V1.CreateInviteOptions ' . \implode(' ', $options) . ']'; } } class ReadInviteOptions extends Options { /** * @param string $identity The `identity` value of the resources to read */ public function __construct($identity = Values::NONE) { $this->options['identity'] = $identity; } /** * The [User](https://www.twilio.com/docs/api/chat/rest/v1/user)'s `identity` value of the resources to read. See [access tokens](https://www.twilio.com/docs/api/chat/guides/create-tokens) for more details. * * @param string $identity The `identity` value of the resources to read * @return $this Fluent Builder */ public function setIdentity($identity) { $this->options['identity'] = $identity; 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.IpMessaging.V1.ReadInviteOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V1/Service/Channel/InviteInstance.php 0000644 00000010754 15002236443 0021406 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V1\Service\Channel; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $accountSid * @property string $channelSid * @property string $serviceSid * @property string $identity * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $roleSid * @property string $createdBy * @property string $url */ class InviteInstance extends InstanceResource { /** * Initialize the InviteInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the Service that the resource is * associated with * @param string $channelSid The SID of the Channel the new resource belongs to * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\IpMessaging\V1\Service\Channel\InviteInstance */ public function __construct(Version $version, array $payload, $serviceSid, $channelSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'channelSid' => Values::array_get($payload, 'channel_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'identity' => Values::array_get($payload, 'identity'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'roleSid' => Values::array_get($payload, 'role_sid'), 'createdBy' => Values::array_get($payload, 'created_by'), 'url' => Values::array_get($payload, 'url'), ); $this->solution = array( 'serviceSid' => $serviceSid, 'channelSid' => $channelSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\IpMessaging\V1\Service\Channel\InviteContext Context * for this * InviteInstance */ protected function proxy() { if (!$this->context) { $this->context = new InviteContext( $this->version, $this->solution['serviceSid'], $this->solution['channelSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch a InviteInstance * * @return InviteInstance Fetched InviteInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the InviteInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.IpMessaging.V1.InviteInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V1/Service/Channel/MessageOptions.php 0000644 00000013056 15002236443 0021421 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V1\Service\Channel; use Twilio\Options; use Twilio\Values; abstract class MessageOptions { /** * @param string $from The identity of the new message's author * @param string $attributes A valid JSON string that contains * application-specific data * @return CreateMessageOptions Options builder */ public static function create($from = Values::NONE, $attributes = Values::NONE) { return new CreateMessageOptions($from, $attributes); } /** * @param string $order The sort order of the returned messages * @return ReadMessageOptions Options builder */ public static function read($order = Values::NONE) { return new ReadMessageOptions($order); } /** * @param string $body The message to send to the channel * @param string $attributes A valid JSON string that contains * application-specific data * @return UpdateMessageOptions Options builder */ public static function update($body = Values::NONE, $attributes = Values::NONE) { return new UpdateMessageOptions($body, $attributes); } } class CreateMessageOptions extends Options { /** * @param string $from The identity of the new message's author * @param string $attributes A valid JSON string that contains * application-specific data */ public function __construct($from = Values::NONE, $attributes = Values::NONE) { $this->options['from'] = $from; $this->options['attributes'] = $attributes; } /** * The [identity](https://www.twilio.com/docs/api/chat/guides/identity) of the new message's author. The default value is `system`. * * @param string $from The identity of the new message's author * @return $this Fluent Builder */ public function setFrom($from) { $this->options['from'] = $from; return $this; } /** * A valid JSON string that contains application-specific data. * * @param string $attributes A valid JSON string that contains * application-specific data * @return $this Fluent Builder */ public function setAttributes($attributes) { $this->options['attributes'] = $attributes; 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.IpMessaging.V1.CreateMessageOptions ' . \implode(' ', $options) . ']'; } } class ReadMessageOptions extends Options { /** * @param string $order The sort order of the returned messages */ public function __construct($order = Values::NONE) { $this->options['order'] = $order; } /** * The sort order of the returned messages. Can be: `asc` (ascending) or `desc` (descending) with `asc` as the default. * * @param string $order The sort order of the returned messages * @return $this Fluent Builder */ public function setOrder($order) { $this->options['order'] = $order; 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.IpMessaging.V1.ReadMessageOptions ' . \implode(' ', $options) . ']'; } } class UpdateMessageOptions extends Options { /** * @param string $body The message to send to the channel * @param string $attributes A valid JSON string that contains * application-specific data */ public function __construct($body = Values::NONE, $attributes = Values::NONE) { $this->options['body'] = $body; $this->options['attributes'] = $attributes; } /** * The message to send to the channel. Can also be an empty string or `null`, which sets the value as an empty string. You can send structured data in the body by serializing it as a string. * * @param string $body The message to send to the channel * @return $this Fluent Builder */ public function setBody($body) { $this->options['body'] = $body; return $this; } /** * A valid JSON string that contains application-specific data. * * @param string $attributes A valid JSON string that contains * application-specific data * @return $this Fluent Builder */ public function setAttributes($attributes) { $this->options['attributes'] = $attributes; 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.IpMessaging.V1.UpdateMessageOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V1/Service/Channel/MemberInstance.php 0000644 00000012032 15002236443 0021346 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V1\Service\Channel; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $accountSid * @property string $channelSid * @property string $serviceSid * @property string $identity * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $roleSid * @property int $lastConsumedMessageIndex * @property \DateTime $lastConsumptionTimestamp * @property string $url */ class MemberInstance extends InstanceResource { /** * Initialize the MemberInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the Service that the resource is * associated with * @param string $channelSid The unique ID of the Channel for the member * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\IpMessaging\V1\Service\Channel\MemberInstance */ public function __construct(Version $version, array $payload, $serviceSid, $channelSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'channelSid' => Values::array_get($payload, 'channel_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'identity' => Values::array_get($payload, 'identity'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'roleSid' => Values::array_get($payload, 'role_sid'), 'lastConsumedMessageIndex' => Values::array_get($payload, 'last_consumed_message_index'), 'lastConsumptionTimestamp' => Deserialize::dateTime(Values::array_get($payload, 'last_consumption_timestamp')), 'url' => Values::array_get($payload, 'url'), ); $this->solution = array( 'serviceSid' => $serviceSid, 'channelSid' => $channelSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\IpMessaging\V1\Service\Channel\MemberContext Context * for this * MemberInstance */ protected function proxy() { if (!$this->context) { $this->context = new MemberContext( $this->version, $this->solution['serviceSid'], $this->solution['channelSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch a MemberInstance * * @return MemberInstance Fetched MemberInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the MemberInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Update the MemberInstance * * @param array|Options $options Optional Arguments * @return MemberInstance Updated MemberInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.IpMessaging.V1.MemberInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V1/ServiceContext.php 0000644 00000023564 15002236443 0016463 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Rest\IpMessaging\V1\Service\ChannelList; use Twilio\Rest\IpMessaging\V1\Service\RoleList; use Twilio\Rest\IpMessaging\V1\Service\UserList; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * @property \Twilio\Rest\IpMessaging\V1\Service\ChannelList $channels * @property \Twilio\Rest\IpMessaging\V1\Service\RoleList $roles * @property \Twilio\Rest\IpMessaging\V1\Service\UserList $users * @method \Twilio\Rest\IpMessaging\V1\Service\ChannelContext channels(string $sid) * @method \Twilio\Rest\IpMessaging\V1\Service\RoleContext roles(string $sid) * @method \Twilio\Rest\IpMessaging\V1\Service\UserContext users(string $sid) */ class ServiceContext extends InstanceContext { protected $_channels = null; protected $_roles = null; protected $_users = null; /** * Initialize the ServiceContext * * @param \Twilio\Version $version Version that contains the resource * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\IpMessaging\V1\ServiceContext */ public function __construct(Version $version, $sid) { parent::__construct($version); // Path Solution $this->solution = array('sid' => $sid, ); $this->uri = '/Services/' . \rawurlencode($sid) . ''; } /** * Fetch a ServiceInstance * * @return ServiceInstance Fetched ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new ServiceInstance($this->version, $payload, $this->solution['sid']); } /** * Deletes the ServiceInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Update the ServiceInstance * * @param array|Options $options Optional Arguments * @return ServiceInstance Updated ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { $options = new Values($options); $data = Values::of(array( 'FriendlyName' => $options['friendlyName'], 'DefaultServiceRoleSid' => $options['defaultServiceRoleSid'], 'DefaultChannelRoleSid' => $options['defaultChannelRoleSid'], 'DefaultChannelCreatorRoleSid' => $options['defaultChannelCreatorRoleSid'], 'ReadStatusEnabled' => Serialize::booleanToString($options['readStatusEnabled']), 'ReachabilityEnabled' => Serialize::booleanToString($options['reachabilityEnabled']), 'TypingIndicatorTimeout' => $options['typingIndicatorTimeout'], 'ConsumptionReportInterval' => $options['consumptionReportInterval'], 'Notifications.NewMessage.Enabled' => Serialize::booleanToString($options['notificationsNewMessageEnabled']), 'Notifications.NewMessage.Template' => $options['notificationsNewMessageTemplate'], 'Notifications.AddedToChannel.Enabled' => Serialize::booleanToString($options['notificationsAddedToChannelEnabled']), 'Notifications.AddedToChannel.Template' => $options['notificationsAddedToChannelTemplate'], 'Notifications.RemovedFromChannel.Enabled' => Serialize::booleanToString($options['notificationsRemovedFromChannelEnabled']), 'Notifications.RemovedFromChannel.Template' => $options['notificationsRemovedFromChannelTemplate'], 'Notifications.InvitedToChannel.Enabled' => Serialize::booleanToString($options['notificationsInvitedToChannelEnabled']), 'Notifications.InvitedToChannel.Template' => $options['notificationsInvitedToChannelTemplate'], 'PreWebhookUrl' => $options['preWebhookUrl'], 'PostWebhookUrl' => $options['postWebhookUrl'], 'WebhookMethod' => $options['webhookMethod'], 'WebhookFilters' => Serialize::map($options['webhookFilters'], function($e) { return $e; }), 'Webhooks.OnMessageSend.Url' => $options['webhooksOnMessageSendUrl'], 'Webhooks.OnMessageSend.Method' => $options['webhooksOnMessageSendMethod'], 'Webhooks.OnMessageUpdate.Url' => $options['webhooksOnMessageUpdateUrl'], 'Webhooks.OnMessageUpdate.Method' => $options['webhooksOnMessageUpdateMethod'], 'Webhooks.OnMessageRemove.Url' => $options['webhooksOnMessageRemoveUrl'], 'Webhooks.OnMessageRemove.Method' => $options['webhooksOnMessageRemoveMethod'], 'Webhooks.OnChannelAdd.Url' => $options['webhooksOnChannelAddUrl'], 'Webhooks.OnChannelAdd.Method' => $options['webhooksOnChannelAddMethod'], 'Webhooks.OnChannelDestroy.Url' => $options['webhooksOnChannelDestroyUrl'], 'Webhooks.OnChannelDestroy.Method' => $options['webhooksOnChannelDestroyMethod'], 'Webhooks.OnChannelUpdate.Url' => $options['webhooksOnChannelUpdateUrl'], 'Webhooks.OnChannelUpdate.Method' => $options['webhooksOnChannelUpdateMethod'], 'Webhooks.OnMemberAdd.Url' => $options['webhooksOnMemberAddUrl'], 'Webhooks.OnMemberAdd.Method' => $options['webhooksOnMemberAddMethod'], 'Webhooks.OnMemberRemove.Url' => $options['webhooksOnMemberRemoveUrl'], 'Webhooks.OnMemberRemove.Method' => $options['webhooksOnMemberRemoveMethod'], 'Webhooks.OnMessageSent.Url' => $options['webhooksOnMessageSentUrl'], 'Webhooks.OnMessageSent.Method' => $options['webhooksOnMessageSentMethod'], 'Webhooks.OnMessageUpdated.Url' => $options['webhooksOnMessageUpdatedUrl'], 'Webhooks.OnMessageUpdated.Method' => $options['webhooksOnMessageUpdatedMethod'], 'Webhooks.OnMessageRemoved.Url' => $options['webhooksOnMessageRemovedUrl'], 'Webhooks.OnMessageRemoved.Method' => $options['webhooksOnMessageRemovedMethod'], 'Webhooks.OnChannelAdded.Url' => $options['webhooksOnChannelAddedUrl'], 'Webhooks.OnChannelAdded.Method' => $options['webhooksOnChannelAddedMethod'], 'Webhooks.OnChannelDestroyed.Url' => $options['webhooksOnChannelDestroyedUrl'], 'Webhooks.OnChannelDestroyed.Method' => $options['webhooksOnChannelDestroyedMethod'], 'Webhooks.OnChannelUpdated.Url' => $options['webhooksOnChannelUpdatedUrl'], 'Webhooks.OnChannelUpdated.Method' => $options['webhooksOnChannelUpdatedMethod'], 'Webhooks.OnMemberAdded.Url' => $options['webhooksOnMemberAddedUrl'], 'Webhooks.OnMemberAdded.Method' => $options['webhooksOnMemberAddedMethod'], 'Webhooks.OnMemberRemoved.Url' => $options['webhooksOnMemberRemovedUrl'], 'Webhooks.OnMemberRemoved.Method' => $options['webhooksOnMemberRemovedMethod'], 'Limits.ChannelMembers' => $options['limitsChannelMembers'], 'Limits.UserChannels' => $options['limitsUserChannels'], )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new ServiceInstance($this->version, $payload, $this->solution['sid']); } /** * Access the channels * * @return \Twilio\Rest\IpMessaging\V1\Service\ChannelList */ protected function getChannels() { if (!$this->_channels) { $this->_channels = new ChannelList($this->version, $this->solution['sid']); } return $this->_channels; } /** * Access the roles * * @return \Twilio\Rest\IpMessaging\V1\Service\RoleList */ protected function getRoles() { if (!$this->_roles) { $this->_roles = new RoleList($this->version, $this->solution['sid']); } return $this->_roles; } /** * Access the users * * @return \Twilio\Rest\IpMessaging\V1\Service\UserList */ protected function getUsers() { if (!$this->_users) { $this->_users = new UserList($this->version, $this->solution['sid']); } return $this->_users; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get($name) { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.IpMessaging.V1.ServiceContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V2.php 0000644 00000005426 15002236443 0013514 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\Rest\IpMessaging\V2\CredentialList; use Twilio\Rest\IpMessaging\V2\ServiceList; use Twilio\Version; /** * @property \Twilio\Rest\IpMessaging\V2\CredentialList $credentials * @property \Twilio\Rest\IpMessaging\V2\ServiceList $services * @method \Twilio\Rest\IpMessaging\V2\CredentialContext credentials(string $sid) * @method \Twilio\Rest\IpMessaging\V2\ServiceContext services(string $sid) */ class V2 extends Version { protected $_credentials = null; protected $_services = null; /** * Construct the V2 version of IpMessaging * * @param \Twilio\Domain $domain Domain that contains the version * @return \Twilio\Rest\IpMessaging\V2 V2 version of IpMessaging */ public function __construct(Domain $domain) { parent::__construct($domain); $this->version = 'v2'; } /** * @return \Twilio\Rest\IpMessaging\V2\CredentialList */ protected function getCredentials() { if (!$this->_credentials) { $this->_credentials = new CredentialList($this); } return $this->_credentials; } /** * @return \Twilio\Rest\IpMessaging\V2\ServiceList */ protected function getServices() { if (!$this->_services) { $this->_services = new ServiceList($this); } return $this->_services; } /** * Magic getter to lazy load root resources * * @param string $name Resource to return * @return \Twilio\ListResource The requested resource * @throws TwilioException For unknown resource */ public function __get($name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown resource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.IpMessaging.V2]'; } } sdk/src/Twilio/Rest/IpMessaging/V2/CredentialInstance.php 0000644 00000010105 15002236443 0017241 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V2; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $accountSid * @property string $friendlyName * @property string $type * @property string $sandbox * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $url */ class CredentialInstance extends InstanceResource { /** * Initialize the CredentialInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The SID of the Credential resource to fetch * @return \Twilio\Rest\IpMessaging\V2\CredentialInstance */ public function __construct(Version $version, array $payload, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'type' => Values::array_get($payload, 'type'), 'sandbox' => Values::array_get($payload, 'sandbox'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), ); $this->solution = array('sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\IpMessaging\V2\CredentialContext Context for this * CredentialInstance */ protected function proxy() { if (!$this->context) { $this->context = new CredentialContext($this->version, $this->solution['sid']); } return $this->context; } /** * Fetch a CredentialInstance * * @return CredentialInstance Fetched CredentialInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Update the CredentialInstance * * @param array|Options $options Optional Arguments * @return CredentialInstance Updated CredentialInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Deletes the CredentialInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.IpMessaging.V2.CredentialInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V2/ServiceOptions.php 0000644 00000112033 15002236443 0016461 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V2; use Twilio\Options; use Twilio\Values; abstract class ServiceOptions { /** * @param string $friendlyName A string to describe the resource * @param string $defaultServiceRoleSid The service role assigned to users when * they are added to the service * @param string $defaultChannelRoleSid The channel role assigned to users when * they are added to a channel * @param string $defaultChannelCreatorRoleSid The channel role assigned to a * channel creator when they join a * new channel * @param bool $readStatusEnabled Whether to enable the Message Consumption * Horizon feature * @param bool $reachabilityEnabled Whether to enable the Reachability * Indicator feature for this Service instance * @param int $typingIndicatorTimeout How long in seconds to wait before * assuming the user is no longer typing * @param int $consumptionReportInterval DEPRECATED * @param bool $notificationsNewMessageEnabled Whether to send a notification * when a new message is added to a * channel * @param string $notificationsNewMessageTemplate The template to use to create * the notification text * displayed when a new message * is added to a channel * @param string $notificationsNewMessageSound The name of the sound to play * when a new message is added to a * channel * @param bool $notificationsNewMessageBadgeCountEnabled Whether the new * message badge is * enabled * @param bool $notificationsAddedToChannelEnabled Whether to send a * notification when a member * is added to a channel * @param string $notificationsAddedToChannelTemplate The template to use to * create the notification * text displayed when a * member is added to a * channel * @param string $notificationsAddedToChannelSound The name of the sound to * play when a member is added * to a channel * @param bool $notificationsRemovedFromChannelEnabled Whether to send a * notification to a user * when they are removed * from a channel * @param string $notificationsRemovedFromChannelTemplate The template to use * to create the * notification text * displayed to a user * when they are removed * @param string $notificationsRemovedFromChannelSound The name of the sound to * play to a user when they * are removed from a * channel * @param bool $notificationsInvitedToChannelEnabled Whether to send a * notification when a user * is invited to a channel * @param string $notificationsInvitedToChannelTemplate The template to use to * create the notification * text displayed when a * user is invited to a * channel * @param string $notificationsInvitedToChannelSound The name of the sound to * play when a user is * invited to a channel * @param string $preWebhookUrl The webhook URL for pre-event webhooks * @param string $postWebhookUrl The URL for post-event webhooks * @param string $webhookMethod The HTTP method to use for both PRE and POST * webhooks * @param string $webhookFilters The list of webhook events that are enabled * for this Service instance * @param int $limitsChannelMembers The maximum number of Members that can be * added to Channels within this Service * @param int $limitsUserChannels The maximum number of Channels Users can be a * Member of within this Service * @param string $mediaCompatibilityMessage The message to send when a media * message has no text * @param int $preWebhookRetryCount Count of times webhook will be retried in * case of timeout or 429/503/504 HTTP * responses * @param int $postWebhookRetryCount The number of times calls to the * `post_webhook_url` will be retried * @param bool $notificationsLogEnabled Whether to log notifications * @return UpdateServiceOptions Options builder */ public static function update($friendlyName = Values::NONE, $defaultServiceRoleSid = Values::NONE, $defaultChannelRoleSid = Values::NONE, $defaultChannelCreatorRoleSid = Values::NONE, $readStatusEnabled = Values::NONE, $reachabilityEnabled = Values::NONE, $typingIndicatorTimeout = Values::NONE, $consumptionReportInterval = Values::NONE, $notificationsNewMessageEnabled = Values::NONE, $notificationsNewMessageTemplate = Values::NONE, $notificationsNewMessageSound = Values::NONE, $notificationsNewMessageBadgeCountEnabled = Values::NONE, $notificationsAddedToChannelEnabled = Values::NONE, $notificationsAddedToChannelTemplate = Values::NONE, $notificationsAddedToChannelSound = Values::NONE, $notificationsRemovedFromChannelEnabled = Values::NONE, $notificationsRemovedFromChannelTemplate = Values::NONE, $notificationsRemovedFromChannelSound = Values::NONE, $notificationsInvitedToChannelEnabled = Values::NONE, $notificationsInvitedToChannelTemplate = Values::NONE, $notificationsInvitedToChannelSound = Values::NONE, $preWebhookUrl = Values::NONE, $postWebhookUrl = Values::NONE, $webhookMethod = Values::NONE, $webhookFilters = Values::NONE, $limitsChannelMembers = Values::NONE, $limitsUserChannels = Values::NONE, $mediaCompatibilityMessage = Values::NONE, $preWebhookRetryCount = Values::NONE, $postWebhookRetryCount = Values::NONE, $notificationsLogEnabled = Values::NONE) { return new UpdateServiceOptions($friendlyName, $defaultServiceRoleSid, $defaultChannelRoleSid, $defaultChannelCreatorRoleSid, $readStatusEnabled, $reachabilityEnabled, $typingIndicatorTimeout, $consumptionReportInterval, $notificationsNewMessageEnabled, $notificationsNewMessageTemplate, $notificationsNewMessageSound, $notificationsNewMessageBadgeCountEnabled, $notificationsAddedToChannelEnabled, $notificationsAddedToChannelTemplate, $notificationsAddedToChannelSound, $notificationsRemovedFromChannelEnabled, $notificationsRemovedFromChannelTemplate, $notificationsRemovedFromChannelSound, $notificationsInvitedToChannelEnabled, $notificationsInvitedToChannelTemplate, $notificationsInvitedToChannelSound, $preWebhookUrl, $postWebhookUrl, $webhookMethod, $webhookFilters, $limitsChannelMembers, $limitsUserChannels, $mediaCompatibilityMessage, $preWebhookRetryCount, $postWebhookRetryCount, $notificationsLogEnabled); } } class UpdateServiceOptions extends Options { /** * @param string $friendlyName A string to describe the resource * @param string $defaultServiceRoleSid The service role assigned to users when * they are added to the service * @param string $defaultChannelRoleSid The channel role assigned to users when * they are added to a channel * @param string $defaultChannelCreatorRoleSid The channel role assigned to a * channel creator when they join a * new channel * @param bool $readStatusEnabled Whether to enable the Message Consumption * Horizon feature * @param bool $reachabilityEnabled Whether to enable the Reachability * Indicator feature for this Service instance * @param int $typingIndicatorTimeout How long in seconds to wait before * assuming the user is no longer typing * @param int $consumptionReportInterval DEPRECATED * @param bool $notificationsNewMessageEnabled Whether to send a notification * when a new message is added to a * channel * @param string $notificationsNewMessageTemplate The template to use to create * the notification text * displayed when a new message * is added to a channel * @param string $notificationsNewMessageSound The name of the sound to play * when a new message is added to a * channel * @param bool $notificationsNewMessageBadgeCountEnabled Whether the new * message badge is * enabled * @param bool $notificationsAddedToChannelEnabled Whether to send a * notification when a member * is added to a channel * @param string $notificationsAddedToChannelTemplate The template to use to * create the notification * text displayed when a * member is added to a * channel * @param string $notificationsAddedToChannelSound The name of the sound to * play when a member is added * to a channel * @param bool $notificationsRemovedFromChannelEnabled Whether to send a * notification to a user * when they are removed * from a channel * @param string $notificationsRemovedFromChannelTemplate The template to use * to create the * notification text * displayed to a user * when they are removed * @param string $notificationsRemovedFromChannelSound The name of the sound to * play to a user when they * are removed from a * channel * @param bool $notificationsInvitedToChannelEnabled Whether to send a * notification when a user * is invited to a channel * @param string $notificationsInvitedToChannelTemplate The template to use to * create the notification * text displayed when a * user is invited to a * channel * @param string $notificationsInvitedToChannelSound The name of the sound to * play when a user is * invited to a channel * @param string $preWebhookUrl The webhook URL for pre-event webhooks * @param string $postWebhookUrl The URL for post-event webhooks * @param string $webhookMethod The HTTP method to use for both PRE and POST * webhooks * @param string $webhookFilters The list of webhook events that are enabled * for this Service instance * @param int $limitsChannelMembers The maximum number of Members that can be * added to Channels within this Service * @param int $limitsUserChannels The maximum number of Channels Users can be a * Member of within this Service * @param string $mediaCompatibilityMessage The message to send when a media * message has no text * @param int $preWebhookRetryCount Count of times webhook will be retried in * case of timeout or 429/503/504 HTTP * responses * @param int $postWebhookRetryCount The number of times calls to the * `post_webhook_url` will be retried * @param bool $notificationsLogEnabled Whether to log notifications */ public function __construct($friendlyName = Values::NONE, $defaultServiceRoleSid = Values::NONE, $defaultChannelRoleSid = Values::NONE, $defaultChannelCreatorRoleSid = Values::NONE, $readStatusEnabled = Values::NONE, $reachabilityEnabled = Values::NONE, $typingIndicatorTimeout = Values::NONE, $consumptionReportInterval = Values::NONE, $notificationsNewMessageEnabled = Values::NONE, $notificationsNewMessageTemplate = Values::NONE, $notificationsNewMessageSound = Values::NONE, $notificationsNewMessageBadgeCountEnabled = Values::NONE, $notificationsAddedToChannelEnabled = Values::NONE, $notificationsAddedToChannelTemplate = Values::NONE, $notificationsAddedToChannelSound = Values::NONE, $notificationsRemovedFromChannelEnabled = Values::NONE, $notificationsRemovedFromChannelTemplate = Values::NONE, $notificationsRemovedFromChannelSound = Values::NONE, $notificationsInvitedToChannelEnabled = Values::NONE, $notificationsInvitedToChannelTemplate = Values::NONE, $notificationsInvitedToChannelSound = Values::NONE, $preWebhookUrl = Values::NONE, $postWebhookUrl = Values::NONE, $webhookMethod = Values::NONE, $webhookFilters = Values::NONE, $limitsChannelMembers = Values::NONE, $limitsUserChannels = Values::NONE, $mediaCompatibilityMessage = Values::NONE, $preWebhookRetryCount = Values::NONE, $postWebhookRetryCount = Values::NONE, $notificationsLogEnabled = Values::NONE) { $this->options['friendlyName'] = $friendlyName; $this->options['defaultServiceRoleSid'] = $defaultServiceRoleSid; $this->options['defaultChannelRoleSid'] = $defaultChannelRoleSid; $this->options['defaultChannelCreatorRoleSid'] = $defaultChannelCreatorRoleSid; $this->options['readStatusEnabled'] = $readStatusEnabled; $this->options['reachabilityEnabled'] = $reachabilityEnabled; $this->options['typingIndicatorTimeout'] = $typingIndicatorTimeout; $this->options['consumptionReportInterval'] = $consumptionReportInterval; $this->options['notificationsNewMessageEnabled'] = $notificationsNewMessageEnabled; $this->options['notificationsNewMessageTemplate'] = $notificationsNewMessageTemplate; $this->options['notificationsNewMessageSound'] = $notificationsNewMessageSound; $this->options['notificationsNewMessageBadgeCountEnabled'] = $notificationsNewMessageBadgeCountEnabled; $this->options['notificationsAddedToChannelEnabled'] = $notificationsAddedToChannelEnabled; $this->options['notificationsAddedToChannelTemplate'] = $notificationsAddedToChannelTemplate; $this->options['notificationsAddedToChannelSound'] = $notificationsAddedToChannelSound; $this->options['notificationsRemovedFromChannelEnabled'] = $notificationsRemovedFromChannelEnabled; $this->options['notificationsRemovedFromChannelTemplate'] = $notificationsRemovedFromChannelTemplate; $this->options['notificationsRemovedFromChannelSound'] = $notificationsRemovedFromChannelSound; $this->options['notificationsInvitedToChannelEnabled'] = $notificationsInvitedToChannelEnabled; $this->options['notificationsInvitedToChannelTemplate'] = $notificationsInvitedToChannelTemplate; $this->options['notificationsInvitedToChannelSound'] = $notificationsInvitedToChannelSound; $this->options['preWebhookUrl'] = $preWebhookUrl; $this->options['postWebhookUrl'] = $postWebhookUrl; $this->options['webhookMethod'] = $webhookMethod; $this->options['webhookFilters'] = $webhookFilters; $this->options['limitsChannelMembers'] = $limitsChannelMembers; $this->options['limitsUserChannels'] = $limitsUserChannels; $this->options['mediaCompatibilityMessage'] = $mediaCompatibilityMessage; $this->options['preWebhookRetryCount'] = $preWebhookRetryCount; $this->options['postWebhookRetryCount'] = $postWebhookRetryCount; $this->options['notificationsLogEnabled'] = $notificationsLogEnabled; } /** * A descriptive string that you create to describe the resource. * * @param string $friendlyName A string to describe the resource * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The service role assigned to users when they are added to the service. See the [Role resource](https://www.twilio.com/docs/chat/rest/role-resource) for more info about roles. * * @param string $defaultServiceRoleSid The service role assigned to users when * they are added to the service * @return $this Fluent Builder */ public function setDefaultServiceRoleSid($defaultServiceRoleSid) { $this->options['defaultServiceRoleSid'] = $defaultServiceRoleSid; return $this; } /** * The channel role assigned to users when they are added to a channel. See the [Role resource](https://www.twilio.com/docs/chat/rest/role-resource) for more info about roles. * * @param string $defaultChannelRoleSid The channel role assigned to users when * they are added to a channel * @return $this Fluent Builder */ public function setDefaultChannelRoleSid($defaultChannelRoleSid) { $this->options['defaultChannelRoleSid'] = $defaultChannelRoleSid; return $this; } /** * The channel role assigned to a channel creator when they join a new channel. See the [Role resource](https://www.twilio.com/docs/chat/rest/role-resource) for more info about roles. * * @param string $defaultChannelCreatorRoleSid The channel role assigned to a * channel creator when they join a * new channel * @return $this Fluent Builder */ public function setDefaultChannelCreatorRoleSid($defaultChannelCreatorRoleSid) { $this->options['defaultChannelCreatorRoleSid'] = $defaultChannelCreatorRoleSid; return $this; } /** * Whether to enable the [Message Consumption Horizon](https://www.twilio.com/docs/chat/consumption-horizon) feature. The default is `true`. * * @param bool $readStatusEnabled Whether to enable the Message Consumption * Horizon feature * @return $this Fluent Builder */ public function setReadStatusEnabled($readStatusEnabled) { $this->options['readStatusEnabled'] = $readStatusEnabled; return $this; } /** * Whether to enable the [Reachability Indicator](https://www.twilio.com/docs/chat/reachability-indicator) for this Service instance. The default is `false`. * * @param bool $reachabilityEnabled Whether to enable the Reachability * Indicator feature for this Service instance * @return $this Fluent Builder */ public function setReachabilityEnabled($reachabilityEnabled) { $this->options['reachabilityEnabled'] = $reachabilityEnabled; return $this; } /** * How long in seconds after a `started typing` event until clients should assume that user is no longer typing, even if no `ended typing` message was received. The default is 5 seconds. * * @param int $typingIndicatorTimeout How long in seconds to wait before * assuming the user is no longer typing * @return $this Fluent Builder */ public function setTypingIndicatorTimeout($typingIndicatorTimeout) { $this->options['typingIndicatorTimeout'] = $typingIndicatorTimeout; return $this; } /** * DEPRECATED. The interval in seconds between consumption reports submission batches from client endpoints. * * @param int $consumptionReportInterval DEPRECATED * @return $this Fluent Builder */ public function setConsumptionReportInterval($consumptionReportInterval) { $this->options['consumptionReportInterval'] = $consumptionReportInterval; return $this; } /** * Whether to send a notification when a new message is added to a channel. The default is `false`. * * @param bool $notificationsNewMessageEnabled Whether to send a notification * when a new message is added to a * channel * @return $this Fluent Builder */ public function setNotificationsNewMessageEnabled($notificationsNewMessageEnabled) { $this->options['notificationsNewMessageEnabled'] = $notificationsNewMessageEnabled; return $this; } /** * The template to use to create the notification text displayed when a new message is added to a channel and `notifications.new_message.enabled` is `true`. * * @param string $notificationsNewMessageTemplate The template to use to create * the notification text * displayed when a new message * is added to a channel * @return $this Fluent Builder */ public function setNotificationsNewMessageTemplate($notificationsNewMessageTemplate) { $this->options['notificationsNewMessageTemplate'] = $notificationsNewMessageTemplate; return $this; } /** * The name of the sound to play when a new message is added to a channel and `notifications.new_message.enabled` is `true`. * * @param string $notificationsNewMessageSound The name of the sound to play * when a new message is added to a * channel * @return $this Fluent Builder */ public function setNotificationsNewMessageSound($notificationsNewMessageSound) { $this->options['notificationsNewMessageSound'] = $notificationsNewMessageSound; return $this; } /** * Whether the new message badge is enabled. The default is `false`. * * @param bool $notificationsNewMessageBadgeCountEnabled Whether the new * message badge is * enabled * @return $this Fluent Builder */ public function setNotificationsNewMessageBadgeCountEnabled($notificationsNewMessageBadgeCountEnabled) { $this->options['notificationsNewMessageBadgeCountEnabled'] = $notificationsNewMessageBadgeCountEnabled; return $this; } /** * Whether to send a notification when a member is added to a channel. The default is `false`. * * @param bool $notificationsAddedToChannelEnabled Whether to send a * notification when a member * is added to a channel * @return $this Fluent Builder */ public function setNotificationsAddedToChannelEnabled($notificationsAddedToChannelEnabled) { $this->options['notificationsAddedToChannelEnabled'] = $notificationsAddedToChannelEnabled; return $this; } /** * The template to use to create the notification text displayed when a member is added to a channel and `notifications.added_to_channel.enabled` is `true`. * * @param string $notificationsAddedToChannelTemplate The template to use to * create the notification * text displayed when a * member is added to a * channel * @return $this Fluent Builder */ public function setNotificationsAddedToChannelTemplate($notificationsAddedToChannelTemplate) { $this->options['notificationsAddedToChannelTemplate'] = $notificationsAddedToChannelTemplate; return $this; } /** * The name of the sound to play when a member is added to a channel and `notifications.added_to_channel.enabled` is `true`. * * @param string $notificationsAddedToChannelSound The name of the sound to * play when a member is added * to a channel * @return $this Fluent Builder */ public function setNotificationsAddedToChannelSound($notificationsAddedToChannelSound) { $this->options['notificationsAddedToChannelSound'] = $notificationsAddedToChannelSound; return $this; } /** * Whether to send a notification to a user when they are removed from a channel. The default is `false`. * * @param bool $notificationsRemovedFromChannelEnabled Whether to send a * notification to a user * when they are removed * from a channel * @return $this Fluent Builder */ public function setNotificationsRemovedFromChannelEnabled($notificationsRemovedFromChannelEnabled) { $this->options['notificationsRemovedFromChannelEnabled'] = $notificationsRemovedFromChannelEnabled; return $this; } /** * The template to use to create the notification text displayed to a user when they are removed from a channel and `notifications.removed_from_channel.enabled` is `true`. * * @param string $notificationsRemovedFromChannelTemplate The template to use * to create the * notification text * displayed to a user * when they are removed * @return $this Fluent Builder */ public function setNotificationsRemovedFromChannelTemplate($notificationsRemovedFromChannelTemplate) { $this->options['notificationsRemovedFromChannelTemplate'] = $notificationsRemovedFromChannelTemplate; return $this; } /** * The name of the sound to play to a user when they are removed from a channel and `notifications.removed_from_channel.enabled` is `true`. * * @param string $notificationsRemovedFromChannelSound The name of the sound to * play to a user when they * are removed from a * channel * @return $this Fluent Builder */ public function setNotificationsRemovedFromChannelSound($notificationsRemovedFromChannelSound) { $this->options['notificationsRemovedFromChannelSound'] = $notificationsRemovedFromChannelSound; return $this; } /** * Whether to send a notification when a user is invited to a channel. The default is `false`. * * @param bool $notificationsInvitedToChannelEnabled Whether to send a * notification when a user * is invited to a channel * @return $this Fluent Builder */ public function setNotificationsInvitedToChannelEnabled($notificationsInvitedToChannelEnabled) { $this->options['notificationsInvitedToChannelEnabled'] = $notificationsInvitedToChannelEnabled; return $this; } /** * The template to use to create the notification text displayed when a user is invited to a channel and `notifications.invited_to_channel.enabled` is `true`. * * @param string $notificationsInvitedToChannelTemplate The template to use to * create the notification * text displayed when a * user is invited to a * channel * @return $this Fluent Builder */ public function setNotificationsInvitedToChannelTemplate($notificationsInvitedToChannelTemplate) { $this->options['notificationsInvitedToChannelTemplate'] = $notificationsInvitedToChannelTemplate; return $this; } /** * The name of the sound to play when a user is invited to a channel and `notifications.invited_to_channel.enabled` is `true`. * * @param string $notificationsInvitedToChannelSound The name of the sound to * play when a user is * invited to a channel * @return $this Fluent Builder */ public function setNotificationsInvitedToChannelSound($notificationsInvitedToChannelSound) { $this->options['notificationsInvitedToChannelSound'] = $notificationsInvitedToChannelSound; return $this; } /** * The URL for pre-event webhooks, which are called by using the `webhook_method`. See [Webhook Events](https://www.twilio.com/docs/chat/webhook-events) for more details. * * @param string $preWebhookUrl The webhook URL for pre-event webhooks * @return $this Fluent Builder */ public function setPreWebhookUrl($preWebhookUrl) { $this->options['preWebhookUrl'] = $preWebhookUrl; return $this; } /** * The URL for post-event webhooks, which are called by using the `webhook_method`. See [Webhook Events](https://www.twilio.com/docs/chat/webhook-events) for more details. * * @param string $postWebhookUrl The URL for post-event webhooks * @return $this Fluent Builder */ public function setPostWebhookUrl($postWebhookUrl) { $this->options['postWebhookUrl'] = $postWebhookUrl; return $this; } /** * The HTTP method to use for calls to the `pre_webhook_url` and `post_webhook_url` webhooks. Can be: `POST` or `GET` and the default is `POST`. See [Webhook Events](https://www.twilio.com/docs/chat/webhook-events) for more details. * * @param string $webhookMethod The HTTP method to use for both PRE and POST * webhooks * @return $this Fluent Builder */ public function setWebhookMethod($webhookMethod) { $this->options['webhookMethod'] = $webhookMethod; return $this; } /** * The list of webhook events that are enabled for this Service instance. See [Webhook Events](https://www.twilio.com/docs/chat/webhook-events) for more details. * * @param string $webhookFilters The list of webhook events that are enabled * for this Service instance * @return $this Fluent Builder */ public function setWebhookFilters($webhookFilters) { $this->options['webhookFilters'] = $webhookFilters; return $this; } /** * The maximum number of Members that can be added to Channels within this Service. Can be up to 1,000. * * @param int $limitsChannelMembers The maximum number of Members that can be * added to Channels within this Service * @return $this Fluent Builder */ public function setLimitsChannelMembers($limitsChannelMembers) { $this->options['limitsChannelMembers'] = $limitsChannelMembers; return $this; } /** * The maximum number of Channels Users can be a Member of within this Service. Can be up to 1,000. * * @param int $limitsUserChannels The maximum number of Channels Users can be a * Member of within this Service * @return $this Fluent Builder */ public function setLimitsUserChannels($limitsUserChannels) { $this->options['limitsUserChannels'] = $limitsUserChannels; return $this; } /** * The message to send when a media message has no text. Can be used as placeholder message. * * @param string $mediaCompatibilityMessage The message to send when a media * message has no text * @return $this Fluent Builder */ public function setMediaCompatibilityMessage($mediaCompatibilityMessage) { $this->options['mediaCompatibilityMessage'] = $mediaCompatibilityMessage; return $this; } /** * The number of times to retry a call to the `pre_webhook_url` if the request times out (after 5 seconds) or it receives a 429, 503, or 504 HTTP response. Default retry count is 0 times, which means the call won't be retried. * * @param int $preWebhookRetryCount Count of times webhook will be retried in * case of timeout or 429/503/504 HTTP * responses * @return $this Fluent Builder */ public function setPreWebhookRetryCount($preWebhookRetryCount) { $this->options['preWebhookRetryCount'] = $preWebhookRetryCount; return $this; } /** * The number of times to retry a call to the `post_webhook_url` if the request times out (after 5 seconds) or it receives a 429, 503, or 504 HTTP response. The default is 0, which means the call won't be retried. * * @param int $postWebhookRetryCount The number of times calls to the * `post_webhook_url` will be retried * @return $this Fluent Builder */ public function setPostWebhookRetryCount($postWebhookRetryCount) { $this->options['postWebhookRetryCount'] = $postWebhookRetryCount; return $this; } /** * Whether to log notifications. The default is `false`. * * @param bool $notificationsLogEnabled Whether to log notifications * @return $this Fluent Builder */ public function setNotificationsLogEnabled($notificationsLogEnabled) { $this->options['notificationsLogEnabled'] = $notificationsLogEnabled; 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.IpMessaging.V2.UpdateServiceOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V2/CredentialContext.php 0000644 00000005555 15002236443 0017136 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V2; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class CredentialContext extends InstanceContext { /** * Initialize the CredentialContext * * @param \Twilio\Version $version Version that contains the resource * @param string $sid The SID of the Credential resource to fetch * @return \Twilio\Rest\IpMessaging\V2\CredentialContext */ public function __construct(Version $version, $sid) { parent::__construct($version); // Path Solution $this->solution = array('sid' => $sid, ); $this->uri = '/Credentials/' . \rawurlencode($sid) . ''; } /** * Fetch a CredentialInstance * * @return CredentialInstance Fetched CredentialInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new CredentialInstance($this->version, $payload, $this->solution['sid']); } /** * Update the CredentialInstance * * @param array|Options $options Optional Arguments * @return CredentialInstance Updated CredentialInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { $options = new Values($options); $data = Values::of(array( 'FriendlyName' => $options['friendlyName'], 'Certificate' => $options['certificate'], 'PrivateKey' => $options['privateKey'], 'Sandbox' => Serialize::booleanToString($options['sandbox']), 'ApiKey' => $options['apiKey'], 'Secret' => $options['secret'], )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new CredentialInstance($this->version, $payload, $this->solution['sid']); } /** * Deletes the CredentialInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.IpMessaging.V2.CredentialContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V2/CredentialOptions.php 0000644 00000026761 15002236443 0017147 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V2; use Twilio\Options; use Twilio\Values; abstract class CredentialOptions { /** * @param string $friendlyName A string to describe the resource * @param string $certificate [APN only] The URL encoded representation of the * certificate * @param string $privateKey [APN only] The URL encoded representation of the * private key * @param bool $sandbox [APN only] Whether to send the credential to sandbox * APNs * @param string $apiKey [GCM only] The API key for the project that was * obtained from the Google Developer console for your * GCM Service application credential * @param string $secret [FCM only] The Server key of your project from * Firebase console * @return CreateCredentialOptions Options builder */ public static function create($friendlyName = Values::NONE, $certificate = Values::NONE, $privateKey = Values::NONE, $sandbox = Values::NONE, $apiKey = Values::NONE, $secret = Values::NONE) { return new CreateCredentialOptions($friendlyName, $certificate, $privateKey, $sandbox, $apiKey, $secret); } /** * @param string $friendlyName A string to describe the resource * @param string $certificate [APN only] The URL encoded representation of the * certificate * @param string $privateKey [APN only] The URL encoded representation of the * private key * @param bool $sandbox [APN only] Whether to send the credential to sandbox * APNs * @param string $apiKey [GCM only] The API key for the project that was * obtained from the Google Developer console for your * GCM Service application credential * @param string $secret [FCM only] The Server key of your project from * Firebase console * @return UpdateCredentialOptions Options builder */ public static function update($friendlyName = Values::NONE, $certificate = Values::NONE, $privateKey = Values::NONE, $sandbox = Values::NONE, $apiKey = Values::NONE, $secret = Values::NONE) { return new UpdateCredentialOptions($friendlyName, $certificate, $privateKey, $sandbox, $apiKey, $secret); } } class CreateCredentialOptions extends Options { /** * @param string $friendlyName A string to describe the resource * @param string $certificate [APN only] The URL encoded representation of the * certificate * @param string $privateKey [APN only] The URL encoded representation of the * private key * @param bool $sandbox [APN only] Whether to send the credential to sandbox * APNs * @param string $apiKey [GCM only] The API key for the project that was * obtained from the Google Developer console for your * GCM Service application credential * @param string $secret [FCM only] The Server key of your project from * Firebase console */ public function __construct($friendlyName = Values::NONE, $certificate = Values::NONE, $privateKey = Values::NONE, $sandbox = Values::NONE, $apiKey = Values::NONE, $secret = Values::NONE) { $this->options['friendlyName'] = $friendlyName; $this->options['certificate'] = $certificate; $this->options['privateKey'] = $privateKey; $this->options['sandbox'] = $sandbox; $this->options['apiKey'] = $apiKey; $this->options['secret'] = $secret; } /** * A descriptive string that you create to describe the new resource. It can be up to 64 characters long. * * @param string $friendlyName A string to describe the resource * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * [APN only] The URL encoded representation of the certificate. For example, `-----BEGIN CERTIFICATE----- MIIFnTCCBIWgAwIBAgIIAjy9H849+E8wDQYJKoZIhvcNAQEF.....A== -----END CERTIFICATE-----` * * @param string $certificate [APN only] The URL encoded representation of the * certificate * @return $this Fluent Builder */ public function setCertificate($certificate) { $this->options['certificate'] = $certificate; return $this; } /** * [APN only] The URL encoded representation of the private key. For example, `-----BEGIN RSA PRIVATE KEY----- MIIEpQIBAAKCAQEAuyf/lNrH9ck8DmNyo3fG... -----END RSA PRIVATE KEY-----` * * @param string $privateKey [APN only] The URL encoded representation of the * private key * @return $this Fluent Builder */ public function setPrivateKey($privateKey) { $this->options['privateKey'] = $privateKey; return $this; } /** * [APN only] Whether to send the credential to sandbox APNs. Can be `true` to send to sandbox APNs or `false` to send to production. * * @param bool $sandbox [APN only] Whether to send the credential to sandbox * APNs * @return $this Fluent Builder */ public function setSandbox($sandbox) { $this->options['sandbox'] = $sandbox; return $this; } /** * [GCM only] The API key for the project that was obtained from the Google Developer console for your GCM Service application credential. * * @param string $apiKey [GCM only] The API key for the project that was * obtained from the Google Developer console for your * GCM Service application credential * @return $this Fluent Builder */ public function setApiKey($apiKey) { $this->options['apiKey'] = $apiKey; return $this; } /** * [FCM only] The **Server key** of your project from the Firebase console, found under Settings / Cloud messaging. * * @param string $secret [FCM only] The Server key of your project from * Firebase console * @return $this Fluent Builder */ public function setSecret($secret) { $this->options['secret'] = $secret; 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.IpMessaging.V2.CreateCredentialOptions ' . \implode(' ', $options) . ']'; } } class UpdateCredentialOptions extends Options { /** * @param string $friendlyName A string to describe the resource * @param string $certificate [APN only] The URL encoded representation of the * certificate * @param string $privateKey [APN only] The URL encoded representation of the * private key * @param bool $sandbox [APN only] Whether to send the credential to sandbox * APNs * @param string $apiKey [GCM only] The API key for the project that was * obtained from the Google Developer console for your * GCM Service application credential * @param string $secret [FCM only] The Server key of your project from * Firebase console */ public function __construct($friendlyName = Values::NONE, $certificate = Values::NONE, $privateKey = Values::NONE, $sandbox = Values::NONE, $apiKey = Values::NONE, $secret = Values::NONE) { $this->options['friendlyName'] = $friendlyName; $this->options['certificate'] = $certificate; $this->options['privateKey'] = $privateKey; $this->options['sandbox'] = $sandbox; $this->options['apiKey'] = $apiKey; $this->options['secret'] = $secret; } /** * A descriptive string that you create to describe the resource. It can be up to 64 characters long. * * @param string $friendlyName A string to describe the resource * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * [APN only] The URL encoded representation of the certificate. For example, `-----BEGIN CERTIFICATE----- MIIFnTCCBIWgAwIBAgIIAjy9H849+E8wDQYJKoZIhvcNAQEF.....A== -----END CERTIFICATE-----` * * @param string $certificate [APN only] The URL encoded representation of the * certificate * @return $this Fluent Builder */ public function setCertificate($certificate) { $this->options['certificate'] = $certificate; return $this; } /** * [APN only] The URL encoded representation of the private key. For example, `-----BEGIN RSA PRIVATE KEY----- MIIEpQIBAAKCAQEAuyf/lNrH9ck8DmNyo3fG... -----END RSA PRIVATE KEY-----` * * @param string $privateKey [APN only] The URL encoded representation of the * private key * @return $this Fluent Builder */ public function setPrivateKey($privateKey) { $this->options['privateKey'] = $privateKey; return $this; } /** * [APN only] Whether to send the credential to sandbox APNs. Can be `true` to send to sandbox APNs or `false` to send to production. * * @param bool $sandbox [APN only] Whether to send the credential to sandbox * APNs * @return $this Fluent Builder */ public function setSandbox($sandbox) { $this->options['sandbox'] = $sandbox; return $this; } /** * [GCM only] The API key for the project that was obtained from the Google Developer console for your GCM Service application credential. * * @param string $apiKey [GCM only] The API key for the project that was * obtained from the Google Developer console for your * GCM Service application credential * @return $this Fluent Builder */ public function setApiKey($apiKey) { $this->options['apiKey'] = $apiKey; return $this; } /** * [FCM only] The **Server key** of your project from the Firebase console, found under Settings / Cloud messaging. * * @param string $secret [FCM only] The Server key of your project from * Firebase console * @return $this Fluent Builder */ public function setSecret($secret) { $this->options['secret'] = $secret; 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.IpMessaging.V2.UpdateCredentialOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V2/ServiceList.php 0000644 00000012317 15002236443 0015745 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V2; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Values; use Twilio\Version; class ServiceList extends ListResource { /** * Construct the ServiceList * * @param Version $version Version that contains the resource * @return \Twilio\Rest\IpMessaging\V2\ServiceList */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = array(); $this->uri = '/Services'; } /** * Create a new ServiceInstance * * @param string $friendlyName A string to describe the resource * @return ServiceInstance Newly created ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function create($friendlyName) { $data = Values::of(array('FriendlyName' => $friendlyName, )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new ServiceInstance($this->version, $payload); } /** * Streams ServiceInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads ServiceInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return ServiceInstance[] Array of results */ public function read($limit = null, $pageSize = null) { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of ServiceInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of ServiceInstance */ public function page($pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $params = Values::of(array( 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new ServicePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of ServiceInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of ServiceInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new ServicePage($this->version, $response, $this->solution); } /** * Constructs a ServiceContext * * @param string $sid The SID of the Service resource to fetch * @return \Twilio\Rest\IpMessaging\V2\ServiceContext */ public function getContext($sid) { return new ServiceContext($this->version, $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.IpMessaging.V2.ServiceList]'; } } sdk/src/Twilio/Rest/IpMessaging/V2/CredentialList.php 0000644 00000013437 15002236443 0016423 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V2; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class CredentialList extends ListResource { /** * Construct the CredentialList * * @param Version $version Version that contains the resource * @return \Twilio\Rest\IpMessaging\V2\CredentialList */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = array(); $this->uri = '/Credentials'; } /** * Streams CredentialInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads CredentialInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return CredentialInstance[] Array of results */ public function read($limit = null, $pageSize = null) { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of CredentialInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of CredentialInstance */ public function page($pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $params = Values::of(array( 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new CredentialPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of CredentialInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of CredentialInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new CredentialPage($this->version, $response, $this->solution); } /** * Create a new CredentialInstance * * @param string $type The type of push-notification service the credential is * for * @param array|Options $options Optional Arguments * @return CredentialInstance Newly created CredentialInstance * @throws TwilioException When an HTTP error occurs. */ public function create($type, $options = array()) { $options = new Values($options); $data = Values::of(array( 'Type' => $type, 'FriendlyName' => $options['friendlyName'], 'Certificate' => $options['certificate'], 'PrivateKey' => $options['privateKey'], 'Sandbox' => Serialize::booleanToString($options['sandbox']), 'ApiKey' => $options['apiKey'], 'Secret' => $options['secret'], )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new CredentialInstance($this->version, $payload); } /** * Constructs a CredentialContext * * @param string $sid The SID of the Credential resource to fetch * @return \Twilio\Rest\IpMessaging\V2\CredentialContext */ public function getContext($sid) { return new CredentialContext($this->version, $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.IpMessaging.V2.CredentialList]'; } } sdk/src/Twilio/Rest/IpMessaging/V2/ServicePage.php 0000644 00000001330 15002236443 0015677 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V2; use Twilio\Page; class ServicePage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new ServiceInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.IpMessaging.V2.ServicePage]'; } } sdk/src/Twilio/Rest/IpMessaging/V2/CredentialPage.php 0000644 00000001341 15002236443 0016353 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V2; use Twilio\Page; class CredentialPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new CredentialInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.IpMessaging.V2.CredentialPage]'; } } sdk/src/Twilio/Rest/IpMessaging/V2/ServiceInstance.php 0000644 00000015412 15002236443 0016575 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V2; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $accountSid * @property string $friendlyName * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $defaultServiceRoleSid * @property string $defaultChannelRoleSid * @property string $defaultChannelCreatorRoleSid * @property bool $readStatusEnabled * @property bool $reachabilityEnabled * @property int $typingIndicatorTimeout * @property int $consumptionReportInterval * @property array $limits * @property string $preWebhookUrl * @property string $postWebhookUrl * @property string $webhookMethod * @property string $webhookFilters * @property int $preWebhookRetryCount * @property int $postWebhookRetryCount * @property array $notifications * @property array $media * @property string $url * @property array $links */ class ServiceInstance extends InstanceResource { protected $_channels = null; protected $_roles = null; protected $_users = null; protected $_bindings = null; /** * Initialize the ServiceInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The SID of the Service resource to fetch * @return \Twilio\Rest\IpMessaging\V2\ServiceInstance */ public function __construct(Version $version, array $payload, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'defaultServiceRoleSid' => Values::array_get($payload, 'default_service_role_sid'), 'defaultChannelRoleSid' => Values::array_get($payload, 'default_channel_role_sid'), 'defaultChannelCreatorRoleSid' => Values::array_get($payload, 'default_channel_creator_role_sid'), 'readStatusEnabled' => Values::array_get($payload, 'read_status_enabled'), 'reachabilityEnabled' => Values::array_get($payload, 'reachability_enabled'), 'typingIndicatorTimeout' => Values::array_get($payload, 'typing_indicator_timeout'), 'consumptionReportInterval' => Values::array_get($payload, 'consumption_report_interval'), 'limits' => Values::array_get($payload, 'limits'), 'preWebhookUrl' => Values::array_get($payload, 'pre_webhook_url'), 'postWebhookUrl' => Values::array_get($payload, 'post_webhook_url'), 'webhookMethod' => Values::array_get($payload, 'webhook_method'), 'webhookFilters' => Values::array_get($payload, 'webhook_filters'), 'preWebhookRetryCount' => Values::array_get($payload, 'pre_webhook_retry_count'), 'postWebhookRetryCount' => Values::array_get($payload, 'post_webhook_retry_count'), 'notifications' => Values::array_get($payload, 'notifications'), 'media' => Values::array_get($payload, 'media'), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ); $this->solution = array('sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\IpMessaging\V2\ServiceContext Context for this * ServiceInstance */ protected function proxy() { if (!$this->context) { $this->context = new ServiceContext($this->version, $this->solution['sid']); } return $this->context; } /** * Fetch a ServiceInstance * * @return ServiceInstance Fetched ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the ServiceInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Update the ServiceInstance * * @param array|Options $options Optional Arguments * @return ServiceInstance Updated ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Access the channels * * @return \Twilio\Rest\IpMessaging\V2\Service\ChannelList */ protected function getChannels() { return $this->proxy()->channels; } /** * Access the roles * * @return \Twilio\Rest\IpMessaging\V2\Service\RoleList */ protected function getRoles() { return $this->proxy()->roles; } /** * Access the users * * @return \Twilio\Rest\IpMessaging\V2\Service\UserList */ protected function getUsers() { return $this->proxy()->users; } /** * Access the bindings * * @return \Twilio\Rest\IpMessaging\V2\Service\BindingList */ protected function getBindings() { return $this->proxy()->bindings; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.IpMessaging.V2.ServiceInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V2/Service/BindingContext.php 0000644 00000004211 15002236443 0020022 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V2\Service; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; class BindingContext extends InstanceContext { /** * Initialize the BindingContext * * @param \Twilio\Version $version Version that contains the resource * @param string $serviceSid The SID of the Service to fetch the resource from * @param string $sid The SID of the resource to fetch * @return \Twilio\Rest\IpMessaging\V2\Service\BindingContext */ public function __construct(Version $version, $serviceSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, 'sid' => $sid, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Bindings/' . \rawurlencode($sid) . ''; } /** * Fetch a BindingInstance * * @return BindingInstance Fetched BindingInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new BindingInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Deletes the BindingInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.IpMessaging.V2.BindingContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V2/Service/UserContext.php 0000644 00000012702 15002236443 0017372 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V2\Service; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Rest\IpMessaging\V2\Service\User\UserBindingList; use Twilio\Rest\IpMessaging\V2\Service\User\UserChannelList; use Twilio\Values; use Twilio\Version; /** * @property \Twilio\Rest\IpMessaging\V2\Service\User\UserChannelList $userChannels * @property \Twilio\Rest\IpMessaging\V2\Service\User\UserBindingList $userBindings * @method \Twilio\Rest\IpMessaging\V2\Service\User\UserChannelContext userChannels(string $channelSid) * @method \Twilio\Rest\IpMessaging\V2\Service\User\UserBindingContext userBindings(string $sid) */ class UserContext extends InstanceContext { protected $_userChannels = null; protected $_userBindings = null; /** * Initialize the UserContext * * @param \Twilio\Version $version Version that contains the resource * @param string $serviceSid The SID of the Service to fetch the resource from * @param string $sid The SID of the User resource to fetch * @return \Twilio\Rest\IpMessaging\V2\Service\UserContext */ public function __construct(Version $version, $serviceSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, 'sid' => $sid, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Users/' . \rawurlencode($sid) . ''; } /** * Fetch a UserInstance * * @return UserInstance Fetched UserInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new UserInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Deletes the UserInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Update the UserInstance * * @param array|Options $options Optional Arguments * @return UserInstance Updated UserInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { $options = new Values($options); $data = Values::of(array( 'RoleSid' => $options['roleSid'], 'Attributes' => $options['attributes'], 'FriendlyName' => $options['friendlyName'], )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new UserInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Access the userChannels * * @return \Twilio\Rest\IpMessaging\V2\Service\User\UserChannelList */ protected function getUserChannels() { if (!$this->_userChannels) { $this->_userChannels = new UserChannelList( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->_userChannels; } /** * Access the userBindings * * @return \Twilio\Rest\IpMessaging\V2\Service\User\UserBindingList */ protected function getUserBindings() { if (!$this->_userBindings) { $this->_userBindings = new UserBindingList( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->_userBindings; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get($name) { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.IpMessaging.V2.UserContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V2/Service/BindingPage.php 0000644 00000001377 15002236443 0017264 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V2\Service; use Twilio\Page; class BindingPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new BindingInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.IpMessaging.V2.BindingPage]'; } } sdk/src/Twilio/Rest/IpMessaging/V2/Service/BindingInstance.php 0000644 00000010605 15002236443 0020146 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V2\Service; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $accountSid * @property string $serviceSid * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $endpoint * @property string $identity * @property string $credentialSid * @property string $bindingType * @property string $messageTypes * @property string $url * @property array $links */ class BindingInstance extends InstanceResource { /** * Initialize the BindingInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the Service that the Binding resource * is associated with * @param string $sid The SID of the resource to fetch * @return \Twilio\Rest\IpMessaging\V2\Service\BindingInstance */ public function __construct(Version $version, array $payload, $serviceSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'endpoint' => Values::array_get($payload, 'endpoint'), 'identity' => Values::array_get($payload, 'identity'), 'credentialSid' => Values::array_get($payload, 'credential_sid'), 'bindingType' => Values::array_get($payload, 'binding_type'), 'messageTypes' => Values::array_get($payload, 'message_types'), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ); $this->solution = array('serviceSid' => $serviceSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\IpMessaging\V2\Service\BindingContext Context for this * BindingInstance */ protected function proxy() { if (!$this->context) { $this->context = new BindingContext( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch a BindingInstance * * @return BindingInstance Fetched BindingInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the BindingInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.IpMessaging.V2.BindingInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V2/Service/User/UserBindingInstance.php 0000644 00000011336 15002236443 0021725 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V2\Service\User; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $accountSid * @property string $serviceSid * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $endpoint * @property string $identity * @property string $userSid * @property string $credentialSid * @property string $bindingType * @property string $messageTypes * @property string $url */ class UserBindingInstance extends InstanceResource { /** * Initialize the UserBindingInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the Service that the resource is * associated with * @param string $userSid The SID of the User with the binding * @param string $sid The SID of the User Binding resource to fetch * @return \Twilio\Rest\IpMessaging\V2\Service\User\UserBindingInstance */ public function __construct(Version $version, array $payload, $serviceSid, $userSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'endpoint' => Values::array_get($payload, 'endpoint'), 'identity' => Values::array_get($payload, 'identity'), 'userSid' => Values::array_get($payload, 'user_sid'), 'credentialSid' => Values::array_get($payload, 'credential_sid'), 'bindingType' => Values::array_get($payload, 'binding_type'), 'messageTypes' => Values::array_get($payload, 'message_types'), 'url' => Values::array_get($payload, 'url'), ); $this->solution = array( 'serviceSid' => $serviceSid, 'userSid' => $userSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\IpMessaging\V2\Service\User\UserBindingContext Context * for this * UserBindingInstance */ protected function proxy() { if (!$this->context) { $this->context = new UserBindingContext( $this->version, $this->solution['serviceSid'], $this->solution['userSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch a UserBindingInstance * * @return UserBindingInstance Fetched UserBindingInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the UserBindingInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.IpMessaging.V2.UserBindingInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V2/Service/User/UserBindingPage.php 0000644 00000001546 15002236443 0021037 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V2\Service\User; use Twilio\Page; class UserBindingPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new UserBindingInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['userSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.IpMessaging.V2.UserBindingPage]'; } } sdk/src/Twilio/Rest/IpMessaging/V2/Service/User/UserChannelOptions.php 0000644 00000011236 15002236443 0021611 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V2\Service\User; use Twilio\Options; use Twilio\Values; abstract class UserChannelOptions { /** * @param string $notificationLevel The push notification level to assign to * the User Channel * @param int $lastConsumedMessageIndex The index of the last Message that the * Member has read within the Channel * @param \DateTime $lastConsumptionTimestamp The ISO 8601 based timestamp * string that represents the * datetime of the last Message read * event for the Member within the * Channel * @return UpdateUserChannelOptions Options builder */ public static function update($notificationLevel = Values::NONE, $lastConsumedMessageIndex = Values::NONE, $lastConsumptionTimestamp = Values::NONE) { return new UpdateUserChannelOptions($notificationLevel, $lastConsumedMessageIndex, $lastConsumptionTimestamp); } } class UpdateUserChannelOptions extends Options { /** * @param string $notificationLevel The push notification level to assign to * the User Channel * @param int $lastConsumedMessageIndex The index of the last Message that the * Member has read within the Channel * @param \DateTime $lastConsumptionTimestamp The ISO 8601 based timestamp * string that represents the * datetime of the last Message read * event for the Member within the * Channel */ public function __construct($notificationLevel = Values::NONE, $lastConsumedMessageIndex = Values::NONE, $lastConsumptionTimestamp = Values::NONE) { $this->options['notificationLevel'] = $notificationLevel; $this->options['lastConsumedMessageIndex'] = $lastConsumedMessageIndex; $this->options['lastConsumptionTimestamp'] = $lastConsumptionTimestamp; } /** * The push notification level to assign to the User Channel. Can be: `default` or `muted`. * * @param string $notificationLevel The push notification level to assign to * the User Channel * @return $this Fluent Builder */ public function setNotificationLevel($notificationLevel) { $this->options['notificationLevel'] = $notificationLevel; return $this; } /** * The index of the last [Message](https://www.twilio.com/docs/chat/rest/message-resource) in the [Channel](https://www.twilio.com/docs/chat/channels) that the Member has read. * * @param int $lastConsumedMessageIndex The index of the last Message that the * Member has read within the Channel * @return $this Fluent Builder */ public function setLastConsumedMessageIndex($lastConsumedMessageIndex) { $this->options['lastConsumedMessageIndex'] = $lastConsumedMessageIndex; return $this; } /** * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) timestamp of the last [Message](https://www.twilio.com/docs/chat/rest/message-resource) read event for the Member within the [Channel](https://www.twilio.com/docs/chat/channels). * * @param \DateTime $lastConsumptionTimestamp The ISO 8601 based timestamp * string that represents the * datetime of the last Message read * event for the Member within the * Channel * @return $this Fluent Builder */ public function setLastConsumptionTimestamp($lastConsumptionTimestamp) { $this->options['lastConsumptionTimestamp'] = $lastConsumptionTimestamp; 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.IpMessaging.V2.UpdateUserChannelOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V2/Service/User/UserChannelPage.php 0000644 00000001546 15002236443 0021035 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V2\Service\User; use Twilio\Page; class UserChannelPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new UserChannelInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['userSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.IpMessaging.V2.UserChannelPage]'; } } sdk/src/Twilio/Rest/IpMessaging/V2/Service/User/UserChannelList.php 0000644 00000012373 15002236443 0021074 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V2\Service\User; use Twilio\ListResource; use Twilio\Values; use Twilio\Version; class UserChannelList extends ListResource { /** * Construct the UserChannelList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Service that the resource is * associated with * @param string $userSid The SID of the User the User Channel belongs to * @return \Twilio\Rest\IpMessaging\V2\Service\User\UserChannelList */ public function __construct(Version $version, $serviceSid, $userSid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, 'userSid' => $userSid, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Users/' . \rawurlencode($userSid) . '/Channels'; } /** * Streams UserChannelInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads UserChannelInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return UserChannelInstance[] Array of results */ public function read($limit = null, $pageSize = null) { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of UserChannelInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of UserChannelInstance */ public function page($pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $params = Values::of(array( 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new UserChannelPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of UserChannelInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of UserChannelInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new UserChannelPage($this->version, $response, $this->solution); } /** * Constructs a UserChannelContext * * @param string $channelSid The SID of the Channel that has the User Channel * to fetch * @return \Twilio\Rest\IpMessaging\V2\Service\User\UserChannelContext */ public function getContext($channelSid) { return new UserChannelContext( $this->version, $this->solution['serviceSid'], $this->solution['userSid'], $channelSid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.IpMessaging.V2.UserChannelList]'; } } sdk/src/Twilio/Rest/IpMessaging/V2/Service/User/UserBindingContext.php 0000644 00000004566 15002236443 0021614 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V2\Service\User; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; class UserBindingContext extends InstanceContext { /** * Initialize the UserBindingContext * * @param \Twilio\Version $version Version that contains the resource * @param string $serviceSid The SID of the Service to fetch the resource from * @param string $userSid The SID of the User with the binding * @param string $sid The SID of the User Binding resource to fetch * @return \Twilio\Rest\IpMessaging\V2\Service\User\UserBindingContext */ public function __construct(Version $version, $serviceSid, $userSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, 'userSid' => $userSid, 'sid' => $sid, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Users/' . \rawurlencode($userSid) . '/Bindings/' . \rawurlencode($sid) . ''; } /** * Fetch a UserBindingInstance * * @return UserBindingInstance Fetched UserBindingInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new UserBindingInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['userSid'], $this->solution['sid'] ); } /** * Deletes the UserBindingInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.IpMessaging.V2.UserBindingContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V2/Service/User/UserChannelContext.php 0000644 00000007160 15002236443 0021603 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V2\Service\User; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class UserChannelContext extends InstanceContext { /** * Initialize the UserChannelContext * * @param \Twilio\Version $version Version that contains the resource * @param string $serviceSid The SID of the Service to fetch the User Channel * resource from * @param string $userSid The SID of the User to fetch the User Channel * resource from * @param string $channelSid The SID of the Channel that has the User Channel * to fetch * @return \Twilio\Rest\IpMessaging\V2\Service\User\UserChannelContext */ public function __construct(Version $version, $serviceSid, $userSid, $channelSid) { parent::__construct($version); // Path Solution $this->solution = array( 'serviceSid' => $serviceSid, 'userSid' => $userSid, 'channelSid' => $channelSid, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Users/' . \rawurlencode($userSid) . '/Channels/' . \rawurlencode($channelSid) . ''; } /** * Fetch a UserChannelInstance * * @return UserChannelInstance Fetched UserChannelInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new UserChannelInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['userSid'], $this->solution['channelSid'] ); } /** * Deletes the UserChannelInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Update the UserChannelInstance * * @param array|Options $options Optional Arguments * @return UserChannelInstance Updated UserChannelInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { $options = new Values($options); $data = Values::of(array( 'NotificationLevel' => $options['notificationLevel'], 'LastConsumedMessageIndex' => $options['lastConsumedMessageIndex'], 'LastConsumptionTimestamp' => Serialize::iso8601DateTime($options['lastConsumptionTimestamp']), )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new UserChannelInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['userSid'], $this->solution['channelSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.IpMessaging.V2.UserChannelContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V2/Service/User/UserChannelInstance.php 0000644 00000012071 15002236443 0021720 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V2\Service\User; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property string $serviceSid * @property string $channelSid * @property string $userSid * @property string $memberSid * @property string $status * @property int $lastConsumedMessageIndex * @property int $unreadMessagesCount * @property array $links * @property string $url * @property string $notificationLevel */ class UserChannelInstance extends InstanceResource { /** * Initialize the UserChannelInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the Service that the resource is * associated with * @param string $userSid The SID of the User the User Channel belongs to * @param string $channelSid The SID of the Channel that has the User Channel * to fetch * @return \Twilio\Rest\IpMessaging\V2\Service\User\UserChannelInstance */ public function __construct(Version $version, array $payload, $serviceSid, $userSid, $channelSid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'channelSid' => Values::array_get($payload, 'channel_sid'), 'userSid' => Values::array_get($payload, 'user_sid'), 'memberSid' => Values::array_get($payload, 'member_sid'), 'status' => Values::array_get($payload, 'status'), 'lastConsumedMessageIndex' => Values::array_get($payload, 'last_consumed_message_index'), 'unreadMessagesCount' => Values::array_get($payload, 'unread_messages_count'), 'links' => Values::array_get($payload, 'links'), 'url' => Values::array_get($payload, 'url'), 'notificationLevel' => Values::array_get($payload, 'notification_level'), ); $this->solution = array( 'serviceSid' => $serviceSid, 'userSid' => $userSid, 'channelSid' => $channelSid ?: $this->properties['channelSid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\IpMessaging\V2\Service\User\UserChannelContext Context * for this * UserChannelInstance */ protected function proxy() { if (!$this->context) { $this->context = new UserChannelContext( $this->version, $this->solution['serviceSid'], $this->solution['userSid'], $this->solution['channelSid'] ); } return $this->context; } /** * Fetch a UserChannelInstance * * @return UserChannelInstance Fetched UserChannelInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the UserChannelInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Update the UserChannelInstance * * @param array|Options $options Optional Arguments * @return UserChannelInstance Updated UserChannelInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.IpMessaging.V2.UserChannelInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V2/Service/User/UserBindingList.php 0000644 00000013134 15002236443 0021072 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V2\Service\User; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class UserBindingList extends ListResource { /** * Construct the UserBindingList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Service that the resource is * associated with * @param string $userSid The SID of the User with the binding * @return \Twilio\Rest\IpMessaging\V2\Service\User\UserBindingList */ public function __construct(Version $version, $serviceSid, $userSid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, 'userSid' => $userSid, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Users/' . \rawurlencode($userSid) . '/Bindings'; } /** * Streams UserBindingInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($options = array(), $limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads UserBindingInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return UserBindingInstance[] Array of results */ public function read($options = array(), $limit = null, $pageSize = null) { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Retrieve a single page of UserBindingInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of UserBindingInstance */ public function page($options = array(), $pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $options = new Values($options); $params = Values::of(array( 'BindingType' => Serialize::map($options['bindingType'], function($e) { return $e; }), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new UserBindingPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of UserBindingInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of UserBindingInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new UserBindingPage($this->version, $response, $this->solution); } /** * Constructs a UserBindingContext * * @param string $sid The SID of the User Binding resource to fetch * @return \Twilio\Rest\IpMessaging\V2\Service\User\UserBindingContext */ public function getContext($sid) { return new UserBindingContext( $this->version, $this->solution['serviceSid'], $this->solution['userSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.IpMessaging.V2.UserBindingList]'; } } sdk/src/Twilio/Rest/IpMessaging/V2/Service/User/UserBindingOptions.php 0000644 00000003540 15002236443 0021612 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V2\Service\User; use Twilio\Options; use Twilio\Values; abstract class UserBindingOptions { /** * @param string $bindingType The push technology used by the User Binding * resources to read * @return ReadUserBindingOptions Options builder */ public static function read($bindingType = Values::NONE) { return new ReadUserBindingOptions($bindingType); } } class ReadUserBindingOptions extends Options { /** * @param string $bindingType The push technology used by the User Binding * resources to read */ public function __construct($bindingType = Values::NONE) { $this->options['bindingType'] = $bindingType; } /** * The push technology used by the User Binding resources to read. Can be: `apn`, `gcm`, or `fcm`. See [push notification configuration](https://www.twilio.com/docs/chat/push-notification-configuration) for more info. * * @param string $bindingType The push technology used by the User Binding * resources to read * @return $this Fluent Builder */ public function setBindingType($bindingType) { $this->options['bindingType'] = $bindingType; 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.IpMessaging.V2.ReadUserBindingOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V2/Service/RoleInstance.php 0000644 00000010561 15002236443 0017476 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V2\Service; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $accountSid * @property string $serviceSid * @property string $friendlyName * @property string $type * @property string $permissions * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $url */ class RoleInstance extends InstanceResource { /** * Initialize the RoleInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the Service that the resource is * associated with * @param string $sid The SID of the Role resource to fetch * @return \Twilio\Rest\IpMessaging\V2\Service\RoleInstance */ public function __construct(Version $version, array $payload, $serviceSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'type' => Values::array_get($payload, 'type'), 'permissions' => Values::array_get($payload, 'permissions'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), ); $this->solution = array('serviceSid' => $serviceSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\IpMessaging\V2\Service\RoleContext Context for this * RoleInstance */ protected function proxy() { if (!$this->context) { $this->context = new RoleContext( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch a RoleInstance * * @return RoleInstance Fetched RoleInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the RoleInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Update the RoleInstance * * @param string $permission A permission the role should have * @return RoleInstance Updated RoleInstance * @throws TwilioException When an HTTP error occurs. */ public function update($permission) { return $this->proxy()->update($permission); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.IpMessaging.V2.RoleInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V2/Service/ChannelInstance.php 0000644 00000013522 15002236443 0020145 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V2\Service; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $accountSid * @property string $serviceSid * @property string $friendlyName * @property string $uniqueName * @property string $attributes * @property string $type * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $createdBy * @property int $membersCount * @property int $messagesCount * @property string $url * @property array $links */ class ChannelInstance extends InstanceResource { protected $_members = null; protected $_messages = null; protected $_invites = null; protected $_webhooks = null; /** * Initialize the ChannelInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the Service that the resource is * associated with * @param string $sid The SID of the resource * @return \Twilio\Rest\IpMessaging\V2\Service\ChannelInstance */ public function __construct(Version $version, array $payload, $serviceSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'uniqueName' => Values::array_get($payload, 'unique_name'), 'attributes' => Values::array_get($payload, 'attributes'), 'type' => Values::array_get($payload, 'type'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'createdBy' => Values::array_get($payload, 'created_by'), 'membersCount' => Values::array_get($payload, 'members_count'), 'messagesCount' => Values::array_get($payload, 'messages_count'), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ); $this->solution = array('serviceSid' => $serviceSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\IpMessaging\V2\Service\ChannelContext Context for this * ChannelInstance */ protected function proxy() { if (!$this->context) { $this->context = new ChannelContext( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch a ChannelInstance * * @return ChannelInstance Fetched ChannelInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the ChannelInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Update the ChannelInstance * * @param array|Options $options Optional Arguments * @return ChannelInstance Updated ChannelInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Access the members * * @return \Twilio\Rest\IpMessaging\V2\Service\Channel\MemberList */ protected function getMembers() { return $this->proxy()->members; } /** * Access the messages * * @return \Twilio\Rest\IpMessaging\V2\Service\Channel\MessageList */ protected function getMessages() { return $this->proxy()->messages; } /** * Access the invites * * @return \Twilio\Rest\IpMessaging\V2\Service\Channel\InviteList */ protected function getInvites() { return $this->proxy()->invites; } /** * Access the webhooks * * @return \Twilio\Rest\IpMessaging\V2\Service\Channel\WebhookList */ protected function getWebhooks() { return $this->proxy()->webhooks; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.IpMessaging.V2.ChannelInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V2/Service/UserList.php 0000644 00000013432 15002236443 0016662 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V2\Service; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; class UserList extends ListResource { /** * Construct the UserList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Service that the resource is * associated with * @return \Twilio\Rest\IpMessaging\V2\Service\UserList */ public function __construct(Version $version, $serviceSid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Users'; } /** * Create a new UserInstance * * @param string $identity The `identity` value that identifies the new * resource's User * @param array|Options $options Optional Arguments * @return UserInstance Newly created UserInstance * @throws TwilioException When an HTTP error occurs. */ public function create($identity, $options = array()) { $options = new Values($options); $data = Values::of(array( 'Identity' => $identity, 'RoleSid' => $options['roleSid'], 'Attributes' => $options['attributes'], 'FriendlyName' => $options['friendlyName'], )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new UserInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Streams UserInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads UserInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return UserInstance[] Array of results */ public function read($limit = null, $pageSize = null) { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of UserInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of UserInstance */ public function page($pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $params = Values::of(array( 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new UserPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of UserInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of UserInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new UserPage($this->version, $response, $this->solution); } /** * Constructs a UserContext * * @param string $sid The SID of the User resource to fetch * @return \Twilio\Rest\IpMessaging\V2\Service\UserContext */ public function getContext($sid) { return new UserContext($this->version, $this->solution['serviceSid'], $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.IpMessaging.V2.UserList]'; } } sdk/src/Twilio/Rest/IpMessaging/V2/Service/UserPage.php 0000644 00000001366 15002236443 0016626 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V2\Service; use Twilio\Page; class UserPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new UserInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.IpMessaging.V2.UserPage]'; } } sdk/src/Twilio/Rest/IpMessaging/V2/Service/UserOptions.php 0000644 00000013032 15002236443 0017376 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V2\Service; use Twilio\Options; use Twilio\Values; abstract class UserOptions { /** * @param string $roleSid The SID of the Role assigned to this user * @param string $attributes A valid JSON string that contains * application-specific data * @param string $friendlyName A string to describe the new resource * @return CreateUserOptions Options builder */ public static function create($roleSid = Values::NONE, $attributes = Values::NONE, $friendlyName = Values::NONE) { return new CreateUserOptions($roleSid, $attributes, $friendlyName); } /** * @param string $roleSid The SID id of the Role assigned to this user * @param string $attributes A valid JSON string that contains * application-specific data * @param string $friendlyName A string to describe the resource * @return UpdateUserOptions Options builder */ public static function update($roleSid = Values::NONE, $attributes = Values::NONE, $friendlyName = Values::NONE) { return new UpdateUserOptions($roleSid, $attributes, $friendlyName); } } class CreateUserOptions extends Options { /** * @param string $roleSid The SID of the Role assigned to this user * @param string $attributes A valid JSON string that contains * application-specific data * @param string $friendlyName A string to describe the new resource */ public function __construct($roleSid = Values::NONE, $attributes = Values::NONE, $friendlyName = Values::NONE) { $this->options['roleSid'] = $roleSid; $this->options['attributes'] = $attributes; $this->options['friendlyName'] = $friendlyName; } /** * The SID of the [Role](https://www.twilio.com/docs/chat/rest/role-resource) to assign to the new User. * * @param string $roleSid The SID of the Role assigned to this user * @return $this Fluent Builder */ public function setRoleSid($roleSid) { $this->options['roleSid'] = $roleSid; return $this; } /** * A valid JSON string that contains application-specific data. * * @param string $attributes A valid JSON string that contains * application-specific data * @return $this Fluent Builder */ public function setAttributes($attributes) { $this->options['attributes'] = $attributes; return $this; } /** * A descriptive string that you create to describe the new resource. This value is often used for display purposes. * * @param string $friendlyName A string to describe the new resource * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; 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.IpMessaging.V2.CreateUserOptions ' . \implode(' ', $options) . ']'; } } class UpdateUserOptions extends Options { /** * @param string $roleSid The SID id of the Role assigned to this user * @param string $attributes A valid JSON string that contains * application-specific data * @param string $friendlyName A string to describe the resource */ public function __construct($roleSid = Values::NONE, $attributes = Values::NONE, $friendlyName = Values::NONE) { $this->options['roleSid'] = $roleSid; $this->options['attributes'] = $attributes; $this->options['friendlyName'] = $friendlyName; } /** * The SID of the [Role](https://www.twilio.com/docs/chat/rest/role-resource) to assign to the User. * * @param string $roleSid The SID id of the Role assigned to this user * @return $this Fluent Builder */ public function setRoleSid($roleSid) { $this->options['roleSid'] = $roleSid; return $this; } /** * A valid JSON string that contains application-specific data. * * @param string $attributes A valid JSON string that contains * application-specific data * @return $this Fluent Builder */ public function setAttributes($attributes) { $this->options['attributes'] = $attributes; return $this; } /** * A descriptive string that you create to describe the resource. It is often used for display purposes. * * @param string $friendlyName A string to describe the resource * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; 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.IpMessaging.V2.UpdateUserOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V2/Service/BindingOptions.php 0000644 00000005011 15002236443 0020030 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V2\Service; use Twilio\Options; use Twilio\Values; abstract class BindingOptions { /** * @param string $bindingType The push technology used by the Binding resources * to read * @param string $identity The `identity` value of the resources to read * @return ReadBindingOptions Options builder */ public static function read($bindingType = Values::NONE, $identity = Values::NONE) { return new ReadBindingOptions($bindingType, $identity); } } class ReadBindingOptions extends Options { /** * @param string $bindingType The push technology used by the Binding resources * to read * @param string $identity The `identity` value of the resources to read */ public function __construct($bindingType = Values::NONE, $identity = Values::NONE) { $this->options['bindingType'] = $bindingType; $this->options['identity'] = $identity; } /** * The push technology used by the Binding resources to read. Can be: `apn`, `gcm`, or `fcm`. See [push notification configuration](https://www.twilio.com/docs/chat/push-notification-configuration) for more info. * * @param string $bindingType The push technology used by the Binding resources * to read * @return $this Fluent Builder */ public function setBindingType($bindingType) { $this->options['bindingType'] = $bindingType; return $this; } /** * The [User](https://www.twilio.com/docs/chat/rest/user-resource)'s `identity` value of the resources to read. See [access tokens](https://www.twilio.com/docs/chat/create-tokens) for more details. * * @param string $identity The `identity` value of the resources to read * @return $this Fluent Builder */ public function setIdentity($identity) { $this->options['identity'] = $identity; 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.IpMessaging.V2.ReadBindingOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V2/Service/RolePage.php 0000644 00000001366 15002236443 0016611 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V2\Service; use Twilio\Page; class RolePage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new RoleInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.IpMessaging.V2.RolePage]'; } } sdk/src/Twilio/Rest/IpMessaging/V2/Service/RoleContext.php 0000644 00000005501 15002236443 0017354 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V2\Service; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class RoleContext extends InstanceContext { /** * Initialize the RoleContext * * @param \Twilio\Version $version Version that contains the resource * @param string $serviceSid The SID of the Service to fetch the resource from * @param string $sid The SID of the Role resource to fetch * @return \Twilio\Rest\IpMessaging\V2\Service\RoleContext */ public function __construct(Version $version, $serviceSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, 'sid' => $sid, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Roles/' . \rawurlencode($sid) . ''; } /** * Fetch a RoleInstance * * @return RoleInstance Fetched RoleInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new RoleInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Deletes the RoleInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Update the RoleInstance * * @param string $permission A permission the role should have * @return RoleInstance Updated RoleInstance * @throws TwilioException When an HTTP error occurs. */ public function update($permission) { $data = Values::of(array('Permission' => Serialize::map($permission, function($e) { return $e; }), )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new RoleInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.IpMessaging.V2.RoleContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V2/Service/ChannelList.php 0000644 00000014460 15002236443 0017316 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V2\Service; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class ChannelList extends ListResource { /** * Construct the ChannelList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Service that the resource is * associated with * @return \Twilio\Rest\IpMessaging\V2\Service\ChannelList */ public function __construct(Version $version, $serviceSid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Channels'; } /** * Create a new ChannelInstance * * @param array|Options $options Optional Arguments * @return ChannelInstance Newly created ChannelInstance * @throws TwilioException When an HTTP error occurs. */ public function create($options = array()) { $options = new Values($options); $data = Values::of(array( 'FriendlyName' => $options['friendlyName'], 'UniqueName' => $options['uniqueName'], 'Attributes' => $options['attributes'], 'Type' => $options['type'], 'DateCreated' => Serialize::iso8601DateTime($options['dateCreated']), 'DateUpdated' => Serialize::iso8601DateTime($options['dateUpdated']), 'CreatedBy' => $options['createdBy'], )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new ChannelInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Streams ChannelInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($options = array(), $limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads ChannelInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return ChannelInstance[] Array of results */ public function read($options = array(), $limit = null, $pageSize = null) { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Retrieve a single page of ChannelInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of ChannelInstance */ public function page($options = array(), $pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $options = new Values($options); $params = Values::of(array( 'Type' => Serialize::map($options['type'], function($e) { return $e; }), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new ChannelPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of ChannelInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of ChannelInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new ChannelPage($this->version, $response, $this->solution); } /** * Constructs a ChannelContext * * @param string $sid The SID of the resource * @return \Twilio\Rest\IpMessaging\V2\Service\ChannelContext */ public function getContext($sid) { return new ChannelContext($this->version, $this->solution['serviceSid'], $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.IpMessaging.V2.ChannelList]'; } } sdk/src/Twilio/Rest/IpMessaging/V2/Service/ChannelContext.php 0000644 00000015701 15002236443 0020026 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V2\Service; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Rest\IpMessaging\V2\Service\Channel\InviteList; use Twilio\Rest\IpMessaging\V2\Service\Channel\MemberList; use Twilio\Rest\IpMessaging\V2\Service\Channel\MessageList; use Twilio\Rest\IpMessaging\V2\Service\Channel\WebhookList; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * @property \Twilio\Rest\IpMessaging\V2\Service\Channel\MemberList $members * @property \Twilio\Rest\IpMessaging\V2\Service\Channel\MessageList $messages * @property \Twilio\Rest\IpMessaging\V2\Service\Channel\InviteList $invites * @property \Twilio\Rest\IpMessaging\V2\Service\Channel\WebhookList $webhooks * @method \Twilio\Rest\IpMessaging\V2\Service\Channel\MemberContext members(string $sid) * @method \Twilio\Rest\IpMessaging\V2\Service\Channel\MessageContext messages(string $sid) * @method \Twilio\Rest\IpMessaging\V2\Service\Channel\InviteContext invites(string $sid) * @method \Twilio\Rest\IpMessaging\V2\Service\Channel\WebhookContext webhooks(string $sid) */ class ChannelContext extends InstanceContext { protected $_members = null; protected $_messages = null; protected $_invites = null; protected $_webhooks = null; /** * Initialize the ChannelContext * * @param \Twilio\Version $version Version that contains the resource * @param string $serviceSid The SID of the Service to fetch the resource from * @param string $sid The SID of the resource * @return \Twilio\Rest\IpMessaging\V2\Service\ChannelContext */ public function __construct(Version $version, $serviceSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, 'sid' => $sid, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Channels/' . \rawurlencode($sid) . ''; } /** * Fetch a ChannelInstance * * @return ChannelInstance Fetched ChannelInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new ChannelInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Deletes the ChannelInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Update the ChannelInstance * * @param array|Options $options Optional Arguments * @return ChannelInstance Updated ChannelInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { $options = new Values($options); $data = Values::of(array( 'FriendlyName' => $options['friendlyName'], 'UniqueName' => $options['uniqueName'], 'Attributes' => $options['attributes'], 'DateCreated' => Serialize::iso8601DateTime($options['dateCreated']), 'DateUpdated' => Serialize::iso8601DateTime($options['dateUpdated']), 'CreatedBy' => $options['createdBy'], )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new ChannelInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Access the members * * @return \Twilio\Rest\IpMessaging\V2\Service\Channel\MemberList */ protected function getMembers() { if (!$this->_members) { $this->_members = new MemberList( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->_members; } /** * Access the messages * * @return \Twilio\Rest\IpMessaging\V2\Service\Channel\MessageList */ protected function getMessages() { if (!$this->_messages) { $this->_messages = new MessageList( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->_messages; } /** * Access the invites * * @return \Twilio\Rest\IpMessaging\V2\Service\Channel\InviteList */ protected function getInvites() { if (!$this->_invites) { $this->_invites = new InviteList( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->_invites; } /** * Access the webhooks * * @return \Twilio\Rest\IpMessaging\V2\Service\Channel\WebhookList */ protected function getWebhooks() { if (!$this->_webhooks) { $this->_webhooks = new WebhookList( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->_webhooks; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get($name) { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.IpMessaging.V2.ChannelContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V2/Service/ChannelPage.php 0000644 00000001377 15002236443 0017262 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V2\Service; use Twilio\Page; class ChannelPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new ChannelInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.IpMessaging.V2.ChannelPage]'; } } sdk/src/Twilio/Rest/IpMessaging/V2/Service/UserInstance.php 0000644 00000012617 15002236443 0017517 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V2\Service; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $accountSid * @property string $serviceSid * @property string $attributes * @property string $friendlyName * @property string $roleSid * @property string $identity * @property bool $isOnline * @property bool $isNotifiable * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property int $joinedChannelsCount * @property array $links * @property string $url */ class UserInstance extends InstanceResource { protected $_userChannels = null; protected $_userBindings = null; /** * Initialize the UserInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the Service that the resource is * associated with * @param string $sid The SID of the User resource to fetch * @return \Twilio\Rest\IpMessaging\V2\Service\UserInstance */ public function __construct(Version $version, array $payload, $serviceSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'attributes' => Values::array_get($payload, 'attributes'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'roleSid' => Values::array_get($payload, 'role_sid'), 'identity' => Values::array_get($payload, 'identity'), 'isOnline' => Values::array_get($payload, 'is_online'), 'isNotifiable' => Values::array_get($payload, 'is_notifiable'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'joinedChannelsCount' => Values::array_get($payload, 'joined_channels_count'), 'links' => Values::array_get($payload, 'links'), 'url' => Values::array_get($payload, 'url'), ); $this->solution = array('serviceSid' => $serviceSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\IpMessaging\V2\Service\UserContext Context for this * UserInstance */ protected function proxy() { if (!$this->context) { $this->context = new UserContext( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch a UserInstance * * @return UserInstance Fetched UserInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the UserInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Update the UserInstance * * @param array|Options $options Optional Arguments * @return UserInstance Updated UserInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Access the userChannels * * @return \Twilio\Rest\IpMessaging\V2\Service\User\UserChannelList */ protected function getUserChannels() { return $this->proxy()->userChannels; } /** * Access the userBindings * * @return \Twilio\Rest\IpMessaging\V2\Service\User\UserBindingList */ protected function getUserBindings() { return $this->proxy()->userBindings; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.IpMessaging.V2.UserInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V2/Service/ChannelOptions.php 0000644 00000032243 15002236443 0020035 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V2\Service; use Twilio\Options; use Twilio\Values; abstract class ChannelOptions { /** * @param string $friendlyName A string to describe the new resource * @param string $uniqueName An application-defined string that uniquely * identifies the Channel resource * @param string $attributes A valid JSON string that contains * application-specific data * @param string $type The visibility of the channel * @param \DateTime $dateCreated The ISO 8601 date and time in GMT when the * resource was created * @param \DateTime $dateUpdated The ISO 8601 date and time in GMT when the * resource was updated * @param string $createdBy The identity of the User that created the Channel * @return CreateChannelOptions Options builder */ public static function create($friendlyName = Values::NONE, $uniqueName = Values::NONE, $attributes = Values::NONE, $type = Values::NONE, $dateCreated = Values::NONE, $dateUpdated = Values::NONE, $createdBy = Values::NONE) { return new CreateChannelOptions($friendlyName, $uniqueName, $attributes, $type, $dateCreated, $dateUpdated, $createdBy); } /** * @param string $type The visibility of the channel to read * @return ReadChannelOptions Options builder */ public static function read($type = Values::NONE) { return new ReadChannelOptions($type); } /** * @param string $friendlyName A string to describe the resource * @param string $uniqueName An application-defined string that uniquely * identifies the resource * @param string $attributes A valid JSON string that contains * application-specific data * @param \DateTime $dateCreated The ISO 8601 date and time in GMT when the * resource was created * @param \DateTime $dateUpdated The ISO 8601 date and time in GMT when the * resource was updated * @param string $createdBy The identity of the User that created the Channel * @return UpdateChannelOptions Options builder */ public static function update($friendlyName = Values::NONE, $uniqueName = Values::NONE, $attributes = Values::NONE, $dateCreated = Values::NONE, $dateUpdated = Values::NONE, $createdBy = Values::NONE) { return new UpdateChannelOptions($friendlyName, $uniqueName, $attributes, $dateCreated, $dateUpdated, $createdBy); } } class CreateChannelOptions extends Options { /** * @param string $friendlyName A string to describe the new resource * @param string $uniqueName An application-defined string that uniquely * identifies the Channel resource * @param string $attributes A valid JSON string that contains * application-specific data * @param string $type The visibility of the channel * @param \DateTime $dateCreated The ISO 8601 date and time in GMT when the * resource was created * @param \DateTime $dateUpdated The ISO 8601 date and time in GMT when the * resource was updated * @param string $createdBy The identity of the User that created the Channel */ public function __construct($friendlyName = Values::NONE, $uniqueName = Values::NONE, $attributes = Values::NONE, $type = Values::NONE, $dateCreated = Values::NONE, $dateUpdated = Values::NONE, $createdBy = Values::NONE) { $this->options['friendlyName'] = $friendlyName; $this->options['uniqueName'] = $uniqueName; $this->options['attributes'] = $attributes; $this->options['type'] = $type; $this->options['dateCreated'] = $dateCreated; $this->options['dateUpdated'] = $dateUpdated; $this->options['createdBy'] = $createdBy; } /** * A descriptive string that you create to describe the new resource. It can be up to 64 characters long. * * @param string $friendlyName A string to describe the new resource * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * An application-defined string that uniquely identifies the resource. It can be used to address the resource in place of the Channel resource's `sid` in the URL. This value must be 64 characters or less in length and be unique within the Service. * * @param string $uniqueName An application-defined string that uniquely * identifies the Channel resource * @return $this Fluent Builder */ public function setUniqueName($uniqueName) { $this->options['uniqueName'] = $uniqueName; return $this; } /** * A valid JSON string that contains application-specific data. * * @param string $attributes A valid JSON string that contains * application-specific data * @return $this Fluent Builder */ public function setAttributes($attributes) { $this->options['attributes'] = $attributes; return $this; } /** * The visibility of the channel. Can be: `public` or `private` and defaults to `public`. * * @param string $type The visibility of the channel * @return $this Fluent Builder */ public function setType($type) { $this->options['type'] = $type; return $this; } /** * The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was created. The default value is the current time set by the Chat service. Note that this should only be used in cases where a Channel is being recreated from a backup/separate source. * * @param \DateTime $dateCreated The ISO 8601 date and time in GMT when the * resource was created * @return $this Fluent Builder */ public function setDateCreated($dateCreated) { $this->options['dateCreated'] = $dateCreated; return $this; } /** * The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was last updated. The default value is `null`. Note that this parameter should only be used in cases where a Channel is being recreated from a backup/separate source and where a Message was previously updated. * * @param \DateTime $dateUpdated The ISO 8601 date and time in GMT when the * resource was updated * @return $this Fluent Builder */ public function setDateUpdated($dateUpdated) { $this->options['dateUpdated'] = $dateUpdated; return $this; } /** * The `identity` of the User that created the channel. Default is: `system`. * * @param string $createdBy The identity of the User that created the Channel * @return $this Fluent Builder */ public function setCreatedBy($createdBy) { $this->options['createdBy'] = $createdBy; 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.IpMessaging.V2.CreateChannelOptions ' . \implode(' ', $options) . ']'; } } class ReadChannelOptions extends Options { /** * @param string $type The visibility of the channel to read */ public function __construct($type = Values::NONE) { $this->options['type'] = $type; } /** * The visibility of the Channels to read. Can be: `public` or `private` and defaults to `public`. * * @param string $type The visibility of the channel to read * @return $this Fluent Builder */ public function setType($type) { $this->options['type'] = $type; 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.IpMessaging.V2.ReadChannelOptions ' . \implode(' ', $options) . ']'; } } class UpdateChannelOptions extends Options { /** * @param string $friendlyName A string to describe the resource * @param string $uniqueName An application-defined string that uniquely * identifies the resource * @param string $attributes A valid JSON string that contains * application-specific data * @param \DateTime $dateCreated The ISO 8601 date and time in GMT when the * resource was created * @param \DateTime $dateUpdated The ISO 8601 date and time in GMT when the * resource was updated * @param string $createdBy The identity of the User that created the Channel */ public function __construct($friendlyName = Values::NONE, $uniqueName = Values::NONE, $attributes = Values::NONE, $dateCreated = Values::NONE, $dateUpdated = Values::NONE, $createdBy = Values::NONE) { $this->options['friendlyName'] = $friendlyName; $this->options['uniqueName'] = $uniqueName; $this->options['attributes'] = $attributes; $this->options['dateCreated'] = $dateCreated; $this->options['dateUpdated'] = $dateUpdated; $this->options['createdBy'] = $createdBy; } /** * A descriptive string that you create to describe the resource. It can be up to 256 characters long. * * @param string $friendlyName A string to describe the resource * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * An application-defined string that uniquely identifies the resource. It can be used to address the resource in place of the resource's `sid` in the URL. This value must be 256 characters or less in length and unique within the Service. * * @param string $uniqueName An application-defined string that uniquely * identifies the resource * @return $this Fluent Builder */ public function setUniqueName($uniqueName) { $this->options['uniqueName'] = $uniqueName; return $this; } /** * A valid JSON string that contains application-specific data. * * @param string $attributes A valid JSON string that contains * application-specific data * @return $this Fluent Builder */ public function setAttributes($attributes) { $this->options['attributes'] = $attributes; return $this; } /** * The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was created. The default value is the current time set by the Chat service. Note that this should only be used in cases where a Channel is being recreated from a backup/separate source. * * @param \DateTime $dateCreated The ISO 8601 date and time in GMT when the * resource was created * @return $this Fluent Builder */ public function setDateCreated($dateCreated) { $this->options['dateCreated'] = $dateCreated; return $this; } /** * The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was last updated. * * @param \DateTime $dateUpdated The ISO 8601 date and time in GMT when the * resource was updated * @return $this Fluent Builder */ public function setDateUpdated($dateUpdated) { $this->options['dateUpdated'] = $dateUpdated; return $this; } /** * The `identity` of the User that created the channel. Default is: `system`. * * @param string $createdBy The identity of the User that created the Channel * @return $this Fluent Builder */ public function setCreatedBy($createdBy) { $this->options['createdBy'] = $createdBy; 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.IpMessaging.V2.UpdateChannelOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V2/Service/RoleList.php 0000644 00000013334 15002236443 0016646 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V2\Service; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class RoleList extends ListResource { /** * Construct the RoleList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Service that the resource is * associated with * @return \Twilio\Rest\IpMessaging\V2\Service\RoleList */ public function __construct(Version $version, $serviceSid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Roles'; } /** * Create a new RoleInstance * * @param string $friendlyName A string to describe the new resource * @param string $type The type of role * @param string $permission A permission the role should have * @return RoleInstance Newly created RoleInstance * @throws TwilioException When an HTTP error occurs. */ public function create($friendlyName, $type, $permission) { $data = Values::of(array( 'FriendlyName' => $friendlyName, 'Type' => $type, 'Permission' => Serialize::map($permission, function($e) { return $e; }), )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new RoleInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Streams RoleInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads RoleInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return RoleInstance[] Array of results */ public function read($limit = null, $pageSize = null) { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of RoleInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of RoleInstance */ public function page($pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $params = Values::of(array( 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new RolePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of RoleInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of RoleInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new RolePage($this->version, $response, $this->solution); } /** * Constructs a RoleContext * * @param string $sid The SID of the Role resource to fetch * @return \Twilio\Rest\IpMessaging\V2\Service\RoleContext */ public function getContext($sid) { return new RoleContext($this->version, $this->solution['serviceSid'], $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.IpMessaging.V2.RoleList]'; } } sdk/src/Twilio/Rest/IpMessaging/V2/Service/BindingList.php 0000644 00000012605 15002236443 0017317 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V2\Service; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class BindingList extends ListResource { /** * Construct the BindingList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Service that the Binding resource * is associated with * @return \Twilio\Rest\IpMessaging\V2\Service\BindingList */ public function __construct(Version $version, $serviceSid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Bindings'; } /** * Streams BindingInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($options = array(), $limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads BindingInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return BindingInstance[] Array of results */ public function read($options = array(), $limit = null, $pageSize = null) { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Retrieve a single page of BindingInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of BindingInstance */ public function page($options = array(), $pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $options = new Values($options); $params = Values::of(array( 'BindingType' => Serialize::map($options['bindingType'], function($e) { return $e; }), 'Identity' => Serialize::map($options['identity'], function($e) { return $e; }), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new BindingPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of BindingInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of BindingInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new BindingPage($this->version, $response, $this->solution); } /** * Constructs a BindingContext * * @param string $sid The SID of the resource to fetch * @return \Twilio\Rest\IpMessaging\V2\Service\BindingContext */ public function getContext($sid) { return new BindingContext($this->version, $this->solution['serviceSid'], $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.IpMessaging.V2.BindingList]'; } } sdk/src/Twilio/Rest/IpMessaging/V2/Service/Channel/WebhookInstance.php 0000644 00000011466 15002236443 0021550 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V2\Service\Channel; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $accountSid * @property string $serviceSid * @property string $channelSid * @property string $type * @property string $url * @property array $configuration * @property \DateTime $dateCreated * @property \DateTime $dateUpdated */ class WebhookInstance extends InstanceResource { /** * Initialize the WebhookInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the Service that the Channel Webhook * resource is associated with * @param string $channelSid The SID of the Channel the Channel Webhook * resource belongs to * @param string $sid The SID of the Channel Webhook resource to fetch * @return \Twilio\Rest\IpMessaging\V2\Service\Channel\WebhookInstance */ public function __construct(Version $version, array $payload, $serviceSid, $channelSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'channelSid' => Values::array_get($payload, 'channel_sid'), 'type' => Values::array_get($payload, 'type'), 'url' => Values::array_get($payload, 'url'), 'configuration' => Values::array_get($payload, 'configuration'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), ); $this->solution = array( 'serviceSid' => $serviceSid, 'channelSid' => $channelSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\IpMessaging\V2\Service\Channel\WebhookContext Context * for this * WebhookInstance */ protected function proxy() { if (!$this->context) { $this->context = new WebhookContext( $this->version, $this->solution['serviceSid'], $this->solution['channelSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch a WebhookInstance * * @return WebhookInstance Fetched WebhookInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Update the WebhookInstance * * @param array|Options $options Optional Arguments * @return WebhookInstance Updated WebhookInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Deletes the WebhookInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.IpMessaging.V2.WebhookInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V2/Service/Channel/MessageContext.php 0000644 00000006776 15002236443 0021426 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V2\Service\Channel; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class MessageContext extends InstanceContext { /** * Initialize the MessageContext * * @param \Twilio\Version $version Version that contains the resource * @param string $serviceSid The SID of the Service to fetch the resource from * @param string $channelSid The SID of the Channel the message to fetch * belongs to * @param string $sid The SID of the Message resource to fetch * @return \Twilio\Rest\IpMessaging\V2\Service\Channel\MessageContext */ public function __construct(Version $version, $serviceSid, $channelSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, 'channelSid' => $channelSid, 'sid' => $sid, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Channels/' . \rawurlencode($channelSid) . '/Messages/' . \rawurlencode($sid) . ''; } /** * Fetch a MessageInstance * * @return MessageInstance Fetched MessageInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new MessageInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid'], $this->solution['sid'] ); } /** * Deletes the MessageInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Update the MessageInstance * * @param array|Options $options Optional Arguments * @return MessageInstance Updated MessageInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { $options = new Values($options); $data = Values::of(array( 'Body' => $options['body'], 'Attributes' => $options['attributes'], 'DateCreated' => Serialize::iso8601DateTime($options['dateCreated']), 'DateUpdated' => Serialize::iso8601DateTime($options['dateUpdated']), 'LastUpdatedBy' => $options['lastUpdatedBy'], 'From' => $options['from'], )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new MessageInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.IpMessaging.V2.MessageContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V2/Service/Channel/WebhookOptions.php 0000644 00000032725 15002236443 0021440 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V2\Service\Channel; use Twilio\Options; use Twilio\Values; abstract class WebhookOptions { /** * @param string $configurationUrl The URL of the webhook to call * @param string $configurationMethod The HTTP method used to call * `configuration.url` * @param string $configurationFilters The events that cause us to call the * Channel Webhook * @param string $configurationTriggers A string that will cause us to call the * webhook when it is found in a message * body * @param string $configurationFlowSid The SID of the Studio Flow to call when * an event occurs * @param int $configurationRetryCount The number of times to retry the webhook * if the first attempt fails * @return CreateWebhookOptions Options builder */ public static function create($configurationUrl = Values::NONE, $configurationMethod = Values::NONE, $configurationFilters = Values::NONE, $configurationTriggers = Values::NONE, $configurationFlowSid = Values::NONE, $configurationRetryCount = Values::NONE) { return new CreateWebhookOptions($configurationUrl, $configurationMethod, $configurationFilters, $configurationTriggers, $configurationFlowSid, $configurationRetryCount); } /** * @param string $configurationUrl The URL of the webhook to call * @param string $configurationMethod The HTTP method used to call * `configuration.url` * @param string $configurationFilters The events that cause us to call the * Channel Webhook * @param string $configurationTriggers A string that will cause us to call the * webhook when it is found in a message * body * @param string $configurationFlowSid The SID of the Studio Flow to call when * an event occurs * @param int $configurationRetryCount The number of times to retry the webhook * if the first attempt fails * @return UpdateWebhookOptions Options builder */ public static function update($configurationUrl = Values::NONE, $configurationMethod = Values::NONE, $configurationFilters = Values::NONE, $configurationTriggers = Values::NONE, $configurationFlowSid = Values::NONE, $configurationRetryCount = Values::NONE) { return new UpdateWebhookOptions($configurationUrl, $configurationMethod, $configurationFilters, $configurationTriggers, $configurationFlowSid, $configurationRetryCount); } } class CreateWebhookOptions extends Options { /** * @param string $configurationUrl The URL of the webhook to call * @param string $configurationMethod The HTTP method used to call * `configuration.url` * @param string $configurationFilters The events that cause us to call the * Channel Webhook * @param string $configurationTriggers A string that will cause us to call the * webhook when it is found in a message * body * @param string $configurationFlowSid The SID of the Studio Flow to call when * an event occurs * @param int $configurationRetryCount The number of times to retry the webhook * if the first attempt fails */ public function __construct($configurationUrl = Values::NONE, $configurationMethod = Values::NONE, $configurationFilters = Values::NONE, $configurationTriggers = Values::NONE, $configurationFlowSid = Values::NONE, $configurationRetryCount = Values::NONE) { $this->options['configurationUrl'] = $configurationUrl; $this->options['configurationMethod'] = $configurationMethod; $this->options['configurationFilters'] = $configurationFilters; $this->options['configurationTriggers'] = $configurationTriggers; $this->options['configurationFlowSid'] = $configurationFlowSid; $this->options['configurationRetryCount'] = $configurationRetryCount; } /** * The URL of the webhook to call using the `configuration.method`. * * @param string $configurationUrl The URL of the webhook to call * @return $this Fluent Builder */ public function setConfigurationUrl($configurationUrl) { $this->options['configurationUrl'] = $configurationUrl; return $this; } /** * The HTTP method used to call `configuration.url`. Can be: `GET` or `POST` and the default is `POST`. * * @param string $configurationMethod The HTTP method used to call * `configuration.url` * @return $this Fluent Builder */ public function setConfigurationMethod($configurationMethod) { $this->options['configurationMethod'] = $configurationMethod; return $this; } /** * The events that cause us to call the Channel Webhook. Used when `type` is `webhook`. This parameter takes only one event. To specify more than one event, repeat this parameter for each event. For the list of possible events, see [Webhook Event Triggers](https://www.twilio.com/docs/chat/webhook-events#webhook-event-trigger). * * @param string $configurationFilters The events that cause us to call the * Channel Webhook * @return $this Fluent Builder */ public function setConfigurationFilters($configurationFilters) { $this->options['configurationFilters'] = $configurationFilters; return $this; } /** * A string that will cause us to call the webhook when it is present in a message body. This parameter takes only one trigger string. To specify more than one, repeat this parameter for each trigger string up to a total of 5 trigger strings. Used only when `type` = `trigger`. * * @param string $configurationTriggers A string that will cause us to call the * webhook when it is found in a message * body * @return $this Fluent Builder */ public function setConfigurationTriggers($configurationTriggers) { $this->options['configurationTriggers'] = $configurationTriggers; return $this; } /** * The SID of the Studio [Flow](https://www.twilio.com/docs/studio/rest-api/flow) to call when an event in `configuration.filters` occurs. Used only when `type` is `studio`. * * @param string $configurationFlowSid The SID of the Studio Flow to call when * an event occurs * @return $this Fluent Builder */ public function setConfigurationFlowSid($configurationFlowSid) { $this->options['configurationFlowSid'] = $configurationFlowSid; return $this; } /** * The number of times to retry the webhook if the first attempt fails. Can be an integer between 0 and 3, inclusive, and the default is 0. * * @param int $configurationRetryCount The number of times to retry the webhook * if the first attempt fails * @return $this Fluent Builder */ public function setConfigurationRetryCount($configurationRetryCount) { $this->options['configurationRetryCount'] = $configurationRetryCount; 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.IpMessaging.V2.CreateWebhookOptions ' . \implode(' ', $options) . ']'; } } class UpdateWebhookOptions extends Options { /** * @param string $configurationUrl The URL of the webhook to call * @param string $configurationMethod The HTTP method used to call * `configuration.url` * @param string $configurationFilters The events that cause us to call the * Channel Webhook * @param string $configurationTriggers A string that will cause us to call the * webhook when it is found in a message * body * @param string $configurationFlowSid The SID of the Studio Flow to call when * an event occurs * @param int $configurationRetryCount The number of times to retry the webhook * if the first attempt fails */ public function __construct($configurationUrl = Values::NONE, $configurationMethod = Values::NONE, $configurationFilters = Values::NONE, $configurationTriggers = Values::NONE, $configurationFlowSid = Values::NONE, $configurationRetryCount = Values::NONE) { $this->options['configurationUrl'] = $configurationUrl; $this->options['configurationMethod'] = $configurationMethod; $this->options['configurationFilters'] = $configurationFilters; $this->options['configurationTriggers'] = $configurationTriggers; $this->options['configurationFlowSid'] = $configurationFlowSid; $this->options['configurationRetryCount'] = $configurationRetryCount; } /** * The URL of the webhook to call using the `configuration.method`. * * @param string $configurationUrl The URL of the webhook to call * @return $this Fluent Builder */ public function setConfigurationUrl($configurationUrl) { $this->options['configurationUrl'] = $configurationUrl; return $this; } /** * The HTTP method used to call `configuration.url`. Can be: `GET` or `POST` and the default is `POST`. * * @param string $configurationMethod The HTTP method used to call * `configuration.url` * @return $this Fluent Builder */ public function setConfigurationMethod($configurationMethod) { $this->options['configurationMethod'] = $configurationMethod; return $this; } /** * The events that cause us to call the Channel Webhook. Used when `type` is `webhook`. This parameter takes only one event. To specify more than one event, repeat this parameter for each event. For the list of possible events, see [Webhook Event Triggers](https://www.twilio.com/docs/chat/webhook-events#webhook-event-trigger). * * @param string $configurationFilters The events that cause us to call the * Channel Webhook * @return $this Fluent Builder */ public function setConfigurationFilters($configurationFilters) { $this->options['configurationFilters'] = $configurationFilters; return $this; } /** * A string that will cause us to call the webhook when it is present in a message body. This parameter takes only one trigger string. To specify more than one, repeat this parameter for each trigger string up to a total of 5 trigger strings. Used only when `type` = `trigger`. * * @param string $configurationTriggers A string that will cause us to call the * webhook when it is found in a message * body * @return $this Fluent Builder */ public function setConfigurationTriggers($configurationTriggers) { $this->options['configurationTriggers'] = $configurationTriggers; return $this; } /** * The SID of the Studio [Flow](https://www.twilio.com/docs/studio/rest-api/flow) to call when an event in `configuration.filters` occurs. Used only when `type` = `studio`. * * @param string $configurationFlowSid The SID of the Studio Flow to call when * an event occurs * @return $this Fluent Builder */ public function setConfigurationFlowSid($configurationFlowSid) { $this->options['configurationFlowSid'] = $configurationFlowSid; return $this; } /** * The number of times to retry the webhook if the first attempt fails. Can be an integer between 0 and 3, inclusive, and the default is 0. * * @param int $configurationRetryCount The number of times to retry the webhook * if the first attempt fails * @return $this Fluent Builder */ public function setConfigurationRetryCount($configurationRetryCount) { $this->options['configurationRetryCount'] = $configurationRetryCount; 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.IpMessaging.V2.UpdateWebhookOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V2/Service/Channel/MemberOptions.php 0000644 00000036425 15002236443 0021252 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V2\Service\Channel; use Twilio\Options; use Twilio\Values; abstract class MemberOptions { /** * @param string $roleSid The SID of the Role to assign to the member * @param int $lastConsumedMessageIndex The index of the last Message in the * Channel the Member has read * @param \DateTime $lastConsumptionTimestamp The ISO 8601 based timestamp * string representing the datetime * of the last Message read event * for the member within the Channel * @param \DateTime $dateCreated The ISO 8601 date and time in GMT when the * resource was created * @param \DateTime $dateUpdated The ISO 8601 date and time in GMT when the * resource was updated * @param string $attributes A valid JSON string that contains * application-specific data * @return CreateMemberOptions Options builder */ public static function create($roleSid = Values::NONE, $lastConsumedMessageIndex = Values::NONE, $lastConsumptionTimestamp = Values::NONE, $dateCreated = Values::NONE, $dateUpdated = Values::NONE, $attributes = Values::NONE) { return new CreateMemberOptions($roleSid, $lastConsumedMessageIndex, $lastConsumptionTimestamp, $dateCreated, $dateUpdated, $attributes); } /** * @param string $identity The `identity` value of the resources to read * @return ReadMemberOptions Options builder */ public static function read($identity = Values::NONE) { return new ReadMemberOptions($identity); } /** * @param string $roleSid The SID of the Role to assign to the member * @param int $lastConsumedMessageIndex The index of the last consumed Message * for the Channel for the Member * @param \DateTime $lastConsumptionTimestamp The ISO 8601 based timestamp * string representing the datetime * of the last Message read event * for the Member within the Channel * @param \DateTime $dateCreated The ISO 8601 date and time in GMT when the * resource was created * @param \DateTime $dateUpdated The ISO 8601 date and time in GMT when the * resource was updated * @param string $attributes A valid JSON string that contains * application-specific data * @return UpdateMemberOptions Options builder */ public static function update($roleSid = Values::NONE, $lastConsumedMessageIndex = Values::NONE, $lastConsumptionTimestamp = Values::NONE, $dateCreated = Values::NONE, $dateUpdated = Values::NONE, $attributes = Values::NONE) { return new UpdateMemberOptions($roleSid, $lastConsumedMessageIndex, $lastConsumptionTimestamp, $dateCreated, $dateUpdated, $attributes); } } class CreateMemberOptions extends Options { /** * @param string $roleSid The SID of the Role to assign to the member * @param int $lastConsumedMessageIndex The index of the last Message in the * Channel the Member has read * @param \DateTime $lastConsumptionTimestamp The ISO 8601 based timestamp * string representing the datetime * of the last Message read event * for the member within the Channel * @param \DateTime $dateCreated The ISO 8601 date and time in GMT when the * resource was created * @param \DateTime $dateUpdated The ISO 8601 date and time in GMT when the * resource was updated * @param string $attributes A valid JSON string that contains * application-specific data */ public function __construct($roleSid = Values::NONE, $lastConsumedMessageIndex = Values::NONE, $lastConsumptionTimestamp = Values::NONE, $dateCreated = Values::NONE, $dateUpdated = Values::NONE, $attributes = Values::NONE) { $this->options['roleSid'] = $roleSid; $this->options['lastConsumedMessageIndex'] = $lastConsumedMessageIndex; $this->options['lastConsumptionTimestamp'] = $lastConsumptionTimestamp; $this->options['dateCreated'] = $dateCreated; $this->options['dateUpdated'] = $dateUpdated; $this->options['attributes'] = $attributes; } /** * The SID of the [Role](https://www.twilio.com/docs/chat/rest/role-resource) to assign to the member. The default roles are those specified on the [Service](https://www.twilio.com/docs/chat/rest/service-resource). * * @param string $roleSid The SID of the Role to assign to the member * @return $this Fluent Builder */ public function setRoleSid($roleSid) { $this->options['roleSid'] = $roleSid; return $this; } /** * The index of the last [Message](https://www.twilio.com/docs/chat/rest/message-resource) in the [Channel](https://www.twilio.com/docs/chat/channels) that the Member has read. This parameter should only be used when recreating a Member from a backup/separate source. * * @param int $lastConsumedMessageIndex The index of the last Message in the * Channel the Member has read * @return $this Fluent Builder */ public function setLastConsumedMessageIndex($lastConsumedMessageIndex) { $this->options['lastConsumedMessageIndex'] = $lastConsumedMessageIndex; return $this; } /** * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) timestamp of the last [Message](https://www.twilio.com/docs/chat/rest/message-resource) read event for the Member within the [Channel](https://www.twilio.com/docs/chat/channels). * * @param \DateTime $lastConsumptionTimestamp The ISO 8601 based timestamp * string representing the datetime * of the last Message read event * for the member within the Channel * @return $this Fluent Builder */ public function setLastConsumptionTimestamp($lastConsumptionTimestamp) { $this->options['lastConsumptionTimestamp'] = $lastConsumptionTimestamp; return $this; } /** * The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was created. The default value is the current time set by the Chat service. Note that this parameter should only be used when a Member is being recreated from a backup/separate source. * * @param \DateTime $dateCreated The ISO 8601 date and time in GMT when the * resource was created * @return $this Fluent Builder */ public function setDateCreated($dateCreated) { $this->options['dateCreated'] = $dateCreated; return $this; } /** * The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was last updated. The default value is `null`. Note that this parameter should only be used when a Member is being recreated from a backup/separate source and where a Member was previously updated. * * @param \DateTime $dateUpdated The ISO 8601 date and time in GMT when the * resource was updated * @return $this Fluent Builder */ public function setDateUpdated($dateUpdated) { $this->options['dateUpdated'] = $dateUpdated; return $this; } /** * A valid JSON string that contains application-specific data. * * @param string $attributes A valid JSON string that contains * application-specific data * @return $this Fluent Builder */ public function setAttributes($attributes) { $this->options['attributes'] = $attributes; 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.IpMessaging.V2.CreateMemberOptions ' . \implode(' ', $options) . ']'; } } class ReadMemberOptions extends Options { /** * @param string $identity The `identity` value of the resources to read */ public function __construct($identity = Values::NONE) { $this->options['identity'] = $identity; } /** * The [User](https://www.twilio.com/docs/chat/rest/user-resource)'s `identity` value of the Member resources to read. See [access tokens](https://www.twilio.com/docs/chat/create-tokens) for more details. * * @param string $identity The `identity` value of the resources to read * @return $this Fluent Builder */ public function setIdentity($identity) { $this->options['identity'] = $identity; 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.IpMessaging.V2.ReadMemberOptions ' . \implode(' ', $options) . ']'; } } class UpdateMemberOptions extends Options { /** * @param string $roleSid The SID of the Role to assign to the member * @param int $lastConsumedMessageIndex The index of the last consumed Message * for the Channel for the Member * @param \DateTime $lastConsumptionTimestamp The ISO 8601 based timestamp * string representing the datetime * of the last Message read event * for the Member within the Channel * @param \DateTime $dateCreated The ISO 8601 date and time in GMT when the * resource was created * @param \DateTime $dateUpdated The ISO 8601 date and time in GMT when the * resource was updated * @param string $attributes A valid JSON string that contains * application-specific data */ public function __construct($roleSid = Values::NONE, $lastConsumedMessageIndex = Values::NONE, $lastConsumptionTimestamp = Values::NONE, $dateCreated = Values::NONE, $dateUpdated = Values::NONE, $attributes = Values::NONE) { $this->options['roleSid'] = $roleSid; $this->options['lastConsumedMessageIndex'] = $lastConsumedMessageIndex; $this->options['lastConsumptionTimestamp'] = $lastConsumptionTimestamp; $this->options['dateCreated'] = $dateCreated; $this->options['dateUpdated'] = $dateUpdated; $this->options['attributes'] = $attributes; } /** * The SID of the [Role](https://www.twilio.com/docs/chat/rest/role-resource) to assign to the member. The default roles are those specified on the [Service](https://www.twilio.com/docs/chat/rest/service-resource). * * @param string $roleSid The SID of the Role to assign to the member * @return $this Fluent Builder */ public function setRoleSid($roleSid) { $this->options['roleSid'] = $roleSid; return $this; } /** * The index of the last [Message](https://www.twilio.com/docs/chat/rest/message-resource) that the Member has read within the [Channel](https://www.twilio.com/docs/chat/channels). * * @param int $lastConsumedMessageIndex The index of the last consumed Message * for the Channel for the Member * @return $this Fluent Builder */ public function setLastConsumedMessageIndex($lastConsumedMessageIndex) { $this->options['lastConsumedMessageIndex'] = $lastConsumedMessageIndex; return $this; } /** * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) timestamp of the last [Message](https://www.twilio.com/docs/chat/rest/message-resource) read event for the Member within the [Channel](https://www.twilio.com/docs/chat/channels). * * @param \DateTime $lastConsumptionTimestamp The ISO 8601 based timestamp * string representing the datetime * of the last Message read event * for the Member within the Channel * @return $this Fluent Builder */ public function setLastConsumptionTimestamp($lastConsumptionTimestamp) { $this->options['lastConsumptionTimestamp'] = $lastConsumptionTimestamp; return $this; } /** * The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was created. The default value is the current time set by the Chat service. Note that this parameter should only be used when a Member is being recreated from a backup/separate source. * * @param \DateTime $dateCreated The ISO 8601 date and time in GMT when the * resource was created * @return $this Fluent Builder */ public function setDateCreated($dateCreated) { $this->options['dateCreated'] = $dateCreated; return $this; } /** * The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was last updated. * * @param \DateTime $dateUpdated The ISO 8601 date and time in GMT when the * resource was updated * @return $this Fluent Builder */ public function setDateUpdated($dateUpdated) { $this->options['dateUpdated'] = $dateUpdated; return $this; } /** * A valid JSON string that contains application-specific data. * * @param string $attributes A valid JSON string that contains * application-specific data * @return $this Fluent Builder */ public function setAttributes($attributes) { $this->options['attributes'] = $attributes; 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.IpMessaging.V2.UpdateMemberOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V2/Service/Channel/MemberContext.php 0000644 00000007044 15002236443 0021236 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V2\Service\Channel; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class MemberContext extends InstanceContext { /** * Initialize the MemberContext * * @param \Twilio\Version $version Version that contains the resource * @param string $serviceSid The SID of the Service to fetch the resource from * @param string $channelSid The SID of the channel the member belongs to * @param string $sid The SID of the Member resource to fetch * @return \Twilio\Rest\IpMessaging\V2\Service\Channel\MemberContext */ public function __construct(Version $version, $serviceSid, $channelSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, 'channelSid' => $channelSid, 'sid' => $sid, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Channels/' . \rawurlencode($channelSid) . '/Members/' . \rawurlencode($sid) . ''; } /** * Fetch a MemberInstance * * @return MemberInstance Fetched MemberInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new MemberInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid'], $this->solution['sid'] ); } /** * Deletes the MemberInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Update the MemberInstance * * @param array|Options $options Optional Arguments * @return MemberInstance Updated MemberInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { $options = new Values($options); $data = Values::of(array( 'RoleSid' => $options['roleSid'], 'LastConsumedMessageIndex' => $options['lastConsumedMessageIndex'], 'LastConsumptionTimestamp' => Serialize::iso8601DateTime($options['lastConsumptionTimestamp']), 'DateCreated' => Serialize::iso8601DateTime($options['dateCreated']), 'DateUpdated' => Serialize::iso8601DateTime($options['dateUpdated']), 'Attributes' => $options['attributes'], )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new MemberInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.IpMessaging.V2.MemberContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V2/Service/Channel/MessageList.php 0000644 00000015243 15002236443 0020702 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V2\Service\Channel; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class MessageList extends ListResource { /** * Construct the MessageList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Service that the resource is * associated with * @param string $channelSid The SID of the Channel the Message resource * belongs to * @return \Twilio\Rest\IpMessaging\V2\Service\Channel\MessageList */ public function __construct(Version $version, $serviceSid, $channelSid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, 'channelSid' => $channelSid, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Channels/' . \rawurlencode($channelSid) . '/Messages'; } /** * Create a new MessageInstance * * @param array|Options $options Optional Arguments * @return MessageInstance Newly created MessageInstance * @throws TwilioException When an HTTP error occurs. */ public function create($options = array()) { $options = new Values($options); $data = Values::of(array( 'From' => $options['from'], 'Attributes' => $options['attributes'], 'DateCreated' => Serialize::iso8601DateTime($options['dateCreated']), 'DateUpdated' => Serialize::iso8601DateTime($options['dateUpdated']), 'LastUpdatedBy' => $options['lastUpdatedBy'], 'Body' => $options['body'], 'MediaSid' => $options['mediaSid'], )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new MessageInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid'] ); } /** * Streams MessageInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($options = array(), $limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads MessageInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return MessageInstance[] Array of results */ public function read($options = array(), $limit = null, $pageSize = null) { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Retrieve a single page of MessageInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of MessageInstance */ public function page($options = array(), $pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $options = new Values($options); $params = Values::of(array( 'Order' => $options['order'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new MessagePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of MessageInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of MessageInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new MessagePage($this->version, $response, $this->solution); } /** * Constructs a MessageContext * * @param string $sid The SID of the Message resource to fetch * @return \Twilio\Rest\IpMessaging\V2\Service\Channel\MessageContext */ public function getContext($sid) { return new MessageContext( $this->version, $this->solution['serviceSid'], $this->solution['channelSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.IpMessaging.V2.MessageList]'; } } sdk/src/Twilio/Rest/IpMessaging/V2/Service/Channel/MessageInstance.php 0000644 00000012610 15002236443 0021526 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V2\Service\Channel; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $accountSid * @property string $attributes * @property string $serviceSid * @property string $to * @property string $channelSid * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $lastUpdatedBy * @property bool $wasEdited * @property string $from * @property string $body * @property int $index * @property string $type * @property array $media * @property string $url */ class MessageInstance extends InstanceResource { /** * Initialize the MessageInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the Service that the resource is * associated with * @param string $channelSid The SID of the Channel the Message resource * belongs to * @param string $sid The SID of the Message resource to fetch * @return \Twilio\Rest\IpMessaging\V2\Service\Channel\MessageInstance */ public function __construct(Version $version, array $payload, $serviceSid, $channelSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'attributes' => Values::array_get($payload, 'attributes'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'to' => Values::array_get($payload, 'to'), 'channelSid' => Values::array_get($payload, 'channel_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'lastUpdatedBy' => Values::array_get($payload, 'last_updated_by'), 'wasEdited' => Values::array_get($payload, 'was_edited'), 'from' => Values::array_get($payload, 'from'), 'body' => Values::array_get($payload, 'body'), 'index' => Values::array_get($payload, 'index'), 'type' => Values::array_get($payload, 'type'), 'media' => Values::array_get($payload, 'media'), 'url' => Values::array_get($payload, 'url'), ); $this->solution = array( 'serviceSid' => $serviceSid, 'channelSid' => $channelSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\IpMessaging\V2\Service\Channel\MessageContext Context * for this * MessageInstance */ protected function proxy() { if (!$this->context) { $this->context = new MessageContext( $this->version, $this->solution['serviceSid'], $this->solution['channelSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch a MessageInstance * * @return MessageInstance Fetched MessageInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the MessageInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Update the MessageInstance * * @param array|Options $options Optional Arguments * @return MessageInstance Updated MessageInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.IpMessaging.V2.MessageInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V2/Service/Channel/WebhookPage.php 0000644 00000001540 15002236443 0020650 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V2\Service\Channel; use Twilio\Page; class WebhookPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new WebhookInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.IpMessaging.V2.WebhookPage]'; } } sdk/src/Twilio/Rest/IpMessaging/V2/Service/Channel/MemberList.php 0000644 00000015551 15002236443 0020527 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V2\Service\Channel; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class MemberList extends ListResource { /** * Construct the MemberList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Service that the resource is * associated with * @param string $channelSid The SID of the Channel for the member * @return \Twilio\Rest\IpMessaging\V2\Service\Channel\MemberList */ public function __construct(Version $version, $serviceSid, $channelSid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, 'channelSid' => $channelSid, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Channels/' . \rawurlencode($channelSid) . '/Members'; } /** * Create a new MemberInstance * * @param string $identity The `identity` value that identifies the new * resource's User * @param array|Options $options Optional Arguments * @return MemberInstance Newly created MemberInstance * @throws TwilioException When an HTTP error occurs. */ public function create($identity, $options = array()) { $options = new Values($options); $data = Values::of(array( 'Identity' => $identity, 'RoleSid' => $options['roleSid'], 'LastConsumedMessageIndex' => $options['lastConsumedMessageIndex'], 'LastConsumptionTimestamp' => Serialize::iso8601DateTime($options['lastConsumptionTimestamp']), 'DateCreated' => Serialize::iso8601DateTime($options['dateCreated']), 'DateUpdated' => Serialize::iso8601DateTime($options['dateUpdated']), 'Attributes' => $options['attributes'], )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new MemberInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid'] ); } /** * Streams MemberInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($options = array(), $limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads MemberInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return MemberInstance[] Array of results */ public function read($options = array(), $limit = null, $pageSize = null) { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Retrieve a single page of MemberInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of MemberInstance */ public function page($options = array(), $pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $options = new Values($options); $params = Values::of(array( 'Identity' => Serialize::map($options['identity'], function($e) { return $e; }), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new MemberPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of MemberInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of MemberInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new MemberPage($this->version, $response, $this->solution); } /** * Constructs a MemberContext * * @param string $sid The SID of the Member resource to fetch * @return \Twilio\Rest\IpMessaging\V2\Service\Channel\MemberContext */ public function getContext($sid) { return new MemberContext( $this->version, $this->solution['serviceSid'], $this->solution['channelSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.IpMessaging.V2.MemberList]'; } } sdk/src/Twilio/Rest/IpMessaging/V2/Service/Channel/InviteContext.php 0000644 00000004621 15002236443 0021263 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V2\Service\Channel; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; class InviteContext extends InstanceContext { /** * Initialize the InviteContext * * @param \Twilio\Version $version Version that contains the resource * @param string $serviceSid The SID of the Service to fetch the resource from * @param string $channelSid The SID of the Channel the resource to fetch * belongs to * @param string $sid The SID of the Invite resource to fetch * @return \Twilio\Rest\IpMessaging\V2\Service\Channel\InviteContext */ public function __construct(Version $version, $serviceSid, $channelSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, 'channelSid' => $channelSid, 'sid' => $sid, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Channels/' . \rawurlencode($channelSid) . '/Invites/' . \rawurlencode($sid) . ''; } /** * Fetch a InviteInstance * * @return InviteInstance Fetched InviteInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new InviteInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid'], $this->solution['sid'] ); } /** * Deletes the InviteInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.IpMessaging.V2.InviteContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V2/Service/Channel/MemberPage.php 0000644 00000001535 15002236443 0020465 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V2\Service\Channel; use Twilio\Page; class MemberPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new MemberInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.IpMessaging.V2.MemberPage]'; } } sdk/src/Twilio/Rest/IpMessaging/V2/Service/Channel/WebhookList.php 0000644 00000015107 15002236443 0020713 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V2\Service\Channel; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class WebhookList extends ListResource { /** * Construct the WebhookList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Service that the Channel Webhook * resource is associated with * @param string $channelSid The SID of the Channel the Channel Webhook * resource belongs to * @return \Twilio\Rest\IpMessaging\V2\Service\Channel\WebhookList */ public function __construct(Version $version, $serviceSid, $channelSid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, 'channelSid' => $channelSid, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Channels/' . \rawurlencode($channelSid) . '/Webhooks'; } /** * Streams WebhookInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads WebhookInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return WebhookInstance[] Array of results */ public function read($limit = null, $pageSize = null) { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of WebhookInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of WebhookInstance */ public function page($pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $params = Values::of(array( 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new WebhookPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of WebhookInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of WebhookInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new WebhookPage($this->version, $response, $this->solution); } /** * Create a new WebhookInstance * * @param string $type The type of webhook * @param array|Options $options Optional Arguments * @return WebhookInstance Newly created WebhookInstance * @throws TwilioException When an HTTP error occurs. */ public function create($type, $options = array()) { $options = new Values($options); $data = Values::of(array( 'Type' => $type, 'Configuration.Url' => $options['configurationUrl'], 'Configuration.Method' => $options['configurationMethod'], 'Configuration.Filters' => Serialize::map($options['configurationFilters'], function($e) { return $e; }), 'Configuration.Triggers' => Serialize::map($options['configurationTriggers'], function($e) { return $e; }), 'Configuration.FlowSid' => $options['configurationFlowSid'], 'Configuration.RetryCount' => $options['configurationRetryCount'], )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new WebhookInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid'] ); } /** * Constructs a WebhookContext * * @param string $sid The SID of the Channel Webhook resource to fetch * @return \Twilio\Rest\IpMessaging\V2\Service\Channel\WebhookContext */ public function getContext($sid) { return new WebhookContext( $this->version, $this->solution['serviceSid'], $this->solution['channelSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.IpMessaging.V2.WebhookList]'; } } sdk/src/Twilio/Rest/IpMessaging/V2/Service/Channel/InviteList.php 0000644 00000014701 15002236443 0020552 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V2\Service\Channel; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class InviteList extends ListResource { /** * Construct the InviteList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Service that the resource is * associated with * @param string $channelSid The SID of the Channel the new resource belongs to * @return \Twilio\Rest\IpMessaging\V2\Service\Channel\InviteList */ public function __construct(Version $version, $serviceSid, $channelSid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, 'channelSid' => $channelSid, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Channels/' . \rawurlencode($channelSid) . '/Invites'; } /** * Create a new InviteInstance * * @param string $identity The `identity` value that identifies the new * resource's User * @param array|Options $options Optional Arguments * @return InviteInstance Newly created InviteInstance * @throws TwilioException When an HTTP error occurs. */ public function create($identity, $options = array()) { $options = new Values($options); $data = Values::of(array('Identity' => $identity, 'RoleSid' => $options['roleSid'], )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new InviteInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid'] ); } /** * Streams InviteInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($options = array(), $limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads InviteInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return InviteInstance[] Array of results */ public function read($options = array(), $limit = null, $pageSize = null) { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Retrieve a single page of InviteInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of InviteInstance */ public function page($options = array(), $pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $options = new Values($options); $params = Values::of(array( 'Identity' => Serialize::map($options['identity'], function($e) { return $e; }), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new InvitePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of InviteInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of InviteInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new InvitePage($this->version, $response, $this->solution); } /** * Constructs a InviteContext * * @param string $sid The SID of the Invite resource to fetch * @return \Twilio\Rest\IpMessaging\V2\Service\Channel\InviteContext */ public function getContext($sid) { return new InviteContext( $this->version, $this->solution['serviceSid'], $this->solution['channelSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.IpMessaging.V2.InviteList]'; } } sdk/src/Twilio/Rest/IpMessaging/V2/Service/Channel/MessagePage.php 0000644 00000001540 15002236443 0020636 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V2\Service\Channel; use Twilio\Page; class MessagePage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new MessageInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.IpMessaging.V2.MessagePage]'; } } sdk/src/Twilio/Rest/IpMessaging/V2/Service/Channel/WebhookContext.php 0000644 00000007355 15002236443 0021432 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V2\Service\Channel; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class WebhookContext extends InstanceContext { /** * Initialize the WebhookContext * * @param \Twilio\Version $version Version that contains the resource * @param string $serviceSid The SID of the Service with the Channel to fetch * the Webhook resource from * @param string $channelSid The SID of the Channel the resource to fetch * belongs to * @param string $sid The SID of the Channel Webhook resource to fetch * @return \Twilio\Rest\IpMessaging\V2\Service\Channel\WebhookContext */ public function __construct(Version $version, $serviceSid, $channelSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, 'channelSid' => $channelSid, 'sid' => $sid, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Channels/' . \rawurlencode($channelSid) . '/Webhooks/' . \rawurlencode($sid) . ''; } /** * Fetch a WebhookInstance * * @return WebhookInstance Fetched WebhookInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new WebhookInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid'], $this->solution['sid'] ); } /** * Update the WebhookInstance * * @param array|Options $options Optional Arguments * @return WebhookInstance Updated WebhookInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { $options = new Values($options); $data = Values::of(array( 'Configuration.Url' => $options['configurationUrl'], 'Configuration.Method' => $options['configurationMethod'], 'Configuration.Filters' => Serialize::map($options['configurationFilters'], function($e) { return $e; }), 'Configuration.Triggers' => Serialize::map($options['configurationTriggers'], function($e) { return $e; }), 'Configuration.FlowSid' => $options['configurationFlowSid'], 'Configuration.RetryCount' => $options['configurationRetryCount'], )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new WebhookInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid'], $this->solution['sid'] ); } /** * Deletes the WebhookInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.IpMessaging.V2.WebhookContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V2/Service/Channel/InvitePage.php 0000644 00000001535 15002236443 0020514 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V2\Service\Channel; use Twilio\Page; class InvitePage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new InviteInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.IpMessaging.V2.InvitePage]'; } } sdk/src/Twilio/Rest/IpMessaging/V2/Service/Channel/InviteOptions.php 0000644 00000005601 15002236443 0021271 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V2\Service\Channel; use Twilio\Options; use Twilio\Values; abstract class InviteOptions { /** * @param string $roleSid The Role assigned to the new member * @return CreateInviteOptions Options builder */ public static function create($roleSid = Values::NONE) { return new CreateInviteOptions($roleSid); } /** * @param string $identity The `identity` value of the resources to read * @return ReadInviteOptions Options builder */ public static function read($identity = Values::NONE) { return new ReadInviteOptions($identity); } } class CreateInviteOptions extends Options { /** * @param string $roleSid The Role assigned to the new member */ public function __construct($roleSid = Values::NONE) { $this->options['roleSid'] = $roleSid; } /** * The SID of the [Role](https://www.twilio.com/docs/chat/rest/role-resource) assigned to the new member. * * @param string $roleSid The Role assigned to the new member * @return $this Fluent Builder */ public function setRoleSid($roleSid) { $this->options['roleSid'] = $roleSid; 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.IpMessaging.V2.CreateInviteOptions ' . \implode(' ', $options) . ']'; } } class ReadInviteOptions extends Options { /** * @param string $identity The `identity` value of the resources to read */ public function __construct($identity = Values::NONE) { $this->options['identity'] = $identity; } /** * The [User](https://www.twilio.com/docs/chat/rest/user-resource)'s `identity` value of the resources to read. See [access tokens](https://www.twilio.com/docs/chat/create-tokens) for more details. * * @param string $identity The `identity` value of the resources to read * @return $this Fluent Builder */ public function setIdentity($identity) { $this->options['identity'] = $identity; 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.IpMessaging.V2.ReadInviteOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V2/Service/Channel/InviteInstance.php 0000644 00000010745 15002236443 0021407 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V2\Service\Channel; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $accountSid * @property string $channelSid * @property string $serviceSid * @property string $identity * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $roleSid * @property string $createdBy * @property string $url */ class InviteInstance extends InstanceResource { /** * Initialize the InviteInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the Service that the resource is * associated with * @param string $channelSid The SID of the Channel the new resource belongs to * @param string $sid The SID of the Invite resource to fetch * @return \Twilio\Rest\IpMessaging\V2\Service\Channel\InviteInstance */ public function __construct(Version $version, array $payload, $serviceSid, $channelSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'channelSid' => Values::array_get($payload, 'channel_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'identity' => Values::array_get($payload, 'identity'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'roleSid' => Values::array_get($payload, 'role_sid'), 'createdBy' => Values::array_get($payload, 'created_by'), 'url' => Values::array_get($payload, 'url'), ); $this->solution = array( 'serviceSid' => $serviceSid, 'channelSid' => $channelSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\IpMessaging\V2\Service\Channel\InviteContext Context * for this * InviteInstance */ protected function proxy() { if (!$this->context) { $this->context = new InviteContext( $this->version, $this->solution['serviceSid'], $this->solution['channelSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch a InviteInstance * * @return InviteInstance Fetched InviteInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the InviteInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.IpMessaging.V2.InviteInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V2/Service/Channel/MessageOptions.php 0000644 00000031357 15002236443 0021426 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V2\Service\Channel; use Twilio\Options; use Twilio\Values; abstract class MessageOptions { /** * @param string $from The Identity of the new message's author * @param string $attributes A valid JSON string that contains * application-specific data * @param \DateTime $dateCreated The ISO 8601 date and time in GMT when the * resource was created * @param \DateTime $dateUpdated The ISO 8601 date and time in GMT when the * resource was updated * @param string $lastUpdatedBy The Identity of the User who last updated the * Message * @param string $body The message to send to the channel * @param string $mediaSid The Media Sid to be attached to the new Message * @return CreateMessageOptions Options builder */ public static function create($from = Values::NONE, $attributes = Values::NONE, $dateCreated = Values::NONE, $dateUpdated = Values::NONE, $lastUpdatedBy = Values::NONE, $body = Values::NONE, $mediaSid = Values::NONE) { return new CreateMessageOptions($from, $attributes, $dateCreated, $dateUpdated, $lastUpdatedBy, $body, $mediaSid); } /** * @param string $order The sort order of the returned messages * @return ReadMessageOptions Options builder */ public static function read($order = Values::NONE) { return new ReadMessageOptions($order); } /** * @param string $body The message to send to the channel * @param string $attributes A valid JSON string that contains * application-specific data * @param \DateTime $dateCreated The ISO 8601 date and time in GMT when the * resource was created * @param \DateTime $dateUpdated The ISO 8601 date and time in GMT when the * resource was updated * @param string $lastUpdatedBy The Identity of the User who last updated the * Message, if applicable * @param string $from The Identity of the message's author * @return UpdateMessageOptions Options builder */ public static function update($body = Values::NONE, $attributes = Values::NONE, $dateCreated = Values::NONE, $dateUpdated = Values::NONE, $lastUpdatedBy = Values::NONE, $from = Values::NONE) { return new UpdateMessageOptions($body, $attributes, $dateCreated, $dateUpdated, $lastUpdatedBy, $from); } } class CreateMessageOptions extends Options { /** * @param string $from The Identity of the new message's author * @param string $attributes A valid JSON string that contains * application-specific data * @param \DateTime $dateCreated The ISO 8601 date and time in GMT when the * resource was created * @param \DateTime $dateUpdated The ISO 8601 date and time in GMT when the * resource was updated * @param string $lastUpdatedBy The Identity of the User who last updated the * Message * @param string $body The message to send to the channel * @param string $mediaSid The Media Sid to be attached to the new Message */ public function __construct($from = Values::NONE, $attributes = Values::NONE, $dateCreated = Values::NONE, $dateUpdated = Values::NONE, $lastUpdatedBy = Values::NONE, $body = Values::NONE, $mediaSid = Values::NONE) { $this->options['from'] = $from; $this->options['attributes'] = $attributes; $this->options['dateCreated'] = $dateCreated; $this->options['dateUpdated'] = $dateUpdated; $this->options['lastUpdatedBy'] = $lastUpdatedBy; $this->options['body'] = $body; $this->options['mediaSid'] = $mediaSid; } /** * The [Identity](https://www.twilio.com/docs/chat/identity) of the new message's author. The default value is `system`. * * @param string $from The Identity of the new message's author * @return $this Fluent Builder */ public function setFrom($from) { $this->options['from'] = $from; return $this; } /** * A valid JSON string that contains application-specific data. * * @param string $attributes A valid JSON string that contains * application-specific data * @return $this Fluent Builder */ public function setAttributes($attributes) { $this->options['attributes'] = $attributes; return $this; } /** * The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was created. The default value is the current time set by the Chat service. This parameter should only be used when a Chat's history is being recreated from a backup/separate source. * * @param \DateTime $dateCreated The ISO 8601 date and time in GMT when the * resource was created * @return $this Fluent Builder */ public function setDateCreated($dateCreated) { $this->options['dateCreated'] = $dateCreated; return $this; } /** * The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was last updated. * * @param \DateTime $dateUpdated The ISO 8601 date and time in GMT when the * resource was updated * @return $this Fluent Builder */ public function setDateUpdated($dateUpdated) { $this->options['dateUpdated'] = $dateUpdated; return $this; } /** * The [Identity](https://www.twilio.com/docs/chat/identity) of the User who last updated the Message, if applicable. * * @param string $lastUpdatedBy The Identity of the User who last updated the * Message * @return $this Fluent Builder */ public function setLastUpdatedBy($lastUpdatedBy) { $this->options['lastUpdatedBy'] = $lastUpdatedBy; return $this; } /** * The message to send to the channel. Can be an empty string or `null`, which sets the value as an empty string. You can send structured data in the body by serializing it as a string. * * @param string $body The message to send to the channel * @return $this Fluent Builder */ public function setBody($body) { $this->options['body'] = $body; return $this; } /** * The SID of the [Media](https://www.twilio.com/docs/chat/rest/media) to attach to the new Message. * * @param string $mediaSid The Media Sid to be attached to the new Message * @return $this Fluent Builder */ public function setMediaSid($mediaSid) { $this->options['mediaSid'] = $mediaSid; 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.IpMessaging.V2.CreateMessageOptions ' . \implode(' ', $options) . ']'; } } class ReadMessageOptions extends Options { /** * @param string $order The sort order of the returned messages */ public function __construct($order = Values::NONE) { $this->options['order'] = $order; } /** * The sort order of the returned messages. Can be: `asc` (ascending) or `desc` (descending) with `asc` as the default. * * @param string $order The sort order of the returned messages * @return $this Fluent Builder */ public function setOrder($order) { $this->options['order'] = $order; 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.IpMessaging.V2.ReadMessageOptions ' . \implode(' ', $options) . ']'; } } class UpdateMessageOptions extends Options { /** * @param string $body The message to send to the channel * @param string $attributes A valid JSON string that contains * application-specific data * @param \DateTime $dateCreated The ISO 8601 date and time in GMT when the * resource was created * @param \DateTime $dateUpdated The ISO 8601 date and time in GMT when the * resource was updated * @param string $lastUpdatedBy The Identity of the User who last updated the * Message, if applicable * @param string $from The Identity of the message's author */ public function __construct($body = Values::NONE, $attributes = Values::NONE, $dateCreated = Values::NONE, $dateUpdated = Values::NONE, $lastUpdatedBy = Values::NONE, $from = Values::NONE) { $this->options['body'] = $body; $this->options['attributes'] = $attributes; $this->options['dateCreated'] = $dateCreated; $this->options['dateUpdated'] = $dateUpdated; $this->options['lastUpdatedBy'] = $lastUpdatedBy; $this->options['from'] = $from; } /** * The message to send to the channel. Can be an empty string or `null`, which sets the value as an empty string. You can send structured data in the body by serializing it as a string. * * @param string $body The message to send to the channel * @return $this Fluent Builder */ public function setBody($body) { $this->options['body'] = $body; return $this; } /** * A valid JSON string that contains application-specific data. * * @param string $attributes A valid JSON string that contains * application-specific data * @return $this Fluent Builder */ public function setAttributes($attributes) { $this->options['attributes'] = $attributes; return $this; } /** * The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was created. The default value is the current time set by the Chat service. This parameter should only be used when a Chat's history is being recreated from a backup/separate source. * * @param \DateTime $dateCreated The ISO 8601 date and time in GMT when the * resource was created * @return $this Fluent Builder */ public function setDateCreated($dateCreated) { $this->options['dateCreated'] = $dateCreated; return $this; } /** * The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was last updated. * * @param \DateTime $dateUpdated The ISO 8601 date and time in GMT when the * resource was updated * @return $this Fluent Builder */ public function setDateUpdated($dateUpdated) { $this->options['dateUpdated'] = $dateUpdated; return $this; } /** * The [Identity](https://www.twilio.com/docs/chat/identity) of the User who last updated the Message, if applicable. * * @param string $lastUpdatedBy The Identity of the User who last updated the * Message, if applicable * @return $this Fluent Builder */ public function setLastUpdatedBy($lastUpdatedBy) { $this->options['lastUpdatedBy'] = $lastUpdatedBy; return $this; } /** * The [Identity](https://www.twilio.com/docs/chat/identity) of the message's author. * * @param string $from The Identity of the message's author * @return $this Fluent Builder */ public function setFrom($from) { $this->options['from'] = $from; 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.IpMessaging.V2.UpdateMessageOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V2/Service/Channel/MemberInstance.php 0000644 00000012164 15002236443 0021355 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V2\Service\Channel; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $accountSid * @property string $channelSid * @property string $serviceSid * @property string $identity * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $roleSid * @property int $lastConsumedMessageIndex * @property \DateTime $lastConsumptionTimestamp * @property string $url * @property string $attributes */ class MemberInstance extends InstanceResource { /** * Initialize the MemberInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the Service that the resource is * associated with * @param string $channelSid The SID of the Channel for the member * @param string $sid The SID of the Member resource to fetch * @return \Twilio\Rest\IpMessaging\V2\Service\Channel\MemberInstance */ public function __construct(Version $version, array $payload, $serviceSid, $channelSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'channelSid' => Values::array_get($payload, 'channel_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'identity' => Values::array_get($payload, 'identity'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'roleSid' => Values::array_get($payload, 'role_sid'), 'lastConsumedMessageIndex' => Values::array_get($payload, 'last_consumed_message_index'), 'lastConsumptionTimestamp' => Deserialize::dateTime(Values::array_get($payload, 'last_consumption_timestamp')), 'url' => Values::array_get($payload, 'url'), 'attributes' => Values::array_get($payload, 'attributes'), ); $this->solution = array( 'serviceSid' => $serviceSid, 'channelSid' => $channelSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\IpMessaging\V2\Service\Channel\MemberContext Context * for this * MemberInstance */ protected function proxy() { if (!$this->context) { $this->context = new MemberContext( $this->version, $this->solution['serviceSid'], $this->solution['channelSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch a MemberInstance * * @return MemberInstance Fetched MemberInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the MemberInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Update the MemberInstance * * @param array|Options $options Optional Arguments * @return MemberInstance Updated MemberInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.IpMessaging.V2.MemberInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/IpMessaging/V2/ServiceContext.php 0000644 00000021014 15002236443 0016450 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V2; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Rest\IpMessaging\V2\Service\BindingList; use Twilio\Rest\IpMessaging\V2\Service\ChannelList; use Twilio\Rest\IpMessaging\V2\Service\RoleList; use Twilio\Rest\IpMessaging\V2\Service\UserList; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * @property \Twilio\Rest\IpMessaging\V2\Service\ChannelList $channels * @property \Twilio\Rest\IpMessaging\V2\Service\RoleList $roles * @property \Twilio\Rest\IpMessaging\V2\Service\UserList $users * @property \Twilio\Rest\IpMessaging\V2\Service\BindingList $bindings * @method \Twilio\Rest\IpMessaging\V2\Service\ChannelContext channels(string $sid) * @method \Twilio\Rest\IpMessaging\V2\Service\RoleContext roles(string $sid) * @method \Twilio\Rest\IpMessaging\V2\Service\UserContext users(string $sid) * @method \Twilio\Rest\IpMessaging\V2\Service\BindingContext bindings(string $sid) */ class ServiceContext extends InstanceContext { protected $_channels = null; protected $_roles = null; protected $_users = null; protected $_bindings = null; /** * Initialize the ServiceContext * * @param \Twilio\Version $version Version that contains the resource * @param string $sid The SID of the Service resource to fetch * @return \Twilio\Rest\IpMessaging\V2\ServiceContext */ public function __construct(Version $version, $sid) { parent::__construct($version); // Path Solution $this->solution = array('sid' => $sid, ); $this->uri = '/Services/' . \rawurlencode($sid) . ''; } /** * Fetch a ServiceInstance * * @return ServiceInstance Fetched ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new ServiceInstance($this->version, $payload, $this->solution['sid']); } /** * Deletes the ServiceInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Update the ServiceInstance * * @param array|Options $options Optional Arguments * @return ServiceInstance Updated ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { $options = new Values($options); $data = Values::of(array( 'FriendlyName' => $options['friendlyName'], 'DefaultServiceRoleSid' => $options['defaultServiceRoleSid'], 'DefaultChannelRoleSid' => $options['defaultChannelRoleSid'], 'DefaultChannelCreatorRoleSid' => $options['defaultChannelCreatorRoleSid'], 'ReadStatusEnabled' => Serialize::booleanToString($options['readStatusEnabled']), 'ReachabilityEnabled' => Serialize::booleanToString($options['reachabilityEnabled']), 'TypingIndicatorTimeout' => $options['typingIndicatorTimeout'], 'ConsumptionReportInterval' => $options['consumptionReportInterval'], 'Notifications.NewMessage.Enabled' => Serialize::booleanToString($options['notificationsNewMessageEnabled']), 'Notifications.NewMessage.Template' => $options['notificationsNewMessageTemplate'], 'Notifications.NewMessage.Sound' => $options['notificationsNewMessageSound'], 'Notifications.NewMessage.BadgeCountEnabled' => Serialize::booleanToString($options['notificationsNewMessageBadgeCountEnabled']), 'Notifications.AddedToChannel.Enabled' => Serialize::booleanToString($options['notificationsAddedToChannelEnabled']), 'Notifications.AddedToChannel.Template' => $options['notificationsAddedToChannelTemplate'], 'Notifications.AddedToChannel.Sound' => $options['notificationsAddedToChannelSound'], 'Notifications.RemovedFromChannel.Enabled' => Serialize::booleanToString($options['notificationsRemovedFromChannelEnabled']), 'Notifications.RemovedFromChannel.Template' => $options['notificationsRemovedFromChannelTemplate'], 'Notifications.RemovedFromChannel.Sound' => $options['notificationsRemovedFromChannelSound'], 'Notifications.InvitedToChannel.Enabled' => Serialize::booleanToString($options['notificationsInvitedToChannelEnabled']), 'Notifications.InvitedToChannel.Template' => $options['notificationsInvitedToChannelTemplate'], 'Notifications.InvitedToChannel.Sound' => $options['notificationsInvitedToChannelSound'], 'PreWebhookUrl' => $options['preWebhookUrl'], 'PostWebhookUrl' => $options['postWebhookUrl'], 'WebhookMethod' => $options['webhookMethod'], 'WebhookFilters' => Serialize::map($options['webhookFilters'], function($e) { return $e; }), 'Limits.ChannelMembers' => $options['limitsChannelMembers'], 'Limits.UserChannels' => $options['limitsUserChannels'], 'Media.CompatibilityMessage' => $options['mediaCompatibilityMessage'], 'PreWebhookRetryCount' => $options['preWebhookRetryCount'], 'PostWebhookRetryCount' => $options['postWebhookRetryCount'], 'Notifications.LogEnabled' => Serialize::booleanToString($options['notificationsLogEnabled']), )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new ServiceInstance($this->version, $payload, $this->solution['sid']); } /** * Access the channels * * @return \Twilio\Rest\IpMessaging\V2\Service\ChannelList */ protected function getChannels() { if (!$this->_channels) { $this->_channels = new ChannelList($this->version, $this->solution['sid']); } return $this->_channels; } /** * Access the roles * * @return \Twilio\Rest\IpMessaging\V2\Service\RoleList */ protected function getRoles() { if (!$this->_roles) { $this->_roles = new RoleList($this->version, $this->solution['sid']); } return $this->_roles; } /** * Access the users * * @return \Twilio\Rest\IpMessaging\V2\Service\UserList */ protected function getUsers() { if (!$this->_users) { $this->_users = new UserList($this->version, $this->solution['sid']); } return $this->_users; } /** * Access the bindings * * @return \Twilio\Rest\IpMessaging\V2\Service\BindingList */ protected function getBindings() { if (!$this->_bindings) { $this->_bindings = new BindingList($this->version, $this->solution['sid']); } return $this->_bindings; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get($name) { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.IpMessaging.V2.ServiceContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Messaging/V1.php 0000644 00000006126 15002236443 0013220 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Messaging; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\Rest\Messaging\V1\ServiceList; use Twilio\Rest\Messaging\V1\SessionList; use Twilio\Rest\Messaging\V1\WebhookList; use Twilio\Version; /** * @property \Twilio\Rest\Messaging\V1\ServiceList $services * @property \Twilio\Rest\Messaging\V1\SessionList $sessions * @property \Twilio\Rest\Messaging\V1\WebhookList $webhooks * @method \Twilio\Rest\Messaging\V1\ServiceContext services(string $sid) * @method \Twilio\Rest\Messaging\V1\SessionContext sessions(string $sid) */ class V1 extends Version { protected $_services = null; protected $_sessions = null; protected $_webhooks = null; /** * Construct the V1 version of Messaging * * @param \Twilio\Domain $domain Domain that contains the version * @return \Twilio\Rest\Messaging\V1 V1 version of Messaging */ public function __construct(Domain $domain) { parent::__construct($domain); $this->version = 'v1'; } /** * @return \Twilio\Rest\Messaging\V1\ServiceList */ protected function getServices() { if (!$this->_services) { $this->_services = new ServiceList($this); } return $this->_services; } /** * @return \Twilio\Rest\Messaging\V1\SessionList */ protected function getSessions() { if (!$this->_sessions) { $this->_sessions = new SessionList($this); } return $this->_sessions; } /** * @return \Twilio\Rest\Messaging\V1\WebhookList */ protected function getWebhooks() { if (!$this->_webhooks) { $this->_webhooks = new WebhookList($this); } return $this->_webhooks; } /** * Magic getter to lazy load root resources * * @param string $name Resource to return * @return \Twilio\ListResource The requested resource * @throws TwilioException For unknown resource */ public function __get($name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown resource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Messaging.V1]'; } } sdk/src/Twilio/Rest/Messaging/V1/WebhookInstance.php 0000644 00000010102 15002236443 0016270 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Messaging\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $accountSid * @property string $serviceSid * @property string $webhookMethod * @property string $webhookFilters * @property string $preWebhookUrl * @property string $postWebhookUrl * @property int $preWebhookRetryCount * @property int $postWebhookRetryCount * @property string $target * @property string $url */ class WebhookInstance extends InstanceResource { /** * Initialize the WebhookInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @return \Twilio\Rest\Messaging\V1\WebhookInstance */ public function __construct(Version $version, array $payload) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'webhookMethod' => Values::array_get($payload, 'webhook_method'), 'webhookFilters' => Values::array_get($payload, 'webhook_filters'), 'preWebhookUrl' => Values::array_get($payload, 'pre_webhook_url'), 'postWebhookUrl' => Values::array_get($payload, 'post_webhook_url'), 'preWebhookRetryCount' => Values::array_get($payload, 'pre_webhook_retry_count'), 'postWebhookRetryCount' => Values::array_get($payload, 'post_webhook_retry_count'), 'target' => Values::array_get($payload, 'target'), 'url' => Values::array_get($payload, 'url'), ); $this->solution = array(); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Messaging\V1\WebhookContext Context for this * WebhookInstance */ protected function proxy() { if (!$this->context) { $this->context = new WebhookContext($this->version); } return $this->context; } /** * Fetch a WebhookInstance * * @return WebhookInstance Fetched WebhookInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Update the WebhookInstance * * @param array|Options $options Optional Arguments * @return WebhookInstance Updated WebhookInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Messaging.V1.WebhookInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Messaging/V1/SessionInstance.php 0000644 00000012374 15002236443 0016332 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Messaging\V1; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $sid * @property string $accountSid * @property string $serviceSid * @property string $messagingServiceSid * @property string $friendlyName * @property string $attributes * @property string $createdBy * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $url * @property array $links */ class SessionInstance extends InstanceResource { protected $_participants = null; protected $_messages = null; protected $_webhooks = null; /** * Initialize the SessionInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The SID that identifies the resource to fetch * @return \Twilio\Rest\Messaging\V1\SessionInstance */ public function __construct(Version $version, array $payload, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'messagingServiceSid' => Values::array_get($payload, 'messaging_service_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'attributes' => Values::array_get($payload, 'attributes'), 'createdBy' => Values::array_get($payload, 'created_by'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ); $this->solution = array('sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Messaging\V1\SessionContext Context for this * SessionInstance */ protected function proxy() { if (!$this->context) { $this->context = new SessionContext($this->version, $this->solution['sid']); } return $this->context; } /** * Fetch a SessionInstance * * @return SessionInstance Fetched SessionInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the SessionInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Update the SessionInstance * * @param array|Options $options Optional Arguments * @return SessionInstance Updated SessionInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Access the participants * * @return \Twilio\Rest\Messaging\V1\Session\ParticipantList */ protected function getParticipants() { return $this->proxy()->participants; } /** * Access the messages * * @return \Twilio\Rest\Messaging\V1\Session\MessageList */ protected function getMessages() { return $this->proxy()->messages; } /** * Access the webhooks * * @return \Twilio\Rest\Messaging\V1\Session\WebhookList */ protected function getWebhooks() { return $this->proxy()->webhooks; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Messaging.V1.SessionInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Messaging/V1/ServiceOptions.php 0000644 00000061722 15002236443 0016177 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Messaging\V1; 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 ServiceOptions { /** * @param string $inboundRequestUrl The URL we call using inbound_method when a * message is received by any phone number or * short code in the Service * @param string $inboundMethod The HTTP method we should use to call * inbound_request_url * @param string $fallbackUrl The URL that we call using fallback_method if an * error occurs while retrieving or executing the * TwiML from the Inbound Request URL * @param string $fallbackMethod The HTTP method we should use to call * fallback_url * @param string $statusCallback The URL we should call to pass status updates * about message delivery * @param bool $stickySender Whether to enable Sticky Sender on the Service * instance * @param bool $mmsConverter Whether to enable the MMS Converter for messages * sent through the Service instance * @param bool $smartEncoding Whether to enable Encoding for messages sent * through the Service instance * @param string $scanMessageContent Reserved * @param bool $fallbackToLongCode Whether to enable Fallback to Long Code for * messages sent through the Service instance * @param bool $areaCodeGeomatch Whether to enable Area Code Geomatch on the * Service Instance * @param int $validityPeriod How long, in seconds, messages sent from the * Service are valid * @param bool $synchronousValidation Reserved * @return CreateServiceOptions Options builder */ public static function create($inboundRequestUrl = Values::NONE, $inboundMethod = Values::NONE, $fallbackUrl = Values::NONE, $fallbackMethod = Values::NONE, $statusCallback = Values::NONE, $stickySender = Values::NONE, $mmsConverter = Values::NONE, $smartEncoding = Values::NONE, $scanMessageContent = Values::NONE, $fallbackToLongCode = Values::NONE, $areaCodeGeomatch = Values::NONE, $validityPeriod = Values::NONE, $synchronousValidation = Values::NONE) { return new CreateServiceOptions($inboundRequestUrl, $inboundMethod, $fallbackUrl, $fallbackMethod, $statusCallback, $stickySender, $mmsConverter, $smartEncoding, $scanMessageContent, $fallbackToLongCode, $areaCodeGeomatch, $validityPeriod, $synchronousValidation); } /** * @param string $friendlyName A string to describe the resource * @param string $inboundRequestUrl The URL we call using inbound_method when a * message is received by any phone number or * short code in the Service * @param string $inboundMethod The HTTP method we should use to call * inbound_request_url * @param string $fallbackUrl The URL that we call using fallback_method if an * error occurs while retrieving or executing the * TwiML from the Inbound Request URL * @param string $fallbackMethod The HTTP method we should use to call * fallback_url * @param string $statusCallback The URL we should call to pass status updates * about message delivery * @param bool $stickySender Whether to enable Sticky Sender on the Service * instance * @param bool $mmsConverter Whether to enable the MMS Converter for messages * sent through the Service instance * @param bool $smartEncoding Whether to enable Encoding for messages sent * through the Service instance * @param string $scanMessageContent Reserved * @param bool $fallbackToLongCode Whether to enable Fallback to Long Code for * messages sent through the Service instance * @param bool $areaCodeGeomatch Whether to enable Area Code Geomatch on the * Service Instance * @param int $validityPeriod How long, in seconds, messages sent from the * Service are valid * @param bool $synchronousValidation Reserved * @return UpdateServiceOptions Options builder */ public static function update($friendlyName = Values::NONE, $inboundRequestUrl = Values::NONE, $inboundMethod = Values::NONE, $fallbackUrl = Values::NONE, $fallbackMethod = Values::NONE, $statusCallback = Values::NONE, $stickySender = Values::NONE, $mmsConverter = Values::NONE, $smartEncoding = Values::NONE, $scanMessageContent = Values::NONE, $fallbackToLongCode = Values::NONE, $areaCodeGeomatch = Values::NONE, $validityPeriod = Values::NONE, $synchronousValidation = Values::NONE) { return new UpdateServiceOptions($friendlyName, $inboundRequestUrl, $inboundMethod, $fallbackUrl, $fallbackMethod, $statusCallback, $stickySender, $mmsConverter, $smartEncoding, $scanMessageContent, $fallbackToLongCode, $areaCodeGeomatch, $validityPeriod, $synchronousValidation); } } class CreateServiceOptions extends Options { /** * @param string $inboundRequestUrl The URL we call using inbound_method when a * message is received by any phone number or * short code in the Service * @param string $inboundMethod The HTTP method we should use to call * inbound_request_url * @param string $fallbackUrl The URL that we call using fallback_method if an * error occurs while retrieving or executing the * TwiML from the Inbound Request URL * @param string $fallbackMethod The HTTP method we should use to call * fallback_url * @param string $statusCallback The URL we should call to pass status updates * about message delivery * @param bool $stickySender Whether to enable Sticky Sender on the Service * instance * @param bool $mmsConverter Whether to enable the MMS Converter for messages * sent through the Service instance * @param bool $smartEncoding Whether to enable Encoding for messages sent * through the Service instance * @param string $scanMessageContent Reserved * @param bool $fallbackToLongCode Whether to enable Fallback to Long Code for * messages sent through the Service instance * @param bool $areaCodeGeomatch Whether to enable Area Code Geomatch on the * Service Instance * @param int $validityPeriod How long, in seconds, messages sent from the * Service are valid * @param bool $synchronousValidation Reserved */ public function __construct($inboundRequestUrl = Values::NONE, $inboundMethod = Values::NONE, $fallbackUrl = Values::NONE, $fallbackMethod = Values::NONE, $statusCallback = Values::NONE, $stickySender = Values::NONE, $mmsConverter = Values::NONE, $smartEncoding = Values::NONE, $scanMessageContent = Values::NONE, $fallbackToLongCode = Values::NONE, $areaCodeGeomatch = Values::NONE, $validityPeriod = Values::NONE, $synchronousValidation = Values::NONE) { $this->options['inboundRequestUrl'] = $inboundRequestUrl; $this->options['inboundMethod'] = $inboundMethod; $this->options['fallbackUrl'] = $fallbackUrl; $this->options['fallbackMethod'] = $fallbackMethod; $this->options['statusCallback'] = $statusCallback; $this->options['stickySender'] = $stickySender; $this->options['mmsConverter'] = $mmsConverter; $this->options['smartEncoding'] = $smartEncoding; $this->options['scanMessageContent'] = $scanMessageContent; $this->options['fallbackToLongCode'] = $fallbackToLongCode; $this->options['areaCodeGeomatch'] = $areaCodeGeomatch; $this->options['validityPeriod'] = $validityPeriod; $this->options['synchronousValidation'] = $synchronousValidation; } /** * The URL we should call using `inbound_method` when a message is received by any phone number or short code in the Service. When this property is `null`, receiving inbound messages is disabled. * * @param string $inboundRequestUrl The URL we call using inbound_method when a * message is received by any phone number or * short code in the Service * @return $this Fluent Builder */ public function setInboundRequestUrl($inboundRequestUrl) { $this->options['inboundRequestUrl'] = $inboundRequestUrl; return $this; } /** * The HTTP method we should use to call `inbound_request_url`. Can be `GET` or `POST` and the default is `POST`. * * @param string $inboundMethod The HTTP method we should use to call * inbound_request_url * @return $this Fluent Builder */ public function setInboundMethod($inboundMethod) { $this->options['inboundMethod'] = $inboundMethod; return $this; } /** * The URL that we should call using `fallback_method` if an error occurs while retrieving or executing the TwiML from the Inbound Request URL. * * @param string $fallbackUrl The URL that we call using fallback_method if an * error occurs while retrieving or executing the * TwiML from the Inbound Request URL * @return $this Fluent Builder */ public function setFallbackUrl($fallbackUrl) { $this->options['fallbackUrl'] = $fallbackUrl; return $this; } /** * The HTTP method we should use to call `fallback_url`. Can be: `GET` or `POST`. * * @param string $fallbackMethod The HTTP method we should use to call * fallback_url * @return $this Fluent Builder */ public function setFallbackMethod($fallbackMethod) { $this->options['fallbackMethod'] = $fallbackMethod; return $this; } /** * The URL we should call to [pass status updates](https://www.twilio.com/docs/sms/api/message-resource#message-status-values) about message delivery. * * @param string $statusCallback The URL we should call to pass status updates * about message delivery * @return $this Fluent Builder */ public function setStatusCallback($statusCallback) { $this->options['statusCallback'] = $statusCallback; return $this; } /** * Whether to enable [Sticky Sender](https://www.twilio.com/docs/sms/services#sticky-sender) on the Service instance. * * @param bool $stickySender Whether to enable Sticky Sender on the Service * instance * @return $this Fluent Builder */ public function setStickySender($stickySender) { $this->options['stickySender'] = $stickySender; return $this; } /** * Whether to enable the [MMS Converter](https://www.twilio.com/docs/sms/services#mms-converter) for messages sent through the Service instance. * * @param bool $mmsConverter Whether to enable the MMS Converter for messages * sent through the Service instance * @return $this Fluent Builder */ public function setMmsConverter($mmsConverter) { $this->options['mmsConverter'] = $mmsConverter; return $this; } /** * Whether to enable [Smart Encoding](https://www.twilio.com/docs/sms/services#smart-encoding) for messages sent through the Service instance. * * @param bool $smartEncoding Whether to enable Encoding for messages sent * through the Service instance * @return $this Fluent Builder */ public function setSmartEncoding($smartEncoding) { $this->options['smartEncoding'] = $smartEncoding; return $this; } /** * Reserved. * * @param string $scanMessageContent Reserved * @return $this Fluent Builder */ public function setScanMessageContent($scanMessageContent) { $this->options['scanMessageContent'] = $scanMessageContent; return $this; } /** * Whether to enable [Fallback to Long Code](https://www.twilio.com/docs/sms/services#fallback-to-long-code) for messages sent through the Service instance. * * @param bool $fallbackToLongCode Whether to enable Fallback to Long Code for * messages sent through the Service instance * @return $this Fluent Builder */ public function setFallbackToLongCode($fallbackToLongCode) { $this->options['fallbackToLongCode'] = $fallbackToLongCode; return $this; } /** * Whether to enable [Area Code Geomatch](https://www.twilio.com/docs/sms/services#area-code-geomatch) on the Service Instance. * * @param bool $areaCodeGeomatch Whether to enable Area Code Geomatch on the * Service Instance * @return $this Fluent Builder */ public function setAreaCodeGeomatch($areaCodeGeomatch) { $this->options['areaCodeGeomatch'] = $areaCodeGeomatch; return $this; } /** * How long, in seconds, messages sent from the Service are valid. Can be an integer from `1` to `14,400`. * * @param int $validityPeriod How long, in seconds, messages sent from the * Service are valid * @return $this Fluent Builder */ public function setValidityPeriod($validityPeriod) { $this->options['validityPeriod'] = $validityPeriod; return $this; } /** * Reserved. * * @param bool $synchronousValidation Reserved * @return $this Fluent Builder */ public function setSynchronousValidation($synchronousValidation) { $this->options['synchronousValidation'] = $synchronousValidation; 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.Messaging.V1.CreateServiceOptions ' . \implode(' ', $options) . ']'; } } class UpdateServiceOptions extends Options { /** * @param string $friendlyName A string to describe the resource * @param string $inboundRequestUrl The URL we call using inbound_method when a * message is received by any phone number or * short code in the Service * @param string $inboundMethod The HTTP method we should use to call * inbound_request_url * @param string $fallbackUrl The URL that we call using fallback_method if an * error occurs while retrieving or executing the * TwiML from the Inbound Request URL * @param string $fallbackMethod The HTTP method we should use to call * fallback_url * @param string $statusCallback The URL we should call to pass status updates * about message delivery * @param bool $stickySender Whether to enable Sticky Sender on the Service * instance * @param bool $mmsConverter Whether to enable the MMS Converter for messages * sent through the Service instance * @param bool $smartEncoding Whether to enable Encoding for messages sent * through the Service instance * @param string $scanMessageContent Reserved * @param bool $fallbackToLongCode Whether to enable Fallback to Long Code for * messages sent through the Service instance * @param bool $areaCodeGeomatch Whether to enable Area Code Geomatch on the * Service Instance * @param int $validityPeriod How long, in seconds, messages sent from the * Service are valid * @param bool $synchronousValidation Reserved */ public function __construct($friendlyName = Values::NONE, $inboundRequestUrl = Values::NONE, $inboundMethod = Values::NONE, $fallbackUrl = Values::NONE, $fallbackMethod = Values::NONE, $statusCallback = Values::NONE, $stickySender = Values::NONE, $mmsConverter = Values::NONE, $smartEncoding = Values::NONE, $scanMessageContent = Values::NONE, $fallbackToLongCode = Values::NONE, $areaCodeGeomatch = Values::NONE, $validityPeriod = Values::NONE, $synchronousValidation = Values::NONE) { $this->options['friendlyName'] = $friendlyName; $this->options['inboundRequestUrl'] = $inboundRequestUrl; $this->options['inboundMethod'] = $inboundMethod; $this->options['fallbackUrl'] = $fallbackUrl; $this->options['fallbackMethod'] = $fallbackMethod; $this->options['statusCallback'] = $statusCallback; $this->options['stickySender'] = $stickySender; $this->options['mmsConverter'] = $mmsConverter; $this->options['smartEncoding'] = $smartEncoding; $this->options['scanMessageContent'] = $scanMessageContent; $this->options['fallbackToLongCode'] = $fallbackToLongCode; $this->options['areaCodeGeomatch'] = $areaCodeGeomatch; $this->options['validityPeriod'] = $validityPeriod; $this->options['synchronousValidation'] = $synchronousValidation; } /** * A descriptive string that you create to describe the resource. It can be up to 64 characters long. * * @param string $friendlyName A string to describe the resource * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The URL we should call using `inbound_method` when a message is received by any phone number or short code in the Service. When this property is `null`, receiving inbound messages is disabled. * * @param string $inboundRequestUrl The URL we call using inbound_method when a * message is received by any phone number or * short code in the Service * @return $this Fluent Builder */ public function setInboundRequestUrl($inboundRequestUrl) { $this->options['inboundRequestUrl'] = $inboundRequestUrl; return $this; } /** * The HTTP method we should use to call `inbound_request_url`. Can be `GET` or `POST` and the default is `POST`. * * @param string $inboundMethod The HTTP method we should use to call * inbound_request_url * @return $this Fluent Builder */ public function setInboundMethod($inboundMethod) { $this->options['inboundMethod'] = $inboundMethod; return $this; } /** * The URL that we should call using `fallback_method` if an error occurs while retrieving or executing the TwiML from the Inbound Request URL. * * @param string $fallbackUrl The URL that we call using fallback_method if an * error occurs while retrieving or executing the * TwiML from the Inbound Request URL * @return $this Fluent Builder */ public function setFallbackUrl($fallbackUrl) { $this->options['fallbackUrl'] = $fallbackUrl; return $this; } /** * The HTTP method we should use to call `fallback_url`. Can be: `GET` or `POST`. * * @param string $fallbackMethod The HTTP method we should use to call * fallback_url * @return $this Fluent Builder */ public function setFallbackMethod($fallbackMethod) { $this->options['fallbackMethod'] = $fallbackMethod; return $this; } /** * The URL we should call to [pass status updates](https://www.twilio.com/docs/sms/api/message-resource#message-status-values) about message delivery. * * @param string $statusCallback The URL we should call to pass status updates * about message delivery * @return $this Fluent Builder */ public function setStatusCallback($statusCallback) { $this->options['statusCallback'] = $statusCallback; return $this; } /** * Whether to enable [Sticky Sender](https://www.twilio.com/docs/sms/services#sticky-sender) on the Service instance. * * @param bool $stickySender Whether to enable Sticky Sender on the Service * instance * @return $this Fluent Builder */ public function setStickySender($stickySender) { $this->options['stickySender'] = $stickySender; return $this; } /** * Whether to enable the [MMS Converter](https://www.twilio.com/docs/sms/services#mms-converter) for messages sent through the Service instance. * * @param bool $mmsConverter Whether to enable the MMS Converter for messages * sent through the Service instance * @return $this Fluent Builder */ public function setMmsConverter($mmsConverter) { $this->options['mmsConverter'] = $mmsConverter; return $this; } /** * Whether to enable [Smart Encoding](https://www.twilio.com/docs/sms/services#smart-encoding) for messages sent through the Service instance. * * @param bool $smartEncoding Whether to enable Encoding for messages sent * through the Service instance * @return $this Fluent Builder */ public function setSmartEncoding($smartEncoding) { $this->options['smartEncoding'] = $smartEncoding; return $this; } /** * Reserved. * * @param string $scanMessageContent Reserved * @return $this Fluent Builder */ public function setScanMessageContent($scanMessageContent) { $this->options['scanMessageContent'] = $scanMessageContent; return $this; } /** * Whether to enable [Fallback to Long Code](https://www.twilio.com/docs/sms/services#fallback-to-long-code) for messages sent through the Service instance. * * @param bool $fallbackToLongCode Whether to enable Fallback to Long Code for * messages sent through the Service instance * @return $this Fluent Builder */ public function setFallbackToLongCode($fallbackToLongCode) { $this->options['fallbackToLongCode'] = $fallbackToLongCode; return $this; } /** * Whether to enable [Area Code Geomatch](https://www.twilio.com/docs/sms/services#area-code-geomatch) on the Service Instance. * * @param bool $areaCodeGeomatch Whether to enable Area Code Geomatch on the * Service Instance * @return $this Fluent Builder */ public function setAreaCodeGeomatch($areaCodeGeomatch) { $this->options['areaCodeGeomatch'] = $areaCodeGeomatch; return $this; } /** * How long, in seconds, messages sent from the Service are valid. Can be an integer from `1` to `14,400`. * * @param int $validityPeriod How long, in seconds, messages sent from the * Service are valid * @return $this Fluent Builder */ public function setValidityPeriod($validityPeriod) { $this->options['validityPeriod'] = $validityPeriod; return $this; } /** * Reserved. * * @param bool $synchronousValidation Reserved * @return $this Fluent Builder */ public function setSynchronousValidation($synchronousValidation) { $this->options['synchronousValidation'] = $synchronousValidation; 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.Messaging.V1.UpdateServiceOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Messaging/V1/Session/WebhookInstance.php 0000644 00000010711 15002236443 0017721 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Messaging\V1\Session; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $sid * @property string $accountSid * @property string $sessionSid * @property string $target * @property string $url * @property array $configuration * @property \DateTime $dateCreated * @property \DateTime $dateUpdated */ class WebhookInstance extends InstanceResource { /** * Initialize the WebhookInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sessionSid The SID of the Session for the webhook * @param string $sid The SID of the resource to fetch * @return \Twilio\Rest\Messaging\V1\Session\WebhookInstance */ public function __construct(Version $version, array $payload, $sessionSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'sessionSid' => Values::array_get($payload, 'session_sid'), 'target' => Values::array_get($payload, 'target'), 'url' => Values::array_get($payload, 'url'), 'configuration' => Values::array_get($payload, 'configuration'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), ); $this->solution = array('sessionSid' => $sessionSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Messaging\V1\Session\WebhookContext Context for this * WebhookInstance */ protected function proxy() { if (!$this->context) { $this->context = new WebhookContext( $this->version, $this->solution['sessionSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch a WebhookInstance * * @return WebhookInstance Fetched WebhookInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Update the WebhookInstance * * @param array|Options $options Optional Arguments * @return WebhookInstance Updated WebhookInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Deletes the WebhookInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Messaging.V1.WebhookInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Messaging/V1/Session/ParticipantInstance.php 0000644 00000012165 15002236443 0020606 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Messaging\V1\Session; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $accountSid * @property string $serviceSid * @property string $messagingServiceSid * @property string $sessionSid * @property string $sid * @property string $identity * @property string $twilioAddress * @property string $userAddress * @property string $attributes * @property string $type * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $url */ class ParticipantInstance extends InstanceResource { /** * Initialize the ParticipantInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sessionSid The SID of the Session for the participant * @param string $sid The SID that identifies the resource to fetch * @return \Twilio\Rest\Messaging\V1\Session\ParticipantInstance */ public function __construct(Version $version, array $payload, $sessionSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'messagingServiceSid' => Values::array_get($payload, 'messaging_service_sid'), 'sessionSid' => Values::array_get($payload, 'session_sid'), 'sid' => Values::array_get($payload, 'sid'), 'identity' => Values::array_get($payload, 'identity'), 'twilioAddress' => Values::array_get($payload, 'twilio_address'), 'userAddress' => Values::array_get($payload, 'user_address'), 'attributes' => Values::array_get($payload, 'attributes'), 'type' => Values::array_get($payload, 'type'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), ); $this->solution = array('sessionSid' => $sessionSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Messaging\V1\Session\ParticipantContext Context for * this * ParticipantInstance */ protected function proxy() { if (!$this->context) { $this->context = new ParticipantContext( $this->version, $this->solution['sessionSid'], $this->solution['sid'] ); } return $this->context; } /** * Update the ParticipantInstance * * @param array|Options $options Optional Arguments * @return ParticipantInstance Updated ParticipantInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Fetch a ParticipantInstance * * @return ParticipantInstance Fetched ParticipantInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the ParticipantInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Messaging.V1.ParticipantInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Messaging/V1/Session/MessageContext.php 0000644 00000006534 15002236443 0017577 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Messaging\V1\Session; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class MessageContext extends InstanceContext { /** * Initialize the MessageContext * * @param \Twilio\Version $version Version that contains the resource * @param string $sessionSid The SID of the Session with the message to fetch * @param string $sid The SID that identifies the resource to fetch * @return \Twilio\Rest\Messaging\V1\Session\MessageContext */ public function __construct(Version $version, $sessionSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array('sessionSid' => $sessionSid, 'sid' => $sid, ); $this->uri = '/Sessions/' . \rawurlencode($sessionSid) . '/Messages/' . \rawurlencode($sid) . ''; } /** * Fetch a MessageInstance * * @return MessageInstance Fetched MessageInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new MessageInstance( $this->version, $payload, $this->solution['sessionSid'], $this->solution['sid'] ); } /** * Update the MessageInstance * * @param array|Options $options Optional Arguments * @return MessageInstance Updated MessageInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { $options = new Values($options); $data = Values::of(array( 'Author' => $options['author'], 'Attributes' => $options['attributes'], 'DateCreated' => Serialize::iso8601DateTime($options['dateCreated']), 'DateUpdated' => Serialize::iso8601DateTime($options['dateUpdated']), 'Body' => $options['body'], )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new MessageInstance( $this->version, $payload, $this->solution['sessionSid'], $this->solution['sid'] ); } /** * Deletes the MessageInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Messaging.V1.MessageContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Messaging/V1/Session/ParticipantList.php 0000644 00000014217 15002236443 0017755 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Messaging\V1\Session; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class ParticipantList extends ListResource { /** * Construct the ParticipantList * * @param Version $version Version that contains the resource * @param string $sessionSid The SID of the Session for the participant * @return \Twilio\Rest\Messaging\V1\Session\ParticipantList */ public function __construct(Version $version, $sessionSid) { parent::__construct($version); // Path Solution $this->solution = array('sessionSid' => $sessionSid, ); $this->uri = '/Sessions/' . \rawurlencode($sessionSid) . '/Participants'; } /** * Create a new ParticipantInstance * * @param array|Options $options Optional Arguments * @return ParticipantInstance Newly created ParticipantInstance * @throws TwilioException When an HTTP error occurs. */ public function create($options = array()) { $options = new Values($options); $data = Values::of(array( 'Identity' => $options['identity'], 'UserAddress' => $options['userAddress'], 'Attributes' => $options['attributes'], 'TwilioAddress' => $options['twilioAddress'], 'DateCreated' => Serialize::iso8601DateTime($options['dateCreated']), 'DateUpdated' => Serialize::iso8601DateTime($options['dateUpdated']), )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new ParticipantInstance($this->version, $payload, $this->solution['sessionSid']); } /** * Streams ParticipantInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads ParticipantInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return ParticipantInstance[] Array of results */ public function read($limit = null, $pageSize = null) { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of ParticipantInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of ParticipantInstance */ public function page($pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $params = Values::of(array( 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new ParticipantPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of ParticipantInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of ParticipantInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new ParticipantPage($this->version, $response, $this->solution); } /** * Constructs a ParticipantContext * * @param string $sid The SID that identifies the resource to fetch * @return \Twilio\Rest\Messaging\V1\Session\ParticipantContext */ public function getContext($sid) { return new ParticipantContext($this->version, $this->solution['sessionSid'], $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Messaging.V1.ParticipantList]'; } } sdk/src/Twilio/Rest/Messaging/V1/Session/WebhookOptions.php 0000644 00000042054 15002236443 0017615 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Messaging\V1\Session; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ abstract class WebhookOptions { /** * @param string $configurationUrl The absolute URL the webhook request should * be sent to * @param string $configurationMethod The HTTP method we should use when * sending a webhook request to url * @param string $configurationFilters The list of events that trigger a * webhook event for the Session * @param string $configurationTriggers The list of keywords, firing webhook * event for the Session * @param string $configurationFlowSid The SID of the studio flow where the * webhook should be sent to * @param int $configurationRetryCount The number of times to call the webhook * request if the first attempt fails * @param int $configurationReplayAfter The message index for which and its * successors the webhook will be replayed * @param bool $configurationBufferMessages Whether buffering should be applied * to messages * @param int $configurationBufferWindow The period to buffer messages * @return CreateWebhookOptions Options builder */ public static function create($configurationUrl = Values::NONE, $configurationMethod = Values::NONE, $configurationFilters = Values::NONE, $configurationTriggers = Values::NONE, $configurationFlowSid = Values::NONE, $configurationRetryCount = Values::NONE, $configurationReplayAfter = Values::NONE, $configurationBufferMessages = Values::NONE, $configurationBufferWindow = Values::NONE) { return new CreateWebhookOptions($configurationUrl, $configurationMethod, $configurationFilters, $configurationTriggers, $configurationFlowSid, $configurationRetryCount, $configurationReplayAfter, $configurationBufferMessages, $configurationBufferWindow); } /** * @param string $configurationUrl The absolute URL the webhook request should * be sent to * @param string $configurationMethod The HTTP method we should use when * sending a webhook request to url * @param string $configurationFilters The list of events that trigger a * webhook event for the Session * @param string $configurationTriggers The list of keywords, that trigger a * webhook event for the Session * @param string $configurationFlowSid The SID of the studio flow where the * webhook should be sent to * @param int $configurationRetryCount The number of times to try the webhook * request if the first attempt fails * @param bool $configurationBufferMessages Whether buffering should be applied * to messages * @param int $configurationBufferWindow The period to buffer messages * @return UpdateWebhookOptions Options builder */ public static function update($configurationUrl = Values::NONE, $configurationMethod = Values::NONE, $configurationFilters = Values::NONE, $configurationTriggers = Values::NONE, $configurationFlowSid = Values::NONE, $configurationRetryCount = Values::NONE, $configurationBufferMessages = Values::NONE, $configurationBufferWindow = Values::NONE) { return new UpdateWebhookOptions($configurationUrl, $configurationMethod, $configurationFilters, $configurationTriggers, $configurationFlowSid, $configurationRetryCount, $configurationBufferMessages, $configurationBufferWindow); } } class CreateWebhookOptions extends Options { /** * @param string $configurationUrl The absolute URL the webhook request should * be sent to * @param string $configurationMethod The HTTP method we should use when * sending a webhook request to url * @param string $configurationFilters The list of events that trigger a * webhook event for the Session * @param string $configurationTriggers The list of keywords, firing webhook * event for the Session * @param string $configurationFlowSid The SID of the studio flow where the * webhook should be sent to * @param int $configurationRetryCount The number of times to call the webhook * request if the first attempt fails * @param int $configurationReplayAfter The message index for which and its * successors the webhook will be replayed * @param bool $configurationBufferMessages Whether buffering should be applied * to messages * @param int $configurationBufferWindow The period to buffer messages */ public function __construct($configurationUrl = Values::NONE, $configurationMethod = Values::NONE, $configurationFilters = Values::NONE, $configurationTriggers = Values::NONE, $configurationFlowSid = Values::NONE, $configurationRetryCount = Values::NONE, $configurationReplayAfter = Values::NONE, $configurationBufferMessages = Values::NONE, $configurationBufferWindow = Values::NONE) { $this->options['configurationUrl'] = $configurationUrl; $this->options['configurationMethod'] = $configurationMethod; $this->options['configurationFilters'] = $configurationFilters; $this->options['configurationTriggers'] = $configurationTriggers; $this->options['configurationFlowSid'] = $configurationFlowSid; $this->options['configurationRetryCount'] = $configurationRetryCount; $this->options['configurationReplayAfter'] = $configurationReplayAfter; $this->options['configurationBufferMessages'] = $configurationBufferMessages; $this->options['configurationBufferWindow'] = $configurationBufferWindow; } /** * The absolute URL the webhook request should be sent to. * * @param string $configurationUrl The absolute URL the webhook request should * be sent to * @return $this Fluent Builder */ public function setConfigurationUrl($configurationUrl) { $this->options['configurationUrl'] = $configurationUrl; return $this; } /** * The HTTP method we should use when sending a webhook request to `url`. Can be `POST` or `GET`. * * @param string $configurationMethod The HTTP method we should use when * sending a webhook request to url * @return $this Fluent Builder */ public function setConfigurationMethod($configurationMethod) { $this->options['configurationMethod'] = $configurationMethod; return $this; } /** * The list of events that trigger a webhook event for the Session. * * @param string $configurationFilters The list of events that trigger a * webhook event for the Session * @return $this Fluent Builder */ public function setConfigurationFilters($configurationFilters) { $this->options['configurationFilters'] = $configurationFilters; return $this; } /** * The list of keywords, firing webhook event for the Session. * * @param string $configurationTriggers The list of keywords, firing webhook * event for the Session * @return $this Fluent Builder */ public function setConfigurationTriggers($configurationTriggers) { $this->options['configurationTriggers'] = $configurationTriggers; return $this; } /** * The SID of the studio flow where the webhook should be sent to. * * @param string $configurationFlowSid The SID of the studio flow where the * webhook should be sent to * @return $this Fluent Builder */ public function setConfigurationFlowSid($configurationFlowSid) { $this->options['configurationFlowSid'] = $configurationFlowSid; return $this; } /** * The number of times to call the webhook request if the first attempt fails. Can be up to 3 and the default is 0. * * @param int $configurationRetryCount The number of times to call the webhook * request if the first attempt fails * @return $this Fluent Builder */ public function setConfigurationRetryCount($configurationRetryCount) { $this->options['configurationRetryCount'] = $configurationRetryCount; return $this; } /** * The message index for which and its successors the webhook will be replayed. Not set by default. * * @param int $configurationReplayAfter The message index for which and its * successors the webhook will be replayed * @return $this Fluent Builder */ public function setConfigurationReplayAfter($configurationReplayAfter) { $this->options['configurationReplayAfter'] = $configurationReplayAfter; return $this; } /** * Whether buffering should be applied to messages. Not set by default. * * @param bool $configurationBufferMessages Whether buffering should be applied * to messages * @return $this Fluent Builder */ public function setConfigurationBufferMessages($configurationBufferMessages) { $this->options['configurationBufferMessages'] = $configurationBufferMessages; return $this; } /** * The period to buffer messages in milliseconds. Default is 3,000 ms. * * @param int $configurationBufferWindow The period to buffer messages * @return $this Fluent Builder */ public function setConfigurationBufferWindow($configurationBufferWindow) { $this->options['configurationBufferWindow'] = $configurationBufferWindow; 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.Messaging.V1.CreateWebhookOptions ' . \implode(' ', $options) . ']'; } } class UpdateWebhookOptions extends Options { /** * @param string $configurationUrl The absolute URL the webhook request should * be sent to * @param string $configurationMethod The HTTP method we should use when * sending a webhook request to url * @param string $configurationFilters The list of events that trigger a * webhook event for the Session * @param string $configurationTriggers The list of keywords, that trigger a * webhook event for the Session * @param string $configurationFlowSid The SID of the studio flow where the * webhook should be sent to * @param int $configurationRetryCount The number of times to try the webhook * request if the first attempt fails * @param bool $configurationBufferMessages Whether buffering should be applied * to messages * @param int $configurationBufferWindow The period to buffer messages */ public function __construct($configurationUrl = Values::NONE, $configurationMethod = Values::NONE, $configurationFilters = Values::NONE, $configurationTriggers = Values::NONE, $configurationFlowSid = Values::NONE, $configurationRetryCount = Values::NONE, $configurationBufferMessages = Values::NONE, $configurationBufferWindow = Values::NONE) { $this->options['configurationUrl'] = $configurationUrl; $this->options['configurationMethod'] = $configurationMethod; $this->options['configurationFilters'] = $configurationFilters; $this->options['configurationTriggers'] = $configurationTriggers; $this->options['configurationFlowSid'] = $configurationFlowSid; $this->options['configurationRetryCount'] = $configurationRetryCount; $this->options['configurationBufferMessages'] = $configurationBufferMessages; $this->options['configurationBufferWindow'] = $configurationBufferWindow; } /** * The absolute URL the webhook request should be sent to. * * @param string $configurationUrl The absolute URL the webhook request should * be sent to * @return $this Fluent Builder */ public function setConfigurationUrl($configurationUrl) { $this->options['configurationUrl'] = $configurationUrl; return $this; } /** * The HTTP method we should use when sending a webhook request to `url`. Can be `POST` or `GET`. * * @param string $configurationMethod The HTTP method we should use when * sending a webhook request to url * @return $this Fluent Builder */ public function setConfigurationMethod($configurationMethod) { $this->options['configurationMethod'] = $configurationMethod; return $this; } /** * The list of events that trigger a webhook event for the Session. * * @param string $configurationFilters The list of events that trigger a * webhook event for the Session * @return $this Fluent Builder */ public function setConfigurationFilters($configurationFilters) { $this->options['configurationFilters'] = $configurationFilters; return $this; } /** * The list of keywords that trigger a webhook event for the Session. * * @param string $configurationTriggers The list of keywords, that trigger a * webhook event for the Session * @return $this Fluent Builder */ public function setConfigurationTriggers($configurationTriggers) { $this->options['configurationTriggers'] = $configurationTriggers; return $this; } /** * The SID of the studio flow where the webhook should be sent to. * * @param string $configurationFlowSid The SID of the studio flow where the * webhook should be sent to * @return $this Fluent Builder */ public function setConfigurationFlowSid($configurationFlowSid) { $this->options['configurationFlowSid'] = $configurationFlowSid; return $this; } /** * The number of times to try the webhook request if the first attempt fails. Can be up to 3 and the default is 0. * * @param int $configurationRetryCount The number of times to try the webhook * request if the first attempt fails * @return $this Fluent Builder */ public function setConfigurationRetryCount($configurationRetryCount) { $this->options['configurationRetryCount'] = $configurationRetryCount; return $this; } /** * Whether buffering should be applied to messages. Not set by default. * * @param bool $configurationBufferMessages Whether buffering should be applied * to messages * @return $this Fluent Builder */ public function setConfigurationBufferMessages($configurationBufferMessages) { $this->options['configurationBufferMessages'] = $configurationBufferMessages; return $this; } /** * The period to buffer messages in milliseconds. Default is 3,000 ms. * * @param int $configurationBufferWindow The period to buffer messages * @return $this Fluent Builder */ public function setConfigurationBufferWindow($configurationBufferWindow) { $this->options['configurationBufferWindow'] = $configurationBufferWindow; 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.Messaging.V1.UpdateWebhookOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Messaging/V1/Session/MessageList.php 0000644 00000013753 15002236443 0017067 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Messaging\V1\Session; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class MessageList extends ListResource { /** * Construct the MessageList * * @param Version $version Version that contains the resource * @param string $sessionSid The SID of the Session for the message * @return \Twilio\Rest\Messaging\V1\Session\MessageList */ public function __construct(Version $version, $sessionSid) { parent::__construct($version); // Path Solution $this->solution = array('sessionSid' => $sessionSid, ); $this->uri = '/Sessions/' . \rawurlencode($sessionSid) . '/Messages'; } /** * Create a new MessageInstance * * @param array|Options $options Optional Arguments * @return MessageInstance Newly created MessageInstance * @throws TwilioException When an HTTP error occurs. */ public function create($options = array()) { $options = new Values($options); $data = Values::of(array( 'Author' => $options['author'], 'Attributes' => $options['attributes'], 'DateCreated' => Serialize::iso8601DateTime($options['dateCreated']), 'DateUpdated' => Serialize::iso8601DateTime($options['dateUpdated']), 'Body' => $options['body'], )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new MessageInstance($this->version, $payload, $this->solution['sessionSid']); } /** * Streams MessageInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads MessageInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return MessageInstance[] Array of results */ public function read($limit = null, $pageSize = null) { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of MessageInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of MessageInstance */ public function page($pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $params = Values::of(array( 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new MessagePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of MessageInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of MessageInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new MessagePage($this->version, $response, $this->solution); } /** * Constructs a MessageContext * * @param string $sid The SID that identifies the resource to fetch * @return \Twilio\Rest\Messaging\V1\Session\MessageContext */ public function getContext($sid) { return new MessageContext($this->version, $this->solution['sessionSid'], $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Messaging.V1.MessageList]'; } } sdk/src/Twilio/Rest/Messaging/V1/Session/MessageInstance.php 0000644 00000011544 15002236443 0017714 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Messaging\V1\Session; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $accountSid * @property string $serviceSid * @property string $messagingServiceSid * @property string $sessionSid * @property string $sid * @property int $index * @property string $author * @property string $body * @property string $attributes * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $url */ class MessageInstance extends InstanceResource { /** * Initialize the MessageInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sessionSid The SID of the Session for the message * @param string $sid The SID that identifies the resource to fetch * @return \Twilio\Rest\Messaging\V1\Session\MessageInstance */ public function __construct(Version $version, array $payload, $sessionSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'messagingServiceSid' => Values::array_get($payload, 'messaging_service_sid'), 'sessionSid' => Values::array_get($payload, 'session_sid'), 'sid' => Values::array_get($payload, 'sid'), 'index' => Values::array_get($payload, 'index'), 'author' => Values::array_get($payload, 'author'), 'body' => Values::array_get($payload, 'body'), 'attributes' => Values::array_get($payload, 'attributes'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), ); $this->solution = array('sessionSid' => $sessionSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Messaging\V1\Session\MessageContext Context for this * MessageInstance */ protected function proxy() { if (!$this->context) { $this->context = new MessageContext( $this->version, $this->solution['sessionSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch a MessageInstance * * @return MessageInstance Fetched MessageInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Update the MessageInstance * * @param array|Options $options Optional Arguments * @return MessageInstance Updated MessageInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Deletes the MessageInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Messaging.V1.MessageInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Messaging/V1/Session/WebhookPage.php 0000644 00000001706 15002236443 0017035 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Messaging\V1\Session; use Twilio\Page; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class WebhookPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new WebhookInstance($this->version, $payload, $this->solution['sessionSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Messaging.V1.WebhookPage]'; } } sdk/src/Twilio/Rest/Messaging/V1/Session/WebhookList.php 0000644 00000015070 15002236443 0017073 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Messaging\V1\Session; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class WebhookList extends ListResource { /** * Construct the WebhookList * * @param Version $version Version that contains the resource * @param string $sessionSid The SID of the Session for the webhook * @return \Twilio\Rest\Messaging\V1\Session\WebhookList */ public function __construct(Version $version, $sessionSid) { parent::__construct($version); // Path Solution $this->solution = array('sessionSid' => $sessionSid, ); $this->uri = '/Sessions/' . \rawurlencode($sessionSid) . '/Webhooks'; } /** * Streams WebhookInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads WebhookInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return WebhookInstance[] Array of results */ public function read($limit = null, $pageSize = null) { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of WebhookInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of WebhookInstance */ public function page($pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $params = Values::of(array( 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new WebhookPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of WebhookInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of WebhookInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new WebhookPage($this->version, $response, $this->solution); } /** * Create a new WebhookInstance * * @param string $target The target of the webhook * @param array|Options $options Optional Arguments * @return WebhookInstance Newly created WebhookInstance * @throws TwilioException When an HTTP error occurs. */ public function create($target, $options = array()) { $options = new Values($options); $data = Values::of(array( 'Target' => $target, 'Configuration.Url' => $options['configurationUrl'], 'Configuration.Method' => $options['configurationMethod'], 'Configuration.Filters' => Serialize::map($options['configurationFilters'], function($e) { return $e; }), 'Configuration.Triggers' => Serialize::map($options['configurationTriggers'], function($e) { return $e; }), 'Configuration.FlowSid' => $options['configurationFlowSid'], 'Configuration.RetryCount' => $options['configurationRetryCount'], 'Configuration.ReplayAfter' => $options['configurationReplayAfter'], 'Configuration.BufferMessages' => Serialize::booleanToString($options['configurationBufferMessages']), 'Configuration.BufferWindow' => $options['configurationBufferWindow'], )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new WebhookInstance($this->version, $payload, $this->solution['sessionSid']); } /** * Constructs a WebhookContext * * @param string $sid The SID of the resource to fetch * @return \Twilio\Rest\Messaging\V1\Session\WebhookContext */ public function getContext($sid) { return new WebhookContext($this->version, $this->solution['sessionSid'], $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Messaging.V1.WebhookList]'; } } sdk/src/Twilio/Rest/Messaging/V1/Session/MessagePage.php 0000644 00000001706 15002236443 0017023 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Messaging\V1\Session; use Twilio\Page; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class MessagePage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new MessageInstance($this->version, $payload, $this->solution['sessionSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Messaging.V1.MessagePage]'; } } sdk/src/Twilio/Rest/Messaging/V1/Session/ParticipantContext.php 0000644 00000006545 15002236443 0020473 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Messaging\V1\Session; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class ParticipantContext extends InstanceContext { /** * Initialize the ParticipantContext * * @param \Twilio\Version $version Version that contains the resource * @param string $sessionSid The SID of the Session with the participant to * fetch * @param string $sid The SID that identifies the resource to fetch * @return \Twilio\Rest\Messaging\V1\Session\ParticipantContext */ public function __construct(Version $version, $sessionSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array('sessionSid' => $sessionSid, 'sid' => $sid, ); $this->uri = '/Sessions/' . \rawurlencode($sessionSid) . '/Participants/' . \rawurlencode($sid) . ''; } /** * Update the ParticipantInstance * * @param array|Options $options Optional Arguments * @return ParticipantInstance Updated ParticipantInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { $options = new Values($options); $data = Values::of(array( 'Attributes' => $options['attributes'], 'DateCreated' => Serialize::iso8601DateTime($options['dateCreated']), 'DateUpdated' => Serialize::iso8601DateTime($options['dateUpdated']), )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new ParticipantInstance( $this->version, $payload, $this->solution['sessionSid'], $this->solution['sid'] ); } /** * Fetch a ParticipantInstance * * @return ParticipantInstance Fetched ParticipantInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new ParticipantInstance( $this->version, $payload, $this->solution['sessionSid'], $this->solution['sid'] ); } /** * Deletes the ParticipantInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Messaging.V1.ParticipantContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Messaging/V1/Session/ParticipantPage.php 0000644 00000001722 15002236443 0017713 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Messaging\V1\Session; use Twilio\Page; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class ParticipantPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new ParticipantInstance($this->version, $payload, $this->solution['sessionSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Messaging.V1.ParticipantPage]'; } } sdk/src/Twilio/Rest/Messaging/V1/Session/WebhookContext.php 0000644 00000007441 15002236443 0017607 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Messaging\V1\Session; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class WebhookContext extends InstanceContext { /** * Initialize the WebhookContext * * @param \Twilio\Version $version Version that contains the resource * @param string $sessionSid The SID of the Session with the Webhook resource * to fetch * @param string $sid The SID of the resource to fetch * @return \Twilio\Rest\Messaging\V1\Session\WebhookContext */ public function __construct(Version $version, $sessionSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array('sessionSid' => $sessionSid, 'sid' => $sid, ); $this->uri = '/Sessions/' . \rawurlencode($sessionSid) . '/Webhooks/' . \rawurlencode($sid) . ''; } /** * Fetch a WebhookInstance * * @return WebhookInstance Fetched WebhookInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new WebhookInstance( $this->version, $payload, $this->solution['sessionSid'], $this->solution['sid'] ); } /** * Update the WebhookInstance * * @param array|Options $options Optional Arguments * @return WebhookInstance Updated WebhookInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { $options = new Values($options); $data = Values::of(array( 'Configuration.Url' => $options['configurationUrl'], 'Configuration.Method' => $options['configurationMethod'], 'Configuration.Filters' => Serialize::map($options['configurationFilters'], function($e) { return $e; }), 'Configuration.Triggers' => Serialize::map($options['configurationTriggers'], function($e) { return $e; }), 'Configuration.FlowSid' => $options['configurationFlowSid'], 'Configuration.RetryCount' => $options['configurationRetryCount'], 'Configuration.BufferMessages' => Serialize::booleanToString($options['configurationBufferMessages']), 'Configuration.BufferWindow' => $options['configurationBufferWindow'], )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new WebhookInstance( $this->version, $payload, $this->solution['sessionSid'], $this->solution['sid'] ); } /** * Deletes the WebhookInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Messaging.V1.WebhookContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Messaging/V1/Session/ParticipantOptions.php 0000644 00000022720 15002236443 0020473 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Messaging\V1\Session; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ abstract class ParticipantOptions { /** * @param string $identity The string that identifies the resource's User * @param string $userAddress The address of the participant's device * @param string $attributes A JSON string that stores application-specific data * @param string $twilioAddress The address of the Twilio phone number that the * participant is in contact with * @param \DateTime $dateCreated The ISO 8601 date and time in GMT when the * resource was created * @param \DateTime $dateUpdated The ISO 8601 date and time in GMT when the * resource was updated * @return CreateParticipantOptions Options builder */ public static function create($identity = Values::NONE, $userAddress = Values::NONE, $attributes = Values::NONE, $twilioAddress = Values::NONE, $dateCreated = Values::NONE, $dateUpdated = Values::NONE) { return new CreateParticipantOptions($identity, $userAddress, $attributes, $twilioAddress, $dateCreated, $dateUpdated); } /** * @param string $attributes A JSON string that stores application-specific data * @param \DateTime $dateCreated The ISO 8601 date and time in GMT when the * resource was created * @param \DateTime $dateUpdated The ISO 8601 date and time in GMT when the * resource was updated * @return UpdateParticipantOptions Options builder */ public static function update($attributes = Values::NONE, $dateCreated = Values::NONE, $dateUpdated = Values::NONE) { return new UpdateParticipantOptions($attributes, $dateCreated, $dateUpdated); } } class CreateParticipantOptions extends Options { /** * @param string $identity The string that identifies the resource's User * @param string $userAddress The address of the participant's device * @param string $attributes A JSON string that stores application-specific data * @param string $twilioAddress The address of the Twilio phone number that the * participant is in contact with * @param \DateTime $dateCreated The ISO 8601 date and time in GMT when the * resource was created * @param \DateTime $dateUpdated The ISO 8601 date and time in GMT when the * resource was updated */ public function __construct($identity = Values::NONE, $userAddress = Values::NONE, $attributes = Values::NONE, $twilioAddress = Values::NONE, $dateCreated = Values::NONE, $dateUpdated = Values::NONE) { $this->options['identity'] = $identity; $this->options['userAddress'] = $userAddress; $this->options['attributes'] = $attributes; $this->options['twilioAddress'] = $twilioAddress; $this->options['dateCreated'] = $dateCreated; $this->options['dateUpdated'] = $dateUpdated; } /** * The application-defined string that uniquely identifies the [Chat User](https://www.twilio.com/docs/chat/rest/user-resource) as the session participant. This parameter is null unless the participant is using the Programmable Chat SDK to communicate. * * @param string $identity The string that identifies the resource's User * @return $this Fluent Builder */ public function setIdentity($identity) { $this->options['identity'] = $identity; return $this; } /** * The address of the participant's device. Can be a phone number or Messenger ID. Together with the Twilio Address, this determines a participant uniquely. This field (with twilio_address) is null when the participant is interacting from a Chat endpoint (see the `identity` field). * * @param string $userAddress The address of the participant's device * @return $this Fluent Builder */ public function setUserAddress($userAddress) { $this->options['userAddress'] = $userAddress; return $this; } /** * A JSON string that stores application-specific data. * * @param string $attributes A JSON string that stores application-specific data * @return $this Fluent Builder */ public function setAttributes($attributes) { $this->options['attributes'] = $attributes; return $this; } /** * The address of the Twilio phone number, WhatsApp number, or Messenger Page ID that the participant is in contact with. This field, together with user_address, is only null when the participant is interacting from a Chat endpoint (see the 'identity' field). * * @param string $twilioAddress The address of the Twilio phone number that the * participant is in contact with * @return $this Fluent Builder */ public function setTwilioAddress($twilioAddress) { $this->options['twilioAddress'] = $twilioAddress; return $this; } /** * The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was created. This is used when importing messages from another system, as the provided value will be trusted and displayed on SDK clients. * * @param \DateTime $dateCreated The ISO 8601 date and time in GMT when the * resource was created * @return $this Fluent Builder */ public function setDateCreated($dateCreated) { $this->options['dateCreated'] = $dateCreated; return $this; } /** * The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was last updated. This is used when importing messages from another system, as the provided value will be trusted and displayed on SDK clients. * * @param \DateTime $dateUpdated The ISO 8601 date and time in GMT when the * resource was updated * @return $this Fluent Builder */ public function setDateUpdated($dateUpdated) { $this->options['dateUpdated'] = $dateUpdated; 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.Messaging.V1.CreateParticipantOptions ' . \implode(' ', $options) . ']'; } } class UpdateParticipantOptions extends Options { /** * @param string $attributes A JSON string that stores application-specific data * @param \DateTime $dateCreated The ISO 8601 date and time in GMT when the * resource was created * @param \DateTime $dateUpdated The ISO 8601 date and time in GMT when the * resource was updated */ public function __construct($attributes = Values::NONE, $dateCreated = Values::NONE, $dateUpdated = Values::NONE) { $this->options['attributes'] = $attributes; $this->options['dateCreated'] = $dateCreated; $this->options['dateUpdated'] = $dateUpdated; } /** * A JSON string that stores application-specific data. * * @param string $attributes A JSON string that stores application-specific data * @return $this Fluent Builder */ public function setAttributes($attributes) { $this->options['attributes'] = $attributes; return $this; } /** * The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was created. This is used when importing messages from another system, as the provided value will be trusted and displayed on SDK clients. * * @param \DateTime $dateCreated The ISO 8601 date and time in GMT when the * resource was created * @return $this Fluent Builder */ public function setDateCreated($dateCreated) { $this->options['dateCreated'] = $dateCreated; return $this; } /** * The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was last updated. * * @param \DateTime $dateUpdated The ISO 8601 date and time in GMT when the * resource was updated * @return $this Fluent Builder */ public function setDateUpdated($dateUpdated) { $this->options['dateUpdated'] = $dateUpdated; 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.Messaging.V1.UpdateParticipantOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Messaging/V1/Session/MessageOptions.php 0000644 00000020623 15002236443 0017601 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Messaging\V1\Session; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ abstract class MessageOptions { /** * @param string $author The identity of the message's author * @param string $attributes A JSON string that stores application-specific data * @param \DateTime $dateCreated The ISO 8601 date and time in GMT when the * resource was created * @param \DateTime $dateUpdated The ISO 8601 date and time in GMT when the * resource was updated * @param string $body The message body * @return CreateMessageOptions Options builder */ public static function create($author = Values::NONE, $attributes = Values::NONE, $dateCreated = Values::NONE, $dateUpdated = Values::NONE, $body = Values::NONE) { return new CreateMessageOptions($author, $attributes, $dateCreated, $dateUpdated, $body); } /** * @param string $author The identity of the message's author * @param string $attributes A JSON string that stores application-specific data * @param \DateTime $dateCreated The ISO 8601 date and time in GMT when the * resource was created * @param \DateTime $dateUpdated The ISO 8601 date and time in GMT when the * resource was updated * @param string $body The message body * @return UpdateMessageOptions Options builder */ public static function update($author = Values::NONE, $attributes = Values::NONE, $dateCreated = Values::NONE, $dateUpdated = Values::NONE, $body = Values::NONE) { return new UpdateMessageOptions($author, $attributes, $dateCreated, $dateUpdated, $body); } } class CreateMessageOptions extends Options { /** * @param string $author The identity of the message's author * @param string $attributes A JSON string that stores application-specific data * @param \DateTime $dateCreated The ISO 8601 date and time in GMT when the * resource was created * @param \DateTime $dateUpdated The ISO 8601 date and time in GMT when the * resource was updated * @param string $body The message body */ public function __construct($author = Values::NONE, $attributes = Values::NONE, $dateCreated = Values::NONE, $dateUpdated = Values::NONE, $body = Values::NONE) { $this->options['author'] = $author; $this->options['attributes'] = $attributes; $this->options['dateCreated'] = $dateCreated; $this->options['dateUpdated'] = $dateUpdated; $this->options['body'] = $body; } /** * The [identity](https://www.twilio.com/docs/chat/identity) of the message's author. Defaults to `system`. * * @param string $author The identity of the message's author * @return $this Fluent Builder */ public function setAuthor($author) { $this->options['author'] = $author; return $this; } /** * A JSON string that stores application-specific data. * * @param string $attributes A JSON string that stores application-specific data * @return $this Fluent Builder */ public function setAttributes($attributes) { $this->options['attributes'] = $attributes; return $this; } /** * The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was created. * * @param \DateTime $dateCreated The ISO 8601 date and time in GMT when the * resource was created * @return $this Fluent Builder */ public function setDateCreated($dateCreated) { $this->options['dateCreated'] = $dateCreated; return $this; } /** * The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was last updated. * * @param \DateTime $dateUpdated The ISO 8601 date and time in GMT when the * resource was updated * @return $this Fluent Builder */ public function setDateUpdated($dateUpdated) { $this->options['dateUpdated'] = $dateUpdated; return $this; } /** * The message body. * * @param string $body The message body * @return $this Fluent Builder */ public function setBody($body) { $this->options['body'] = $body; 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.Messaging.V1.CreateMessageOptions ' . \implode(' ', $options) . ']'; } } class UpdateMessageOptions extends Options { /** * @param string $author The identity of the message's author * @param string $attributes A JSON string that stores application-specific data * @param \DateTime $dateCreated The ISO 8601 date and time in GMT when the * resource was created * @param \DateTime $dateUpdated The ISO 8601 date and time in GMT when the * resource was updated * @param string $body The message body */ public function __construct($author = Values::NONE, $attributes = Values::NONE, $dateCreated = Values::NONE, $dateUpdated = Values::NONE, $body = Values::NONE) { $this->options['author'] = $author; $this->options['attributes'] = $attributes; $this->options['dateCreated'] = $dateCreated; $this->options['dateUpdated'] = $dateUpdated; $this->options['body'] = $body; } /** * The [identity](https://www.twilio.com/docs/chat/identity) of the message's author. Defaults to `system`. * * @param string $author The identity of the message's author * @return $this Fluent Builder */ public function setAuthor($author) { $this->options['author'] = $author; return $this; } /** * A JSON string that stores application-specific data. * * @param string $attributes A JSON string that stores application-specific data * @return $this Fluent Builder */ public function setAttributes($attributes) { $this->options['attributes'] = $attributes; return $this; } /** * The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was created. * * @param \DateTime $dateCreated The ISO 8601 date and time in GMT when the * resource was created * @return $this Fluent Builder */ public function setDateCreated($dateCreated) { $this->options['dateCreated'] = $dateCreated; return $this; } /** * The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was last updated. * * @param \DateTime $dateUpdated The ISO 8601 date and time in GMT when the * resource was updated * @return $this Fluent Builder */ public function setDateUpdated($dateUpdated) { $this->options['dateUpdated'] = $dateUpdated; return $this; } /** * The message body. * * @param string $body The message body * @return $this Fluent Builder */ public function setBody($body) { $this->options['body'] = $body; 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.Messaging.V1.UpdateMessageOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Messaging/V1/WebhookOptions.php 0000644 00000014737 15002236443 0016201 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Messaging\V1; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ abstract class WebhookOptions { /** * @param string $webhookMethod The HTTP method to use when sending a webhook * request * @param string $webhookFilters The list of webhook event triggers that are * enabled for the Service * @param string $preWebhookUrl The absolute URL of the pre-event webhook * @param string $postWebhookUrl The absolute URL of the post-event webhook * @param int $preWebhookRetryCount The number of times to try the pre-event * webhook request if the first attempt fails * @param int $postWebhookRetryCount The number of times to try the post-event * webhook request if the first attempt fails * @param string $target The routing target of the webhook * @return UpdateWebhookOptions Options builder */ public static function update($webhookMethod = Values::NONE, $webhookFilters = Values::NONE, $preWebhookUrl = Values::NONE, $postWebhookUrl = Values::NONE, $preWebhookRetryCount = Values::NONE, $postWebhookRetryCount = Values::NONE, $target = Values::NONE) { return new UpdateWebhookOptions($webhookMethod, $webhookFilters, $preWebhookUrl, $postWebhookUrl, $preWebhookRetryCount, $postWebhookRetryCount, $target); } } class UpdateWebhookOptions extends Options { /** * @param string $webhookMethod The HTTP method to use when sending a webhook * request * @param string $webhookFilters The list of webhook event triggers that are * enabled for the Service * @param string $preWebhookUrl The absolute URL of the pre-event webhook * @param string $postWebhookUrl The absolute URL of the post-event webhook * @param int $preWebhookRetryCount The number of times to try the pre-event * webhook request if the first attempt fails * @param int $postWebhookRetryCount The number of times to try the post-event * webhook request if the first attempt fails * @param string $target The routing target of the webhook */ public function __construct($webhookMethod = Values::NONE, $webhookFilters = Values::NONE, $preWebhookUrl = Values::NONE, $postWebhookUrl = Values::NONE, $preWebhookRetryCount = Values::NONE, $postWebhookRetryCount = Values::NONE, $target = Values::NONE) { $this->options['webhookMethod'] = $webhookMethod; $this->options['webhookFilters'] = $webhookFilters; $this->options['preWebhookUrl'] = $preWebhookUrl; $this->options['postWebhookUrl'] = $postWebhookUrl; $this->options['preWebhookRetryCount'] = $preWebhookRetryCount; $this->options['postWebhookRetryCount'] = $postWebhookRetryCount; $this->options['target'] = $target; } /** * The HTTP method to use when sending a webhook request. * * @param string $webhookMethod The HTTP method to use when sending a webhook * request * @return $this Fluent Builder */ public function setWebhookMethod($webhookMethod) { $this->options['webhookMethod'] = $webhookMethod; return $this; } /** * The list of webhook event triggers that are enabled for the Service. * * @param string $webhookFilters The list of webhook event triggers that are * enabled for the Service * @return $this Fluent Builder */ public function setWebhookFilters($webhookFilters) { $this->options['webhookFilters'] = $webhookFilters; return $this; } /** * The absolute URL of the pre-event webhook. * * @param string $preWebhookUrl The absolute URL of the pre-event webhook * @return $this Fluent Builder */ public function setPreWebhookUrl($preWebhookUrl) { $this->options['preWebhookUrl'] = $preWebhookUrl; return $this; } /** * The absolute URL of the post-event webhook. * * @param string $postWebhookUrl The absolute URL of the post-event webhook * @return $this Fluent Builder */ public function setPostWebhookUrl($postWebhookUrl) { $this->options['postWebhookUrl'] = $postWebhookUrl; return $this; } /** * The number of times to try the pre-event webhook request if the first attempt fails. Can be up to 3 and the default is 0. * * @param int $preWebhookRetryCount The number of times to try the pre-event * webhook request if the first attempt fails * @return $this Fluent Builder */ public function setPreWebhookRetryCount($preWebhookRetryCount) { $this->options['preWebhookRetryCount'] = $preWebhookRetryCount; return $this; } /** * The number of times to try the post-event webhook request if the first attempt fails. Can be up to 3 and the default is 0. * * @param int $postWebhookRetryCount The number of times to try the post-event * webhook request if the first attempt fails * @return $this Fluent Builder */ public function setPostWebhookRetryCount($postWebhookRetryCount) { $this->options['postWebhookRetryCount'] = $postWebhookRetryCount; return $this; } /** * The routing target of the webhook. Can be ordinary or routed internally to Flex * * @param string $target The routing target of the webhook * @return $this Fluent Builder */ public function setTarget($target) { $this->options['target'] = $target; 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.Messaging.V1.UpdateWebhookOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Messaging/V1/ServiceList.php 0000644 00000014674 15002236443 0015463 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Messaging\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class ServiceList extends ListResource { /** * Construct the ServiceList * * @param Version $version Version that contains the resource * @return \Twilio\Rest\Messaging\V1\ServiceList */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = array(); $this->uri = '/Services'; } /** * Create a new ServiceInstance * * @param string $friendlyName A string to describe the resource * @param array|Options $options Optional Arguments * @return ServiceInstance Newly created ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function create($friendlyName, $options = array()) { $options = new Values($options); $data = Values::of(array( 'FriendlyName' => $friendlyName, 'InboundRequestUrl' => $options['inboundRequestUrl'], 'InboundMethod' => $options['inboundMethod'], 'FallbackUrl' => $options['fallbackUrl'], 'FallbackMethod' => $options['fallbackMethod'], 'StatusCallback' => $options['statusCallback'], 'StickySender' => Serialize::booleanToString($options['stickySender']), 'MmsConverter' => Serialize::booleanToString($options['mmsConverter']), 'SmartEncoding' => Serialize::booleanToString($options['smartEncoding']), 'ScanMessageContent' => $options['scanMessageContent'], 'FallbackToLongCode' => Serialize::booleanToString($options['fallbackToLongCode']), 'AreaCodeGeomatch' => Serialize::booleanToString($options['areaCodeGeomatch']), 'ValidityPeriod' => $options['validityPeriod'], 'SynchronousValidation' => Serialize::booleanToString($options['synchronousValidation']), )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new ServiceInstance($this->version, $payload); } /** * Streams ServiceInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads ServiceInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return ServiceInstance[] Array of results */ public function read($limit = null, $pageSize = null) { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of ServiceInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of ServiceInstance */ public function page($pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $params = Values::of(array( 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new ServicePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of ServiceInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of ServiceInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new ServicePage($this->version, $response, $this->solution); } /** * Constructs a ServiceContext * * @param string $sid The SID that identifies the resource to fetch * @return \Twilio\Rest\Messaging\V1\ServiceContext */ public function getContext($sid) { return new ServiceContext($this->version, $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Messaging.V1.ServiceList]'; } } sdk/src/Twilio/Rest/Messaging/V1/SessionPage.php 0000644 00000001637 15002236443 0015442 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Messaging\V1; use Twilio\Page; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class SessionPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new SessionInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Messaging.V1.SessionPage]'; } } sdk/src/Twilio/Rest/Messaging/V1/WebhookPage.php 0000644 00000001637 15002236443 0015415 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Messaging\V1; use Twilio\Page; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class WebhookPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new WebhookInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Messaging.V1.WebhookPage]'; } } sdk/src/Twilio/Rest/Messaging/V1/ServicePage.php 0000644 00000001505 15002236443 0015411 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Messaging\V1; use Twilio\Page; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class ServicePage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new ServiceInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Messaging.V1.ServicePage]'; } } sdk/src/Twilio/Rest/Messaging/V1/SessionList.php 0000644 00000013744 15002236443 0015503 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Messaging\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class SessionList extends ListResource { /** * Construct the SessionList * * @param Version $version Version that contains the resource * @return \Twilio\Rest\Messaging\V1\SessionList */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = array(); $this->uri = '/Sessions'; } /** * Create a new SessionInstance * * @param string $messagingServiceSid The SID of the SMS Service the session * belongs to * @param array|Options $options Optional Arguments * @return SessionInstance Newly created SessionInstance * @throws TwilioException When an HTTP error occurs. */ public function create($messagingServiceSid, $options = array()) { $options = new Values($options); $data = Values::of(array( 'MessagingServiceSid' => $messagingServiceSid, 'FriendlyName' => $options['friendlyName'], 'Attributes' => $options['attributes'], 'DateCreated' => Serialize::iso8601DateTime($options['dateCreated']), 'DateUpdated' => Serialize::iso8601DateTime($options['dateUpdated']), 'CreatedBy' => $options['createdBy'], )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new SessionInstance($this->version, $payload); } /** * Streams SessionInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads SessionInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return SessionInstance[] Array of results */ public function read($limit = null, $pageSize = null) { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of SessionInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of SessionInstance */ public function page($pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $params = Values::of(array( 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new SessionPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of SessionInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of SessionInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new SessionPage($this->version, $response, $this->solution); } /** * Constructs a SessionContext * * @param string $sid The SID that identifies the resource to fetch * @return \Twilio\Rest\Messaging\V1\SessionContext */ public function getContext($sid) { return new SessionContext($this->version, $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Messaging.V1.SessionList]'; } } sdk/src/Twilio/Rest/Messaging/V1/WebhookList.php 0000644 00000002255 15002236443 0015451 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Messaging\V1; use Twilio\ListResource; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class WebhookList extends ListResource { /** * Construct the WebhookList * * @param Version $version Version that contains the resource * @return \Twilio\Rest\Messaging\V1\WebhookList */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = array(); } /** * Constructs a WebhookContext * * @return \Twilio\Rest\Messaging\V1\WebhookContext */ public function getContext() { return new WebhookContext($this->version); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Messaging.V1.WebhookList]'; } } sdk/src/Twilio/Rest/Messaging/V1/ServiceInstance.php 0000644 00000014403 15002236443 0016302 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Messaging\V1; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * * @property string $sid * @property string $accountSid * @property string $friendlyName * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $inboundRequestUrl * @property string $inboundMethod * @property string $fallbackUrl * @property string $fallbackMethod * @property string $statusCallback * @property bool $stickySender * @property bool $mmsConverter * @property bool $smartEncoding * @property string $scanMessageContent * @property bool $fallbackToLongCode * @property bool $areaCodeGeomatch * @property bool $synchronousValidation * @property int $validityPeriod * @property string $url * @property array $links */ class ServiceInstance extends InstanceResource { protected $_phoneNumbers = null; protected $_shortCodes = null; protected $_alphaSenders = null; /** * Initialize the ServiceInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The SID that identifies the resource to fetch * @return \Twilio\Rest\Messaging\V1\ServiceInstance */ public function __construct(Version $version, array $payload, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'inboundRequestUrl' => Values::array_get($payload, 'inbound_request_url'), 'inboundMethod' => Values::array_get($payload, 'inbound_method'), 'fallbackUrl' => Values::array_get($payload, 'fallback_url'), 'fallbackMethod' => Values::array_get($payload, 'fallback_method'), 'statusCallback' => Values::array_get($payload, 'status_callback'), 'stickySender' => Values::array_get($payload, 'sticky_sender'), 'mmsConverter' => Values::array_get($payload, 'mms_converter'), 'smartEncoding' => Values::array_get($payload, 'smart_encoding'), 'scanMessageContent' => Values::array_get($payload, 'scan_message_content'), 'fallbackToLongCode' => Values::array_get($payload, 'fallback_to_long_code'), 'areaCodeGeomatch' => Values::array_get($payload, 'area_code_geomatch'), 'synchronousValidation' => Values::array_get($payload, 'synchronous_validation'), 'validityPeriod' => Values::array_get($payload, 'validity_period'), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ); $this->solution = array('sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Messaging\V1\ServiceContext Context for this * ServiceInstance */ protected function proxy() { if (!$this->context) { $this->context = new ServiceContext($this->version, $this->solution['sid']); } return $this->context; } /** * Update the ServiceInstance * * @param array|Options $options Optional Arguments * @return ServiceInstance Updated ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Fetch a ServiceInstance * * @return ServiceInstance Fetched ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the ServiceInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Access the phoneNumbers * * @return \Twilio\Rest\Messaging\V1\Service\PhoneNumberList */ protected function getPhoneNumbers() { return $this->proxy()->phoneNumbers; } /** * Access the shortCodes * * @return \Twilio\Rest\Messaging\V1\Service\ShortCodeList */ protected function getShortCodes() { return $this->proxy()->shortCodes; } /** * Access the alphaSenders * * @return \Twilio\Rest\Messaging\V1\Service\AlphaSenderList */ protected function getAlphaSenders() { return $this->proxy()->alphaSenders; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Messaging.V1.ServiceInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Messaging/V1/WebhookContext.php 0000644 00000005346 15002236443 0016166 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Messaging\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class WebhookContext extends InstanceContext { /** * Initialize the WebhookContext * * @param \Twilio\Version $version Version that contains the resource * @return \Twilio\Rest\Messaging\V1\WebhookContext */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = array(); $this->uri = '/Sessions/Webhooks'; } /** * Fetch a WebhookInstance * * @return WebhookInstance Fetched WebhookInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new WebhookInstance($this->version, $payload); } /** * Update the WebhookInstance * * @param array|Options $options Optional Arguments * @return WebhookInstance Updated WebhookInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { $options = new Values($options); $data = Values::of(array( 'WebhookMethod' => $options['webhookMethod'], 'WebhookFilters' => Serialize::map($options['webhookFilters'], function($e) { return $e; }), 'PreWebhookUrl' => $options['preWebhookUrl'], 'PostWebhookUrl' => $options['postWebhookUrl'], 'PreWebhookRetryCount' => $options['preWebhookRetryCount'], 'PostWebhookRetryCount' => $options['postWebhookRetryCount'], 'Target' => $options['target'], )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new WebhookInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Messaging.V1.WebhookContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Messaging/V1/Service/ShortCodeContext.php 0000644 00000004425 15002236443 0020057 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Messaging\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class ShortCodeContext extends InstanceContext { /** * Initialize the ShortCodeContext * * @param \Twilio\Version $version Version that contains the resource * @param string $serviceSid The SID of the Service to fetch the resource from * @param string $sid The SID that identifies the resource to fetch * @return \Twilio\Rest\Messaging\V1\Service\ShortCodeContext */ public function __construct(Version $version, $serviceSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, 'sid' => $sid, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/ShortCodes/' . \rawurlencode($sid) . ''; } /** * Deletes the ShortCodeInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Fetch a ShortCodeInstance * * @return ShortCodeInstance Fetched ShortCodeInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new ShortCodeInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Messaging.V1.ShortCodeContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Messaging/V1/Service/AlphaSenderInstance.php 0000644 00000010324 15002236443 0020466 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Messaging\V1\Service; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * * @property string $sid * @property string $accountSid * @property string $serviceSid * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $alphaSender * @property array $capabilities * @property string $url */ class AlphaSenderInstance extends InstanceResource { /** * Initialize the AlphaSenderInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the Service that the resource is * associated with * @param string $sid The SID that identifies the resource to fetch * @return \Twilio\Rest\Messaging\V1\Service\AlphaSenderInstance */ public function __construct(Version $version, array $payload, $serviceSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'alphaSender' => Values::array_get($payload, 'alpha_sender'), 'capabilities' => Values::array_get($payload, 'capabilities'), 'url' => Values::array_get($payload, 'url'), ); $this->solution = array('serviceSid' => $serviceSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Messaging\V1\Service\AlphaSenderContext Context for * this * AlphaSenderInstance */ protected function proxy() { if (!$this->context) { $this->context = new AlphaSenderContext( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch a AlphaSenderInstance * * @return AlphaSenderInstance Fetched AlphaSenderInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the AlphaSenderInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Messaging.V1.AlphaSenderInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Messaging/V1/Service/ShortCodePage.php 0000644 00000001562 15002236443 0017306 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Messaging\V1\Service; use Twilio\Page; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class ShortCodePage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new ShortCodeInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Messaging.V1.ShortCodePage]'; } } sdk/src/Twilio/Rest/Messaging/V1/Service/PhoneNumberPage.php 0000644 00000001570 15002236443 0017635 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Messaging\V1\Service; use Twilio\Page; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class PhoneNumberPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new PhoneNumberInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Messaging.V1.PhoneNumberPage]'; } } sdk/src/Twilio/Rest/Messaging/V1/Service/ShortCodeInstance.php 0000644 00000010336 15002236443 0020175 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Messaging\V1\Service; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * * @property string $sid * @property string $accountSid * @property string $serviceSid * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $shortCode * @property string $countryCode * @property string $capabilities * @property string $url */ class ShortCodeInstance extends InstanceResource { /** * Initialize the ShortCodeInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the Service that the resource is * associated with * @param string $sid The SID that identifies the resource to fetch * @return \Twilio\Rest\Messaging\V1\Service\ShortCodeInstance */ public function __construct(Version $version, array $payload, $serviceSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'shortCode' => Values::array_get($payload, 'short_code'), 'countryCode' => Values::array_get($payload, 'country_code'), 'capabilities' => Values::array_get($payload, 'capabilities'), 'url' => Values::array_get($payload, 'url'), ); $this->solution = array('serviceSid' => $serviceSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Messaging\V1\Service\ShortCodeContext Context for this * ShortCodeInstance */ protected function proxy() { if (!$this->context) { $this->context = new ShortCodeContext( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->context; } /** * Deletes the ShortCodeInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Fetch a ShortCodeInstance * * @return ShortCodeInstance Fetched ShortCodeInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Messaging.V1.ShortCodeInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Messaging/V1/Service/ShortCodeList.php 0000644 00000013306 15002236443 0017344 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Messaging\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class ShortCodeList extends ListResource { /** * Construct the ShortCodeList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Service that the resource is * associated with * @return \Twilio\Rest\Messaging\V1\Service\ShortCodeList */ public function __construct(Version $version, $serviceSid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/ShortCodes'; } /** * Create a new ShortCodeInstance * * @param string $shortCodeSid The SID of the ShortCode being added to the * Service * @return ShortCodeInstance Newly created ShortCodeInstance * @throws TwilioException When an HTTP error occurs. */ public function create($shortCodeSid) { $data = Values::of(array('ShortCodeSid' => $shortCodeSid, )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new ShortCodeInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Streams ShortCodeInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads ShortCodeInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return ShortCodeInstance[] Array of results */ public function read($limit = null, $pageSize = null) { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of ShortCodeInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of ShortCodeInstance */ public function page($pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $params = Values::of(array( 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new ShortCodePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of ShortCodeInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of ShortCodeInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new ShortCodePage($this->version, $response, $this->solution); } /** * Constructs a ShortCodeContext * * @param string $sid The SID that identifies the resource to fetch * @return \Twilio\Rest\Messaging\V1\Service\ShortCodeContext */ public function getContext($sid) { return new ShortCodeContext($this->version, $this->solution['serviceSid'], $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Messaging.V1.ShortCodeList]'; } } sdk/src/Twilio/Rest/Messaging/V1/Service/AlphaSenderPage.php 0000644 00000001570 15002236443 0017601 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Messaging\V1\Service; use Twilio\Page; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class AlphaSenderPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new AlphaSenderInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Messaging.V1.AlphaSenderPage]'; } } sdk/src/Twilio/Rest/Messaging/V1/Service/PhoneNumberContext.php 0000644 00000004451 15002236443 0020406 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Messaging\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class PhoneNumberContext extends InstanceContext { /** * Initialize the PhoneNumberContext * * @param \Twilio\Version $version Version that contains the resource * @param string $serviceSid The SID of the Service to fetch the resource from * @param string $sid The SID that identifies the resource to fetch * @return \Twilio\Rest\Messaging\V1\Service\PhoneNumberContext */ public function __construct(Version $version, $serviceSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, 'sid' => $sid, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/PhoneNumbers/' . \rawurlencode($sid) . ''; } /** * Deletes the PhoneNumberInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Fetch a PhoneNumberInstance * * @return PhoneNumberInstance Fetched PhoneNumberInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new PhoneNumberInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Messaging.V1.PhoneNumberContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Messaging/V1/Service/AlphaSenderContext.php 0000644 00000004524 15002236443 0020353 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Messaging\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class AlphaSenderContext extends InstanceContext { /** * Initialize the AlphaSenderContext * * @param \Twilio\Version $version Version that contains the resource * @param string $serviceSid The SID of the Messaging Service to fetch the * resource from * @param string $sid The SID that identifies the resource to fetch * @return \Twilio\Rest\Messaging\V1\Service\AlphaSenderContext */ public function __construct(Version $version, $serviceSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, 'sid' => $sid, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/AlphaSenders/' . \rawurlencode($sid) . ''; } /** * Fetch a AlphaSenderInstance * * @return AlphaSenderInstance Fetched AlphaSenderInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new AlphaSenderInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Deletes the AlphaSenderInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Messaging.V1.AlphaSenderContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Messaging/V1/Service/AlphaSenderList.php 0000644 00000013267 15002236443 0017646 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Messaging\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class AlphaSenderList extends ListResource { /** * Construct the AlphaSenderList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Service that the resource is * associated with * @return \Twilio\Rest\Messaging\V1\Service\AlphaSenderList */ public function __construct(Version $version, $serviceSid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/AlphaSenders'; } /** * Create a new AlphaSenderInstance * * @param string $alphaSender The Alphanumeric Sender ID string * @return AlphaSenderInstance Newly created AlphaSenderInstance * @throws TwilioException When an HTTP error occurs. */ public function create($alphaSender) { $data = Values::of(array('AlphaSender' => $alphaSender, )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new AlphaSenderInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Streams AlphaSenderInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads AlphaSenderInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return AlphaSenderInstance[] Array of results */ public function read($limit = null, $pageSize = null) { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of AlphaSenderInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of AlphaSenderInstance */ public function page($pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $params = Values::of(array( 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new AlphaSenderPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of AlphaSenderInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of AlphaSenderInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new AlphaSenderPage($this->version, $response, $this->solution); } /** * Constructs a AlphaSenderContext * * @param string $sid The SID that identifies the resource to fetch * @return \Twilio\Rest\Messaging\V1\Service\AlphaSenderContext */ public function getContext($sid) { return new AlphaSenderContext($this->version, $this->solution['serviceSid'], $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Messaging.V1.AlphaSenderList]'; } } sdk/src/Twilio/Rest/Messaging/V1/Service/PhoneNumberInstance.php 0000644 00000010500 15002236443 0020516 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Messaging\V1\Service; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * * @property string $sid * @property string $accountSid * @property string $serviceSid * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $phoneNumber * @property string $countryCode * @property string $capabilities * @property string $url */ class PhoneNumberInstance extends InstanceResource { /** * Initialize the PhoneNumberInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the Service that the resource is * associated with * @param string $sid The SID that identifies the resource to fetch * @return \Twilio\Rest\Messaging\V1\Service\PhoneNumberInstance */ public function __construct(Version $version, array $payload, $serviceSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'phoneNumber' => Values::array_get($payload, 'phone_number'), 'countryCode' => Values::array_get($payload, 'country_code'), 'capabilities' => Values::array_get($payload, 'capabilities'), 'url' => Values::array_get($payload, 'url'), ); $this->solution = array('serviceSid' => $serviceSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Messaging\V1\Service\PhoneNumberContext Context for * this * PhoneNumberInstance */ protected function proxy() { if (!$this->context) { $this->context = new PhoneNumberContext( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->context; } /** * Deletes the PhoneNumberInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Fetch a PhoneNumberInstance * * @return PhoneNumberInstance Fetched PhoneNumberInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Messaging.V1.PhoneNumberInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Messaging/V1/Service/PhoneNumberList.php 0000644 00000013375 15002236443 0017702 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Messaging\V1\Service; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class PhoneNumberList extends ListResource { /** * Construct the PhoneNumberList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Service that the resource is * associated with * @return \Twilio\Rest\Messaging\V1\Service\PhoneNumberList */ public function __construct(Version $version, $serviceSid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/PhoneNumbers'; } /** * Create a new PhoneNumberInstance * * @param string $phoneNumberSid The SID of the Phone Number being added to the * Service * @return PhoneNumberInstance Newly created PhoneNumberInstance * @throws TwilioException When an HTTP error occurs. */ public function create($phoneNumberSid) { $data = Values::of(array('PhoneNumberSid' => $phoneNumberSid, )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new PhoneNumberInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Streams PhoneNumberInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads PhoneNumberInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return PhoneNumberInstance[] Array of results */ public function read($limit = null, $pageSize = null) { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of PhoneNumberInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of PhoneNumberInstance */ public function page($pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $params = Values::of(array( 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new PhoneNumberPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of PhoneNumberInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of PhoneNumberInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new PhoneNumberPage($this->version, $response, $this->solution); } /** * Constructs a PhoneNumberContext * * @param string $sid The SID that identifies the resource to fetch * @return \Twilio\Rest\Messaging\V1\Service\PhoneNumberContext */ public function getContext($sid) { return new PhoneNumberContext($this->version, $this->solution['serviceSid'], $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Messaging.V1.PhoneNumberList]'; } } sdk/src/Twilio/Rest/Messaging/V1/SessionOptions.php 0000644 00000021653 15002236443 0016221 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Messaging\V1; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ abstract class SessionOptions { /** * @param string $friendlyName A string to describe the resource * @param string $attributes A JSON string that stores application-specific data * @param \DateTime $dateCreated The ISO 8601 date and time in GMT when the * resource was created * @param \DateTime $dateUpdated The ISO 8601 date and time in GMT when the * resource was updated * @param string $createdBy The Identity of the session's creator * @return CreateSessionOptions Options builder */ public static function create($friendlyName = Values::NONE, $attributes = Values::NONE, $dateCreated = Values::NONE, $dateUpdated = Values::NONE, $createdBy = Values::NONE) { return new CreateSessionOptions($friendlyName, $attributes, $dateCreated, $dateUpdated, $createdBy); } /** * @param string $friendlyName A string to describe the resource * @param string $attributes A JSON string that stores application-specific data * @param \DateTime $dateCreated The ISO 8601 date and time in GMT when the * resource was created * @param \DateTime $dateUpdated The ISO 8601 date and time in GMT when the * resource was updated * @param string $createdBy The Identity of the session's creator * @return UpdateSessionOptions Options builder */ public static function update($friendlyName = Values::NONE, $attributes = Values::NONE, $dateCreated = Values::NONE, $dateUpdated = Values::NONE, $createdBy = Values::NONE) { return new UpdateSessionOptions($friendlyName, $attributes, $dateCreated, $dateUpdated, $createdBy); } } class CreateSessionOptions extends Options { /** * @param string $friendlyName A string to describe the resource * @param string $attributes A JSON string that stores application-specific data * @param \DateTime $dateCreated The ISO 8601 date and time in GMT when the * resource was created * @param \DateTime $dateUpdated The ISO 8601 date and time in GMT when the * resource was updated * @param string $createdBy The Identity of the session's creator */ public function __construct($friendlyName = Values::NONE, $attributes = Values::NONE, $dateCreated = Values::NONE, $dateUpdated = Values::NONE, $createdBy = Values::NONE) { $this->options['friendlyName'] = $friendlyName; $this->options['attributes'] = $attributes; $this->options['dateCreated'] = $dateCreated; $this->options['dateUpdated'] = $dateUpdated; $this->options['createdBy'] = $createdBy; } /** * A descriptive string that you create to describe the resource. It can be up to 64 characters long. * * @param string $friendlyName A string to describe the resource * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * A JSON string that stores application-specific data. * * @param string $attributes A JSON string that stores application-specific data * @return $this Fluent Builder */ public function setAttributes($attributes) { $this->options['attributes'] = $attributes; return $this; } /** * The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was created. * * @param \DateTime $dateCreated The ISO 8601 date and time in GMT when the * resource was created * @return $this Fluent Builder */ public function setDateCreated($dateCreated) { $this->options['dateCreated'] = $dateCreated; return $this; } /** * The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was last updated. * * @param \DateTime $dateUpdated The ISO 8601 date and time in GMT when the * resource was updated * @return $this Fluent Builder */ public function setDateUpdated($dateUpdated) { $this->options['dateUpdated'] = $dateUpdated; return $this; } /** * The Identity of the session's creator. If the Session was created through the API, the value will be `system` * * @param string $createdBy The Identity of the session's creator * @return $this Fluent Builder */ public function setCreatedBy($createdBy) { $this->options['createdBy'] = $createdBy; 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.Messaging.V1.CreateSessionOptions ' . \implode(' ', $options) . ']'; } } class UpdateSessionOptions extends Options { /** * @param string $friendlyName A string to describe the resource * @param string $attributes A JSON string that stores application-specific data * @param \DateTime $dateCreated The ISO 8601 date and time in GMT when the * resource was created * @param \DateTime $dateUpdated The ISO 8601 date and time in GMT when the * resource was updated * @param string $createdBy The Identity of the session's creator */ public function __construct($friendlyName = Values::NONE, $attributes = Values::NONE, $dateCreated = Values::NONE, $dateUpdated = Values::NONE, $createdBy = Values::NONE) { $this->options['friendlyName'] = $friendlyName; $this->options['attributes'] = $attributes; $this->options['dateCreated'] = $dateCreated; $this->options['dateUpdated'] = $dateUpdated; $this->options['createdBy'] = $createdBy; } /** * A descriptive string that you create to describe the resource. It can be up to 64 characters long. * * @param string $friendlyName A string to describe the resource * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * A JSON string that stores application-specific data. * * @param string $attributes A JSON string that stores application-specific data * @return $this Fluent Builder */ public function setAttributes($attributes) { $this->options['attributes'] = $attributes; return $this; } /** * The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was created. * * @param \DateTime $dateCreated The ISO 8601 date and time in GMT when the * resource was created * @return $this Fluent Builder */ public function setDateCreated($dateCreated) { $this->options['dateCreated'] = $dateCreated; return $this; } /** * The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was last updated. * * @param \DateTime $dateUpdated The ISO 8601 date and time in GMT when the * resource was updated * @return $this Fluent Builder */ public function setDateUpdated($dateUpdated) { $this->options['dateUpdated'] = $dateUpdated; return $this; } /** * The Identity of the session's creator. If the Session was created through the API, the value will be `system` * * @param string $createdBy The Identity of the session's creator * @return $this Fluent Builder */ public function setCreatedBy($createdBy) { $this->options['createdBy'] = $createdBy; 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.Messaging.V1.UpdateSessionOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Messaging/V1/ServiceContext.php 0000644 00000014672 15002236443 0016172 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Messaging\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Rest\Messaging\V1\Service\AlphaSenderList; use Twilio\Rest\Messaging\V1\Service\PhoneNumberList; use Twilio\Rest\Messaging\V1\Service\ShortCodeList; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * * @property \Twilio\Rest\Messaging\V1\Service\PhoneNumberList $phoneNumbers * @property \Twilio\Rest\Messaging\V1\Service\ShortCodeList $shortCodes * @property \Twilio\Rest\Messaging\V1\Service\AlphaSenderList $alphaSenders * @method \Twilio\Rest\Messaging\V1\Service\PhoneNumberContext phoneNumbers(string $sid) * @method \Twilio\Rest\Messaging\V1\Service\ShortCodeContext shortCodes(string $sid) * @method \Twilio\Rest\Messaging\V1\Service\AlphaSenderContext alphaSenders(string $sid) */ class ServiceContext extends InstanceContext { protected $_phoneNumbers = null; protected $_shortCodes = null; protected $_alphaSenders = null; /** * Initialize the ServiceContext * * @param \Twilio\Version $version Version that contains the resource * @param string $sid The SID that identifies the resource to fetch * @return \Twilio\Rest\Messaging\V1\ServiceContext */ public function __construct(Version $version, $sid) { parent::__construct($version); // Path Solution $this->solution = array('sid' => $sid, ); $this->uri = '/Services/' . \rawurlencode($sid) . ''; } /** * Update the ServiceInstance * * @param array|Options $options Optional Arguments * @return ServiceInstance Updated ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { $options = new Values($options); $data = Values::of(array( 'FriendlyName' => $options['friendlyName'], 'InboundRequestUrl' => $options['inboundRequestUrl'], 'InboundMethod' => $options['inboundMethod'], 'FallbackUrl' => $options['fallbackUrl'], 'FallbackMethod' => $options['fallbackMethod'], 'StatusCallback' => $options['statusCallback'], 'StickySender' => Serialize::booleanToString($options['stickySender']), 'MmsConverter' => Serialize::booleanToString($options['mmsConverter']), 'SmartEncoding' => Serialize::booleanToString($options['smartEncoding']), 'ScanMessageContent' => $options['scanMessageContent'], 'FallbackToLongCode' => Serialize::booleanToString($options['fallbackToLongCode']), 'AreaCodeGeomatch' => Serialize::booleanToString($options['areaCodeGeomatch']), 'ValidityPeriod' => $options['validityPeriod'], 'SynchronousValidation' => Serialize::booleanToString($options['synchronousValidation']), )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new ServiceInstance($this->version, $payload, $this->solution['sid']); } /** * Fetch a ServiceInstance * * @return ServiceInstance Fetched ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new ServiceInstance($this->version, $payload, $this->solution['sid']); } /** * Deletes the ServiceInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Access the phoneNumbers * * @return \Twilio\Rest\Messaging\V1\Service\PhoneNumberList */ protected function getPhoneNumbers() { if (!$this->_phoneNumbers) { $this->_phoneNumbers = new PhoneNumberList($this->version, $this->solution['sid']); } return $this->_phoneNumbers; } /** * Access the shortCodes * * @return \Twilio\Rest\Messaging\V1\Service\ShortCodeList */ protected function getShortCodes() { if (!$this->_shortCodes) { $this->_shortCodes = new ShortCodeList($this->version, $this->solution['sid']); } return $this->_shortCodes; } /** * Access the alphaSenders * * @return \Twilio\Rest\Messaging\V1\Service\AlphaSenderList */ protected function getAlphaSenders() { if (!$this->_alphaSenders) { $this->_alphaSenders = new AlphaSenderList($this->version, $this->solution['sid']); } return $this->_alphaSenders; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get($name) { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Messaging.V1.ServiceContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Messaging/V1/SessionContext.php 0000644 00000013406 15002236443 0016207 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Messaging\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Rest\Messaging\V1\Session\MessageList; use Twilio\Rest\Messaging\V1\Session\ParticipantList; use Twilio\Rest\Messaging\V1\Session\WebhookList; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property \Twilio\Rest\Messaging\V1\Session\ParticipantList $participants * @property \Twilio\Rest\Messaging\V1\Session\MessageList $messages * @property \Twilio\Rest\Messaging\V1\Session\WebhookList $webhooks * @method \Twilio\Rest\Messaging\V1\Session\ParticipantContext participants(string $sid) * @method \Twilio\Rest\Messaging\V1\Session\MessageContext messages(string $sid) * @method \Twilio\Rest\Messaging\V1\Session\WebhookContext webhooks(string $sid) */ class SessionContext extends InstanceContext { protected $_participants = null; protected $_messages = null; protected $_webhooks = null; /** * Initialize the SessionContext * * @param \Twilio\Version $version Version that contains the resource * @param string $sid The SID that identifies the resource to fetch * @return \Twilio\Rest\Messaging\V1\SessionContext */ public function __construct(Version $version, $sid) { parent::__construct($version); // Path Solution $this->solution = array('sid' => $sid, ); $this->uri = '/Sessions/' . \rawurlencode($sid) . ''; } /** * Fetch a SessionInstance * * @return SessionInstance Fetched SessionInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new SessionInstance($this->version, $payload, $this->solution['sid']); } /** * Deletes the SessionInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Update the SessionInstance * * @param array|Options $options Optional Arguments * @return SessionInstance Updated SessionInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { $options = new Values($options); $data = Values::of(array( 'FriendlyName' => $options['friendlyName'], 'Attributes' => $options['attributes'], 'DateCreated' => Serialize::iso8601DateTime($options['dateCreated']), 'DateUpdated' => Serialize::iso8601DateTime($options['dateUpdated']), 'CreatedBy' => $options['createdBy'], )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new SessionInstance($this->version, $payload, $this->solution['sid']); } /** * Access the participants * * @return \Twilio\Rest\Messaging\V1\Session\ParticipantList */ protected function getParticipants() { if (!$this->_participants) { $this->_participants = new ParticipantList($this->version, $this->solution['sid']); } return $this->_participants; } /** * Access the messages * * @return \Twilio\Rest\Messaging\V1\Session\MessageList */ protected function getMessages() { if (!$this->_messages) { $this->_messages = new MessageList($this->version, $this->solution['sid']); } return $this->_messages; } /** * Access the webhooks * * @return \Twilio\Rest\Messaging\V1\Session\WebhookList */ protected function getWebhooks() { if (!$this->_webhooks) { $this->_webhooks = new WebhookList($this->version, $this->solution['sid']); } return $this->_webhooks; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get($name) { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Messaging.V1.SessionContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/IpMessaging.php 0000644 00000007077 15002236443 0013231 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\Rest\IpMessaging\V1; use Twilio\Rest\IpMessaging\V2; /** * @property \Twilio\Rest\IpMessaging\V1 $v1 * @property \Twilio\Rest\IpMessaging\V2 $v2 * @property \Twilio\Rest\IpMessaging\V2\CredentialList $credentials * @property \Twilio\Rest\IpMessaging\V2\ServiceList $services * @method \Twilio\Rest\IpMessaging\V2\CredentialContext credentials(string $sid) * @method \Twilio\Rest\IpMessaging\V2\ServiceContext services(string $sid) */ class IpMessaging extends Domain { protected $_v1 = null; protected $_v2 = null; /** * Construct the IpMessaging Domain * * @param \Twilio\Rest\Client $client Twilio\Rest\Client to communicate with * Twilio * @return \Twilio\Rest\IpMessaging Domain for IpMessaging */ public function __construct(Client $client) { parent::__construct($client); $this->baseUrl = 'https://chat.twilio.com'; } /** * @return \Twilio\Rest\IpMessaging\V1 Version v1 of ip_messaging */ protected function getV1() { if (!$this->_v1) { $this->_v1 = new V1($this); } return $this->_v1; } /** * @return \Twilio\Rest\IpMessaging\V2 Version v2 of ip_messaging */ protected function getV2() { if (!$this->_v2) { $this->_v2 = new V2($this); } return $this->_v2; } /** * Magic getter to lazy load version * * @param string $name Version to return * @return \Twilio\Version The requested version * @throws TwilioException For unknown versions */ public function __get($name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown version ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $method = 'context' . \ucfirst($name); if (\method_exists($this, $method)) { return \call_user_func_array(array($this, $method), $arguments); } throw new TwilioException('Unknown context ' . $name); } /** * @return \Twilio\Rest\IpMessaging\V2\CredentialList */ protected function getCredentials() { return $this->v2->credentials; } /** * @param string $sid The SID of the Credential resource to fetch * @return \Twilio\Rest\IpMessaging\V2\CredentialContext */ protected function contextCredentials($sid) { return $this->v2->credentials($sid); } /** * @return \Twilio\Rest\IpMessaging\V2\ServiceList */ protected function getServices() { return $this->v2->services; } /** * @param string $sid The SID of the Service resource to fetch * @return \Twilio\Rest\IpMessaging\V2\ServiceContext */ protected function contextServices($sid) { return $this->v2->services($sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.IpMessaging]'; } } sdk/src/Twilio/Rest/Video/V1.php 0000644 00000011114 15002236443 0012342 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Video; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\Rest\Video\V1\CompositionHookList; use Twilio\Rest\Video\V1\CompositionList; use Twilio\Rest\Video\V1\CompositionSettingsList; use Twilio\Rest\Video\V1\RecordingList; use Twilio\Rest\Video\V1\RecordingSettingsList; use Twilio\Rest\Video\V1\RoomList; use Twilio\Version; /** * @property \Twilio\Rest\Video\V1\CompositionList $compositions * @property \Twilio\Rest\Video\V1\CompositionHookList $compositionHooks * @property \Twilio\Rest\Video\V1\CompositionSettingsList $compositionSettings * @property \Twilio\Rest\Video\V1\RecordingList $recordings * @property \Twilio\Rest\Video\V1\RecordingSettingsList $recordingSettings * @property \Twilio\Rest\Video\V1\RoomList $rooms * @method \Twilio\Rest\Video\V1\CompositionContext compositions(string $sid) * @method \Twilio\Rest\Video\V1\CompositionHookContext compositionHooks(string $sid) * @method \Twilio\Rest\Video\V1\RecordingContext recordings(string $sid) * @method \Twilio\Rest\Video\V1\RoomContext rooms(string $sid) */ class V1 extends Version { protected $_compositions = null; protected $_compositionHooks = null; protected $_compositionSettings = null; protected $_recordings = null; protected $_recordingSettings = null; protected $_rooms = null; /** * Construct the V1 version of Video * * @param \Twilio\Domain $domain Domain that contains the version * @return \Twilio\Rest\Video\V1 V1 version of Video */ public function __construct(Domain $domain) { parent::__construct($domain); $this->version = 'v1'; } /** * @return \Twilio\Rest\Video\V1\CompositionList */ protected function getCompositions() { if (!$this->_compositions) { $this->_compositions = new CompositionList($this); } return $this->_compositions; } /** * @return \Twilio\Rest\Video\V1\CompositionHookList */ protected function getCompositionHooks() { if (!$this->_compositionHooks) { $this->_compositionHooks = new CompositionHookList($this); } return $this->_compositionHooks; } /** * @return \Twilio\Rest\Video\V1\CompositionSettingsList */ protected function getCompositionSettings() { if (!$this->_compositionSettings) { $this->_compositionSettings = new CompositionSettingsList($this); } return $this->_compositionSettings; } /** * @return \Twilio\Rest\Video\V1\RecordingList */ protected function getRecordings() { if (!$this->_recordings) { $this->_recordings = new RecordingList($this); } return $this->_recordings; } /** * @return \Twilio\Rest\Video\V1\RecordingSettingsList */ protected function getRecordingSettings() { if (!$this->_recordingSettings) { $this->_recordingSettings = new RecordingSettingsList($this); } return $this->_recordingSettings; } /** * @return \Twilio\Rest\Video\V1\RoomList */ protected function getRooms() { if (!$this->_rooms) { $this->_rooms = new RoomList($this); } return $this->_rooms; } /** * Magic getter to lazy load root resources * * @param string $name Resource to return * @return \Twilio\ListResource The requested resource * @throws TwilioException For unknown resource */ public function __get($name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown resource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Video.V1]'; } } sdk/src/Twilio/Rest/Video/V1/CompositionSettingsOptions.php 0000644 00000012465 15002236443 0017754 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Video\V1; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ abstract class CompositionSettingsOptions { /** * @param string $awsCredentialsSid The SID of the stored Credential resource * @param string $encryptionKeySid The SID of the Public Key resource to use * for encryption * @param string $awsS3Url The URL of the AWS S3 bucket where the compositions * should be stored * @param bool $awsStorageEnabled Whether all compositions should be written to * the aws_s3_url * @param bool $encryptionEnabled Whether all compositions should be stored in * an encrypted form * @return CreateCompositionSettingsOptions Options builder */ public static function create($awsCredentialsSid = Values::NONE, $encryptionKeySid = Values::NONE, $awsS3Url = Values::NONE, $awsStorageEnabled = Values::NONE, $encryptionEnabled = Values::NONE) { return new CreateCompositionSettingsOptions($awsCredentialsSid, $encryptionKeySid, $awsS3Url, $awsStorageEnabled, $encryptionEnabled); } } class CreateCompositionSettingsOptions extends Options { /** * @param string $awsCredentialsSid The SID of the stored Credential resource * @param string $encryptionKeySid The SID of the Public Key resource to use * for encryption * @param string $awsS3Url The URL of the AWS S3 bucket where the compositions * should be stored * @param bool $awsStorageEnabled Whether all compositions should be written to * the aws_s3_url * @param bool $encryptionEnabled Whether all compositions should be stored in * an encrypted form */ public function __construct($awsCredentialsSid = Values::NONE, $encryptionKeySid = Values::NONE, $awsS3Url = Values::NONE, $awsStorageEnabled = Values::NONE, $encryptionEnabled = Values::NONE) { $this->options['awsCredentialsSid'] = $awsCredentialsSid; $this->options['encryptionKeySid'] = $encryptionKeySid; $this->options['awsS3Url'] = $awsS3Url; $this->options['awsStorageEnabled'] = $awsStorageEnabled; $this->options['encryptionEnabled'] = $encryptionEnabled; } /** * The SID of the stored Credential resource. * * @param string $awsCredentialsSid The SID of the stored Credential resource * @return $this Fluent Builder */ public function setAwsCredentialsSid($awsCredentialsSid) { $this->options['awsCredentialsSid'] = $awsCredentialsSid; return $this; } /** * The SID of the Public Key resource to use for encryption. * * @param string $encryptionKeySid The SID of the Public Key resource to use * for encryption * @return $this Fluent Builder */ public function setEncryptionKeySid($encryptionKeySid) { $this->options['encryptionKeySid'] = $encryptionKeySid; return $this; } /** * The URL of the AWS S3 bucket where the compositions should be stored. We only support DNS-compliant URLs like `http://<my-bucket>.s3-<aws-region>.amazonaws.com/compositions`, where `compositions` is the path in which you want the compositions to be stored. * * @param string $awsS3Url The URL of the AWS S3 bucket where the compositions * should be stored * @return $this Fluent Builder */ public function setAwsS3Url($awsS3Url) { $this->options['awsS3Url'] = $awsS3Url; return $this; } /** * Whether all compositions should be written to the `aws_s3_url`. When `false`, all compositions are stored in our cloud. * * @param bool $awsStorageEnabled Whether all compositions should be written to * the aws_s3_url * @return $this Fluent Builder */ public function setAwsStorageEnabled($awsStorageEnabled) { $this->options['awsStorageEnabled'] = $awsStorageEnabled; return $this; } /** * Whether all compositions should be stored in an encrypted form. The default is `false`. * * @param bool $encryptionEnabled Whether all compositions should be stored in * an encrypted form * @return $this Fluent Builder */ public function setEncryptionEnabled($encryptionEnabled) { $this->options['encryptionEnabled'] = $encryptionEnabled; 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.Video.V1.CreateCompositionSettingsOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Video/V1/CompositionPage.php 0000644 00000001643 15002236443 0015450 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Video\V1; use Twilio\Page; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class CompositionPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new CompositionInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Video.V1.CompositionPage]'; } } sdk/src/Twilio/Rest/Video/V1/RoomInstance.php 0000644 00000012320 15002236443 0014743 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Video\V1; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $status * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $accountSid * @property bool $enableTurn * @property string $uniqueName * @property string $statusCallback * @property string $statusCallbackMethod * @property \DateTime $endTime * @property int $duration * @property string $type * @property int $maxParticipants * @property bool $recordParticipantsOnConnect * @property string $videoCodecs * @property string $mediaRegion * @property string $url * @property array $links */ class RoomInstance extends InstanceResource { protected $_recordings = null; protected $_participants = null; /** * Initialize the RoomInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The SID that identifies the resource to fetch * @return \Twilio\Rest\Video\V1\RoomInstance */ public function __construct(Version $version, array $payload, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'sid' => Values::array_get($payload, 'sid'), 'status' => Values::array_get($payload, 'status'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'accountSid' => Values::array_get($payload, 'account_sid'), 'enableTurn' => Values::array_get($payload, 'enable_turn'), 'uniqueName' => Values::array_get($payload, 'unique_name'), 'statusCallback' => Values::array_get($payload, 'status_callback'), 'statusCallbackMethod' => Values::array_get($payload, 'status_callback_method'), 'endTime' => Deserialize::dateTime(Values::array_get($payload, 'end_time')), 'duration' => Values::array_get($payload, 'duration'), 'type' => Values::array_get($payload, 'type'), 'maxParticipants' => Values::array_get($payload, 'max_participants'), 'recordParticipantsOnConnect' => Values::array_get($payload, 'record_participants_on_connect'), 'videoCodecs' => Values::array_get($payload, 'video_codecs'), 'mediaRegion' => Values::array_get($payload, 'media_region'), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ); $this->solution = array('sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Video\V1\RoomContext Context for this RoomInstance */ protected function proxy() { if (!$this->context) { $this->context = new RoomContext($this->version, $this->solution['sid']); } return $this->context; } /** * Fetch a RoomInstance * * @return RoomInstance Fetched RoomInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Update the RoomInstance * * @param string $status The new status of the resource * @return RoomInstance Updated RoomInstance * @throws TwilioException When an HTTP error occurs. */ public function update($status) { return $this->proxy()->update($status); } /** * Access the recordings * * @return \Twilio\Rest\Video\V1\Room\RoomRecordingList */ protected function getRecordings() { return $this->proxy()->recordings; } /** * Access the participants * * @return \Twilio\Rest\Video\V1\Room\ParticipantList */ protected function getParticipants() { return $this->proxy()->participants; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Video.V1.RoomInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Video/V1/Room/ParticipantInstance.php 0000644 00000012326 15002236443 0017227 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Video\V1\Room; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $roomSid * @property string $accountSid * @property string $status * @property string $identity * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property \DateTime $startTime * @property \DateTime $endTime * @property int $duration * @property string $url * @property array $links */ class ParticipantInstance extends InstanceResource { protected $_publishedTracks = null; protected $_subscribedTracks = null; protected $_subscribeRules = null; /** * Initialize the ParticipantInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $roomSid The SID of the participant's room * @param string $sid The SID that identifies the resource to fetch * @return \Twilio\Rest\Video\V1\Room\ParticipantInstance */ public function __construct(Version $version, array $payload, $roomSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'sid' => Values::array_get($payload, 'sid'), 'roomSid' => Values::array_get($payload, 'room_sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'status' => Values::array_get($payload, 'status'), 'identity' => Values::array_get($payload, 'identity'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'startTime' => Deserialize::dateTime(Values::array_get($payload, 'start_time')), 'endTime' => Deserialize::dateTime(Values::array_get($payload, 'end_time')), 'duration' => Values::array_get($payload, 'duration'), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ); $this->solution = array('roomSid' => $roomSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Video\V1\Room\ParticipantContext Context for this * ParticipantInstance */ protected function proxy() { if (!$this->context) { $this->context = new ParticipantContext( $this->version, $this->solution['roomSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch a ParticipantInstance * * @return ParticipantInstance Fetched ParticipantInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Update the ParticipantInstance * * @param array|Options $options Optional Arguments * @return ParticipantInstance Updated ParticipantInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Access the publishedTracks * * @return \Twilio\Rest\Video\V1\Room\Participant\PublishedTrackList */ protected function getPublishedTracks() { return $this->proxy()->publishedTracks; } /** * Access the subscribedTracks * * @return \Twilio\Rest\Video\V1\Room\Participant\SubscribedTrackList */ protected function getSubscribedTracks() { return $this->proxy()->subscribedTracks; } /** * Access the subscribeRules * * @return \Twilio\Rest\Video\V1\Room\Participant\SubscribeRulesList */ protected function getSubscribeRules() { return $this->proxy()->subscribeRules; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Video.V1.ParticipantInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Video/V1/Room/RoomRecordingContext.php 0000644 00000004306 15002236443 0017401 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Video\V1\Room; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; class RoomRecordingContext extends InstanceContext { /** * Initialize the RoomRecordingContext * * @param \Twilio\Version $version Version that contains the resource * @param string $roomSid The SID of the Room resource with the recording to * fetch * @param string $sid The SID that identifies the resource to fetch * @return \Twilio\Rest\Video\V1\Room\RoomRecordingContext */ public function __construct(Version $version, $roomSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array('roomSid' => $roomSid, 'sid' => $sid, ); $this->uri = '/Rooms/' . \rawurlencode($roomSid) . '/Recordings/' . \rawurlencode($sid) . ''; } /** * Fetch a RoomRecordingInstance * * @return RoomRecordingInstance Fetched RoomRecordingInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new RoomRecordingInstance( $this->version, $payload, $this->solution['roomSid'], $this->solution['sid'] ); } /** * Deletes the RoomRecordingInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Video.V1.RoomRecordingContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Video/V1/Room/RoomRecordingList.php 0000644 00000013015 15002236443 0016665 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Video\V1\Room; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class RoomRecordingList extends ListResource { /** * Construct the RoomRecordingList * * @param Version $version Version that contains the resource * @param string $roomSid The SID of the Room resource the recording is * associated with * @return \Twilio\Rest\Video\V1\Room\RoomRecordingList */ public function __construct(Version $version, $roomSid) { parent::__construct($version); // Path Solution $this->solution = array('roomSid' => $roomSid, ); $this->uri = '/Rooms/' . \rawurlencode($roomSid) . '/Recordings'; } /** * Streams RoomRecordingInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($options = array(), $limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads RoomRecordingInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return RoomRecordingInstance[] Array of results */ public function read($options = array(), $limit = null, $pageSize = null) { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Retrieve a single page of RoomRecordingInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of RoomRecordingInstance */ public function page($options = array(), $pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $options = new Values($options); $params = Values::of(array( 'Status' => $options['status'], 'SourceSid' => $options['sourceSid'], 'DateCreatedAfter' => Serialize::iso8601DateTime($options['dateCreatedAfter']), 'DateCreatedBefore' => Serialize::iso8601DateTime($options['dateCreatedBefore']), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new RoomRecordingPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of RoomRecordingInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of RoomRecordingInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new RoomRecordingPage($this->version, $response, $this->solution); } /** * Constructs a RoomRecordingContext * * @param string $sid The SID that identifies the resource to fetch * @return \Twilio\Rest\Video\V1\Room\RoomRecordingContext */ public function getContext($sid) { return new RoomRecordingContext($this->version, $this->solution['roomSid'], $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Video.V1.RoomRecordingList]'; } } sdk/src/Twilio/Rest/Video/V1/Room/RoomRecordingOptions.php 0000644 00000010254 15002236443 0017407 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Video\V1\Room; use Twilio\Options; use Twilio\Values; abstract class RoomRecordingOptions { /** * @param string $status Read only the recordings with this status * @param string $sourceSid Read only the recordings that have this source_sid * @param \DateTime $dateCreatedAfter Read only Recordings that started on or * after this ISO 8601 datetime with time * zone * @param \DateTime $dateCreatedBefore Read only Recordings that started before * this ISO 8601 date-time with time zone * @return ReadRoomRecordingOptions Options builder */ public static function read($status = Values::NONE, $sourceSid = Values::NONE, $dateCreatedAfter = Values::NONE, $dateCreatedBefore = Values::NONE) { return new ReadRoomRecordingOptions($status, $sourceSid, $dateCreatedAfter, $dateCreatedBefore); } } class ReadRoomRecordingOptions extends Options { /** * @param string $status Read only the recordings with this status * @param string $sourceSid Read only the recordings that have this source_sid * @param \DateTime $dateCreatedAfter Read only Recordings that started on or * after this ISO 8601 datetime with time * zone * @param \DateTime $dateCreatedBefore Read only Recordings that started before * this ISO 8601 date-time with time zone */ public function __construct($status = Values::NONE, $sourceSid = Values::NONE, $dateCreatedAfter = Values::NONE, $dateCreatedBefore = Values::NONE) { $this->options['status'] = $status; $this->options['sourceSid'] = $sourceSid; $this->options['dateCreatedAfter'] = $dateCreatedAfter; $this->options['dateCreatedBefore'] = $dateCreatedBefore; } /** * Read only the recordings with this status. Can be: `processing`, `completed`, or `deleted`. * * @param string $status Read only the recordings with this status * @return $this Fluent Builder */ public function setStatus($status) { $this->options['status'] = $status; return $this; } /** * Read only the recordings that have this `source_sid`. * * @param string $sourceSid Read only the recordings that have this source_sid * @return $this Fluent Builder */ public function setSourceSid($sourceSid) { $this->options['sourceSid'] = $sourceSid; return $this; } /** * Read only recordings that started on or after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) datetime with time zone. * * @param \DateTime $dateCreatedAfter Read only Recordings that started on or * after this ISO 8601 datetime with time * zone * @return $this Fluent Builder */ public function setDateCreatedAfter($dateCreatedAfter) { $this->options['dateCreatedAfter'] = $dateCreatedAfter; return $this; } /** * Read only Recordings that started before this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) datetime with time zone. * * @param \DateTime $dateCreatedBefore Read only Recordings that started before * this ISO 8601 date-time with time zone * @return $this Fluent Builder */ public function setDateCreatedBefore($dateCreatedBefore) { $this->options['dateCreatedBefore'] = $dateCreatedBefore; 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.Video.V1.ReadRoomRecordingOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Video/V1/Room/ParticipantList.php 0000644 00000012663 15002236443 0016402 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Video\V1\Room; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class ParticipantList extends ListResource { /** * Construct the ParticipantList * * @param Version $version Version that contains the resource * @param string $roomSid The SID of the participant's room * @return \Twilio\Rest\Video\V1\Room\ParticipantList */ public function __construct(Version $version, $roomSid) { parent::__construct($version); // Path Solution $this->solution = array('roomSid' => $roomSid, ); $this->uri = '/Rooms/' . \rawurlencode($roomSid) . '/Participants'; } /** * Streams ParticipantInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($options = array(), $limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads ParticipantInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return ParticipantInstance[] Array of results */ public function read($options = array(), $limit = null, $pageSize = null) { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Retrieve a single page of ParticipantInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of ParticipantInstance */ public function page($options = array(), $pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $options = new Values($options); $params = Values::of(array( 'Status' => $options['status'], 'Identity' => $options['identity'], 'DateCreatedAfter' => Serialize::iso8601DateTime($options['dateCreatedAfter']), 'DateCreatedBefore' => Serialize::iso8601DateTime($options['dateCreatedBefore']), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new ParticipantPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of ParticipantInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of ParticipantInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new ParticipantPage($this->version, $response, $this->solution); } /** * Constructs a ParticipantContext * * @param string $sid The SID that identifies the resource to fetch * @return \Twilio\Rest\Video\V1\Room\ParticipantContext */ public function getContext($sid) { return new ParticipantContext($this->version, $this->solution['roomSid'], $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Video.V1.ParticipantList]'; } } sdk/src/Twilio/Rest/Video/V1/Room/RoomRecordingInstance.php 0000644 00000011302 15002236443 0017513 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Video\V1\Room; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property string $status * @property \DateTime $dateCreated * @property string $sid * @property string $sourceSid * @property string $size * @property string $url * @property string $type * @property int $duration * @property string $containerFormat * @property string $codec * @property array $groupingSids * @property string $trackName * @property string $offset * @property string $roomSid * @property array $links */ class RoomRecordingInstance extends InstanceResource { /** * Initialize the RoomRecordingInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $roomSid The SID of the Room resource the recording is * associated with * @param string $sid The SID that identifies the resource to fetch * @return \Twilio\Rest\Video\V1\Room\RoomRecordingInstance */ public function __construct(Version $version, array $payload, $roomSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'accountSid' => Values::array_get($payload, 'account_sid'), 'status' => Values::array_get($payload, 'status'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'sid' => Values::array_get($payload, 'sid'), 'sourceSid' => Values::array_get($payload, 'source_sid'), 'size' => Values::array_get($payload, 'size'), 'url' => Values::array_get($payload, 'url'), 'type' => Values::array_get($payload, 'type'), 'duration' => Values::array_get($payload, 'duration'), 'containerFormat' => Values::array_get($payload, 'container_format'), 'codec' => Values::array_get($payload, 'codec'), 'groupingSids' => Values::array_get($payload, 'grouping_sids'), 'trackName' => Values::array_get($payload, 'track_name'), 'offset' => Values::array_get($payload, 'offset'), 'roomSid' => Values::array_get($payload, 'room_sid'), 'links' => Values::array_get($payload, 'links'), ); $this->solution = array('roomSid' => $roomSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Video\V1\Room\RoomRecordingContext Context for this * RoomRecordingInstance */ protected function proxy() { if (!$this->context) { $this->context = new RoomRecordingContext( $this->version, $this->solution['roomSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch a RoomRecordingInstance * * @return RoomRecordingInstance Fetched RoomRecordingInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the RoomRecordingInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Video.V1.RoomRecordingInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Video/V1/Room/ParticipantContext.php 0000644 00000013514 15002236443 0017107 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Video\V1\Room; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Rest\Video\V1\Room\Participant\PublishedTrackList; use Twilio\Rest\Video\V1\Room\Participant\SubscribeRulesList; use Twilio\Rest\Video\V1\Room\Participant\SubscribedTrackList; use Twilio\Values; use Twilio\Version; /** * @property \Twilio\Rest\Video\V1\Room\Participant\PublishedTrackList $publishedTracks * @property \Twilio\Rest\Video\V1\Room\Participant\SubscribedTrackList $subscribedTracks * @property \Twilio\Rest\Video\V1\Room\Participant\SubscribeRulesList $subscribeRules * @method \Twilio\Rest\Video\V1\Room\Participant\PublishedTrackContext publishedTracks(string $sid) * @method \Twilio\Rest\Video\V1\Room\Participant\SubscribedTrackContext subscribedTracks(string $sid) */ class ParticipantContext extends InstanceContext { protected $_publishedTracks = null; protected $_subscribedTracks = null; protected $_subscribeRules = null; /** * Initialize the ParticipantContext * * @param \Twilio\Version $version Version that contains the resource * @param string $roomSid The SID of the room with the Participant resource to * fetch * @param string $sid The SID that identifies the resource to fetch * @return \Twilio\Rest\Video\V1\Room\ParticipantContext */ public function __construct(Version $version, $roomSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array('roomSid' => $roomSid, 'sid' => $sid, ); $this->uri = '/Rooms/' . \rawurlencode($roomSid) . '/Participants/' . \rawurlencode($sid) . ''; } /** * Fetch a ParticipantInstance * * @return ParticipantInstance Fetched ParticipantInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new ParticipantInstance( $this->version, $payload, $this->solution['roomSid'], $this->solution['sid'] ); } /** * Update the ParticipantInstance * * @param array|Options $options Optional Arguments * @return ParticipantInstance Updated ParticipantInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { $options = new Values($options); $data = Values::of(array('Status' => $options['status'], )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new ParticipantInstance( $this->version, $payload, $this->solution['roomSid'], $this->solution['sid'] ); } /** * Access the publishedTracks * * @return \Twilio\Rest\Video\V1\Room\Participant\PublishedTrackList */ protected function getPublishedTracks() { if (!$this->_publishedTracks) { $this->_publishedTracks = new PublishedTrackList( $this->version, $this->solution['roomSid'], $this->solution['sid'] ); } return $this->_publishedTracks; } /** * Access the subscribedTracks * * @return \Twilio\Rest\Video\V1\Room\Participant\SubscribedTrackList */ protected function getSubscribedTracks() { if (!$this->_subscribedTracks) { $this->_subscribedTracks = new SubscribedTrackList( $this->version, $this->solution['roomSid'], $this->solution['sid'] ); } return $this->_subscribedTracks; } /** * Access the subscribeRules * * @return \Twilio\Rest\Video\V1\Room\Participant\SubscribeRulesList */ protected function getSubscribeRules() { if (!$this->_subscribeRules) { $this->_subscribeRules = new SubscribeRulesList( $this->version, $this->solution['roomSid'], $this->solution['sid'] ); } return $this->_subscribeRules; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get($name) { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Video.V1.ParticipantContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Video/V1/Room/Participant/SubscribedTrackInstance.php 0000644 00000010211 15002236443 0022270 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Video\V1\Room\Participant; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $participantSid * @property string $publisherSid * @property string $roomSid * @property string $name * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property bool $enabled * @property string $kind * @property string $url */ class SubscribedTrackInstance extends InstanceResource { /** * Initialize the SubscribedTrackInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $roomSid The SID of the room where the track is published * @param string $participantSid The SID of the participant that subscribes to * the track * @param string $sid The SID that identifies the resource to fetch * @return \Twilio\Rest\Video\V1\Room\Participant\SubscribedTrackInstance */ public function __construct(Version $version, array $payload, $roomSid, $participantSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'sid' => Values::array_get($payload, 'sid'), 'participantSid' => Values::array_get($payload, 'participant_sid'), 'publisherSid' => Values::array_get($payload, 'publisher_sid'), 'roomSid' => Values::array_get($payload, 'room_sid'), 'name' => Values::array_get($payload, 'name'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'enabled' => Values::array_get($payload, 'enabled'), 'kind' => Values::array_get($payload, 'kind'), 'url' => Values::array_get($payload, 'url'), ); $this->solution = array( 'roomSid' => $roomSid, 'participantSid' => $participantSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Video\V1\Room\Participant\SubscribedTrackContext Context for this SubscribedTrackInstance */ protected function proxy() { if (!$this->context) { $this->context = new SubscribedTrackContext( $this->version, $this->solution['roomSid'], $this->solution['participantSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch a SubscribedTrackInstance * * @return SubscribedTrackInstance Fetched SubscribedTrackInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Video.V1.SubscribedTrackInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Video/V1/Room/Participant/PublishedTrackInstance.php 0000644 00000010441 15002236443 0022127 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Video\V1\Room\Participant; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $participantSid * @property string $roomSid * @property string $name * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property bool $enabled * @property string $kind * @property string $url */ class PublishedTrackInstance extends InstanceResource { /** * Initialize the PublishedTrackInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $roomSid The SID of the Room resource where the track is * published * @param string $participantSid The SID of the Participant resource with the * published track * @param string $sid The SID that identifies the resource to fetch * @return \Twilio\Rest\Video\V1\Room\Participant\PublishedTrackInstance */ public function __construct(Version $version, array $payload, $roomSid, $participantSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'sid' => Values::array_get($payload, 'sid'), 'participantSid' => Values::array_get($payload, 'participant_sid'), 'roomSid' => Values::array_get($payload, 'room_sid'), 'name' => Values::array_get($payload, 'name'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'enabled' => Values::array_get($payload, 'enabled'), 'kind' => Values::array_get($payload, 'kind'), 'url' => Values::array_get($payload, 'url'), ); $this->solution = array( 'roomSid' => $roomSid, 'participantSid' => $participantSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Video\V1\Room\Participant\PublishedTrackContext Context * for * this * PublishedTrackInstance */ protected function proxy() { if (!$this->context) { $this->context = new PublishedTrackContext( $this->version, $this->solution['roomSid'], $this->solution['participantSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch a PublishedTrackInstance * * @return PublishedTrackInstance Fetched PublishedTrackInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Video.V1.PublishedTrackInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Video/V1/Room/Participant/SubscribedTrackPage.php 0000644 00000001556 15002236443 0021414 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Video\V1\Room\Participant; use Twilio\Page; class SubscribedTrackPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new SubscribedTrackInstance( $this->version, $payload, $this->solution['roomSid'], $this->solution['participantSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Video.V1.SubscribedTrackPage]'; } } sdk/src/Twilio/Rest/Video/V1/Room/Participant/SubscribeRulesPage.php 0000644 00000001734 15002236443 0021274 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Video\V1\Room\Participant; use Twilio\Page; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class SubscribeRulesPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new SubscribeRulesInstance( $this->version, $payload, $this->solution['roomSid'], $this->solution['participantSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Video.V1.SubscribeRulesPage]'; } } sdk/src/Twilio/Rest/Video/V1/Room/Participant/SubscribeRulesOptions.php 0000644 00000003314 15002236443 0022047 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Video\V1\Room\Participant; 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 SubscribeRulesOptions { /** * @param array $rules A JSON-encoded array of subscribe rules * @return UpdateSubscribeRulesOptions Options builder */ public static function update($rules = Values::NONE) { return new UpdateSubscribeRulesOptions($rules); } } class UpdateSubscribeRulesOptions extends Options { /** * @param array $rules A JSON-encoded array of subscribe rules */ public function __construct($rules = Values::NONE) { $this->options['rules'] = $rules; } /** * A JSON-encoded array of subscribe rules. See the [Specifying Subscribe Rules](https://www.twilio.com/docs/video/api/track-subscriptions#specifying-sr) section for further information. * * @param array $rules A JSON-encoded array of subscribe rules * @return $this Fluent Builder */ public function setRules($rules) { $this->options['rules'] = $rules; 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.Video.V1.UpdateSubscribeRulesOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Video/V1/Room/Participant/SubscribeRulesInstance.php 0000644 00000005114 15002236443 0022160 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Video\V1\Room\Participant; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * * @property string $participantSid * @property string $roomSid * @property string $rules * @property \DateTime $dateCreated * @property \DateTime $dateUpdated */ class SubscribeRulesInstance extends InstanceResource { /** * Initialize the SubscribeRulesInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $roomSid The SID of the Room resource for the Subscribe Rules * @param string $participantSid The SID of the Participant resource for the * Subscribe Rules * @return \Twilio\Rest\Video\V1\Room\Participant\SubscribeRulesInstance */ public function __construct(Version $version, array $payload, $roomSid, $participantSid) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'participantSid' => Values::array_get($payload, 'participant_sid'), 'roomSid' => Values::array_get($payload, 'room_sid'), 'rules' => Values::array_get($payload, 'rules'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), ); $this->solution = array('roomSid' => $roomSid, 'participantSid' => $participantSid, ); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Video.V1.SubscribeRulesInstance]'; } } sdk/src/Twilio/Rest/Video/V1/Room/Participant/SubscribeRulesList.php 0000644 00000005405 15002236443 0021332 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Video\V1\Room\Participant; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class SubscribeRulesList extends ListResource { /** * Construct the SubscribeRulesList * * @param Version $version Version that contains the resource * @param string $roomSid The SID of the Room resource for the Subscribe Rules * @param string $participantSid The SID of the Participant resource for the * Subscribe Rules * @return \Twilio\Rest\Video\V1\Room\Participant\SubscribeRulesList */ public function __construct(Version $version, $roomSid, $participantSid) { parent::__construct($version); // Path Solution $this->solution = array('roomSid' => $roomSid, 'participantSid' => $participantSid, ); $this->uri = '/Rooms/' . \rawurlencode($roomSid) . '/Participants/' . \rawurlencode($participantSid) . '/SubscribeRules'; } /** * Fetch a SubscribeRulesInstance * * @return SubscribeRulesInstance Fetched SubscribeRulesInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new SubscribeRulesInstance( $this->version, $payload, $this->solution['roomSid'], $this->solution['participantSid'] ); } /** * Update the SubscribeRulesInstance * * @param array|Options $options Optional Arguments * @return SubscribeRulesInstance Updated SubscribeRulesInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { $options = new Values($options); $data = Values::of(array('Rules' => Serialize::jsonObject($options['rules']), )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new SubscribeRulesInstance( $this->version, $payload, $this->solution['roomSid'], $this->solution['participantSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Video.V1.SubscribeRulesList]'; } } sdk/src/Twilio/Rest/Video/V1/Room/Participant/PublishedTrackList.php 0000644 00000012455 15002236443 0021305 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Video\V1\Room\Participant; use Twilio\ListResource; use Twilio\Values; use Twilio\Version; class PublishedTrackList extends ListResource { /** * Construct the PublishedTrackList * * @param Version $version Version that contains the resource * @param string $roomSid The SID of the Room resource where the track is * published * @param string $participantSid The SID of the Participant resource with the * published track * @return \Twilio\Rest\Video\V1\Room\Participant\PublishedTrackList */ public function __construct(Version $version, $roomSid, $participantSid) { parent::__construct($version); // Path Solution $this->solution = array('roomSid' => $roomSid, 'participantSid' => $participantSid, ); $this->uri = '/Rooms/' . \rawurlencode($roomSid) . '/Participants/' . \rawurlencode($participantSid) . '/PublishedTracks'; } /** * Streams PublishedTrackInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads PublishedTrackInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return PublishedTrackInstance[] Array of results */ public function read($limit = null, $pageSize = null) { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of PublishedTrackInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of PublishedTrackInstance */ public function page($pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $params = Values::of(array( 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new PublishedTrackPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of PublishedTrackInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of PublishedTrackInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new PublishedTrackPage($this->version, $response, $this->solution); } /** * Constructs a PublishedTrackContext * * @param string $sid The SID that identifies the resource to fetch * @return \Twilio\Rest\Video\V1\Room\Participant\PublishedTrackContext */ public function getContext($sid) { return new PublishedTrackContext( $this->version, $this->solution['roomSid'], $this->solution['participantSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Video.V1.PublishedTrackList]'; } } sdk/src/Twilio/Rest/Video/V1/Room/Participant/PublishedTrackContext.php 0000644 00000004412 15002236443 0022010 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Video\V1\Room\Participant; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; class PublishedTrackContext extends InstanceContext { /** * Initialize the PublishedTrackContext * * @param \Twilio\Version $version Version that contains the resource * @param string $roomSid The SID of the Room resource where the Track resource * to fetch is published * @param string $participantSid The SID of the Participant resource with the * published track to fetch * @param string $sid The SID that identifies the resource to fetch * @return \Twilio\Rest\Video\V1\Room\Participant\PublishedTrackContext */ public function __construct(Version $version, $roomSid, $participantSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array('roomSid' => $roomSid, 'participantSid' => $participantSid, 'sid' => $sid, ); $this->uri = '/Rooms/' . \rawurlencode($roomSid) . '/Participants/' . \rawurlencode($participantSid) . '/PublishedTracks/' . \rawurlencode($sid) . ''; } /** * Fetch a PublishedTrackInstance * * @return PublishedTrackInstance Fetched PublishedTrackInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new PublishedTrackInstance( $this->version, $payload, $this->solution['roomSid'], $this->solution['participantSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Video.V1.PublishedTrackContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Video/V1/Room/Participant/SubscribedTrackList.php 0000644 00000012422 15002236443 0021445 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Video\V1\Room\Participant; use Twilio\ListResource; use Twilio\Values; use Twilio\Version; class SubscribedTrackList extends ListResource { /** * Construct the SubscribedTrackList * * @param Version $version Version that contains the resource * @param string $roomSid The SID of the room where the track is published * @param string $participantSid The SID of the participant that subscribes to * the track * @return \Twilio\Rest\Video\V1\Room\Participant\SubscribedTrackList */ public function __construct(Version $version, $roomSid, $participantSid) { parent::__construct($version); // Path Solution $this->solution = array('roomSid' => $roomSid, 'participantSid' => $participantSid, ); $this->uri = '/Rooms/' . \rawurlencode($roomSid) . '/Participants/' . \rawurlencode($participantSid) . '/SubscribedTracks'; } /** * Streams SubscribedTrackInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads SubscribedTrackInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return SubscribedTrackInstance[] Array of results */ public function read($limit = null, $pageSize = null) { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of SubscribedTrackInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of SubscribedTrackInstance */ public function page($pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $params = Values::of(array( 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new SubscribedTrackPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of SubscribedTrackInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of SubscribedTrackInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new SubscribedTrackPage($this->version, $response, $this->solution); } /** * Constructs a SubscribedTrackContext * * @param string $sid The SID that identifies the resource to fetch * @return \Twilio\Rest\Video\V1\Room\Participant\SubscribedTrackContext */ public function getContext($sid) { return new SubscribedTrackContext( $this->version, $this->solution['roomSid'], $this->solution['participantSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Video.V1.SubscribedTrackList]'; } } sdk/src/Twilio/Rest/Video/V1/Room/Participant/PublishedTrackPage.php 0000644 00000001553 15002236443 0021243 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Video\V1\Room\Participant; use Twilio\Page; class PublishedTrackPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new PublishedTrackInstance( $this->version, $payload, $this->solution['roomSid'], $this->solution['participantSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Video.V1.PublishedTrackPage]'; } } sdk/src/Twilio/Rest/Video/V1/Room/Participant/SubscribedTrackContext.php 0000644 00000004417 15002236443 0022163 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Video\V1\Room\Participant; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; class SubscribedTrackContext extends InstanceContext { /** * Initialize the SubscribedTrackContext * * @param \Twilio\Version $version Version that contains the resource * @param string $roomSid The SID of the Room where the Track resource to fetch * is subscribed * @param string $participantSid The SID of the participant that subscribes to * the Track resource to fetch * @param string $sid The SID that identifies the resource to fetch * @return \Twilio\Rest\Video\V1\Room\Participant\SubscribedTrackContext */ public function __construct(Version $version, $roomSid, $participantSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array('roomSid' => $roomSid, 'participantSid' => $participantSid, 'sid' => $sid, ); $this->uri = '/Rooms/' . \rawurlencode($roomSid) . '/Participants/' . \rawurlencode($participantSid) . '/SubscribedTracks/' . \rawurlencode($sid) . ''; } /** * Fetch a SubscribedTrackInstance * * @return SubscribedTrackInstance Fetched SubscribedTrackInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new SubscribedTrackInstance( $this->version, $payload, $this->solution['roomSid'], $this->solution['participantSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Video.V1.SubscribedTrackContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Video/V1/Room/ParticipantPage.php 0000644 00000001371 15002236443 0016335 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Video\V1\Room; use Twilio\Page; class ParticipantPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new ParticipantInstance($this->version, $payload, $this->solution['roomSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Video.V1.ParticipantPage]'; } } sdk/src/Twilio/Rest/Video/V1/Room/RoomRecordingPage.php 0000644 00000001377 15002236443 0016636 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Video\V1\Room; use Twilio\Page; class RoomRecordingPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new RoomRecordingInstance($this->version, $payload, $this->solution['roomSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Video.V1.RoomRecordingPage]'; } } sdk/src/Twilio/Rest/Video/V1/Room/ParticipantOptions.php 0000644 00000013137 15002236443 0017117 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Video\V1\Room; use Twilio\Options; use Twilio\Values; abstract class ParticipantOptions { /** * @param string $status Read only the participants with this status * @param string $identity Read only the Participants with this user identity * value * @param \DateTime $dateCreatedAfter Read only Participants that started after * this date in UTC ISO 8601 format * @param \DateTime $dateCreatedBefore Read only Participants that started * before this date in ISO 8601 format * @return ReadParticipantOptions Options builder */ public static function read($status = Values::NONE, $identity = Values::NONE, $dateCreatedAfter = Values::NONE, $dateCreatedBefore = Values::NONE) { return new ReadParticipantOptions($status, $identity, $dateCreatedAfter, $dateCreatedBefore); } /** * @param string $status The new status of the resource * @return UpdateParticipantOptions Options builder */ public static function update($status = Values::NONE) { return new UpdateParticipantOptions($status); } } class ReadParticipantOptions extends Options { /** * @param string $status Read only the participants with this status * @param string $identity Read only the Participants with this user identity * value * @param \DateTime $dateCreatedAfter Read only Participants that started after * this date in UTC ISO 8601 format * @param \DateTime $dateCreatedBefore Read only Participants that started * before this date in ISO 8601 format */ public function __construct($status = Values::NONE, $identity = Values::NONE, $dateCreatedAfter = Values::NONE, $dateCreatedBefore = Values::NONE) { $this->options['status'] = $status; $this->options['identity'] = $identity; $this->options['dateCreatedAfter'] = $dateCreatedAfter; $this->options['dateCreatedBefore'] = $dateCreatedBefore; } /** * Read only the participants with this status. Can be: `connected` or `disconnected`. For `in-progress` Rooms the default Status is `connected`, for `completed` Rooms only `disconnected` Participants are returned. * * @param string $status Read only the participants with this status * @return $this Fluent Builder */ public function setStatus($status) { $this->options['status'] = $status; return $this; } /** * Read only the Participants with this [User](https://www.twilio.com/docs/chat/rest/user-resource) `identity` value. * * @param string $identity Read only the Participants with this user identity * value * @return $this Fluent Builder */ public function setIdentity($identity) { $this->options['identity'] = $identity; return $this; } /** * Read only Participants that started after this date in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601#UTC) format. * * @param \DateTime $dateCreatedAfter Read only Participants that started after * this date in UTC ISO 8601 format * @return $this Fluent Builder */ public function setDateCreatedAfter($dateCreatedAfter) { $this->options['dateCreatedAfter'] = $dateCreatedAfter; return $this; } /** * Read only Participants that started before this date in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601#UTC) format. * * @param \DateTime $dateCreatedBefore Read only Participants that started * before this date in ISO 8601 format * @return $this Fluent Builder */ public function setDateCreatedBefore($dateCreatedBefore) { $this->options['dateCreatedBefore'] = $dateCreatedBefore; 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.Video.V1.ReadParticipantOptions ' . \implode(' ', $options) . ']'; } } class UpdateParticipantOptions extends Options { /** * @param string $status The new status of the resource */ public function __construct($status = Values::NONE) { $this->options['status'] = $status; } /** * The new status of the resource. Can be: `connected` or `disconnected`. For `in-progress` Rooms the default Status is `connected`, for `completed` Rooms only `disconnected` Participants are returned. * * @param string $status The new status of the resource * @return $this Fluent Builder */ public function setStatus($status) { $this->options['status'] = $status; 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.Video.V1.UpdateParticipantOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Video/V1/CompositionHookList.php 0000644 00000015741 15002236443 0016334 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Video\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class CompositionHookList extends ListResource { /** * Construct the CompositionHookList * * @param Version $version Version that contains the resource * @return \Twilio\Rest\Video\V1\CompositionHookList */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = array(); $this->uri = '/CompositionHooks'; } /** * Streams CompositionHookInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($options = array(), $limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads CompositionHookInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return CompositionHookInstance[] Array of results */ public function read($options = array(), $limit = null, $pageSize = null) { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Retrieve a single page of CompositionHookInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of CompositionHookInstance */ public function page($options = array(), $pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $options = new Values($options); $params = Values::of(array( 'Enabled' => Serialize::booleanToString($options['enabled']), 'DateCreatedAfter' => Serialize::iso8601DateTime($options['dateCreatedAfter']), 'DateCreatedBefore' => Serialize::iso8601DateTime($options['dateCreatedBefore']), 'FriendlyName' => $options['friendlyName'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new CompositionHookPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of CompositionHookInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of CompositionHookInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new CompositionHookPage($this->version, $response, $this->solution); } /** * Create a new CompositionHookInstance * * @param string $friendlyName A unique string to describe the resource * @param array|Options $options Optional Arguments * @return CompositionHookInstance Newly created CompositionHookInstance * @throws TwilioException When an HTTP error occurs. */ public function create($friendlyName, $options = array()) { $options = new Values($options); $data = Values::of(array( 'FriendlyName' => $friendlyName, 'Enabled' => Serialize::booleanToString($options['enabled']), 'VideoLayout' => Serialize::jsonObject($options['videoLayout']), 'AudioSources' => Serialize::map($options['audioSources'], function($e) { return $e; }), 'AudioSourcesExcluded' => Serialize::map($options['audioSourcesExcluded'], function($e) { return $e; }), 'Resolution' => $options['resolution'], 'Format' => $options['format'], 'StatusCallback' => $options['statusCallback'], 'StatusCallbackMethod' => $options['statusCallbackMethod'], 'Trim' => Serialize::booleanToString($options['trim']), )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new CompositionHookInstance($this->version, $payload); } /** * Constructs a CompositionHookContext * * @param string $sid The SID that identifies the resource to fetch * @return \Twilio\Rest\Video\V1\CompositionHookContext */ public function getContext($sid) { return new CompositionHookContext($this->version, $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Video.V1.CompositionHookList]'; } } sdk/src/Twilio/Rest/Video/V1/CompositionHookInstance.php 0000644 00000012274 15002236443 0017163 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Video\V1; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $accountSid * @property string $friendlyName * @property bool $enabled * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $sid * @property string $audioSources * @property string $audioSourcesExcluded * @property array $videoLayout * @property string $resolution * @property bool $trim * @property string $format * @property string $statusCallback * @property string $statusCallbackMethod * @property string $url */ class CompositionHookInstance extends InstanceResource { /** * Initialize the CompositionHookInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The SID that identifies the resource to fetch * @return \Twilio\Rest\Video\V1\CompositionHookInstance */ public function __construct(Version $version, array $payload, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'accountSid' => Values::array_get($payload, 'account_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'enabled' => Values::array_get($payload, 'enabled'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'sid' => Values::array_get($payload, 'sid'), 'audioSources' => Values::array_get($payload, 'audio_sources'), 'audioSourcesExcluded' => Values::array_get($payload, 'audio_sources_excluded'), 'videoLayout' => Values::array_get($payload, 'video_layout'), 'resolution' => Values::array_get($payload, 'resolution'), 'trim' => Values::array_get($payload, 'trim'), 'format' => Values::array_get($payload, 'format'), 'statusCallback' => Values::array_get($payload, 'status_callback'), 'statusCallbackMethod' => Values::array_get($payload, 'status_callback_method'), 'url' => Values::array_get($payload, 'url'), ); $this->solution = array('sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Video\V1\CompositionHookContext Context for this * CompositionHookInstance */ protected function proxy() { if (!$this->context) { $this->context = new CompositionHookContext($this->version, $this->solution['sid']); } return $this->context; } /** * Fetch a CompositionHookInstance * * @return CompositionHookInstance Fetched CompositionHookInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the CompositionHookInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Update the CompositionHookInstance * * @param string $friendlyName A unique string to describe the resource * @param array|Options $options Optional Arguments * @return CompositionHookInstance Updated CompositionHookInstance * @throws TwilioException When an HTTP error occurs. */ public function update($friendlyName, $options = array()) { return $this->proxy()->update($friendlyName, $options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Video.V1.CompositionHookInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Video/V1/RecordingSettingsOptions.php 0000644 00000012413 15002236443 0017356 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Video\V1; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ abstract class RecordingSettingsOptions { /** * @param string $awsCredentialsSid The SID of the stored Credential resource * @param string $encryptionKeySid The SID of the Public Key resource to use * for encryption * @param string $awsS3Url The URL of the AWS S3 bucket where the recordings * should be stored * @param bool $awsStorageEnabled Whether all recordings should be written to * the aws_s3_url * @param bool $encryptionEnabled Whether all recordings should be stored in an * encrypted form * @return CreateRecordingSettingsOptions Options builder */ public static function create($awsCredentialsSid = Values::NONE, $encryptionKeySid = Values::NONE, $awsS3Url = Values::NONE, $awsStorageEnabled = Values::NONE, $encryptionEnabled = Values::NONE) { return new CreateRecordingSettingsOptions($awsCredentialsSid, $encryptionKeySid, $awsS3Url, $awsStorageEnabled, $encryptionEnabled); } } class CreateRecordingSettingsOptions extends Options { /** * @param string $awsCredentialsSid The SID of the stored Credential resource * @param string $encryptionKeySid The SID of the Public Key resource to use * for encryption * @param string $awsS3Url The URL of the AWS S3 bucket where the recordings * should be stored * @param bool $awsStorageEnabled Whether all recordings should be written to * the aws_s3_url * @param bool $encryptionEnabled Whether all recordings should be stored in an * encrypted form */ public function __construct($awsCredentialsSid = Values::NONE, $encryptionKeySid = Values::NONE, $awsS3Url = Values::NONE, $awsStorageEnabled = Values::NONE, $encryptionEnabled = Values::NONE) { $this->options['awsCredentialsSid'] = $awsCredentialsSid; $this->options['encryptionKeySid'] = $encryptionKeySid; $this->options['awsS3Url'] = $awsS3Url; $this->options['awsStorageEnabled'] = $awsStorageEnabled; $this->options['encryptionEnabled'] = $encryptionEnabled; } /** * The SID of the stored Credential resource. * * @param string $awsCredentialsSid The SID of the stored Credential resource * @return $this Fluent Builder */ public function setAwsCredentialsSid($awsCredentialsSid) { $this->options['awsCredentialsSid'] = $awsCredentialsSid; return $this; } /** * The SID of the Public Key resource to use for encryption. * * @param string $encryptionKeySid The SID of the Public Key resource to use * for encryption * @return $this Fluent Builder */ public function setEncryptionKeySid($encryptionKeySid) { $this->options['encryptionKeySid'] = $encryptionKeySid; return $this; } /** * The URL of the AWS S3 bucket where the recordings should be stored. We only support DNS-compliant URLs like `http://<my-bucket>.s3-<aws-region>.amazonaws.com/recordings`, where `recordings` is the path in which you want the recordings to be stored. * * @param string $awsS3Url The URL of the AWS S3 bucket where the recordings * should be stored * @return $this Fluent Builder */ public function setAwsS3Url($awsS3Url) { $this->options['awsS3Url'] = $awsS3Url; return $this; } /** * Whether all recordings should be written to the `aws_s3_url`. When `false`, all recordings are stored in our cloud. * * @param bool $awsStorageEnabled Whether all recordings should be written to * the aws_s3_url * @return $this Fluent Builder */ public function setAwsStorageEnabled($awsStorageEnabled) { $this->options['awsStorageEnabled'] = $awsStorageEnabled; return $this; } /** * Whether all recordings should be stored in an encrypted form. The default is `false`. * * @param bool $encryptionEnabled Whether all recordings should be stored in an * encrypted form * @return $this Fluent Builder */ public function setEncryptionEnabled($encryptionEnabled) { $this->options['encryptionEnabled'] = $encryptionEnabled; 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.Video.V1.CreateRecordingSettingsOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Video/V1/CompositionOptions.php 0000644 00000033407 15002236443 0016232 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Video\V1; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ abstract class CompositionOptions { /** * @param string $status Read only Composition resources with this status * @param \DateTime $dateCreatedAfter Read only Composition resources created * on or after this [ISO * 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time with time zone * @param \DateTime $dateCreatedBefore Read only Composition resources created * before this ISO 8601 date-time with time * zone * @param string $roomSid Read only Composition resources with this Room SID * @return ReadCompositionOptions Options builder */ public static function read($status = Values::NONE, $dateCreatedAfter = Values::NONE, $dateCreatedBefore = Values::NONE, $roomSid = Values::NONE) { return new ReadCompositionOptions($status, $dateCreatedAfter, $dateCreatedBefore, $roomSid); } /** * @param array $videoLayout An object that describes the video layout of the * composition * @param string $audioSources An array of track names from the same group room * to merge * @param string $audioSourcesExcluded An array of track names to exclude * @param string $resolution A string that describes the columns (width) and * rows (height) of the generated composed video in * pixels * @param string $format The container format of the composition's media files * @param string $statusCallback The URL we should call to send status * information to your application * @param string $statusCallbackMethod The HTTP method we should use to call * status_callback * @param bool $trim Whether to clip the intervals where there is no active * media in the composition * @return CreateCompositionOptions Options builder */ public static function create($videoLayout = Values::NONE, $audioSources = Values::NONE, $audioSourcesExcluded = Values::NONE, $resolution = Values::NONE, $format = Values::NONE, $statusCallback = Values::NONE, $statusCallbackMethod = Values::NONE, $trim = Values::NONE) { return new CreateCompositionOptions($videoLayout, $audioSources, $audioSourcesExcluded, $resolution, $format, $statusCallback, $statusCallbackMethod, $trim); } } class ReadCompositionOptions extends Options { /** * @param string $status Read only Composition resources with this status * @param \DateTime $dateCreatedAfter Read only Composition resources created * on or after this [ISO * 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time with time zone * @param \DateTime $dateCreatedBefore Read only Composition resources created * before this ISO 8601 date-time with time * zone * @param string $roomSid Read only Composition resources with this Room SID */ public function __construct($status = Values::NONE, $dateCreatedAfter = Values::NONE, $dateCreatedBefore = Values::NONE, $roomSid = Values::NONE) { $this->options['status'] = $status; $this->options['dateCreatedAfter'] = $dateCreatedAfter; $this->options['dateCreatedBefore'] = $dateCreatedBefore; $this->options['roomSid'] = $roomSid; } /** * Read only Composition resources with this status. Can be: `enqueued`, `processing`, `completed`, `deleted`, or `failed`. * * @param string $status Read only Composition resources with this status * @return $this Fluent Builder */ public function setStatus($status) { $this->options['status'] = $status; return $this; } /** * Read only Composition resources created on or after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time with time zone. * * @param \DateTime $dateCreatedAfter Read only Composition resources created * on or after this [ISO * 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time with time zone * @return $this Fluent Builder */ public function setDateCreatedAfter($dateCreatedAfter) { $this->options['dateCreatedAfter'] = $dateCreatedAfter; return $this; } /** * Read only Composition resources created before this ISO 8601 date-time with time zone. * * @param \DateTime $dateCreatedBefore Read only Composition resources created * before this ISO 8601 date-time with time * zone * @return $this Fluent Builder */ public function setDateCreatedBefore($dateCreatedBefore) { $this->options['dateCreatedBefore'] = $dateCreatedBefore; return $this; } /** * Read only Composition resources with this Room SID. * * @param string $roomSid Read only Composition resources with this Room SID * @return $this Fluent Builder */ public function setRoomSid($roomSid) { $this->options['roomSid'] = $roomSid; 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.Video.V1.ReadCompositionOptions ' . \implode(' ', $options) . ']'; } } class CreateCompositionOptions extends Options { /** * @param array $videoLayout An object that describes the video layout of the * composition * @param string $audioSources An array of track names from the same group room * to merge * @param string $audioSourcesExcluded An array of track names to exclude * @param string $resolution A string that describes the columns (width) and * rows (height) of the generated composed video in * pixels * @param string $format The container format of the composition's media files * @param string $statusCallback The URL we should call to send status * information to your application * @param string $statusCallbackMethod The HTTP method we should use to call * status_callback * @param bool $trim Whether to clip the intervals where there is no active * media in the composition */ public function __construct($videoLayout = Values::NONE, $audioSources = Values::NONE, $audioSourcesExcluded = Values::NONE, $resolution = Values::NONE, $format = Values::NONE, $statusCallback = Values::NONE, $statusCallbackMethod = Values::NONE, $trim = Values::NONE) { $this->options['videoLayout'] = $videoLayout; $this->options['audioSources'] = $audioSources; $this->options['audioSourcesExcluded'] = $audioSourcesExcluded; $this->options['resolution'] = $resolution; $this->options['format'] = $format; $this->options['statusCallback'] = $statusCallback; $this->options['statusCallbackMethod'] = $statusCallbackMethod; $this->options['trim'] = $trim; } /** * An object that describes the video layout of the composition in terms of regions. See [Specifying Video Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info. * * @param array $videoLayout An object that describes the video layout of the * composition * @return $this Fluent Builder */ public function setVideoLayout($videoLayout) { $this->options['videoLayout'] = $videoLayout; return $this; } /** * An array of track names from the same group room to merge into the new composition. Can include zero or more track names. The new composition includes all audio sources specified in `audio_sources` except for those specified in `audio_sources_excluded`. The track names in this parameter can include an asterisk as a wild card character, which will match zero or more characters in a track name. For example, `student*` includes `student` as well as `studentTeam`. * * @param string $audioSources An array of track names from the same group room * to merge * @return $this Fluent Builder */ public function setAudioSources($audioSources) { $this->options['audioSources'] = $audioSources; return $this; } /** * An array of track names to exclude. The new composition includes all audio sources specified in `audio_sources` except for those specified in `audio_sources_excluded`. The track names in this parameter can include an asterisk as a wild card character, which will match zero or more characters in a track name. For example, `student*` excludes `student` as well as `studentTeam`. This parameter can also be empty. * * @param string $audioSourcesExcluded An array of track names to exclude * @return $this Fluent Builder */ public function setAudioSourcesExcluded($audioSourcesExcluded) { $this->options['audioSourcesExcluded'] = $audioSourcesExcluded; return $this; } /** * A string that describes the columns (width) and rows (height) of the generated composed video in pixels. Defaults to `640x480`. The string's format is `{width}x{height}` where: * 16 <= `{width}` <= 1280 * 16 <= `{height}` <= 1280 * `{width}` * `{height}` <= 921,600 Typical values are: * HD = `1280x720` * PAL = `1024x576` * VGA = `640x480` * CIF = `320x240` Note that the `resolution` imposes an aspect ratio to the resulting composition. When the original video tracks are constrained by the aspect ratio, they are scaled to fit. See [Specifying Video Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info. * * @param string $resolution A string that describes the columns (width) and * rows (height) of the generated composed video in * pixels * @return $this Fluent Builder */ public function setResolution($resolution) { $this->options['resolution'] = $resolution; return $this; } /** * The container format of the composition's media files. Can be: `mp4` or `webm` and the default is `webm`. If you specify `mp4` or `webm`, you must also specify one or more `audio_sources` and/or a `video_layout` element that contains a valid `video_sources` list, otherwise an error occurs. * * @param string $format The container format of the composition's media files * @return $this Fluent Builder */ public function setFormat($format) { $this->options['format'] = $format; return $this; } /** * The URL we should call using the `status_callback_method` to send status information to your application on every composition event. If not provided, status callback events will not be dispatched. * * @param string $statusCallback The URL we should call to send status * information to your application * @return $this Fluent Builder */ public function setStatusCallback($statusCallback) { $this->options['statusCallback'] = $statusCallback; return $this; } /** * The HTTP method we should use to call `status_callback`. Can be: `POST` or `GET` and the default is `POST`. * * @param string $statusCallbackMethod The HTTP method we should use to call * status_callback * @return $this Fluent Builder */ public function setStatusCallbackMethod($statusCallbackMethod) { $this->options['statusCallbackMethod'] = $statusCallbackMethod; return $this; } /** * Whether to clip the intervals where there is no active media in the composition. The default is `true`. Compositions with `trim` enabled are shorter when the Room is created and no Participant joins for a while as well as if all the Participants leave the room and join later, because those gaps will be removed. See [Specifying Video Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info. * * @param bool $trim Whether to clip the intervals where there is no active * media in the composition * @return $this Fluent Builder */ public function setTrim($trim) { $this->options['trim'] = $trim; 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.Video.V1.CreateCompositionOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Video/V1/CompositionHookContext.php 0000644 00000007113 15002236443 0017037 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Video\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class CompositionHookContext extends InstanceContext { /** * Initialize the CompositionHookContext * * @param \Twilio\Version $version Version that contains the resource * @param string $sid The SID that identifies the resource to fetch * @return \Twilio\Rest\Video\V1\CompositionHookContext */ public function __construct(Version $version, $sid) { parent::__construct($version); // Path Solution $this->solution = array('sid' => $sid, ); $this->uri = '/CompositionHooks/' . \rawurlencode($sid) . ''; } /** * Fetch a CompositionHookInstance * * @return CompositionHookInstance Fetched CompositionHookInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new CompositionHookInstance($this->version, $payload, $this->solution['sid']); } /** * Deletes the CompositionHookInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Update the CompositionHookInstance * * @param string $friendlyName A unique string to describe the resource * @param array|Options $options Optional Arguments * @return CompositionHookInstance Updated CompositionHookInstance * @throws TwilioException When an HTTP error occurs. */ public function update($friendlyName, $options = array()) { $options = new Values($options); $data = Values::of(array( 'FriendlyName' => $friendlyName, 'Enabled' => Serialize::booleanToString($options['enabled']), 'VideoLayout' => Serialize::jsonObject($options['videoLayout']), 'AudioSources' => Serialize::map($options['audioSources'], function($e) { return $e; }), 'AudioSourcesExcluded' => Serialize::map($options['audioSourcesExcluded'], function($e) { return $e; }), 'Trim' => Serialize::booleanToString($options['trim']), 'Format' => $options['format'], 'Resolution' => $options['resolution'], 'StatusCallback' => $options['statusCallback'], 'StatusCallbackMethod' => $options['statusCallbackMethod'], )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new CompositionHookInstance($this->version, $payload, $this->solution['sid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Video.V1.CompositionHookContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Video/V1/RecordingInstance.php 0000644 00000010452 15002236443 0015747 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Video\V1; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property string $status * @property \DateTime $dateCreated * @property string $sid * @property string $sourceSid * @property string $size * @property string $url * @property string $type * @property int $duration * @property string $containerFormat * @property string $codec * @property array $groupingSids * @property string $trackName * @property string $offset * @property array $links */ class RecordingInstance extends InstanceResource { /** * Initialize the RecordingInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The SID that identifies the resource to fetch * @return \Twilio\Rest\Video\V1\RecordingInstance */ public function __construct(Version $version, array $payload, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'accountSid' => Values::array_get($payload, 'account_sid'), 'status' => Values::array_get($payload, 'status'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'sid' => Values::array_get($payload, 'sid'), 'sourceSid' => Values::array_get($payload, 'source_sid'), 'size' => Values::array_get($payload, 'size'), 'url' => Values::array_get($payload, 'url'), 'type' => Values::array_get($payload, 'type'), 'duration' => Values::array_get($payload, 'duration'), 'containerFormat' => Values::array_get($payload, 'container_format'), 'codec' => Values::array_get($payload, 'codec'), 'groupingSids' => Values::array_get($payload, 'grouping_sids'), 'trackName' => Values::array_get($payload, 'track_name'), 'offset' => Values::array_get($payload, 'offset'), 'links' => Values::array_get($payload, 'links'), ); $this->solution = array('sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Video\V1\RecordingContext Context for this * RecordingInstance */ protected function proxy() { if (!$this->context) { $this->context = new RecordingContext($this->version, $this->solution['sid']); } return $this->context; } /** * Fetch a RecordingInstance * * @return RecordingInstance Fetched RecordingInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the RecordingInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Video.V1.RecordingInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Video/V1/CompositionSettingsContext.php 0000644 00000005723 15002236443 0017744 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Video\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class CompositionSettingsContext extends InstanceContext { /** * Initialize the CompositionSettingsContext * * @param \Twilio\Version $version Version that contains the resource * @return \Twilio\Rest\Video\V1\CompositionSettingsContext */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = array(); $this->uri = '/CompositionSettings/Default'; } /** * Fetch a CompositionSettingsInstance * * @return CompositionSettingsInstance Fetched CompositionSettingsInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new CompositionSettingsInstance($this->version, $payload); } /** * Create a new CompositionSettingsInstance * * @param string $friendlyName A descriptive string that you create to describe * the resource * @param array|Options $options Optional Arguments * @return CompositionSettingsInstance Newly created CompositionSettingsInstance * @throws TwilioException When an HTTP error occurs. */ public function create($friendlyName, $options = array()) { $options = new Values($options); $data = Values::of(array( 'FriendlyName' => $friendlyName, 'AwsCredentialsSid' => $options['awsCredentialsSid'], 'EncryptionKeySid' => $options['encryptionKeySid'], 'AwsS3Url' => $options['awsS3Url'], 'AwsStorageEnabled' => Serialize::booleanToString($options['awsStorageEnabled']), 'EncryptionEnabled' => Serialize::booleanToString($options['encryptionEnabled']), )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new CompositionSettingsInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Video.V1.CompositionSettingsContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Video/V1/CompositionSettingsPage.php 0000644 00000001673 15002236443 0017174 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Video\V1; use Twilio\Page; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class CompositionSettingsPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new CompositionSettingsInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Video.V1.CompositionSettingsPage]'; } } sdk/src/Twilio/Rest/Video/V1/RoomContext.php 0000644 00000010457 15002236443 0014634 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Video\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Rest\Video\V1\Room\ParticipantList; use Twilio\Rest\Video\V1\Room\RoomRecordingList; use Twilio\Values; use Twilio\Version; /** * @property \Twilio\Rest\Video\V1\Room\RoomRecordingList $recordings * @property \Twilio\Rest\Video\V1\Room\ParticipantList $participants * @method \Twilio\Rest\Video\V1\Room\RoomRecordingContext recordings(string $sid) * @method \Twilio\Rest\Video\V1\Room\ParticipantContext participants(string $sid) */ class RoomContext extends InstanceContext { protected $_recordings = null; protected $_participants = null; /** * Initialize the RoomContext * * @param \Twilio\Version $version Version that contains the resource * @param string $sid The SID that identifies the resource to fetch * @return \Twilio\Rest\Video\V1\RoomContext */ public function __construct(Version $version, $sid) { parent::__construct($version); // Path Solution $this->solution = array('sid' => $sid, ); $this->uri = '/Rooms/' . \rawurlencode($sid) . ''; } /** * Fetch a RoomInstance * * @return RoomInstance Fetched RoomInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new RoomInstance($this->version, $payload, $this->solution['sid']); } /** * Update the RoomInstance * * @param string $status The new status of the resource * @return RoomInstance Updated RoomInstance * @throws TwilioException When an HTTP error occurs. */ public function update($status) { $data = Values::of(array('Status' => $status, )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new RoomInstance($this->version, $payload, $this->solution['sid']); } /** * Access the recordings * * @return \Twilio\Rest\Video\V1\Room\RoomRecordingList */ protected function getRecordings() { if (!$this->_recordings) { $this->_recordings = new RoomRecordingList($this->version, $this->solution['sid']); } return $this->_recordings; } /** * Access the participants * * @return \Twilio\Rest\Video\V1\Room\ParticipantList */ protected function getParticipants() { if (!$this->_participants) { $this->_participants = new ParticipantList($this->version, $this->solution['sid']); } return $this->_participants; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get($name) { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Video.V1.RoomContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Video/V1/CompositionList.php 0000644 00000015516 15002236443 0015513 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Video\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class CompositionList extends ListResource { /** * Construct the CompositionList * * @param Version $version Version that contains the resource * @return \Twilio\Rest\Video\V1\CompositionList */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = array(); $this->uri = '/Compositions'; } /** * Streams CompositionInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($options = array(), $limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads CompositionInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return CompositionInstance[] Array of results */ public function read($options = array(), $limit = null, $pageSize = null) { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Retrieve a single page of CompositionInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of CompositionInstance */ public function page($options = array(), $pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $options = new Values($options); $params = Values::of(array( 'Status' => $options['status'], 'DateCreatedAfter' => Serialize::iso8601DateTime($options['dateCreatedAfter']), 'DateCreatedBefore' => Serialize::iso8601DateTime($options['dateCreatedBefore']), 'RoomSid' => $options['roomSid'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new CompositionPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of CompositionInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of CompositionInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new CompositionPage($this->version, $response, $this->solution); } /** * Create a new CompositionInstance * * @param string $roomSid The SID of the Group Room with the media tracks to be * used as composition sources * @param array|Options $options Optional Arguments * @return CompositionInstance Newly created CompositionInstance * @throws TwilioException When an HTTP error occurs. */ public function create($roomSid, $options = array()) { $options = new Values($options); $data = Values::of(array( 'RoomSid' => $roomSid, 'VideoLayout' => Serialize::jsonObject($options['videoLayout']), 'AudioSources' => Serialize::map($options['audioSources'], function($e) { return $e; }), 'AudioSourcesExcluded' => Serialize::map($options['audioSourcesExcluded'], function($e) { return $e; }), 'Resolution' => $options['resolution'], 'Format' => $options['format'], 'StatusCallback' => $options['statusCallback'], 'StatusCallbackMethod' => $options['statusCallbackMethod'], 'Trim' => Serialize::booleanToString($options['trim']), )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new CompositionInstance($this->version, $payload); } /** * Constructs a CompositionContext * * @param string $sid The SID that identifies the resource to fetch * @return \Twilio\Rest\Video\V1\CompositionContext */ public function getContext($sid) { return new CompositionContext($this->version, $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Video.V1.CompositionList]'; } } sdk/src/Twilio/Rest/Video/V1/RecordingList.php 0000644 00000012566 15002236443 0015126 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Video\V1; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class RecordingList extends ListResource { /** * Construct the RecordingList * * @param Version $version Version that contains the resource * @return \Twilio\Rest\Video\V1\RecordingList */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = array(); $this->uri = '/Recordings'; } /** * Streams RecordingInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($options = array(), $limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads RecordingInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return RecordingInstance[] Array of results */ public function read($options = array(), $limit = null, $pageSize = null) { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Retrieve a single page of RecordingInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of RecordingInstance */ public function page($options = array(), $pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $options = new Values($options); $params = Values::of(array( 'Status' => $options['status'], 'SourceSid' => $options['sourceSid'], 'GroupingSid' => Serialize::map($options['groupingSid'], function($e) { return $e; }), 'DateCreatedAfter' => Serialize::iso8601DateTime($options['dateCreatedAfter']), 'DateCreatedBefore' => Serialize::iso8601DateTime($options['dateCreatedBefore']), 'MediaType' => $options['mediaType'], 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new RecordingPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of RecordingInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of RecordingInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new RecordingPage($this->version, $response, $this->solution); } /** * Constructs a RecordingContext * * @param string $sid The SID that identifies the resource to fetch * @return \Twilio\Rest\Video\V1\RecordingContext */ public function getContext($sid) { return new RecordingContext($this->version, $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Video.V1.RecordingList]'; } } sdk/src/Twilio/Rest/Video/V1/CompositionContext.php 0000644 00000004145 15002236443 0016220 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Video\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class CompositionContext extends InstanceContext { /** * Initialize the CompositionContext * * @param \Twilio\Version $version Version that contains the resource * @param string $sid The SID that identifies the resource to fetch * @return \Twilio\Rest\Video\V1\CompositionContext */ public function __construct(Version $version, $sid) { parent::__construct($version); // Path Solution $this->solution = array('sid' => $sid, ); $this->uri = '/Compositions/' . \rawurlencode($sid) . ''; } /** * Fetch a CompositionInstance * * @return CompositionInstance Fetched CompositionInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new CompositionInstance($this->version, $payload, $this->solution['sid']); } /** * Deletes the CompositionInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Video.V1.CompositionContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Video/V1/RoomOptions.php 0000644 00000030522 15002236443 0014636 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Video\V1; use Twilio\Options; use Twilio\Values; abstract class RoomOptions { /** * @param bool $enableTurn Enable Twilio's Network Traversal TURN service * @param string $type The type of room * @param string $uniqueName An application-defined string that uniquely * identifies the resource * @param string $statusCallback The URL to send status information to your * application * @param string $statusCallbackMethod The HTTP method we should use to call * status_callback * @param int $maxParticipants The maximum number of concurrent Participants * allowed in the room * @param bool $recordParticipantsOnConnect Whether to start recording when * Participants connect * @param string $videoCodecs An array of the video codecs that are supported * when publishing a track in the room * @param string $mediaRegion The region for the media server in Group Rooms * @return CreateRoomOptions Options builder */ public static function create($enableTurn = Values::NONE, $type = Values::NONE, $uniqueName = Values::NONE, $statusCallback = Values::NONE, $statusCallbackMethod = Values::NONE, $maxParticipants = Values::NONE, $recordParticipantsOnConnect = Values::NONE, $videoCodecs = Values::NONE, $mediaRegion = Values::NONE) { return new CreateRoomOptions($enableTurn, $type, $uniqueName, $statusCallback, $statusCallbackMethod, $maxParticipants, $recordParticipantsOnConnect, $videoCodecs, $mediaRegion); } /** * @param string $status Read only the rooms with this status * @param string $uniqueName Read only rooms with this unique_name * @param \DateTime $dateCreatedAfter Read only rooms that started on or after * this date, given as YYYY-MM-DD * @param \DateTime $dateCreatedBefore Read only rooms that started before this * date, given as YYYY-MM-DD * @return ReadRoomOptions Options builder */ public static function read($status = Values::NONE, $uniqueName = Values::NONE, $dateCreatedAfter = Values::NONE, $dateCreatedBefore = Values::NONE) { return new ReadRoomOptions($status, $uniqueName, $dateCreatedAfter, $dateCreatedBefore); } } class CreateRoomOptions extends Options { /** * @param bool $enableTurn Enable Twilio's Network Traversal TURN service * @param string $type The type of room * @param string $uniqueName An application-defined string that uniquely * identifies the resource * @param string $statusCallback The URL to send status information to your * application * @param string $statusCallbackMethod The HTTP method we should use to call * status_callback * @param int $maxParticipants The maximum number of concurrent Participants * allowed in the room * @param bool $recordParticipantsOnConnect Whether to start recording when * Participants connect * @param string $videoCodecs An array of the video codecs that are supported * when publishing a track in the room * @param string $mediaRegion The region for the media server in Group Rooms */ public function __construct($enableTurn = Values::NONE, $type = Values::NONE, $uniqueName = Values::NONE, $statusCallback = Values::NONE, $statusCallbackMethod = Values::NONE, $maxParticipants = Values::NONE, $recordParticipantsOnConnect = Values::NONE, $videoCodecs = Values::NONE, $mediaRegion = Values::NONE) { $this->options['enableTurn'] = $enableTurn; $this->options['type'] = $type; $this->options['uniqueName'] = $uniqueName; $this->options['statusCallback'] = $statusCallback; $this->options['statusCallbackMethod'] = $statusCallbackMethod; $this->options['maxParticipants'] = $maxParticipants; $this->options['recordParticipantsOnConnect'] = $recordParticipantsOnConnect; $this->options['videoCodecs'] = $videoCodecs; $this->options['mediaRegion'] = $mediaRegion; } /** * Deprecated. Whether to enable [Twilio's Network Traversal TURN service](https://www.twilio.com/stun-turn). TURN service is used when direct peer-to-peer media connections cannot be established due to firewall restrictions. This setting only applies to rooms with type `peer-to-peer`. * * @param bool $enableTurn Enable Twilio's Network Traversal TURN service * @return $this Fluent Builder */ public function setEnableTurn($enableTurn) { $this->options['enableTurn'] = $enableTurn; return $this; } /** * The type of room. Can be: `peer-to-peer`, `group-small`, or `group`. The default value is `group`. * * @param string $type The type of room * @return $this Fluent Builder */ public function setType($type) { $this->options['type'] = $type; return $this; } /** * An application-defined string that uniquely identifies the resource. It can be used as a `room_sid` in place of the resource's `sid` in the URL to address the resource. This value is unique for `in-progress` rooms. SDK clients can use this name to connect to the room. REST API clients can use this name in place of the Room SID to interact with the room as long as the room is `in-progress`. * * @param string $uniqueName An application-defined string that uniquely * identifies the resource * @return $this Fluent Builder */ public function setUniqueName($uniqueName) { $this->options['uniqueName'] = $uniqueName; return $this; } /** * The URL we should call using the `status_callback_method` to send status information to your application on every room event. See [Status Callbacks](https://www.twilio.com/docs/video/api/status-callbacks) for more info. * * @param string $statusCallback The URL to send status information to your * application * @return $this Fluent Builder */ public function setStatusCallback($statusCallback) { $this->options['statusCallback'] = $statusCallback; return $this; } /** * The HTTP method we should use to call `status_callback`. Can be `POST` or `GET`. * * @param string $statusCallbackMethod The HTTP method we should use to call * status_callback * @return $this Fluent Builder */ public function setStatusCallbackMethod($statusCallbackMethod) { $this->options['statusCallbackMethod'] = $statusCallbackMethod; return $this; } /** * The maximum number of concurrent Participants allowed in the room. Peer-to-peer rooms can have up to 10 Participants. Small Group rooms can have up to 4 Participants. Group rooms can have up to 50 Participants. * * @param int $maxParticipants The maximum number of concurrent Participants * allowed in the room * @return $this Fluent Builder */ public function setMaxParticipants($maxParticipants) { $this->options['maxParticipants'] = $maxParticipants; return $this; } /** * Whether to start recording when Participants connect. ***This feature is not available in `peer-to-peer` rooms.*** * * @param bool $recordParticipantsOnConnect Whether to start recording when * Participants connect * @return $this Fluent Builder */ public function setRecordParticipantsOnConnect($recordParticipantsOnConnect) { $this->options['recordParticipantsOnConnect'] = $recordParticipantsOnConnect; return $this; } /** * An array of the video codecs that are supported when publishing a track in the room. Can be: `VP8` and `H264`. ***This feature is not available in `peer-to-peer` rooms*** * * @param string $videoCodecs An array of the video codecs that are supported * when publishing a track in the room * @return $this Fluent Builder */ public function setVideoCodecs($videoCodecs) { $this->options['videoCodecs'] = $videoCodecs; return $this; } /** * The region for the media server in Group Rooms. Can be: one of the [available Media Regions](https://www.twilio.com/docs/video/ip-address-whitelisting#group-rooms-media-servers). ***This feature is not available in `peer-to-peer` rooms.*** * * @param string $mediaRegion The region for the media server in Group Rooms * @return $this Fluent Builder */ public function setMediaRegion($mediaRegion) { $this->options['mediaRegion'] = $mediaRegion; 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.Video.V1.CreateRoomOptions ' . \implode(' ', $options) . ']'; } } class ReadRoomOptions extends Options { /** * @param string $status Read only the rooms with this status * @param string $uniqueName Read only rooms with this unique_name * @param \DateTime $dateCreatedAfter Read only rooms that started on or after * this date, given as YYYY-MM-DD * @param \DateTime $dateCreatedBefore Read only rooms that started before this * date, given as YYYY-MM-DD */ public function __construct($status = Values::NONE, $uniqueName = Values::NONE, $dateCreatedAfter = Values::NONE, $dateCreatedBefore = Values::NONE) { $this->options['status'] = $status; $this->options['uniqueName'] = $uniqueName; $this->options['dateCreatedAfter'] = $dateCreatedAfter; $this->options['dateCreatedBefore'] = $dateCreatedBefore; } /** * Read only the rooms with this status. Can be: `in-progress` (default) or `completed` * * @param string $status Read only the rooms with this status * @return $this Fluent Builder */ public function setStatus($status) { $this->options['status'] = $status; return $this; } /** * Read only rooms with the this `unique_name`. * * @param string $uniqueName Read only rooms with this unique_name * @return $this Fluent Builder */ public function setUniqueName($uniqueName) { $this->options['uniqueName'] = $uniqueName; return $this; } /** * Read only rooms that started on or after this date, given as `YYYY-MM-DD`. * * @param \DateTime $dateCreatedAfter Read only rooms that started on or after * this date, given as YYYY-MM-DD * @return $this Fluent Builder */ public function setDateCreatedAfter($dateCreatedAfter) { $this->options['dateCreatedAfter'] = $dateCreatedAfter; return $this; } /** * Read only rooms that started before this date, given as `YYYY-MM-DD`. * * @param \DateTime $dateCreatedBefore Read only rooms that started before this * date, given as YYYY-MM-DD * @return $this Fluent Builder */ public function setDateCreatedBefore($dateCreatedBefore) { $this->options['dateCreatedBefore'] = $dateCreatedBefore; 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.Video.V1.ReadRoomOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Video/V1/RoomList.php 0000644 00000014545 15002236443 0014125 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Video\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class RoomList extends ListResource { /** * Construct the RoomList * * @param Version $version Version that contains the resource * @return \Twilio\Rest\Video\V1\RoomList */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = array(); $this->uri = '/Rooms'; } /** * Create a new RoomInstance * * @param array|Options $options Optional Arguments * @return RoomInstance Newly created RoomInstance * @throws TwilioException When an HTTP error occurs. */ public function create($options = array()) { $options = new Values($options); $data = Values::of(array( 'EnableTurn' => Serialize::booleanToString($options['enableTurn']), 'Type' => $options['type'], 'UniqueName' => $options['uniqueName'], 'StatusCallback' => $options['statusCallback'], 'StatusCallbackMethod' => $options['statusCallbackMethod'], 'MaxParticipants' => $options['maxParticipants'], 'RecordParticipantsOnConnect' => Serialize::booleanToString($options['recordParticipantsOnConnect']), 'VideoCodecs' => Serialize::map($options['videoCodecs'], function($e) { return $e; }), 'MediaRegion' => $options['mediaRegion'], )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new RoomInstance($this->version, $payload); } /** * Streams RoomInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($options = array(), $limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads RoomInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return RoomInstance[] Array of results */ public function read($options = array(), $limit = null, $pageSize = null) { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Retrieve a single page of RoomInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of RoomInstance */ public function page($options = array(), $pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $options = new Values($options); $params = Values::of(array( 'Status' => $options['status'], 'UniqueName' => $options['uniqueName'], 'DateCreatedAfter' => Serialize::iso8601DateTime($options['dateCreatedAfter']), 'DateCreatedBefore' => Serialize::iso8601DateTime($options['dateCreatedBefore']), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new RoomPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of RoomInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of RoomInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new RoomPage($this->version, $response, $this->solution); } /** * Constructs a RoomContext * * @param string $sid The SID that identifies the resource to fetch * @return \Twilio\Rest\Video\V1\RoomContext */ public function getContext($sid) { return new RoomContext($this->version, $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Video.V1.RoomList]'; } } sdk/src/Twilio/Rest/Video/V1/RecordingContext.php 0000644 00000003606 15002236443 0015632 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Video\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; class RecordingContext extends InstanceContext { /** * Initialize the RecordingContext * * @param \Twilio\Version $version Version that contains the resource * @param string $sid The SID that identifies the resource to fetch * @return \Twilio\Rest\Video\V1\RecordingContext */ public function __construct(Version $version, $sid) { parent::__construct($version); // Path Solution $this->solution = array('sid' => $sid, ); $this->uri = '/Recordings/' . \rawurlencode($sid) . ''; } /** * Fetch a RecordingInstance * * @return RecordingInstance Fetched RecordingInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new RecordingInstance($this->version, $payload, $this->solution['sid']); } /** * Deletes the RecordingInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Video.V1.RecordingContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Video/V1/RoomPage.php 0000644 00000001303 15002236443 0014052 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Video\V1; use Twilio\Page; class RoomPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new RoomInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Video.V1.RoomPage]'; } } sdk/src/Twilio/Rest/Video/V1/RecordingSettingsInstance.php 0000644 00000010112 15002236443 0017461 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Video\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $accountSid * @property string $friendlyName * @property string $awsCredentialsSid * @property string $awsS3Url * @property bool $awsStorageEnabled * @property string $encryptionKeySid * @property bool $encryptionEnabled * @property string $url */ class RecordingSettingsInstance extends InstanceResource { /** * Initialize the RecordingSettingsInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @return \Twilio\Rest\Video\V1\RecordingSettingsInstance */ public function __construct(Version $version, array $payload) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'accountSid' => Values::array_get($payload, 'account_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'awsCredentialsSid' => Values::array_get($payload, 'aws_credentials_sid'), 'awsS3Url' => Values::array_get($payload, 'aws_s3_url'), 'awsStorageEnabled' => Values::array_get($payload, 'aws_storage_enabled'), 'encryptionKeySid' => Values::array_get($payload, 'encryption_key_sid'), 'encryptionEnabled' => Values::array_get($payload, 'encryption_enabled'), 'url' => Values::array_get($payload, 'url'), ); $this->solution = array(); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Video\V1\RecordingSettingsContext Context for this * RecordingSettingsInstance */ protected function proxy() { if (!$this->context) { $this->context = new RecordingSettingsContext($this->version); } return $this->context; } /** * Fetch a RecordingSettingsInstance * * @return RecordingSettingsInstance Fetched RecordingSettingsInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Create a new RecordingSettingsInstance * * @param string $friendlyName A string to describe the resource * @param array|Options $options Optional Arguments * @return RecordingSettingsInstance Newly created RecordingSettingsInstance * @throws TwilioException When an HTTP error occurs. */ public function create($friendlyName, $options = array()) { return $this->proxy()->create($friendlyName, $options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Video.V1.RecordingSettingsInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Video/V1/CompositionSettingsList.php 0000644 00000002361 15002236443 0017226 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Video\V1; use Twilio\ListResource; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class CompositionSettingsList extends ListResource { /** * Construct the CompositionSettingsList * * @param Version $version Version that contains the resource * @return \Twilio\Rest\Video\V1\CompositionSettingsList */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = array(); } /** * Constructs a CompositionSettingsContext * * @return \Twilio\Rest\Video\V1\CompositionSettingsContext */ public function getContext() { return new CompositionSettingsContext($this->version); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Video.V1.CompositionSettingsList]'; } } sdk/src/Twilio/Rest/Video/V1/RecordingSettingsPage.php 0000644 00000001665 15002236443 0016606 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Video\V1; use Twilio\Page; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class RecordingSettingsPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new RecordingSettingsInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Video.V1.RecordingSettingsPage]'; } } sdk/src/Twilio/Rest/Video/V1/CompositionInstance.php 0000644 00000011620 15002236443 0016334 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Video\V1; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $accountSid * @property string $status * @property \DateTime $dateCreated * @property \DateTime $dateCompleted * @property \DateTime $dateDeleted * @property string $sid * @property string $roomSid * @property string $audioSources * @property string $audioSourcesExcluded * @property array $videoLayout * @property string $resolution * @property bool $trim * @property string $format * @property int $bitrate * @property string $size * @property int $duration * @property string $url * @property array $links */ class CompositionInstance extends InstanceResource { /** * Initialize the CompositionInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The SID that identifies the resource to fetch * @return \Twilio\Rest\Video\V1\CompositionInstance */ public function __construct(Version $version, array $payload, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'accountSid' => Values::array_get($payload, 'account_sid'), 'status' => Values::array_get($payload, 'status'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateCompleted' => Deserialize::dateTime(Values::array_get($payload, 'date_completed')), 'dateDeleted' => Deserialize::dateTime(Values::array_get($payload, 'date_deleted')), 'sid' => Values::array_get($payload, 'sid'), 'roomSid' => Values::array_get($payload, 'room_sid'), 'audioSources' => Values::array_get($payload, 'audio_sources'), 'audioSourcesExcluded' => Values::array_get($payload, 'audio_sources_excluded'), 'videoLayout' => Values::array_get($payload, 'video_layout'), 'resolution' => Values::array_get($payload, 'resolution'), 'trim' => Values::array_get($payload, 'trim'), 'format' => Values::array_get($payload, 'format'), 'bitrate' => Values::array_get($payload, 'bitrate'), 'size' => Values::array_get($payload, 'size'), 'duration' => Values::array_get($payload, 'duration'), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ); $this->solution = array('sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Video\V1\CompositionContext Context for this * CompositionInstance */ protected function proxy() { if (!$this->context) { $this->context = new CompositionContext($this->version, $this->solution['sid']); } return $this->context; } /** * Fetch a CompositionInstance * * @return CompositionInstance Fetched CompositionInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the CompositionInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Video.V1.CompositionInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Video/V1/CompositionHookPage.php 0000644 00000001657 15002236443 0016276 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Video\V1; use Twilio\Page; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class CompositionHookPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new CompositionHookInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Video.V1.CompositionHookPage]'; } } sdk/src/Twilio/Rest/Video/V1/CompositionSettingsInstance.php 0000644 00000010245 15002236443 0020057 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Video\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. * * @property string $accountSid * @property string $friendlyName * @property string $awsCredentialsSid * @property string $awsS3Url * @property bool $awsStorageEnabled * @property string $encryptionKeySid * @property bool $encryptionEnabled * @property string $url */ class CompositionSettingsInstance extends InstanceResource { /** * Initialize the CompositionSettingsInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @return \Twilio\Rest\Video\V1\CompositionSettingsInstance */ public function __construct(Version $version, array $payload) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'accountSid' => Values::array_get($payload, 'account_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'awsCredentialsSid' => Values::array_get($payload, 'aws_credentials_sid'), 'awsS3Url' => Values::array_get($payload, 'aws_s3_url'), 'awsStorageEnabled' => Values::array_get($payload, 'aws_storage_enabled'), 'encryptionKeySid' => Values::array_get($payload, 'encryption_key_sid'), 'encryptionEnabled' => Values::array_get($payload, 'encryption_enabled'), 'url' => Values::array_get($payload, 'url'), ); $this->solution = array(); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Video\V1\CompositionSettingsContext Context for this * CompositionSettingsInstance */ protected function proxy() { if (!$this->context) { $this->context = new CompositionSettingsContext($this->version); } return $this->context; } /** * Fetch a CompositionSettingsInstance * * @return CompositionSettingsInstance Fetched CompositionSettingsInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Create a new CompositionSettingsInstance * * @param string $friendlyName A descriptive string that you create to describe * the resource * @param array|Options $options Optional Arguments * @return CompositionSettingsInstance Newly created CompositionSettingsInstance * @throws TwilioException When an HTTP error occurs. */ public function create($friendlyName, $options = array()) { return $this->proxy()->create($friendlyName, $options); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Video.V1.CompositionSettingsInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Video/V1/RecordingPage.php 0000644 00000001322 15002236443 0015053 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Video\V1; use Twilio\Page; class RecordingPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new RecordingInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Video.V1.RecordingPage]'; } } sdk/src/Twilio/Rest/Video/V1/RecordingOptions.php 0000644 00000013607 15002236443 0015643 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Video\V1; use Twilio\Options; use Twilio\Values; abstract class RecordingOptions { /** * @param string $status Read only the recordings that have this status * @param string $sourceSid Read only the recordings that have this source_sid * @param string $groupingSid Read only recordings that have this grouping_sid * @param \DateTime $dateCreatedAfter Read only recordings that started on or * after this [ISO * 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time with time zone * @param \DateTime $dateCreatedBefore Read only recordings that started before * this [ISO * 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time with time zone * @param string $mediaType Read only recordings that have this media type * @return ReadRecordingOptions Options builder */ public static function read($status = Values::NONE, $sourceSid = Values::NONE, $groupingSid = Values::NONE, $dateCreatedAfter = Values::NONE, $dateCreatedBefore = Values::NONE, $mediaType = Values::NONE) { return new ReadRecordingOptions($status, $sourceSid, $groupingSid, $dateCreatedAfter, $dateCreatedBefore, $mediaType); } } class ReadRecordingOptions extends Options { /** * @param string $status Read only the recordings that have this status * @param string $sourceSid Read only the recordings that have this source_sid * @param string $groupingSid Read only recordings that have this grouping_sid * @param \DateTime $dateCreatedAfter Read only recordings that started on or * after this [ISO * 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time with time zone * @param \DateTime $dateCreatedBefore Read only recordings that started before * this [ISO * 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time with time zone * @param string $mediaType Read only recordings that have this media type */ public function __construct($status = Values::NONE, $sourceSid = Values::NONE, $groupingSid = Values::NONE, $dateCreatedAfter = Values::NONE, $dateCreatedBefore = Values::NONE, $mediaType = Values::NONE) { $this->options['status'] = $status; $this->options['sourceSid'] = $sourceSid; $this->options['groupingSid'] = $groupingSid; $this->options['dateCreatedAfter'] = $dateCreatedAfter; $this->options['dateCreatedBefore'] = $dateCreatedBefore; $this->options['mediaType'] = $mediaType; } /** * Read only the recordings that have this status. Can be: `processing`, `completed`, or `deleted`. * * @param string $status Read only the recordings that have this status * @return $this Fluent Builder */ public function setStatus($status) { $this->options['status'] = $status; return $this; } /** * Read only the recordings that have this `source_sid`. * * @param string $sourceSid Read only the recordings that have this source_sid * @return $this Fluent Builder */ public function setSourceSid($sourceSid) { $this->options['sourceSid'] = $sourceSid; return $this; } /** * Read only recordings with this `grouping_sid`, which may include a `participant_sid` and/or a `room_sid`. * * @param string $groupingSid Read only recordings that have this grouping_sid * @return $this Fluent Builder */ public function setGroupingSid($groupingSid) { $this->options['groupingSid'] = $groupingSid; return $this; } /** * Read only recordings that started on or after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time with time zone. * * @param \DateTime $dateCreatedAfter Read only recordings that started on or * after this [ISO * 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time with time zone * @return $this Fluent Builder */ public function setDateCreatedAfter($dateCreatedAfter) { $this->options['dateCreatedAfter'] = $dateCreatedAfter; return $this; } /** * Read only recordings that started before this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time with time zone, given as `YYYY-MM-DDThh:mm:ss+|-hh:mm` or `YYYY-MM-DDThh:mm:ssZ`. * * @param \DateTime $dateCreatedBefore Read only recordings that started before * this [ISO * 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time with time zone * @return $this Fluent Builder */ public function setDateCreatedBefore($dateCreatedBefore) { $this->options['dateCreatedBefore'] = $dateCreatedBefore; return $this; } /** * Read only recordings that have this media type. Can be either `audio` or `video`. * * @param string $mediaType Read only recordings that have this media type * @return $this Fluent Builder */ public function setMediaType($mediaType) { $this->options['mediaType'] = $mediaType; 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.Video.V1.ReadRecordingOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Video/V1/RecordingSettingsList.php 0000644 00000002343 15002236443 0016637 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Video\V1; use Twilio\ListResource; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class RecordingSettingsList extends ListResource { /** * Construct the RecordingSettingsList * * @param Version $version Version that contains the resource * @return \Twilio\Rest\Video\V1\RecordingSettingsList */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = array(); } /** * Constructs a RecordingSettingsContext * * @return \Twilio\Rest\Video\V1\RecordingSettingsContext */ public function getContext() { return new RecordingSettingsContext($this->version); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Video.V1.RecordingSettingsList]'; } } sdk/src/Twilio/Rest/Video/V1/RecordingSettingsContext.php 0000644 00000005572 15002236443 0017357 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Video\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ class RecordingSettingsContext extends InstanceContext { /** * Initialize the RecordingSettingsContext * * @param \Twilio\Version $version Version that contains the resource * @return \Twilio\Rest\Video\V1\RecordingSettingsContext */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = array(); $this->uri = '/RecordingSettings/Default'; } /** * Fetch a RecordingSettingsInstance * * @return RecordingSettingsInstance Fetched RecordingSettingsInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new RecordingSettingsInstance($this->version, $payload); } /** * Create a new RecordingSettingsInstance * * @param string $friendlyName A string to describe the resource * @param array|Options $options Optional Arguments * @return RecordingSettingsInstance Newly created RecordingSettingsInstance * @throws TwilioException When an HTTP error occurs. */ public function create($friendlyName, $options = array()) { $options = new Values($options); $data = Values::of(array( 'FriendlyName' => $friendlyName, 'AwsCredentialsSid' => $options['awsCredentialsSid'], 'EncryptionKeySid' => $options['encryptionKeySid'], 'AwsS3Url' => $options['awsS3Url'], 'AwsStorageEnabled' => Serialize::booleanToString($options['awsStorageEnabled']), 'EncryptionEnabled' => Serialize::booleanToString($options['encryptionEnabled']), )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new RecordingSettingsInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Video.V1.RecordingSettingsContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Video/V1/CompositionHookOptions.php 0000644 00000063322 15002236443 0017052 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Video\V1; use Twilio\Options; use Twilio\Values; /** * PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com. */ abstract class CompositionHookOptions { /** * @param bool $enabled Read only CompositionHook resources with an enabled * value that matches this parameter * @param \DateTime $dateCreatedAfter Read only CompositionHook resources * created on or after this ISO 8601 * datetime with time zone * @param \DateTime $dateCreatedBefore Read only CompositionHook resources * created before this ISO 8601 datetime * with time zone * @param string $friendlyName Read only CompositionHook resources with * friendly names that match this string * @return ReadCompositionHookOptions Options builder */ public static function read($enabled = Values::NONE, $dateCreatedAfter = Values::NONE, $dateCreatedBefore = Values::NONE, $friendlyName = Values::NONE) { return new ReadCompositionHookOptions($enabled, $dateCreatedAfter, $dateCreatedBefore, $friendlyName); } /** * @param bool $enabled Whether the composition hook is active * @param array $videoLayout An object that describes the video layout of the * composition hook * @param string $audioSources An array of track names from the same group room * to merge * @param string $audioSourcesExcluded An array of track names to exclude * @param string $resolution A string that describes the rows (width) and * columns (height) of the generated composed video * in pixels * @param string $format The container format of the media files used by the * compositions created by the composition hook * @param string $statusCallback The URL we should call to send status * information to your application * @param string $statusCallbackMethod The HTTP method we should use to call * status_callback * @param bool $trim Whether to clip the intervals where there is no active * media in the Compositions triggered by the composition hook * @return CreateCompositionHookOptions Options builder */ public static function create($enabled = Values::NONE, $videoLayout = Values::NONE, $audioSources = Values::NONE, $audioSourcesExcluded = Values::NONE, $resolution = Values::NONE, $format = Values::NONE, $statusCallback = Values::NONE, $statusCallbackMethod = Values::NONE, $trim = Values::NONE) { return new CreateCompositionHookOptions($enabled, $videoLayout, $audioSources, $audioSourcesExcluded, $resolution, $format, $statusCallback, $statusCallbackMethod, $trim); } /** * @param bool $enabled Whether the composition hook is active * @param array $videoLayout A JSON object that describes the video layout of * the composition hook * @param string $audioSources An array of track names from the same group room * to merge * @param string $audioSourcesExcluded An array of track names to exclude * @param bool $trim Whether to clip the intervals where there is no active * media in the Compositions triggered by the composition hook * @param string $format The container format of the media files used by the * compositions created by the composition hook * @param string $resolution A string that describes the columns (width) and * rows (height) of the generated composed video in * pixels * @param string $statusCallback The URL we should call to send status * information to your application * @param string $statusCallbackMethod The HTTP method we should use to call * status_callback * @return UpdateCompositionHookOptions Options builder */ public static function update($enabled = Values::NONE, $videoLayout = Values::NONE, $audioSources = Values::NONE, $audioSourcesExcluded = Values::NONE, $trim = Values::NONE, $format = Values::NONE, $resolution = Values::NONE, $statusCallback = Values::NONE, $statusCallbackMethod = Values::NONE) { return new UpdateCompositionHookOptions($enabled, $videoLayout, $audioSources, $audioSourcesExcluded, $trim, $format, $resolution, $statusCallback, $statusCallbackMethod); } } class ReadCompositionHookOptions extends Options { /** * @param bool $enabled Read only CompositionHook resources with an enabled * value that matches this parameter * @param \DateTime $dateCreatedAfter Read only CompositionHook resources * created on or after this ISO 8601 * datetime with time zone * @param \DateTime $dateCreatedBefore Read only CompositionHook resources * created before this ISO 8601 datetime * with time zone * @param string $friendlyName Read only CompositionHook resources with * friendly names that match this string */ public function __construct($enabled = Values::NONE, $dateCreatedAfter = Values::NONE, $dateCreatedBefore = Values::NONE, $friendlyName = Values::NONE) { $this->options['enabled'] = $enabled; $this->options['dateCreatedAfter'] = $dateCreatedAfter; $this->options['dateCreatedBefore'] = $dateCreatedBefore; $this->options['friendlyName'] = $friendlyName; } /** * Read only CompositionHook resources with an `enabled` value that matches this parameter. * * @param bool $enabled Read only CompositionHook resources with an enabled * value that matches this parameter * @return $this Fluent Builder */ public function setEnabled($enabled) { $this->options['enabled'] = $enabled; return $this; } /** * Read only CompositionHook resources created on or after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) datetime with time zone. * * @param \DateTime $dateCreatedAfter Read only CompositionHook resources * created on or after this ISO 8601 * datetime with time zone * @return $this Fluent Builder */ public function setDateCreatedAfter($dateCreatedAfter) { $this->options['dateCreatedAfter'] = $dateCreatedAfter; return $this; } /** * Read only CompositionHook resources created before this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) datetime with time zone. * * @param \DateTime $dateCreatedBefore Read only CompositionHook resources * created before this ISO 8601 datetime * with time zone * @return $this Fluent Builder */ public function setDateCreatedBefore($dateCreatedBefore) { $this->options['dateCreatedBefore'] = $dateCreatedBefore; return $this; } /** * Read only CompositionHook resources with friendly names that match this string. The match is not case sensitive and can include asterisk `*` characters as wildcard match. * * @param string $friendlyName Read only CompositionHook resources with * friendly names that match this string * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; 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.Video.V1.ReadCompositionHookOptions ' . \implode(' ', $options) . ']'; } } class CreateCompositionHookOptions extends Options { /** * @param bool $enabled Whether the composition hook is active * @param array $videoLayout An object that describes the video layout of the * composition hook * @param string $audioSources An array of track names from the same group room * to merge * @param string $audioSourcesExcluded An array of track names to exclude * @param string $resolution A string that describes the rows (width) and * columns (height) of the generated composed video * in pixels * @param string $format The container format of the media files used by the * compositions created by the composition hook * @param string $statusCallback The URL we should call to send status * information to your application * @param string $statusCallbackMethod The HTTP method we should use to call * status_callback * @param bool $trim Whether to clip the intervals where there is no active * media in the Compositions triggered by the composition hook */ public function __construct($enabled = Values::NONE, $videoLayout = Values::NONE, $audioSources = Values::NONE, $audioSourcesExcluded = Values::NONE, $resolution = Values::NONE, $format = Values::NONE, $statusCallback = Values::NONE, $statusCallbackMethod = Values::NONE, $trim = Values::NONE) { $this->options['enabled'] = $enabled; $this->options['videoLayout'] = $videoLayout; $this->options['audioSources'] = $audioSources; $this->options['audioSourcesExcluded'] = $audioSourcesExcluded; $this->options['resolution'] = $resolution; $this->options['format'] = $format; $this->options['statusCallback'] = $statusCallback; $this->options['statusCallbackMethod'] = $statusCallbackMethod; $this->options['trim'] = $trim; } /** * Whether the composition hook is active. When `true`, the composition hook will be triggered for every completed Group Room in the account. When `false`, the composition hook will never be triggered. * * @param bool $enabled Whether the composition hook is active * @return $this Fluent Builder */ public function setEnabled($enabled) { $this->options['enabled'] = $enabled; return $this; } /** * An object that describes the video layout of the composition hook in terms of regions. See [Specifying Video Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info. * * @param array $videoLayout An object that describes the video layout of the * composition hook * @return $this Fluent Builder */ public function setVideoLayout($videoLayout) { $this->options['videoLayout'] = $videoLayout; return $this; } /** * An array of track names from the same group room to merge into the compositions created by the composition hook. Can include zero or more track names. A composition triggered by the composition hook includes all audio sources specified in `audio_sources` except those specified in `audio_sources_excluded`. The track names in this parameter can include an asterisk as a wild card character, which matches zero or more characters in a track name. For example, `student*` includes tracks named `student` as well as `studentTeam`. * * @param string $audioSources An array of track names from the same group room * to merge * @return $this Fluent Builder */ public function setAudioSources($audioSources) { $this->options['audioSources'] = $audioSources; return $this; } /** * An array of track names to exclude. A composition triggered by the composition hook includes all audio sources specified in `audio_sources` except for those specified in `audio_sources_excluded`. The track names in this parameter can include an asterisk as a wild card character, which matches zero or more characters in a track name. For example, `student*` excludes `student` as well as `studentTeam`. This parameter can also be empty. * * @param string $audioSourcesExcluded An array of track names to exclude * @return $this Fluent Builder */ public function setAudioSourcesExcluded($audioSourcesExcluded) { $this->options['audioSourcesExcluded'] = $audioSourcesExcluded; return $this; } /** * A string that describes the columns (width) and rows (height) of the generated composed video in pixels. Defaults to `640x480`. The string's format is `{width}x{height}` where: * 16 <= `{width}` <= 1280 * 16 <= `{height}` <= 1280 * `{width}` * `{height}` <= 921,600 Typical values are: * HD = `1280x720` * PAL = `1024x576` * VGA = `640x480` * CIF = `320x240` Note that the `resolution` imposes an aspect ratio to the resulting composition. When the original video tracks are constrained by the aspect ratio, they are scaled to fit. See [Specifying Video Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info. * * @param string $resolution A string that describes the rows (width) and * columns (height) of the generated composed video * in pixels * @return $this Fluent Builder */ public function setResolution($resolution) { $this->options['resolution'] = $resolution; return $this; } /** * The container format of the media files used by the compositions created by the composition hook. Can be: `mp4` or `webm` and the default is `webm`. If `mp4` or `webm`, `audio_sources` must have one or more tracks and/or a `video_layout` element must contain a valid `video_sources` list, otherwise an error occurs. * * @param string $format The container format of the media files used by the * compositions created by the composition hook * @return $this Fluent Builder */ public function setFormat($format) { $this->options['format'] = $format; return $this; } /** * The URL we should call using the `status_callback_method` to send status information to your application on every composition event. If not provided, status callback events will not be dispatched. * * @param string $statusCallback The URL we should call to send status * information to your application * @return $this Fluent Builder */ public function setStatusCallback($statusCallback) { $this->options['statusCallback'] = $statusCallback; return $this; } /** * The HTTP method we should use to call `status_callback`. Can be: `POST` or `GET` and the default is `POST`. * * @param string $statusCallbackMethod The HTTP method we should use to call * status_callback * @return $this Fluent Builder */ public function setStatusCallbackMethod($statusCallbackMethod) { $this->options['statusCallbackMethod'] = $statusCallbackMethod; return $this; } /** * Whether to clip the intervals where there is no active media in the Compositions triggered by the composition hook. The default is `true`. Compositions with `trim` enabled are shorter when the Room is created and no Participant joins for a while as well as if all the Participants leave the room and join later, because those gaps will be removed. See [Specifying Video Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info. * * @param bool $trim Whether to clip the intervals where there is no active * media in the Compositions triggered by the composition hook * @return $this Fluent Builder */ public function setTrim($trim) { $this->options['trim'] = $trim; 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.Video.V1.CreateCompositionHookOptions ' . \implode(' ', $options) . ']'; } } class UpdateCompositionHookOptions extends Options { /** * @param bool $enabled Whether the composition hook is active * @param array $videoLayout A JSON object that describes the video layout of * the composition hook * @param string $audioSources An array of track names from the same group room * to merge * @param string $audioSourcesExcluded An array of track names to exclude * @param bool $trim Whether to clip the intervals where there is no active * media in the Compositions triggered by the composition hook * @param string $format The container format of the media files used by the * compositions created by the composition hook * @param string $resolution A string that describes the columns (width) and * rows (height) of the generated composed video in * pixels * @param string $statusCallback The URL we should call to send status * information to your application * @param string $statusCallbackMethod The HTTP method we should use to call * status_callback */ public function __construct($enabled = Values::NONE, $videoLayout = Values::NONE, $audioSources = Values::NONE, $audioSourcesExcluded = Values::NONE, $trim = Values::NONE, $format = Values::NONE, $resolution = Values::NONE, $statusCallback = Values::NONE, $statusCallbackMethod = Values::NONE) { $this->options['enabled'] = $enabled; $this->options['videoLayout'] = $videoLayout; $this->options['audioSources'] = $audioSources; $this->options['audioSourcesExcluded'] = $audioSourcesExcluded; $this->options['trim'] = $trim; $this->options['format'] = $format; $this->options['resolution'] = $resolution; $this->options['statusCallback'] = $statusCallback; $this->options['statusCallbackMethod'] = $statusCallbackMethod; } /** * Whether the composition hook is active. When `true`, the composition hook will be triggered for every completed Group Room in the account. When `false`, the composition hook never triggers. * * @param bool $enabled Whether the composition hook is active * @return $this Fluent Builder */ public function setEnabled($enabled) { $this->options['enabled'] = $enabled; return $this; } /** * A JSON object that describes the video layout of the composition hook in terms of regions. See [Specifying Video Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info. * * @param array $videoLayout A JSON object that describes the video layout of * the composition hook * @return $this Fluent Builder */ public function setVideoLayout($videoLayout) { $this->options['videoLayout'] = $videoLayout; return $this; } /** * An array of track names from the same group room to merge into the compositions created by the composition hook. Can include zero or more track names. A composition triggered by the composition hook includes all audio sources specified in `audio_sources` except those specified in `audio_sources_excluded`. The track names in this parameter can include an asterisk as a wild card character, which matches zero or more characters in a track name. For example, `student*` includes tracks named `student` as well as `studentTeam`. * * @param string $audioSources An array of track names from the same group room * to merge * @return $this Fluent Builder */ public function setAudioSources($audioSources) { $this->options['audioSources'] = $audioSources; return $this; } /** * An array of track names to exclude. A composition triggered by the composition hook includes all audio sources specified in `audio_sources` except for those specified in `audio_sources_excluded`. The track names in this parameter can include an asterisk as a wild card character, which matches zero or more characters in a track name. For example, `student*` excludes `student` as well as `studentTeam`. This parameter can also be empty. * * @param string $audioSourcesExcluded An array of track names to exclude * @return $this Fluent Builder */ public function setAudioSourcesExcluded($audioSourcesExcluded) { $this->options['audioSourcesExcluded'] = $audioSourcesExcluded; return $this; } /** * Whether to clip the intervals where there is no active media in the compositions triggered by the composition hook. The default is `true`. Compositions with `trim` enabled are shorter when the Room is created and no Participant joins for a while as well as if all the Participants leave the room and join later, because those gaps will be removed. See [Specifying Video Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info. * * @param bool $trim Whether to clip the intervals where there is no active * media in the Compositions triggered by the composition hook * @return $this Fluent Builder */ public function setTrim($trim) { $this->options['trim'] = $trim; return $this; } /** * The container format of the media files used by the compositions created by the composition hook. Can be: `mp4` or `webm` and the default is `webm`. If `mp4` or `webm`, `audio_sources` must have one or more tracks and/or a `video_layout` element must contain a valid `video_sources` list, otherwise an error occurs. * * @param string $format The container format of the media files used by the * compositions created by the composition hook * @return $this Fluent Builder */ public function setFormat($format) { $this->options['format'] = $format; return $this; } /** * A string that describes the columns (width) and rows (height) of the generated composed video in pixels. Defaults to `640x480`. The string's format is `{width}x{height}` where: * 16 <= `{width}` <= 1280 * 16 <= `{height}` <= 1280 * `{width}` * `{height}` <= 921,600 Typical values are: * HD = `1280x720` * PAL = `1024x576` * VGA = `640x480` * CIF = `320x240` Note that the `resolution` imposes an aspect ratio to the resulting composition. When the original video tracks are constrained by the aspect ratio, they are scaled to fit. See [Specifying Video Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info. * * @param string $resolution A string that describes the columns (width) and * rows (height) of the generated composed video in * pixels * @return $this Fluent Builder */ public function setResolution($resolution) { $this->options['resolution'] = $resolution; return $this; } /** * The URL we should call using the `status_callback_method` to send status information to your application on every composition event. If not provided, status callback events will not be dispatched. * * @param string $statusCallback The URL we should call to send status * information to your application * @return $this Fluent Builder */ public function setStatusCallback($statusCallback) { $this->options['statusCallback'] = $statusCallback; return $this; } /** * The HTTP method we should use to call `status_callback`. Can be: `POST` or `GET` and the default is `POST`. * * @param string $statusCallbackMethod The HTTP method we should use to call * status_callback * @return $this Fluent Builder */ public function setStatusCallbackMethod($statusCallbackMethod) { $this->options['statusCallbackMethod'] = $statusCallbackMethod; 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.Video.V1.UpdateCompositionHookOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Studio/V1.php 0000644 00000004321 15002236443 0012545 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Studio; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\Rest\Studio\V1\FlowList; use Twilio\Version; /** * @property \Twilio\Rest\Studio\V1\FlowList $flows * @method \Twilio\Rest\Studio\V1\FlowContext flows(string $sid) */ class V1 extends Version { protected $_flows = null; /** * Construct the V1 version of Studio * * @param \Twilio\Domain $domain Domain that contains the version * @return \Twilio\Rest\Studio\V1 V1 version of Studio */ public function __construct(Domain $domain) { parent::__construct($domain); $this->version = 'v1'; } /** * @return \Twilio\Rest\Studio\V1\FlowList */ protected function getFlows() { if (!$this->_flows) { $this->_flows = new FlowList($this); } return $this->_flows; } /** * Magic getter to lazy load root resources * * @param string $name Resource to return * @return \Twilio\ListResource The requested resource * @throws TwilioException For unknown resource */ public function __get($name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown resource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Studio.V1]'; } } sdk/src/Twilio/Rest/Studio/V1/FlowContext.php 0000644 00000010013 15002236443 0015014 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Studio\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Rest\Studio\V1\Flow\EngagementList; use Twilio\Rest\Studio\V1\Flow\ExecutionList; use Twilio\Values; use Twilio\Version; /** * @property \Twilio\Rest\Studio\V1\Flow\EngagementList $engagements * @property \Twilio\Rest\Studio\V1\Flow\ExecutionList $executions * @method \Twilio\Rest\Studio\V1\Flow\EngagementContext engagements(string $sid) * @method \Twilio\Rest\Studio\V1\Flow\ExecutionContext executions(string $sid) */ class FlowContext extends InstanceContext { protected $_engagements = null; protected $_executions = null; /** * Initialize the FlowContext * * @param \Twilio\Version $version Version that contains the resource * @param string $sid The SID that identifies the resource to fetch * @return \Twilio\Rest\Studio\V1\FlowContext */ public function __construct(Version $version, $sid) { parent::__construct($version); // Path Solution $this->solution = array('sid' => $sid, ); $this->uri = '/Flows/' . \rawurlencode($sid) . ''; } /** * Fetch a FlowInstance * * @return FlowInstance Fetched FlowInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new FlowInstance($this->version, $payload, $this->solution['sid']); } /** * Deletes the FlowInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Access the engagements * * @return \Twilio\Rest\Studio\V1\Flow\EngagementList */ protected function getEngagements() { if (!$this->_engagements) { $this->_engagements = new EngagementList($this->version, $this->solution['sid']); } return $this->_engagements; } /** * Access the executions * * @return \Twilio\Rest\Studio\V1\Flow\ExecutionList */ protected function getExecutions() { if (!$this->_executions) { $this->_executions = new ExecutionList($this->version, $this->solution['sid']); } return $this->_executions; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get($name) { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Studio.V1.FlowContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Studio/V1/FlowPage.php 0000644 00000001305 15002236443 0014250 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Studio\V1; use Twilio\Page; class FlowPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new FlowInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Studio.V1.FlowPage]'; } } sdk/src/Twilio/Rest/Studio/V1/FlowInstance.php 0000644 00000010202 15002236443 0015134 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Studio\V1; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $accountSid * @property string $friendlyName * @property string $status * @property int $version * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $url * @property array $links */ class FlowInstance extends InstanceResource { protected $_engagements = null; protected $_executions = null; /** * Initialize the FlowInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The SID that identifies the resource to fetch * @return \Twilio\Rest\Studio\V1\FlowInstance */ public function __construct(Version $version, array $payload, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'status' => Values::array_get($payload, 'status'), 'version' => Values::array_get($payload, 'version'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ); $this->solution = array('sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Studio\V1\FlowContext Context for this FlowInstance */ protected function proxy() { if (!$this->context) { $this->context = new FlowContext($this->version, $this->solution['sid']); } return $this->context; } /** * Fetch a FlowInstance * * @return FlowInstance Fetched FlowInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the FlowInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Access the engagements * * @return \Twilio\Rest\Studio\V1\Flow\EngagementList */ protected function getEngagements() { return $this->proxy()->engagements; } /** * Access the executions * * @return \Twilio\Rest\Studio\V1\Flow\ExecutionList */ protected function getExecutions() { return $this->proxy()->executions; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Studio.V1.FlowInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Studio/V1/FlowList.php 0000644 00000011055 15002236443 0014312 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Studio\V1; use Twilio\ListResource; use Twilio\Values; use Twilio\Version; class FlowList extends ListResource { /** * Construct the FlowList * * @param Version $version Version that contains the resource * @return \Twilio\Rest\Studio\V1\FlowList */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = array(); $this->uri = '/Flows'; } /** * Streams FlowInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads FlowInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return FlowInstance[] Array of results */ public function read($limit = null, $pageSize = null) { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of FlowInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of FlowInstance */ public function page($pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $params = Values::of(array( 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new FlowPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of FlowInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of FlowInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new FlowPage($this->version, $response, $this->solution); } /** * Constructs a FlowContext * * @param string $sid The SID that identifies the resource to fetch * @return \Twilio\Rest\Studio\V1\FlowContext */ public function getContext($sid) { return new FlowContext($this->version, $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Studio.V1.FlowList]'; } } sdk/src/Twilio/Rest/Studio/V1/Flow/ExecutionOptions.php 0000644 00000010667 15002236443 0017005 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Studio\V1\Flow; use Twilio\Options; use Twilio\Values; abstract class ExecutionOptions { /** * @param \DateTime $dateCreatedFrom Only show Executions that started on or * after this ISO 8601 date-time * @param \DateTime $dateCreatedTo Only show Executions that started before * this ISO 8601 date-time * @return ReadExecutionOptions Options builder */ public static function read($dateCreatedFrom = Values::NONE, $dateCreatedTo = Values::NONE) { return new ReadExecutionOptions($dateCreatedFrom, $dateCreatedTo); } /** * @param array $parameters JSON data that will be added to the Flow's context * @return CreateExecutionOptions Options builder */ public static function create($parameters = Values::NONE) { return new CreateExecutionOptions($parameters); } } class ReadExecutionOptions extends Options { /** * @param \DateTime $dateCreatedFrom Only show Executions that started on or * after this ISO 8601 date-time * @param \DateTime $dateCreatedTo Only show Executions that started before * this ISO 8601 date-time */ public function __construct($dateCreatedFrom = Values::NONE, $dateCreatedTo = Values::NONE) { $this->options['dateCreatedFrom'] = $dateCreatedFrom; $this->options['dateCreatedTo'] = $dateCreatedTo; } /** * Only show Execution resources starting on or after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time, given as `YYYY-MM-DDThh:mm:ss-hh:mm`. * * @param \DateTime $dateCreatedFrom Only show Executions that started on or * after this ISO 8601 date-time * @return $this Fluent Builder */ public function setDateCreatedFrom($dateCreatedFrom) { $this->options['dateCreatedFrom'] = $dateCreatedFrom; return $this; } /** * Only show Execution resources starting before this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time, given as `YYYY-MM-DDThh:mm:ss-hh:mm`. * * @param \DateTime $dateCreatedTo Only show Executions that started before * this ISO 8601 date-time * @return $this Fluent Builder */ public function setDateCreatedTo($dateCreatedTo) { $this->options['dateCreatedTo'] = $dateCreatedTo; 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.Studio.V1.ReadExecutionOptions ' . \implode(' ', $options) . ']'; } } class CreateExecutionOptions extends Options { /** * @param array $parameters JSON data that will be added to the Flow's context */ public function __construct($parameters = Values::NONE) { $this->options['parameters'] = $parameters; } /** * JSON data that will be added to the Flow's context and that can be accessed as variables inside your Flow. For example, if you pass in `Parameters={"name":"Zeke"}`, a widget in your Flow can reference the variable `{{flow.data.name}}`, which returns "Zeke". Note: the JSON value must explicitly be passed as a string, not as a hash object. Depending on your particular HTTP library, you may need to add quotes or URL encode the JSON string. * * @param array $parameters JSON data that will be added to the Flow's context * @return $this Fluent Builder */ public function setParameters($parameters) { $this->options['parameters'] = $parameters; 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.Studio.V1.CreateExecutionOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Studio/V1/Flow/EngagementInstance.php 0000644 00000011274 15002236443 0017220 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Studio\V1\Flow; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $accountSid * @property string $flowSid * @property string $contactSid * @property string $contactChannelAddress * @property array $context * @property string $status * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $url * @property array $links */ class EngagementInstance extends InstanceResource { protected $_steps = null; protected $_engagementContext = null; /** * Initialize the EngagementInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $flowSid The SID of the Flow * @param string $sid The SID of the Engagement resource to fetch * @return \Twilio\Rest\Studio\V1\Flow\EngagementInstance */ public function __construct(Version $version, array $payload, $flowSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'flowSid' => Values::array_get($payload, 'flow_sid'), 'contactSid' => Values::array_get($payload, 'contact_sid'), 'contactChannelAddress' => Values::array_get($payload, 'contact_channel_address'), 'context' => Values::array_get($payload, 'context'), 'status' => Values::array_get($payload, 'status'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ); $this->solution = array('flowSid' => $flowSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Studio\V1\Flow\EngagementContext Context for this * EngagementInstance */ protected function proxy() { if (!$this->context) { $this->context = new EngagementContext( $this->version, $this->solution['flowSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch a EngagementInstance * * @return EngagementInstance Fetched EngagementInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the EngagementInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Access the steps * * @return \Twilio\Rest\Studio\V1\Flow\Engagement\StepList */ protected function getSteps() { return $this->proxy()->steps; } /** * Access the engagementContext * * @return \Twilio\Rest\Studio\V1\Flow\Engagement\EngagementContextList */ protected function getEngagementContext() { return $this->proxy()->engagementContext; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Studio.V1.EngagementInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Studio/V1/Flow/ExecutionPage.php 0000644 00000001365 15002236443 0016221 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Studio\V1\Flow; use Twilio\Page; class ExecutionPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new ExecutionInstance($this->version, $payload, $this->solution['flowSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Studio.V1.ExecutionPage]'; } } sdk/src/Twilio/Rest/Studio/V1/Flow/EngagementList.php 0000644 00000013543 15002236443 0016370 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Studio\V1\Flow; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class EngagementList extends ListResource { /** * Construct the EngagementList * * @param Version $version Version that contains the resource * @param string $flowSid The SID of the Flow * @return \Twilio\Rest\Studio\V1\Flow\EngagementList */ public function __construct(Version $version, $flowSid) { parent::__construct($version); // Path Solution $this->solution = array('flowSid' => $flowSid, ); $this->uri = '/Flows/' . \rawurlencode($flowSid) . '/Engagements'; } /** * Streams EngagementInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads EngagementInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return EngagementInstance[] Array of results */ public function read($limit = null, $pageSize = null) { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of EngagementInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of EngagementInstance */ public function page($pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $params = Values::of(array( 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new EngagementPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of EngagementInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of EngagementInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new EngagementPage($this->version, $response, $this->solution); } /** * Create a new EngagementInstance * * @param string $to The Contact phone number to start a Studio Flow Engagement * @param string $from The Twilio phone number to send messages or initiate * calls from during the Flow Engagement * @param array|Options $options Optional Arguments * @return EngagementInstance Newly created EngagementInstance * @throws TwilioException When an HTTP error occurs. */ public function create($to, $from, $options = array()) { $options = new Values($options); $data = Values::of(array( 'To' => $to, 'From' => $from, 'Parameters' => Serialize::jsonObject($options['parameters']), )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new EngagementInstance($this->version, $payload, $this->solution['flowSid']); } /** * Constructs a EngagementContext * * @param string $sid The SID of the Engagement resource to fetch * @return \Twilio\Rest\Studio\V1\Flow\EngagementContext */ public function getContext($sid) { return new EngagementContext($this->version, $this->solution['flowSid'], $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Studio.V1.EngagementList]'; } } sdk/src/Twilio/Rest/Studio/V1/Flow/ExecutionInstance.php 0000644 00000011261 15002236443 0017105 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Studio\V1\Flow; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $accountSid * @property string $flowSid * @property string $contactSid * @property string $contactChannelAddress * @property array $context * @property string $status * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $url * @property array $links */ class ExecutionInstance extends InstanceResource { protected $_steps = null; protected $_executionContext = null; /** * Initialize the ExecutionInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $flowSid The SID of the Flow * @param string $sid The SID of the Execution resource to fetch * @return \Twilio\Rest\Studio\V1\Flow\ExecutionInstance */ public function __construct(Version $version, array $payload, $flowSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'flowSid' => Values::array_get($payload, 'flow_sid'), 'contactSid' => Values::array_get($payload, 'contact_sid'), 'contactChannelAddress' => Values::array_get($payload, 'contact_channel_address'), 'context' => Values::array_get($payload, 'context'), 'status' => Values::array_get($payload, 'status'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ); $this->solution = array('flowSid' => $flowSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Studio\V1\Flow\ExecutionContext Context for this * ExecutionInstance */ protected function proxy() { if (!$this->context) { $this->context = new ExecutionContext( $this->version, $this->solution['flowSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch a ExecutionInstance * * @return ExecutionInstance Fetched ExecutionInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the ExecutionInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Access the steps * * @return \Twilio\Rest\Studio\V1\Flow\Execution\ExecutionStepList */ protected function getSteps() { return $this->proxy()->steps; } /** * Access the executionContext * * @return \Twilio\Rest\Studio\V1\Flow\Execution\ExecutionContextList */ protected function getExecutionContext() { return $this->proxy()->executionContext; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Studio.V1.ExecutionInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Studio/V1/Flow/EngagementContext.php 0000644 00000010750 15002236443 0017076 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Studio\V1\Flow; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Rest\Studio\V1\Flow\Engagement\EngagementContextList; use Twilio\Rest\Studio\V1\Flow\Engagement\StepList; use Twilio\Values; use Twilio\Version; /** * @property \Twilio\Rest\Studio\V1\Flow\Engagement\StepList $steps * @property \Twilio\Rest\Studio\V1\Flow\Engagement\EngagementContextList $engagementContext * @method \Twilio\Rest\Studio\V1\Flow\Engagement\StepContext steps(string $sid) * @method \Twilio\Rest\Studio\V1\Flow\Engagement\EngagementContextContext engagementContext() */ class EngagementContext extends InstanceContext { protected $_steps = null; protected $_engagementContext = null; /** * Initialize the EngagementContext * * @param \Twilio\Version $version Version that contains the resource * @param string $flowSid Flow SID * @param string $sid The SID of the Engagement resource to fetch * @return \Twilio\Rest\Studio\V1\Flow\EngagementContext */ public function __construct(Version $version, $flowSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array('flowSid' => $flowSid, 'sid' => $sid, ); $this->uri = '/Flows/' . \rawurlencode($flowSid) . '/Engagements/' . \rawurlencode($sid) . ''; } /** * Fetch a EngagementInstance * * @return EngagementInstance Fetched EngagementInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new EngagementInstance( $this->version, $payload, $this->solution['flowSid'], $this->solution['sid'] ); } /** * Deletes the EngagementInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Access the steps * * @return \Twilio\Rest\Studio\V1\Flow\Engagement\StepList */ protected function getSteps() { if (!$this->_steps) { $this->_steps = new StepList($this->version, $this->solution['flowSid'], $this->solution['sid']); } return $this->_steps; } /** * Access the engagementContext * * @return \Twilio\Rest\Studio\V1\Flow\Engagement\EngagementContextList */ protected function getEngagementContext() { if (!$this->_engagementContext) { $this->_engagementContext = new EngagementContextList( $this->version, $this->solution['flowSid'], $this->solution['sid'] ); } return $this->_engagementContext; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get($name) { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Studio.V1.EngagementContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Studio/V1/Flow/ExecutionList.php 0000644 00000014434 15002236443 0016261 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Studio\V1\Flow; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class ExecutionList extends ListResource { /** * Construct the ExecutionList * * @param Version $version Version that contains the resource * @param string $flowSid The SID of the Flow * @return \Twilio\Rest\Studio\V1\Flow\ExecutionList */ public function __construct(Version $version, $flowSid) { parent::__construct($version); // Path Solution $this->solution = array('flowSid' => $flowSid, ); $this->uri = '/Flows/' . \rawurlencode($flowSid) . '/Executions'; } /** * Streams ExecutionInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($options = array(), $limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads ExecutionInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return ExecutionInstance[] Array of results */ public function read($options = array(), $limit = null, $pageSize = null) { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Retrieve a single page of ExecutionInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of ExecutionInstance */ public function page($options = array(), $pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $options = new Values($options); $params = Values::of(array( 'DateCreatedFrom' => Serialize::iso8601DateTime($options['dateCreatedFrom']), 'DateCreatedTo' => Serialize::iso8601DateTime($options['dateCreatedTo']), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new ExecutionPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of ExecutionInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of ExecutionInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new ExecutionPage($this->version, $response, $this->solution); } /** * Create a new ExecutionInstance * * @param string $to The Contact phone number to start a Studio Flow Execution * @param string $from The Twilio phone number to send messages or initiate * calls from during the Flow Execution * @param array|Options $options Optional Arguments * @return ExecutionInstance Newly created ExecutionInstance * @throws TwilioException When an HTTP error occurs. */ public function create($to, $from, $options = array()) { $options = new Values($options); $data = Values::of(array( 'To' => $to, 'From' => $from, 'Parameters' => Serialize::jsonObject($options['parameters']), )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new ExecutionInstance($this->version, $payload, $this->solution['flowSid']); } /** * Constructs a ExecutionContext * * @param string $sid The SID of the Execution resource to fetch * @return \Twilio\Rest\Studio\V1\Flow\ExecutionContext */ public function getContext($sid) { return new ExecutionContext($this->version, $this->solution['flowSid'], $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Studio.V1.ExecutionList]'; } } sdk/src/Twilio/Rest/Studio/V1/Flow/Execution/ExecutionStepContext.php 0000644 00000007732 15002236443 0021574 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Studio\V1\Flow\Execution; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Rest\Studio\V1\Flow\Execution\ExecutionStep\ExecutionStepContextList; use Twilio\Values; use Twilio\Version; /** * @property \Twilio\Rest\Studio\V1\Flow\Execution\ExecutionStep\ExecutionStepContextList $stepContext * @method \Twilio\Rest\Studio\V1\Flow\Execution\ExecutionStep\ExecutionStepContextContext stepContext() */ class ExecutionStepContext extends InstanceContext { protected $_stepContext = null; /** * Initialize the ExecutionStepContext * * @param \Twilio\Version $version Version that contains the resource * @param string $flowSid The SID of the Flow * @param string $executionSid The SID of the Execution * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Studio\V1\Flow\Execution\ExecutionStepContext */ public function __construct(Version $version, $flowSid, $executionSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array('flowSid' => $flowSid, 'executionSid' => $executionSid, 'sid' => $sid, ); $this->uri = '/Flows/' . \rawurlencode($flowSid) . '/Executions/' . \rawurlencode($executionSid) . '/Steps/' . \rawurlencode($sid) . ''; } /** * Fetch a ExecutionStepInstance * * @return ExecutionStepInstance Fetched ExecutionStepInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new ExecutionStepInstance( $this->version, $payload, $this->solution['flowSid'], $this->solution['executionSid'], $this->solution['sid'] ); } /** * Access the stepContext * * @return \Twilio\Rest\Studio\V1\Flow\Execution\ExecutionStep\ExecutionStepContextList */ protected function getStepContext() { if (!$this->_stepContext) { $this->_stepContext = new ExecutionStepContextList( $this->version, $this->solution['flowSid'], $this->solution['executionSid'], $this->solution['sid'] ); } return $this->_stepContext; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get($name) { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Studio.V1.ExecutionStepContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Studio/V1/Flow/Execution/ExecutionStepList.php 0000644 00000012167 15002236443 0021061 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Studio\V1\Flow\Execution; use Twilio\ListResource; use Twilio\Values; use Twilio\Version; class ExecutionStepList extends ListResource { /** * Construct the ExecutionStepList * * @param Version $version Version that contains the resource * @param string $flowSid The SID of the Flow * @param string $executionSid The SID of the Execution * @return \Twilio\Rest\Studio\V1\Flow\Execution\ExecutionStepList */ public function __construct(Version $version, $flowSid, $executionSid) { parent::__construct($version); // Path Solution $this->solution = array('flowSid' => $flowSid, 'executionSid' => $executionSid, ); $this->uri = '/Flows/' . \rawurlencode($flowSid) . '/Executions/' . \rawurlencode($executionSid) . '/Steps'; } /** * Streams ExecutionStepInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads ExecutionStepInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return ExecutionStepInstance[] Array of results */ public function read($limit = null, $pageSize = null) { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of ExecutionStepInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of ExecutionStepInstance */ public function page($pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $params = Values::of(array( 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new ExecutionStepPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of ExecutionStepInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of ExecutionStepInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new ExecutionStepPage($this->version, $response, $this->solution); } /** * Constructs a ExecutionStepContext * * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Studio\V1\Flow\Execution\ExecutionStepContext */ public function getContext($sid) { return new ExecutionStepContext( $this->version, $this->solution['flowSid'], $this->solution['executionSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Studio.V1.ExecutionStepList]'; } } sdk/src/Twilio/Rest/Studio/V1/Flow/Execution/ExecutionStepPage.php 0000644 00000001546 15002236443 0021021 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Studio\V1\Flow\Execution; use Twilio\Page; class ExecutionStepPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new ExecutionStepInstance( $this->version, $payload, $this->solution['flowSid'], $this->solution['executionSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Studio.V1.ExecutionStepPage]'; } } sdk/src/Twilio/Rest/Studio/V1/Flow/Execution/ExecutionContextPage.php 0000644 00000001557 15002236443 0021534 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Studio\V1\Flow\Execution; use Twilio\Page; class ExecutionContextPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new ExecutionContextInstance( $this->version, $payload, $this->solution['flowSid'], $this->solution['executionSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Studio.V1.ExecutionContextPage]'; } } sdk/src/Twilio/Rest/Studio/V1/Flow/Execution/ExecutionContextList.php 0000644 00000002554 15002236443 0021571 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Studio\V1\Flow\Execution; use Twilio\ListResource; use Twilio\Version; class ExecutionContextList extends ListResource { /** * Construct the ExecutionContextList * * @param Version $version Version that contains the resource * @param string $flowSid The SID of the Flow * @param string $executionSid The SID of the Execution * @return \Twilio\Rest\Studio\V1\Flow\Execution\ExecutionContextList */ public function __construct(Version $version, $flowSid, $executionSid) { parent::__construct($version); // Path Solution $this->solution = array('flowSid' => $flowSid, 'executionSid' => $executionSid, ); } /** * Constructs a ExecutionContextContext * * @return \Twilio\Rest\Studio\V1\Flow\Execution\ExecutionContextContext */ public function getContext() { return new ExecutionContextContext( $this->version, $this->solution['flowSid'], $this->solution['executionSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Studio.V1.ExecutionContextList]'; } } sdk/src/Twilio/Rest/Studio/V1/Flow/Execution/ExecutionContextContext.php 0000644 00000003676 15002236443 0022310 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Studio\V1\Flow\Execution; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; class ExecutionContextContext extends InstanceContext { /** * Initialize the ExecutionContextContext * * @param \Twilio\Version $version Version that contains the resource * @param string $flowSid The SID of the Flow * @param string $executionSid The SID of the Execution * @return \Twilio\Rest\Studio\V1\Flow\Execution\ExecutionContextContext */ public function __construct(Version $version, $flowSid, $executionSid) { parent::__construct($version); // Path Solution $this->solution = array('flowSid' => $flowSid, 'executionSid' => $executionSid, ); $this->uri = '/Flows/' . \rawurlencode($flowSid) . '/Executions/' . \rawurlencode($executionSid) . '/Context'; } /** * Fetch a ExecutionContextInstance * * @return ExecutionContextInstance Fetched ExecutionContextInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new ExecutionContextInstance( $this->version, $payload, $this->solution['flowSid'], $this->solution['executionSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Studio.V1.ExecutionContextContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Studio/V1/Flow/Execution/ExecutionStepInstance.php 0000644 00000011225 15002236443 0021704 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Studio\V1\Flow\Execution; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $accountSid * @property string $flowSid * @property string $executionSid * @property string $name * @property array $context * @property string $transitionedFrom * @property string $transitionedTo * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $url * @property array $links */ class ExecutionStepInstance extends InstanceResource { protected $_stepContext = null; /** * Initialize the ExecutionStepInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $flowSid The SID of the Flow * @param string $executionSid The SID of the Execution * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Studio\V1\Flow\Execution\ExecutionStepInstance */ public function __construct(Version $version, array $payload, $flowSid, $executionSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'flowSid' => Values::array_get($payload, 'flow_sid'), 'executionSid' => Values::array_get($payload, 'execution_sid'), 'name' => Values::array_get($payload, 'name'), 'context' => Values::array_get($payload, 'context'), 'transitionedFrom' => Values::array_get($payload, 'transitioned_from'), 'transitionedTo' => Values::array_get($payload, 'transitioned_to'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ); $this->solution = array( 'flowSid' => $flowSid, 'executionSid' => $executionSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Studio\V1\Flow\Execution\ExecutionStepContext Context * for this * ExecutionStepInstance */ protected function proxy() { if (!$this->context) { $this->context = new ExecutionStepContext( $this->version, $this->solution['flowSid'], $this->solution['executionSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch a ExecutionStepInstance * * @return ExecutionStepInstance Fetched ExecutionStepInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Access the stepContext * * @return \Twilio\Rest\Studio\V1\Flow\Execution\ExecutionStep\ExecutionStepContextList */ protected function getStepContext() { return $this->proxy()->stepContext; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Studio.V1.ExecutionStepInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Studio/V1/Flow/Execution/ExecutionStep/ExecutionStepContextList.php 0000644 00000003117 15002236443 0025220 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Studio\V1\Flow\Execution\ExecutionStep; use Twilio\ListResource; use Twilio\Version; class ExecutionStepContextList extends ListResource { /** * Construct the ExecutionStepContextList * * @param Version $version Version that contains the resource * @param string $flowSid The SID of the Flow * @param string $executionSid The SID of the Execution * @param string $stepSid Step SID * @return \Twilio\Rest\Studio\V1\Flow\Execution\ExecutionStep\ExecutionStepContextList */ public function __construct(Version $version, $flowSid, $executionSid, $stepSid) { parent::__construct($version); // Path Solution $this->solution = array( 'flowSid' => $flowSid, 'executionSid' => $executionSid, 'stepSid' => $stepSid, ); } /** * Constructs a ExecutionStepContextContext * * @return \Twilio\Rest\Studio\V1\Flow\Execution\ExecutionStep\ExecutionStepContextContext */ public function getContext() { return new ExecutionStepContextContext( $this->version, $this->solution['flowSid'], $this->solution['executionSid'], $this->solution['stepSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Studio.V1.ExecutionStepContextList]'; } } sdk/src/Twilio/Rest/Studio/V1/Flow/Execution/ExecutionStep/ExecutionStepContextInstance.php 0000644 00000007331 15002236443 0026053 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Studio\V1\Flow\Execution\ExecutionStep; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property array $context * @property string $executionSid * @property string $flowSid * @property string $stepSid * @property string $url */ class ExecutionStepContextInstance extends InstanceResource { /** * Initialize the ExecutionStepContextInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $flowSid The SID of the Flow * @param string $executionSid The SID of the Execution * @param string $stepSid Step SID * @return \Twilio\Rest\Studio\V1\Flow\Execution\ExecutionStep\ExecutionStepContextInstance */ public function __construct(Version $version, array $payload, $flowSid, $executionSid, $stepSid) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'accountSid' => Values::array_get($payload, 'account_sid'), 'context' => Values::array_get($payload, 'context'), 'executionSid' => Values::array_get($payload, 'execution_sid'), 'flowSid' => Values::array_get($payload, 'flow_sid'), 'stepSid' => Values::array_get($payload, 'step_sid'), 'url' => Values::array_get($payload, 'url'), ); $this->solution = array( 'flowSid' => $flowSid, 'executionSid' => $executionSid, 'stepSid' => $stepSid, ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Studio\V1\Flow\Execution\ExecutionStep\ExecutionStepContextContext Context for this * ExecutionStepContextInstance */ protected function proxy() { if (!$this->context) { $this->context = new ExecutionStepContextContext( $this->version, $this->solution['flowSid'], $this->solution['executionSid'], $this->solution['stepSid'] ); } return $this->context; } /** * Fetch a ExecutionStepContextInstance * * @return ExecutionStepContextInstance Fetched ExecutionStepContextInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Studio.V1.ExecutionStepContextInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Studio/V1/Flow/Execution/ExecutionStep/ExecutionStepContextContext.php 0000644 00000004275 15002236443 0025737 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Studio\V1\Flow\Execution\ExecutionStep; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; class ExecutionStepContextContext extends InstanceContext { /** * Initialize the ExecutionStepContextContext * * @param \Twilio\Version $version Version that contains the resource * @param string $flowSid The SID of the Flow * @param string $executionSid The SID of the Execution * @param string $stepSid Step SID * @return \Twilio\Rest\Studio\V1\Flow\Execution\ExecutionStep\ExecutionStepContextContext */ public function __construct(Version $version, $flowSid, $executionSid, $stepSid) { parent::__construct($version); // Path Solution $this->solution = array( 'flowSid' => $flowSid, 'executionSid' => $executionSid, 'stepSid' => $stepSid, ); $this->uri = '/Flows/' . \rawurlencode($flowSid) . '/Executions/' . \rawurlencode($executionSid) . '/Steps/' . \rawurlencode($stepSid) . '/Context'; } /** * Fetch a ExecutionStepContextInstance * * @return ExecutionStepContextInstance Fetched ExecutionStepContextInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new ExecutionStepContextInstance( $this->version, $payload, $this->solution['flowSid'], $this->solution['executionSid'], $this->solution['stepSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Studio.V1.ExecutionStepContextContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Studio/V1/Flow/Execution/ExecutionStep/ExecutionStepContextPage.php 0000644 00000001661 15002236443 0025163 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Studio\V1\Flow\Execution\ExecutionStep; use Twilio\Page; class ExecutionStepContextPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new ExecutionStepContextInstance( $this->version, $payload, $this->solution['flowSid'], $this->solution['executionSid'], $this->solution['stepSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Studio.V1.ExecutionStepContextPage]'; } } sdk/src/Twilio/Rest/Studio/V1/Flow/Execution/ExecutionContextInstance.php 0000644 00000006450 15002236443 0022421 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Studio\V1\Flow\Execution; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property array $context * @property string $flowSid * @property string $executionSid * @property string $url */ class ExecutionContextInstance extends InstanceResource { /** * Initialize the ExecutionContextInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $flowSid The SID of the Flow * @param string $executionSid The SID of the Execution * @return \Twilio\Rest\Studio\V1\Flow\Execution\ExecutionContextInstance */ public function __construct(Version $version, array $payload, $flowSid, $executionSid) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'accountSid' => Values::array_get($payload, 'account_sid'), 'context' => Values::array_get($payload, 'context'), 'flowSid' => Values::array_get($payload, 'flow_sid'), 'executionSid' => Values::array_get($payload, 'execution_sid'), 'url' => Values::array_get($payload, 'url'), ); $this->solution = array('flowSid' => $flowSid, 'executionSid' => $executionSid, ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Studio\V1\Flow\Execution\ExecutionContextContext Context for this ExecutionContextInstance */ protected function proxy() { if (!$this->context) { $this->context = new ExecutionContextContext( $this->version, $this->solution['flowSid'], $this->solution['executionSid'] ); } return $this->context; } /** * Fetch a ExecutionContextInstance * * @return ExecutionContextInstance Fetched ExecutionContextInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Studio.V1.ExecutionContextInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Studio/V1/Flow/ExecutionContext.php 0000644 00000011076 15002236443 0016771 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Studio\V1\Flow; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Rest\Studio\V1\Flow\Execution\ExecutionContextList; use Twilio\Rest\Studio\V1\Flow\Execution\ExecutionStepList; use Twilio\Values; use Twilio\Version; /** * @property \Twilio\Rest\Studio\V1\Flow\Execution\ExecutionStepList $steps * @property \Twilio\Rest\Studio\V1\Flow\Execution\ExecutionContextList $executionContext * @method \Twilio\Rest\Studio\V1\Flow\Execution\ExecutionStepContext steps(string $sid) * @method \Twilio\Rest\Studio\V1\Flow\Execution\ExecutionContextContext executionContext() */ class ExecutionContext extends InstanceContext { protected $_steps = null; protected $_executionContext = null; /** * Initialize the ExecutionContext * * @param \Twilio\Version $version Version that contains the resource * @param string $flowSid The SID of the Flow * @param string $sid The SID of the Execution resource to fetch * @return \Twilio\Rest\Studio\V1\Flow\ExecutionContext */ public function __construct(Version $version, $flowSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array('flowSid' => $flowSid, 'sid' => $sid, ); $this->uri = '/Flows/' . \rawurlencode($flowSid) . '/Executions/' . \rawurlencode($sid) . ''; } /** * Fetch a ExecutionInstance * * @return ExecutionInstance Fetched ExecutionInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new ExecutionInstance( $this->version, $payload, $this->solution['flowSid'], $this->solution['sid'] ); } /** * Deletes the ExecutionInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Access the steps * * @return \Twilio\Rest\Studio\V1\Flow\Execution\ExecutionStepList */ protected function getSteps() { if (!$this->_steps) { $this->_steps = new ExecutionStepList( $this->version, $this->solution['flowSid'], $this->solution['sid'] ); } return $this->_steps; } /** * Access the executionContext * * @return \Twilio\Rest\Studio\V1\Flow\Execution\ExecutionContextList */ protected function getExecutionContext() { if (!$this->_executionContext) { $this->_executionContext = new ExecutionContextList( $this->version, $this->solution['flowSid'], $this->solution['sid'] ); } return $this->_executionContext; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get($name) { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Studio.V1.ExecutionContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Studio/V1/Flow/EngagementOptions.php 0000644 00000004405 15002236443 0017105 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Studio\V1\Flow; use Twilio\Options; use Twilio\Values; abstract class EngagementOptions { /** * @param array $parameters A JSON string we will add to your flow's context * and that you can access as variables inside your * flow * @return CreateEngagementOptions Options builder */ public static function create($parameters = Values::NONE) { return new CreateEngagementOptions($parameters); } } class CreateEngagementOptions extends Options { /** * @param array $parameters A JSON string we will add to your flow's context * and that you can access as variables inside your * flow */ public function __construct($parameters = Values::NONE) { $this->options['parameters'] = $parameters; } /** * A JSON string we will add to your flow's context and that you can access as variables inside your flow. For example, if you pass in `Parameters={'name':'Zeke'}` then inside a widget you can reference the variable `{{flow.data.name}}` which will return the string 'Zeke'. Note: the JSON value must explicitly be passed as a string, not as a hash object. Depending on your particular HTTP library, you may need to add quotes or URL encode your JSON string. * * @param array $parameters A JSON string we will add to your flow's context * and that you can access as variables inside your * flow * @return $this Fluent Builder */ public function setParameters($parameters) { $this->options['parameters'] = $parameters; 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.Studio.V1.CreateEngagementOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Studio/V1/Flow/EngagementPage.php 0000644 00000001370 15002236443 0016324 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Studio\V1\Flow; use Twilio\Page; class EngagementPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new EngagementInstance($this->version, $payload, $this->solution['flowSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Studio.V1.EngagementPage]'; } } sdk/src/Twilio/Rest/Studio/V1/Flow/Engagement/EngagementContextList.php 0000644 00000002546 15002236443 0022010 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Studio\V1\Flow\Engagement; use Twilio\ListResource; use Twilio\Version; class EngagementContextList extends ListResource { /** * Construct the EngagementContextList * * @param Version $version Version that contains the resource * @param string $flowSid Flow SID * @param string $engagementSid Engagement SID * @return \Twilio\Rest\Studio\V1\Flow\Engagement\EngagementContextList */ public function __construct(Version $version, $flowSid, $engagementSid) { parent::__construct($version); // Path Solution $this->solution = array('flowSid' => $flowSid, 'engagementSid' => $engagementSid, ); } /** * Constructs a EngagementContextContext * * @return \Twilio\Rest\Studio\V1\Flow\Engagement\EngagementContextContext */ public function getContext() { return new EngagementContextContext( $this->version, $this->solution['flowSid'], $this->solution['engagementSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Studio.V1.EngagementContextList]'; } } sdk/src/Twilio/Rest/Studio/V1/Flow/Engagement/StepPage.php 0000644 00000001515 15002236443 0017240 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Studio\V1\Flow\Engagement; use Twilio\Page; class StepPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new StepInstance( $this->version, $payload, $this->solution['flowSid'], $this->solution['engagementSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Studio.V1.StepPage]'; } } sdk/src/Twilio/Rest/Studio/V1/Flow/Engagement/EngagementContextPage.php 0000644 00000001564 15002236443 0021750 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Studio\V1\Flow\Engagement; use Twilio\Page; class EngagementContextPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new EngagementContextInstance( $this->version, $payload, $this->solution['flowSid'], $this->solution['engagementSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Studio.V1.EngagementContextPage]'; } } sdk/src/Twilio/Rest/Studio/V1/Flow/Engagement/EngagementContextContext.php 0000644 00000003672 15002236443 0022522 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Studio\V1\Flow\Engagement; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; class EngagementContextContext extends InstanceContext { /** * Initialize the EngagementContextContext * * @param \Twilio\Version $version Version that contains the resource * @param string $flowSid Flow SID * @param string $engagementSid Engagement SID * @return \Twilio\Rest\Studio\V1\Flow\Engagement\EngagementContextContext */ public function __construct(Version $version, $flowSid, $engagementSid) { parent::__construct($version); // Path Solution $this->solution = array('flowSid' => $flowSid, 'engagementSid' => $engagementSid, ); $this->uri = '/Flows/' . \rawurlencode($flowSid) . '/Engagements/' . \rawurlencode($engagementSid) . '/Context'; } /** * Fetch a EngagementContextInstance * * @return EngagementContextInstance Fetched EngagementContextInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new EngagementContextInstance( $this->version, $payload, $this->solution['flowSid'], $this->solution['engagementSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Studio.V1.EngagementContextContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Studio/V1/Flow/Engagement/Step/StepContextPage.php 0000644 00000001617 15002236443 0021523 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Studio\V1\Flow\Engagement\Step; use Twilio\Page; class StepContextPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new StepContextInstance( $this->version, $payload, $this->solution['flowSid'], $this->solution['engagementSid'], $this->solution['stepSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Studio.V1.StepContextPage]'; } } sdk/src/Twilio/Rest/Studio/V1/Flow/Engagement/Step/StepContextInstance.php 0000644 00000007021 15002236443 0022406 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Studio\V1\Flow\Engagement\Step; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property array $context * @property string $engagementSid * @property string $flowSid * @property string $stepSid * @property string $url */ class StepContextInstance extends InstanceResource { /** * Initialize the StepContextInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $flowSid The SID of the Flow * @param string $engagementSid The SID of the Engagement * @param string $stepSid Step SID * @return \Twilio\Rest\Studio\V1\Flow\Engagement\Step\StepContextInstance */ public function __construct(Version $version, array $payload, $flowSid, $engagementSid, $stepSid) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'accountSid' => Values::array_get($payload, 'account_sid'), 'context' => Values::array_get($payload, 'context'), 'engagementSid' => Values::array_get($payload, 'engagement_sid'), 'flowSid' => Values::array_get($payload, 'flow_sid'), 'stepSid' => Values::array_get($payload, 'step_sid'), 'url' => Values::array_get($payload, 'url'), ); $this->solution = array( 'flowSid' => $flowSid, 'engagementSid' => $engagementSid, 'stepSid' => $stepSid, ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Studio\V1\Flow\Engagement\Step\StepContextContext Context for this StepContextInstance */ protected function proxy() { if (!$this->context) { $this->context = new StepContextContext( $this->version, $this->solution['flowSid'], $this->solution['engagementSid'], $this->solution['stepSid'] ); } return $this->context; } /** * Fetch a StepContextInstance * * @return StepContextInstance Fetched StepContextInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Studio.V1.StepContextInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Studio/V1/Flow/Engagement/Step/StepContextList.php 0000644 00000002776 15002236443 0021571 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Studio\V1\Flow\Engagement\Step; use Twilio\ListResource; use Twilio\Version; class StepContextList extends ListResource { /** * Construct the StepContextList * * @param Version $version Version that contains the resource * @param string $flowSid The SID of the Flow * @param string $engagementSid The SID of the Engagement * @param string $stepSid Step SID * @return \Twilio\Rest\Studio\V1\Flow\Engagement\Step\StepContextList */ public function __construct(Version $version, $flowSid, $engagementSid, $stepSid) { parent::__construct($version); // Path Solution $this->solution = array( 'flowSid' => $flowSid, 'engagementSid' => $engagementSid, 'stepSid' => $stepSid, ); } /** * Constructs a StepContextContext * * @return \Twilio\Rest\Studio\V1\Flow\Engagement\Step\StepContextContext */ public function getContext() { return new StepContextContext( $this->version, $this->solution['flowSid'], $this->solution['engagementSid'], $this->solution['stepSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Studio.V1.StepContextList]'; } } sdk/src/Twilio/Rest/Studio/V1/Flow/Engagement/Step/StepContextContext.php 0000644 00000004155 15002236443 0022273 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Studio\V1\Flow\Engagement\Step; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; class StepContextContext extends InstanceContext { /** * Initialize the StepContextContext * * @param \Twilio\Version $version Version that contains the resource * @param string $flowSid The SID of the Flow * @param string $engagementSid The SID of the Engagement * @param string $stepSid Step SID * @return \Twilio\Rest\Studio\V1\Flow\Engagement\Step\StepContextContext */ public function __construct(Version $version, $flowSid, $engagementSid, $stepSid) { parent::__construct($version); // Path Solution $this->solution = array( 'flowSid' => $flowSid, 'engagementSid' => $engagementSid, 'stepSid' => $stepSid, ); $this->uri = '/Flows/' . \rawurlencode($flowSid) . '/Engagements/' . \rawurlencode($engagementSid) . '/Steps/' . \rawurlencode($stepSid) . '/Context'; } /** * Fetch a StepContextInstance * * @return StepContextInstance Fetched StepContextInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new StepContextInstance( $this->version, $payload, $this->solution['flowSid'], $this->solution['engagementSid'], $this->solution['stepSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Studio.V1.StepContextContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Studio/V1/Flow/Engagement/StepList.php 0000644 00000011761 15002236443 0017303 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Studio\V1\Flow\Engagement; use Twilio\ListResource; use Twilio\Values; use Twilio\Version; class StepList extends ListResource { /** * Construct the StepList * * @param Version $version Version that contains the resource * @param string $flowSid The SID of the Flow * @param string $engagementSid The SID of the Engagement * @return \Twilio\Rest\Studio\V1\Flow\Engagement\StepList */ public function __construct(Version $version, $flowSid, $engagementSid) { parent::__construct($version); // Path Solution $this->solution = array('flowSid' => $flowSid, 'engagementSid' => $engagementSid, ); $this->uri = '/Flows/' . \rawurlencode($flowSid) . '/Engagements/' . \rawurlencode($engagementSid) . '/Steps'; } /** * Streams StepInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads StepInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return StepInstance[] Array of results */ public function read($limit = null, $pageSize = null) { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of StepInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of StepInstance */ public function page($pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $params = Values::of(array( 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new StepPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of StepInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of StepInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new StepPage($this->version, $response, $this->solution); } /** * Constructs a StepContext * * @param string $sid The SID that identifies the resource to fetch * @return \Twilio\Rest\Studio\V1\Flow\Engagement\StepContext */ public function getContext($sid) { return new StepContext( $this->version, $this->solution['flowSid'], $this->solution['engagementSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Studio.V1.StepList]'; } } sdk/src/Twilio/Rest/Studio/V1/Flow/Engagement/StepContext.php 0000644 00000007517 15002236443 0020020 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Studio\V1\Flow\Engagement; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Rest\Studio\V1\Flow\Engagement\Step\StepContextList; use Twilio\Values; use Twilio\Version; /** * @property \Twilio\Rest\Studio\V1\Flow\Engagement\Step\StepContextList $stepContext * @method \Twilio\Rest\Studio\V1\Flow\Engagement\Step\StepContextContext stepContext() */ class StepContext extends InstanceContext { protected $_stepContext = null; /** * Initialize the StepContext * * @param \Twilio\Version $version Version that contains the resource * @param string $flowSid The SID of the Flow * @param string $engagementSid The SID of the Engagement * @param string $sid The SID that identifies the resource to fetch * @return \Twilio\Rest\Studio\V1\Flow\Engagement\StepContext */ public function __construct(Version $version, $flowSid, $engagementSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array('flowSid' => $flowSid, 'engagementSid' => $engagementSid, 'sid' => $sid, ); $this->uri = '/Flows/' . \rawurlencode($flowSid) . '/Engagements/' . \rawurlencode($engagementSid) . '/Steps/' . \rawurlencode($sid) . ''; } /** * Fetch a StepInstance * * @return StepInstance Fetched StepInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new StepInstance( $this->version, $payload, $this->solution['flowSid'], $this->solution['engagementSid'], $this->solution['sid'] ); } /** * Access the stepContext * * @return \Twilio\Rest\Studio\V1\Flow\Engagement\Step\StepContextList */ protected function getStepContext() { if (!$this->_stepContext) { $this->_stepContext = new StepContextList( $this->version, $this->solution['flowSid'], $this->solution['engagementSid'], $this->solution['sid'] ); } return $this->_stepContext; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get($name) { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Studio.V1.StepContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Studio/V1/Flow/Engagement/EngagementContextInstance.php 0000644 00000006450 15002236443 0022637 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Studio\V1\Flow\Engagement; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property array $context * @property string $engagementSid * @property string $flowSid * @property string $url */ class EngagementContextInstance extends InstanceResource { /** * Initialize the EngagementContextInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $flowSid Flow SID * @param string $engagementSid Engagement SID * @return \Twilio\Rest\Studio\V1\Flow\Engagement\EngagementContextInstance */ public function __construct(Version $version, array $payload, $flowSid, $engagementSid) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'accountSid' => Values::array_get($payload, 'account_sid'), 'context' => Values::array_get($payload, 'context'), 'engagementSid' => Values::array_get($payload, 'engagement_sid'), 'flowSid' => Values::array_get($payload, 'flow_sid'), 'url' => Values::array_get($payload, 'url'), ); $this->solution = array('flowSid' => $flowSid, 'engagementSid' => $engagementSid, ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Studio\V1\Flow\Engagement\EngagementContextContext Context for this EngagementContextInstance */ protected function proxy() { if (!$this->context) { $this->context = new EngagementContextContext( $this->version, $this->solution['flowSid'], $this->solution['engagementSid'] ); } return $this->context; } /** * Fetch a EngagementContextInstance * * @return EngagementContextInstance Fetched EngagementContextInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Studio.V1.EngagementContextInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Studio/V1/Flow/Engagement/StepInstance.php 0000644 00000010743 15002236443 0020133 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Studio\V1\Flow\Engagement; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $accountSid * @property string $flowSid * @property string $engagementSid * @property string $name * @property array $context * @property string $transitionedFrom * @property string $transitionedTo * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $url * @property array $links */ class StepInstance extends InstanceResource { protected $_stepContext = null; /** * Initialize the StepInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $flowSid The SID of the Flow * @param string $engagementSid The SID of the Engagement * @param string $sid The SID that identifies the resource to fetch * @return \Twilio\Rest\Studio\V1\Flow\Engagement\StepInstance */ public function __construct(Version $version, array $payload, $flowSid, $engagementSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'flowSid' => Values::array_get($payload, 'flow_sid'), 'engagementSid' => Values::array_get($payload, 'engagement_sid'), 'name' => Values::array_get($payload, 'name'), 'context' => Values::array_get($payload, 'context'), 'transitionedFrom' => Values::array_get($payload, 'transitioned_from'), 'transitionedTo' => Values::array_get($payload, 'transitioned_to'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ); $this->solution = array( 'flowSid' => $flowSid, 'engagementSid' => $engagementSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Studio\V1\Flow\Engagement\StepContext Context for this * StepInstance */ protected function proxy() { if (!$this->context) { $this->context = new StepContext( $this->version, $this->solution['flowSid'], $this->solution['engagementSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch a StepInstance * * @return StepInstance Fetched StepInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Access the stepContext * * @return \Twilio\Rest\Studio\V1\Flow\Engagement\Step\StepContextList */ protected function getStepContext() { return $this->proxy()->stepContext; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Studio.V1.StepInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Trunking.php 0000644 00000005215 15002236443 0012614 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\Rest\Trunking\V1; /** * @property \Twilio\Rest\Trunking\V1 $v1 * @property \Twilio\Rest\Trunking\V1\TrunkList $trunks * @method \Twilio\Rest\Trunking\V1\TrunkContext trunks(string $sid) */ class Trunking extends Domain { protected $_v1 = null; /** * Construct the Trunking Domain * * @param \Twilio\Rest\Client $client Twilio\Rest\Client to communicate with * Twilio * @return \Twilio\Rest\Trunking Domain for Trunking */ public function __construct(Client $client) { parent::__construct($client); $this->baseUrl = 'https://trunking.twilio.com'; } /** * @return \Twilio\Rest\Trunking\V1 Version v1 of trunking */ protected function getV1() { if (!$this->_v1) { $this->_v1 = new V1($this); } return $this->_v1; } /** * Magic getter to lazy load version * * @param string $name Version to return * @return \Twilio\Version The requested version * @throws TwilioException For unknown versions */ public function __get($name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown version ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $method = 'context' . \ucfirst($name); if (\method_exists($this, $method)) { return \call_user_func_array(array($this, $method), $arguments); } throw new TwilioException('Unknown context ' . $name); } /** * @return \Twilio\Rest\Trunking\V1\TrunkList */ protected function getTrunks() { return $this->v1->trunks; } /** * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Trunking\V1\TrunkContext */ protected function contextTrunks($sid) { return $this->v1->trunks($sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Trunking]'; } } sdk/src/Twilio/Rest/Wireless.php 0000644 00000007563 15002236443 0012620 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\Rest\Wireless\V1; /** * @property \Twilio\Rest\Wireless\V1 $v1 * @property \Twilio\Rest\Wireless\V1\UsageRecordList $usageRecords * @property \Twilio\Rest\Wireless\V1\CommandList $commands * @property \Twilio\Rest\Wireless\V1\RatePlanList $ratePlans * @property \Twilio\Rest\Wireless\V1\SimList $sims * @method \Twilio\Rest\Wireless\V1\CommandContext commands(string $sid) * @method \Twilio\Rest\Wireless\V1\RatePlanContext ratePlans(string $sid) * @method \Twilio\Rest\Wireless\V1\SimContext sims(string $sid) */ class Wireless extends Domain { protected $_v1 = null; /** * Construct the Wireless Domain * * @param \Twilio\Rest\Client $client Twilio\Rest\Client to communicate with * Twilio * @return \Twilio\Rest\Wireless Domain for Wireless */ public function __construct(Client $client) { parent::__construct($client); $this->baseUrl = 'https://wireless.twilio.com'; } /** * @return \Twilio\Rest\Wireless\V1 Version v1 of wireless */ protected function getV1() { if (!$this->_v1) { $this->_v1 = new V1($this); } return $this->_v1; } /** * Magic getter to lazy load version * * @param string $name Version to return * @return \Twilio\Version The requested version * @throws TwilioException For unknown versions */ public function __get($name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown version ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $method = 'context' . \ucfirst($name); if (\method_exists($this, $method)) { return \call_user_func_array(array($this, $method), $arguments); } throw new TwilioException('Unknown context ' . $name); } /** * @return \Twilio\Rest\Wireless\V1\UsageRecordList */ protected function getUsageRecords() { return $this->v1->usageRecords; } /** * @return \Twilio\Rest\Wireless\V1\CommandList */ protected function getCommands() { return $this->v1->commands; } /** * @param string $sid The SID that identifies the resource to fetch * @return \Twilio\Rest\Wireless\V1\CommandContext */ protected function contextCommands($sid) { return $this->v1->commands($sid); } /** * @return \Twilio\Rest\Wireless\V1\RatePlanList */ protected function getRatePlans() { return $this->v1->ratePlans; } /** * @param string $sid The SID that identifies the resource to fetch * @return \Twilio\Rest\Wireless\V1\RatePlanContext */ protected function contextRatePlans($sid) { return $this->v1->ratePlans($sid); } /** * @return \Twilio\Rest\Wireless\V1\SimList */ protected function getSims() { return $this->v1->sims; } /** * @param string $sid The SID of the Sim resource to fetch * @return \Twilio\Rest\Wireless\V1\SimContext */ protected function contextSims($sid) { return $this->v1->sims($sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Wireless]'; } } sdk/src/Twilio/Rest/Verify.php 0000644 00000005205 15002236443 0012256 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\Rest\Verify\V2; /** * @property \Twilio\Rest\Verify\V2 $v2 * @property \Twilio\Rest\Verify\V2\ServiceList $services * @method \Twilio\Rest\Verify\V2\ServiceContext services(string $sid) */ class Verify extends Domain { protected $_v2 = null; /** * Construct the Verify Domain * * @param \Twilio\Rest\Client $client Twilio\Rest\Client to communicate with * Twilio * @return \Twilio\Rest\Verify Domain for Verify */ public function __construct(Client $client) { parent::__construct($client); $this->baseUrl = 'https://verify.twilio.com'; } /** * @return \Twilio\Rest\Verify\V2 Version v2 of verify */ protected function getV2() { if (!$this->_v2) { $this->_v2 = new V2($this); } return $this->_v2; } /** * Magic getter to lazy load version * * @param string $name Version to return * @return \Twilio\Version The requested version * @throws TwilioException For unknown versions */ public function __get($name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown version ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $method = 'context' . \ucfirst($name); if (\method_exists($this, $method)) { return \call_user_func_array(array($this, $method), $arguments); } throw new TwilioException('Unknown context ' . $name); } /** * @return \Twilio\Rest\Verify\V2\ServiceList */ protected function getServices() { return $this->v2->services; } /** * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Verify\V2\ServiceContext */ protected function contextServices($sid) { return $this->v2->services($sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Verify]'; } } sdk/src/Twilio/Rest/Fax/V1.php 0000644 00000004261 15002236443 0012017 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Fax; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\Rest\Fax\V1\FaxList; use Twilio\Version; /** * @property \Twilio\Rest\Fax\V1\FaxList $faxes * @method \Twilio\Rest\Fax\V1\FaxContext faxes(string $sid) */ class V1 extends Version { protected $_faxes = null; /** * Construct the V1 version of Fax * * @param \Twilio\Domain $domain Domain that contains the version * @return \Twilio\Rest\Fax\V1 V1 version of Fax */ public function __construct(Domain $domain) { parent::__construct($domain); $this->version = 'v1'; } /** * @return \Twilio\Rest\Fax\V1\FaxList */ protected function getFaxes() { if (!$this->_faxes) { $this->_faxes = new FaxList($this); } return $this->_faxes; } /** * Magic getter to lazy load root resources * * @param string $name Resource to return * @return \Twilio\ListResource The requested resource * @throws TwilioException For unknown resource */ public function __get($name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown resource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Fax.V1]'; } } sdk/src/Twilio/Rest/Fax/V1/FaxContext.php 0000644 00000010134 15002236443 0014076 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Fax\V1; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Rest\Fax\V1\Fax\FaxMediaList; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * * @property \Twilio\Rest\Fax\V1\Fax\FaxMediaList $media * @method \Twilio\Rest\Fax\V1\Fax\FaxMediaContext media(string $sid) */ class FaxContext extends InstanceContext { protected $_media = null; /** * Initialize the FaxContext * * @param \Twilio\Version $version Version that contains the resource * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Fax\V1\FaxContext */ public function __construct(Version $version, $sid) { parent::__construct($version); // Path Solution $this->solution = array('sid' => $sid, ); $this->uri = '/Faxes/' . \rawurlencode($sid) . ''; } /** * Fetch a FaxInstance * * @return FaxInstance Fetched FaxInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new FaxInstance($this->version, $payload, $this->solution['sid']); } /** * Update the FaxInstance * * @param array|Options $options Optional Arguments * @return FaxInstance Updated FaxInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { $options = new Values($options); $data = Values::of(array('Status' => $options['status'], )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new FaxInstance($this->version, $payload, $this->solution['sid']); } /** * Deletes the FaxInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Access the media * * @return \Twilio\Rest\Fax\V1\Fax\FaxMediaList */ protected function getMedia() { if (!$this->_media) { $this->_media = new FaxMediaList($this->version, $this->solution['sid']); } return $this->_media; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get($name) { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Fax.V1.FaxContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Fax/V1/FaxInstance.php 0000644 00000012145 15002236443 0014222 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Fax\V1; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * * @property string $sid * @property string $accountSid * @property string $from * @property string $to * @property string $quality * @property string $mediaSid * @property string $mediaUrl * @property int $numPages * @property int $duration * @property string $status * @property string $direction * @property string $apiVersion * @property string $price * @property string $priceUnit * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property array $links * @property string $url */ class FaxInstance extends InstanceResource { protected $_media = null; /** * Initialize the FaxInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Fax\V1\FaxInstance */ public function __construct(Version $version, array $payload, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'from' => Values::array_get($payload, 'from'), 'to' => Values::array_get($payload, 'to'), 'quality' => Values::array_get($payload, 'quality'), 'mediaSid' => Values::array_get($payload, 'media_sid'), 'mediaUrl' => Values::array_get($payload, 'media_url'), 'numPages' => Values::array_get($payload, 'num_pages'), 'duration' => Values::array_get($payload, 'duration'), 'status' => Values::array_get($payload, 'status'), 'direction' => Values::array_get($payload, 'direction'), 'apiVersion' => Values::array_get($payload, 'api_version'), 'price' => Values::array_get($payload, 'price'), 'priceUnit' => Values::array_get($payload, 'price_unit'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'links' => Values::array_get($payload, 'links'), 'url' => Values::array_get($payload, 'url'), ); $this->solution = array('sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Fax\V1\FaxContext Context for this FaxInstance */ protected function proxy() { if (!$this->context) { $this->context = new FaxContext($this->version, $this->solution['sid']); } return $this->context; } /** * Fetch a FaxInstance * * @return FaxInstance Fetched FaxInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Update the FaxInstance * * @param array|Options $options Optional Arguments * @return FaxInstance Updated FaxInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Deletes the FaxInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Access the media * * @return \Twilio\Rest\Fax\V1\Fax\FaxMediaList */ protected function getMedia() { return $this->proxy()->media; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Fax.V1.FaxInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Fax/V1/FaxPage.php 0000644 00000001455 15002236443 0013334 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Fax\V1; use Twilio\Page; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class FaxPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new FaxInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Fax.V1.FaxPage]'; } } sdk/src/Twilio/Rest/Fax/V1/FaxList.php 0000644 00000014615 15002236443 0013375 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Fax\V1; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class FaxList extends ListResource { /** * Construct the FaxList * * @param Version $version Version that contains the resource * @return \Twilio\Rest\Fax\V1\FaxList */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = array(); $this->uri = '/Faxes'; } /** * Streams FaxInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($options = array(), $limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($options, $limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads FaxInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param array|Options $options Optional Arguments * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return FaxInstance[] Array of results */ public function read($options = array(), $limit = null, $pageSize = null) { return \iterator_to_array($this->stream($options, $limit, $pageSize), false); } /** * Retrieve a single page of FaxInstance records from the API. * Request is executed immediately * * @param array|Options $options Optional Arguments * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of FaxInstance */ public function page($options = array(), $pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $options = new Values($options); $params = Values::of(array( 'From' => $options['from'], 'To' => $options['to'], 'DateCreatedOnOrBefore' => Serialize::iso8601DateTime($options['dateCreatedOnOrBefore']), 'DateCreatedAfter' => Serialize::iso8601DateTime($options['dateCreatedAfter']), 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new FaxPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of FaxInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of FaxInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new FaxPage($this->version, $response, $this->solution); } /** * Create a new FaxInstance * * @param string $to The phone number to receive the fax * @param string $mediaUrl The URL of the PDF that contains the fax * @param array|Options $options Optional Arguments * @return FaxInstance Newly created FaxInstance * @throws TwilioException When an HTTP error occurs. */ public function create($to, $mediaUrl, $options = array()) { $options = new Values($options); $data = Values::of(array( 'To' => $to, 'MediaUrl' => $mediaUrl, 'Quality' => $options['quality'], 'StatusCallback' => $options['statusCallback'], 'From' => $options['from'], 'SipAuthUsername' => $options['sipAuthUsername'], 'SipAuthPassword' => $options['sipAuthPassword'], 'StoreMedia' => Serialize::booleanToString($options['storeMedia']), 'Ttl' => $options['ttl'], )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new FaxInstance($this->version, $payload); } /** * Constructs a FaxContext * * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Fax\V1\FaxContext */ public function getContext($sid) { return new FaxContext($this->version, $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Fax.V1.FaxList]'; } } sdk/src/Twilio/Rest/Fax/V1/FaxOptions.php 0000644 00000026004 15002236443 0014110 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Fax\V1; 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 FaxOptions { /** * @param string $from Retrieve only those faxes sent from this phone number * @param string $to Retrieve only those faxes sent to this phone number * @param \DateTime $dateCreatedOnOrBefore Retrieve only faxes created on or * before this date * @param \DateTime $dateCreatedAfter Retrieve only faxes created after this * date * @return ReadFaxOptions Options builder */ public static function read($from = Values::NONE, $to = Values::NONE, $dateCreatedOnOrBefore = Values::NONE, $dateCreatedAfter = Values::NONE) { return new ReadFaxOptions($from, $to, $dateCreatedOnOrBefore, $dateCreatedAfter); } /** * @param string $quality The quality of this fax * @param string $statusCallback The URL we should call to send status * information to your application * @param string $from The number the fax was sent from * @param string $sipAuthUsername The username for SIP authentication * @param string $sipAuthPassword The password for SIP authentication * @param bool $storeMedia Whether to store a copy of the sent media * @param int $ttl How long in minutes to try to send the fax * @return CreateFaxOptions Options builder */ public static function create($quality = Values::NONE, $statusCallback = Values::NONE, $from = Values::NONE, $sipAuthUsername = Values::NONE, $sipAuthPassword = Values::NONE, $storeMedia = Values::NONE, $ttl = Values::NONE) { return new CreateFaxOptions($quality, $statusCallback, $from, $sipAuthUsername, $sipAuthPassword, $storeMedia, $ttl); } /** * @param string $status The new status of the resource * @return UpdateFaxOptions Options builder */ public static function update($status = Values::NONE) { return new UpdateFaxOptions($status); } } class ReadFaxOptions extends Options { /** * @param string $from Retrieve only those faxes sent from this phone number * @param string $to Retrieve only those faxes sent to this phone number * @param \DateTime $dateCreatedOnOrBefore Retrieve only faxes created on or * before this date * @param \DateTime $dateCreatedAfter Retrieve only faxes created after this * date */ public function __construct($from = Values::NONE, $to = Values::NONE, $dateCreatedOnOrBefore = Values::NONE, $dateCreatedAfter = Values::NONE) { $this->options['from'] = $from; $this->options['to'] = $to; $this->options['dateCreatedOnOrBefore'] = $dateCreatedOnOrBefore; $this->options['dateCreatedAfter'] = $dateCreatedAfter; } /** * Retrieve only those faxes sent from this phone number, specified in [E.164](https://www.twilio.com/docs/glossary/what-e164) format. * * @param string $from Retrieve only those faxes sent from this phone number * @return $this Fluent Builder */ public function setFrom($from) { $this->options['from'] = $from; return $this; } /** * Retrieve only those faxes sent to this phone number, specified in [E.164](https://www.twilio.com/docs/glossary/what-e164) format. * * @param string $to Retrieve only those faxes sent to this phone number * @return $this Fluent Builder */ public function setTo($to) { $this->options['to'] = $to; return $this; } /** * Retrieve only those faxes with a `date_created` that is before or equal to this value, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. * * @param \DateTime $dateCreatedOnOrBefore Retrieve only faxes created on or * before this date * @return $this Fluent Builder */ public function setDateCreatedOnOrBefore($dateCreatedOnOrBefore) { $this->options['dateCreatedOnOrBefore'] = $dateCreatedOnOrBefore; return $this; } /** * Retrieve only those faxes with a `date_created` that is later than this value, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. * * @param \DateTime $dateCreatedAfter Retrieve only faxes created after this * date * @return $this Fluent Builder */ public function setDateCreatedAfter($dateCreatedAfter) { $this->options['dateCreatedAfter'] = $dateCreatedAfter; 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.Fax.V1.ReadFaxOptions ' . \implode(' ', $options) . ']'; } } class CreateFaxOptions extends Options { /** * @param string $quality The quality of this fax * @param string $statusCallback The URL we should call to send status * information to your application * @param string $from The number the fax was sent from * @param string $sipAuthUsername The username for SIP authentication * @param string $sipAuthPassword The password for SIP authentication * @param bool $storeMedia Whether to store a copy of the sent media * @param int $ttl How long in minutes to try to send the fax */ public function __construct($quality = Values::NONE, $statusCallback = Values::NONE, $from = Values::NONE, $sipAuthUsername = Values::NONE, $sipAuthPassword = Values::NONE, $storeMedia = Values::NONE, $ttl = Values::NONE) { $this->options['quality'] = $quality; $this->options['statusCallback'] = $statusCallback; $this->options['from'] = $from; $this->options['sipAuthUsername'] = $sipAuthUsername; $this->options['sipAuthPassword'] = $sipAuthPassword; $this->options['storeMedia'] = $storeMedia; $this->options['ttl'] = $ttl; } /** * The [Fax Quality value](https://www.twilio.com/docs/fax/api/fax-resource#fax-quality-values) that describes the fax quality. Can be: `standard`, `fine`, or `superfine` and defaults to `fine`. * * @param string $quality The quality of this fax * @return $this Fluent Builder */ public function setQuality($quality) { $this->options['quality'] = $quality; return $this; } /** * The URL we should call using the `POST` method to send [status information](https://www.twilio.com/docs/fax/api/fax-resource#fax-status-callback) to your application when the status of the fax changes. * * @param string $statusCallback The URL we should call to send status * information to your application * @return $this Fluent Builder */ public function setStatusCallback($statusCallback) { $this->options['statusCallback'] = $statusCallback; return $this; } /** * The number the fax was sent from. Can be the phone number in [E.164](https://www.twilio.com/docs/glossary/what-e164) format or the SIP `from` value. The caller ID displayed to the recipient uses this value. If this is a phone number, it must be a Twilio number or a verified outgoing caller id from your account. If `to` is a SIP address, this can be any alphanumeric string (and also the characters `+`, `_`, `.`, and `-`), which will be used in the `from` header of the SIP request. * * @param string $from The number the fax was sent from * @return $this Fluent Builder */ public function setFrom($from) { $this->options['from'] = $from; return $this; } /** * The username to use with the `sip_auth_password` to authenticate faxes sent to a SIP address. * * @param string $sipAuthUsername The username for SIP authentication * @return $this Fluent Builder */ public function setSipAuthUsername($sipAuthUsername) { $this->options['sipAuthUsername'] = $sipAuthUsername; return $this; } /** * The password to use with `sip_auth_username` to authenticate faxes sent to a SIP address. * * @param string $sipAuthPassword The password for SIP authentication * @return $this Fluent Builder */ public function setSipAuthPassword($sipAuthPassword) { $this->options['sipAuthPassword'] = $sipAuthPassword; return $this; } /** * Whether to store a copy of the sent media on our servers for later retrieval. Can be: `true` or `false` and the default is `true`. * * @param bool $storeMedia Whether to store a copy of the sent media * @return $this Fluent Builder */ public function setStoreMedia($storeMedia) { $this->options['storeMedia'] = $storeMedia; return $this; } /** * How long in minutes from when the fax is initiated that we should try to send the fax. * * @param int $ttl How long in minutes to try to send the fax * @return $this Fluent Builder */ public function setTtl($ttl) { $this->options['ttl'] = $ttl; 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.Fax.V1.CreateFaxOptions ' . \implode(' ', $options) . ']'; } } class UpdateFaxOptions extends Options { /** * @param string $status The new status of the resource */ public function __construct($status = Values::NONE) { $this->options['status'] = $status; } /** * The new [status](https://www.twilio.com/docs/fax/api/fax-resource#fax-status-values) of the resource. Can be only `canceled`. This may fail if transmission has already started. * * @param string $status The new status of the resource * @return $this Fluent Builder */ public function setStatus($status) { $this->options['status'] = $status; 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.Fax.V1.UpdateFaxOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Fax/V1/Fax/FaxMediaInstance.php 0000644 00000007670 15002236443 0015707 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Fax\V1\Fax; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * * @property string $sid * @property string $accountSid * @property string $faxSid * @property string $contentType * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $url */ class FaxMediaInstance extends InstanceResource { /** * Initialize the FaxMediaInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $faxSid The SID of the fax the FaxMedia resource is associated * with * @param string $sid The unique string that identifies the resource to fetch * @return \Twilio\Rest\Fax\V1\Fax\FaxMediaInstance */ public function __construct(Version $version, array $payload, $faxSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'faxSid' => Values::array_get($payload, 'fax_sid'), 'contentType' => Values::array_get($payload, 'content_type'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), ); $this->solution = array('faxSid' => $faxSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Fax\V1\Fax\FaxMediaContext Context for this * FaxMediaInstance */ protected function proxy() { if (!$this->context) { $this->context = new FaxMediaContext( $this->version, $this->solution['faxSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch a FaxMediaInstance * * @return FaxMediaInstance Fetched FaxMediaInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the FaxMediaInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Fax.V1.FaxMediaInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Fax/V1/Fax/FaxMediaList.php 0000644 00000011674 15002236443 0015055 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Fax\V1\Fax; use Twilio\ListResource; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class FaxMediaList extends ListResource { /** * Construct the FaxMediaList * * @param Version $version Version that contains the resource * @param string $faxSid The SID of the fax the FaxMedia resource is associated * with * @return \Twilio\Rest\Fax\V1\Fax\FaxMediaList */ public function __construct(Version $version, $faxSid) { parent::__construct($version); // Path Solution $this->solution = array('faxSid' => $faxSid, ); $this->uri = '/Faxes/' . \rawurlencode($faxSid) . '/Media'; } /** * Streams FaxMediaInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads FaxMediaInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return FaxMediaInstance[] Array of results */ public function read($limit = null, $pageSize = null) { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of FaxMediaInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of FaxMediaInstance */ public function page($pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $params = Values::of(array( 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new FaxMediaPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of FaxMediaInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of FaxMediaInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new FaxMediaPage($this->version, $response, $this->solution); } /** * Constructs a FaxMediaContext * * @param string $sid The unique string that identifies the resource to fetch * @return \Twilio\Rest\Fax\V1\Fax\FaxMediaContext */ public function getContext($sid) { return new FaxMediaContext($this->version, $this->solution['faxSid'], $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Fax.V1.FaxMediaList]'; } } sdk/src/Twilio/Rest/Fax/V1/Fax/FaxMediaContext.php 0000644 00000004341 15002236443 0015557 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Fax\V1\Fax; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class FaxMediaContext extends InstanceContext { /** * Initialize the FaxMediaContext * * @param \Twilio\Version $version Version that contains the resource * @param string $faxSid The SID of the fax with the FaxMedia resource to fetch * @param string $sid The unique string that identifies the resource to fetch * @return \Twilio\Rest\Fax\V1\Fax\FaxMediaContext */ public function __construct(Version $version, $faxSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array('faxSid' => $faxSid, 'sid' => $sid, ); $this->uri = '/Faxes/' . \rawurlencode($faxSid) . '/Media/' . \rawurlencode($sid) . ''; } /** * Fetch a FaxMediaInstance * * @return FaxMediaInstance Fetched FaxMediaInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new FaxMediaInstance( $this->version, $payload, $this->solution['faxSid'], $this->solution['sid'] ); } /** * Deletes the FaxMediaInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Fax.V1.FaxMediaContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Fax/V1/Fax/FaxMediaPage.php 0000644 00000001533 15002236443 0015007 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Fax\V1\Fax; use Twilio\Page; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class FaxMediaPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new FaxMediaInstance($this->version, $payload, $this->solution['faxSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Fax.V1.FaxMediaPage]'; } } sdk/src/Twilio/Rest/FlexApi.php 0000644 00000010301 15002236443 0012333 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\Rest\FlexApi\V1; /** * @property \Twilio\Rest\FlexApi\V1 $v1 * @property \Twilio\Rest\FlexApi\V1\ChannelList $channel * @property \Twilio\Rest\FlexApi\V1\ConfigurationList $configuration * @property \Twilio\Rest\FlexApi\V1\FlexFlowList $flexFlow * @property \Twilio\Rest\FlexApi\V1\WebChannelList $webChannel * @method \Twilio\Rest\FlexApi\V1\ChannelContext channel(string $sid) * @method \Twilio\Rest\FlexApi\V1\ConfigurationContext configuration() * @method \Twilio\Rest\FlexApi\V1\FlexFlowContext flexFlow(string $sid) * @method \Twilio\Rest\FlexApi\V1\WebChannelContext webChannel(string $sid) */ class FlexApi extends Domain { protected $_v1 = null; /** * Construct the FlexApi Domain * * @param \Twilio\Rest\Client $client Twilio\Rest\Client to communicate with * Twilio * @return \Twilio\Rest\FlexApi Domain for FlexApi */ public function __construct(Client $client) { parent::__construct($client); $this->baseUrl = 'https://flex-api.twilio.com'; } /** * @return \Twilio\Rest\FlexApi\V1 Version v1 of flex_api */ protected function getV1() { if (!$this->_v1) { $this->_v1 = new V1($this); } return $this->_v1; } /** * Magic getter to lazy load version * * @param string $name Version to return * @return \Twilio\Version The requested version * @throws TwilioException For unknown versions */ public function __get($name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown version ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $method = 'context' . \ucfirst($name); if (\method_exists($this, $method)) { return \call_user_func_array(array($this, $method), $arguments); } throw new TwilioException('Unknown context ' . $name); } /** * @return \Twilio\Rest\FlexApi\V1\ChannelList */ protected function getChannel() { return $this->v1->channel; } /** * @param string $sid The SID that identifies the Flex chat channel resource to * fetch * @return \Twilio\Rest\FlexApi\V1\ChannelContext */ protected function contextChannel($sid) { return $this->v1->channel($sid); } /** * @return \Twilio\Rest\FlexApi\V1\ConfigurationList */ protected function getConfiguration() { return $this->v1->configuration; } /** * @return \Twilio\Rest\FlexApi\V1\ConfigurationContext */ protected function contextConfiguration() { return $this->v1->configuration(); } /** * @return \Twilio\Rest\FlexApi\V1\FlexFlowList */ protected function getFlexFlow() { return $this->v1->flexFlow; } /** * @param string $sid The SID that identifies the resource to fetch * @return \Twilio\Rest\FlexApi\V1\FlexFlowContext */ protected function contextFlexFlow($sid) { return $this->v1->flexFlow($sid); } /** * @return \Twilio\Rest\FlexApi\V1\WebChannelList */ protected function getWebChannel() { return $this->v1->webChannel; } /** * @param string $sid The SID of the WebChannel resource to fetch * @return \Twilio\Rest\FlexApi\V1\WebChannelContext */ protected function contextWebChannel($sid) { return $this->v1->webChannel($sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.FlexApi]'; } } sdk/src/Twilio/Rest/Verify/V2.php 0000644 00000004365 15002236443 0012553 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Verify; use Twilio\Domain; use Twilio\Exceptions\TwilioException; use Twilio\Rest\Verify\V2\ServiceList; use Twilio\Version; /** * @property \Twilio\Rest\Verify\V2\ServiceList $services * @method \Twilio\Rest\Verify\V2\ServiceContext services(string $sid) */ class V2 extends Version { protected $_services = null; /** * Construct the V2 version of Verify * * @param \Twilio\Domain $domain Domain that contains the version * @return \Twilio\Rest\Verify\V2 V2 version of Verify */ public function __construct(Domain $domain) { parent::__construct($domain); $this->version = 'v2'; } /** * @return \Twilio\Rest\Verify\V2\ServiceList */ protected function getServices() { if (!$this->_services) { $this->_services = new ServiceList($this); } return $this->_services; } /** * Magic getter to lazy load root resources * * @param string $name Resource to return * @return \Twilio\ListResource The requested resource * @throws TwilioException For unknown resource */ public function __get($name) { $method = 'get' . \ucfirst($name); if (\method_exists($this, $method)) { return $this->$method(); } throw new TwilioException('Unknown resource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Verify.V2]'; } } sdk/src/Twilio/Rest/Verify/V2/ServiceOptions.php 0000644 00000027617 15002236443 0015534 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Verify\V2; use Twilio\Options; use Twilio\Values; abstract class ServiceOptions { /** * @param int $codeLength The length of the verification code to generate * @param bool $lookupEnabled Whether to perform a lookup with each verification * @param bool $skipSmsToLandlines Whether to skip sending SMS verifications to * landlines * @param bool $dtmfInputRequired Whether to ask the user to press a number * before delivering the verify code in a phone * call * @param string $ttsName The name of an alternative text-to-speech service to * use in phone calls * @param bool $psd2Enabled Whether to pass PSD2 transaction parameters when * starting a verification * @return CreateServiceOptions Options builder */ public static function create($codeLength = Values::NONE, $lookupEnabled = Values::NONE, $skipSmsToLandlines = Values::NONE, $dtmfInputRequired = Values::NONE, $ttsName = Values::NONE, $psd2Enabled = Values::NONE) { return new CreateServiceOptions($codeLength, $lookupEnabled, $skipSmsToLandlines, $dtmfInputRequired, $ttsName, $psd2Enabled); } /** * @param string $friendlyName A string to describe the verification service * @param int $codeLength The length of the verification code to generate * @param bool $lookupEnabled Whether to perform a lookup with each verification * @param bool $skipSmsToLandlines Whether to skip sending SMS verifications to * landlines * @param bool $dtmfInputRequired Whether to ask the user to press a number * before delivering the verify code in a phone * call * @param string $ttsName The name of an alternative text-to-speech service to * use in phone calls * @param bool $psd2Enabled Whether to pass PSD2 transaction parameters when * starting a verification * @return UpdateServiceOptions Options builder */ public static function update($friendlyName = Values::NONE, $codeLength = Values::NONE, $lookupEnabled = Values::NONE, $skipSmsToLandlines = Values::NONE, $dtmfInputRequired = Values::NONE, $ttsName = Values::NONE, $psd2Enabled = Values::NONE) { return new UpdateServiceOptions($friendlyName, $codeLength, $lookupEnabled, $skipSmsToLandlines, $dtmfInputRequired, $ttsName, $psd2Enabled); } } class CreateServiceOptions extends Options { /** * @param int $codeLength The length of the verification code to generate * @param bool $lookupEnabled Whether to perform a lookup with each verification * @param bool $skipSmsToLandlines Whether to skip sending SMS verifications to * landlines * @param bool $dtmfInputRequired Whether to ask the user to press a number * before delivering the verify code in a phone * call * @param string $ttsName The name of an alternative text-to-speech service to * use in phone calls * @param bool $psd2Enabled Whether to pass PSD2 transaction parameters when * starting a verification */ public function __construct($codeLength = Values::NONE, $lookupEnabled = Values::NONE, $skipSmsToLandlines = Values::NONE, $dtmfInputRequired = Values::NONE, $ttsName = Values::NONE, $psd2Enabled = Values::NONE) { $this->options['codeLength'] = $codeLength; $this->options['lookupEnabled'] = $lookupEnabled; $this->options['skipSmsToLandlines'] = $skipSmsToLandlines; $this->options['dtmfInputRequired'] = $dtmfInputRequired; $this->options['ttsName'] = $ttsName; $this->options['psd2Enabled'] = $psd2Enabled; } /** * The length of the verification code to generate. Must be an integer value between 4 and 10, inclusive. * * @param int $codeLength The length of the verification code to generate * @return $this Fluent Builder */ public function setCodeLength($codeLength) { $this->options['codeLength'] = $codeLength; return $this; } /** * Whether to perform a lookup with each verification started and return info about the phone number. * * @param bool $lookupEnabled Whether to perform a lookup with each verification * @return $this Fluent Builder */ public function setLookupEnabled($lookupEnabled) { $this->options['lookupEnabled'] = $lookupEnabled; return $this; } /** * Whether to skip sending SMS verifications to landlines. Requires `lookup_enabled`. * * @param bool $skipSmsToLandlines Whether to skip sending SMS verifications to * landlines * @return $this Fluent Builder */ public function setSkipSmsToLandlines($skipSmsToLandlines) { $this->options['skipSmsToLandlines'] = $skipSmsToLandlines; return $this; } /** * Whether to ask the user to press a number before delivering the verify code in a phone call. * * @param bool $dtmfInputRequired Whether to ask the user to press a number * before delivering the verify code in a phone * call * @return $this Fluent Builder */ public function setDtmfInputRequired($dtmfInputRequired) { $this->options['dtmfInputRequired'] = $dtmfInputRequired; return $this; } /** * The name of an alternative text-to-speech service to use in phone calls. Applies only to TTS languages. * * @param string $ttsName The name of an alternative text-to-speech service to * use in phone calls * @return $this Fluent Builder */ public function setTtsName($ttsName) { $this->options['ttsName'] = $ttsName; return $this; } /** * Whether to pass PSD2 transaction parameters when starting a verification. * * @param bool $psd2Enabled Whether to pass PSD2 transaction parameters when * starting a verification * @return $this Fluent Builder */ public function setPsd2Enabled($psd2Enabled) { $this->options['psd2Enabled'] = $psd2Enabled; 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.Verify.V2.CreateServiceOptions ' . \implode(' ', $options) . ']'; } } class UpdateServiceOptions extends Options { /** * @param string $friendlyName A string to describe the verification service * @param int $codeLength The length of the verification code to generate * @param bool $lookupEnabled Whether to perform a lookup with each verification * @param bool $skipSmsToLandlines Whether to skip sending SMS verifications to * landlines * @param bool $dtmfInputRequired Whether to ask the user to press a number * before delivering the verify code in a phone * call * @param string $ttsName The name of an alternative text-to-speech service to * use in phone calls * @param bool $psd2Enabled Whether to pass PSD2 transaction parameters when * starting a verification */ public function __construct($friendlyName = Values::NONE, $codeLength = Values::NONE, $lookupEnabled = Values::NONE, $skipSmsToLandlines = Values::NONE, $dtmfInputRequired = Values::NONE, $ttsName = Values::NONE, $psd2Enabled = Values::NONE) { $this->options['friendlyName'] = $friendlyName; $this->options['codeLength'] = $codeLength; $this->options['lookupEnabled'] = $lookupEnabled; $this->options['skipSmsToLandlines'] = $skipSmsToLandlines; $this->options['dtmfInputRequired'] = $dtmfInputRequired; $this->options['ttsName'] = $ttsName; $this->options['psd2Enabled'] = $psd2Enabled; } /** * A descriptive string that you create to describe the verification service. It can be up to 64 characters long. **This value should not contain PII.** * * @param string $friendlyName A string to describe the verification service * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The length of the verification code to generate. Must be an integer value between 4 and 10, inclusive. * * @param int $codeLength The length of the verification code to generate * @return $this Fluent Builder */ public function setCodeLength($codeLength) { $this->options['codeLength'] = $codeLength; return $this; } /** * Whether to perform a lookup with each verification started and return info about the phone number. * * @param bool $lookupEnabled Whether to perform a lookup with each verification * @return $this Fluent Builder */ public function setLookupEnabled($lookupEnabled) { $this->options['lookupEnabled'] = $lookupEnabled; return $this; } /** * Whether to skip sending SMS verifications to landlines. Requires `lookup_enabled`. * * @param bool $skipSmsToLandlines Whether to skip sending SMS verifications to * landlines * @return $this Fluent Builder */ public function setSkipSmsToLandlines($skipSmsToLandlines) { $this->options['skipSmsToLandlines'] = $skipSmsToLandlines; return $this; } /** * Whether to ask the user to press a number before delivering the verify code in a phone call. * * @param bool $dtmfInputRequired Whether to ask the user to press a number * before delivering the verify code in a phone * call * @return $this Fluent Builder */ public function setDtmfInputRequired($dtmfInputRequired) { $this->options['dtmfInputRequired'] = $dtmfInputRequired; return $this; } /** * The name of an alternative text-to-speech service to use in phone calls. Applies only to TTS languages. * * @param string $ttsName The name of an alternative text-to-speech service to * use in phone calls * @return $this Fluent Builder */ public function setTtsName($ttsName) { $this->options['ttsName'] = $ttsName; return $this; } /** * Whether to pass PSD2 transaction parameters when starting a verification. * * @param bool $psd2Enabled Whether to pass PSD2 transaction parameters when * starting a verification * @return $this Fluent Builder */ public function setPsd2Enabled($psd2Enabled) { $this->options['psd2Enabled'] = $psd2Enabled; 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.Verify.V2.UpdateServiceOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Verify/V2/ServiceList.php 0000644 00000013512 15002236443 0015001 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Verify\V2; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class ServiceList extends ListResource { /** * Construct the ServiceList * * @param Version $version Version that contains the resource * @return \Twilio\Rest\Verify\V2\ServiceList */ public function __construct(Version $version) { parent::__construct($version); // Path Solution $this->solution = array(); $this->uri = '/Services'; } /** * Create a new ServiceInstance * * @param string $friendlyName A string to describe the verification service * @param array|Options $options Optional Arguments * @return ServiceInstance Newly created ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function create($friendlyName, $options = array()) { $options = new Values($options); $data = Values::of(array( 'FriendlyName' => $friendlyName, 'CodeLength' => $options['codeLength'], 'LookupEnabled' => Serialize::booleanToString($options['lookupEnabled']), 'SkipSmsToLandlines' => Serialize::booleanToString($options['skipSmsToLandlines']), 'DtmfInputRequired' => Serialize::booleanToString($options['dtmfInputRequired']), 'TtsName' => $options['ttsName'], 'Psd2Enabled' => Serialize::booleanToString($options['psd2Enabled']), )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new ServiceInstance($this->version, $payload); } /** * Streams ServiceInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads ServiceInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return ServiceInstance[] Array of results */ public function read($limit = null, $pageSize = null) { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of ServiceInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of ServiceInstance */ public function page($pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $params = Values::of(array( 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new ServicePage($this->version, $response, $this->solution); } /** * Retrieve a specific page of ServiceInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of ServiceInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new ServicePage($this->version, $response, $this->solution); } /** * Constructs a ServiceContext * * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Verify\V2\ServiceContext */ public function getContext($sid) { return new ServiceContext($this->version, $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Verify.V2.ServiceList]'; } } sdk/src/Twilio/Rest/Verify/V2/ServicePage.php 0000644 00000001316 15002236443 0014741 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Verify\V2; use Twilio\Page; class ServicePage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new ServiceInstance($this->version, $payload); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Verify.V2.ServicePage]'; } } sdk/src/Twilio/Rest/Verify/V2/ServiceInstance.php 0000644 00000013157 15002236443 0015637 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Verify\V2; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $accountSid * @property string $friendlyName * @property int $codeLength * @property bool $lookupEnabled * @property bool $psd2Enabled * @property bool $skipSmsToLandlines * @property bool $dtmfInputRequired * @property string $ttsName * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $url * @property array $links */ class ServiceInstance extends InstanceResource { protected $_verifications = null; protected $_verificationChecks = null; protected $_rateLimits = null; protected $_messagingConfigurations = null; /** * Initialize the ServiceInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Verify\V2\ServiceInstance */ public function __construct(Version $version, array $payload, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'sid' => Values::array_get($payload, 'sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'friendlyName' => Values::array_get($payload, 'friendly_name'), 'codeLength' => Values::array_get($payload, 'code_length'), 'lookupEnabled' => Values::array_get($payload, 'lookup_enabled'), 'psd2Enabled' => Values::array_get($payload, 'psd2_enabled'), 'skipSmsToLandlines' => Values::array_get($payload, 'skip_sms_to_landlines'), 'dtmfInputRequired' => Values::array_get($payload, 'dtmf_input_required'), 'ttsName' => Values::array_get($payload, 'tts_name'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ); $this->solution = array('sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Verify\V2\ServiceContext Context for this * ServiceInstance */ protected function proxy() { if (!$this->context) { $this->context = new ServiceContext($this->version, $this->solution['sid']); } return $this->context; } /** * Fetch a ServiceInstance * * @return ServiceInstance Fetched ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the ServiceInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Update the ServiceInstance * * @param array|Options $options Optional Arguments * @return ServiceInstance Updated ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Access the verifications * * @return \Twilio\Rest\Verify\V2\Service\VerificationList */ protected function getVerifications() { return $this->proxy()->verifications; } /** * Access the verificationChecks * * @return \Twilio\Rest\Verify\V2\Service\VerificationCheckList */ protected function getVerificationChecks() { return $this->proxy()->verificationChecks; } /** * Access the rateLimits * * @return \Twilio\Rest\Verify\V2\Service\RateLimitList */ protected function getRateLimits() { return $this->proxy()->rateLimits; } /** * Access the messagingConfigurations * * @return \Twilio\Rest\Verify\V2\Service\MessagingConfigurationList */ protected function getMessagingConfigurations() { return $this->proxy()->messagingConfigurations; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Verify.V2.ServiceInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Verify/V2/Service/VerificationPage.php 0000644 00000001404 15002236443 0017361 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Verify\V2\Service; use Twilio\Page; class VerificationPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new VerificationInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Verify.V2.VerificationPage]'; } } sdk/src/Twilio/Rest/Verify/V2/Service/VerificationCheckInstance.php 0000644 00000005535 15002236443 0021220 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Verify\V2\Service; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $serviceSid * @property string $accountSid * @property string $to * @property string $channel * @property string $status * @property bool $valid * @property string $amount * @property string $payee * @property \DateTime $dateCreated * @property \DateTime $dateUpdated */ class VerificationCheckInstance extends InstanceResource { /** * Initialize the VerificationCheckInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the Service that the resource is * associated with * @return \Twilio\Rest\Verify\V2\Service\VerificationCheckInstance */ public function __construct(Version $version, array $payload, $serviceSid) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'sid' => Values::array_get($payload, 'sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'to' => Values::array_get($payload, 'to'), 'channel' => Values::array_get($payload, 'channel'), 'status' => Values::array_get($payload, 'status'), 'valid' => Values::array_get($payload, 'valid'), 'amount' => Values::array_get($payload, 'amount'), 'payee' => Values::array_get($payload, 'payee'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), ); $this->solution = array('serviceSid' => $serviceSid, ); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Verify.V2.VerificationCheckInstance]'; } } sdk/src/Twilio/Rest/Verify/V2/Service/VerificationContext.php 0000644 00000005147 15002236443 0020141 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Verify\V2\Service; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; class VerificationContext extends InstanceContext { /** * Initialize the VerificationContext * * @param \Twilio\Version $version Version that contains the resource * @param string $serviceSid The SID of the verification Service to fetch the * resource from * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Verify\V2\Service\VerificationContext */ public function __construct(Version $version, $serviceSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, 'sid' => $sid, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Verifications/' . \rawurlencode($sid) . ''; } /** * Update the VerificationInstance * * @param string $status The new status of the resource * @return VerificationInstance Updated VerificationInstance * @throws TwilioException When an HTTP error occurs. */ public function update($status) { $data = Values::of(array('Status' => $status, )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new VerificationInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Fetch a VerificationInstance * * @return VerificationInstance Fetched VerificationInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new VerificationInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Verify.V2.VerificationContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Verify/V2/Service/VerificationOptions.php 0000644 00000015646 15002236443 0020155 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Verify\V2\Service; use Twilio\Options; use Twilio\Values; abstract class VerificationOptions { /** * @param string $customMessage The text of a custom message to use for the * verification * @param string $sendDigits The digits to send after a phone call is answered * @param string $locale The locale to use for the verification SMS or call * @param string $customCode A pre-generated code * @param string $amount The amount of the associated PSD2 compliant * transaction. * @param string $payee The payee of the associated PSD2 compliant transaction * @param array $rateLimits The custom key-value pairs of Programmable Rate * Limits. * @param array $channelConfiguration Channel specific configuration in json * format. * @return CreateVerificationOptions Options builder */ public static function create($customMessage = Values::NONE, $sendDigits = Values::NONE, $locale = Values::NONE, $customCode = Values::NONE, $amount = Values::NONE, $payee = Values::NONE, $rateLimits = Values::NONE, $channelConfiguration = Values::NONE) { return new CreateVerificationOptions($customMessage, $sendDigits, $locale, $customCode, $amount, $payee, $rateLimits, $channelConfiguration); } } class CreateVerificationOptions extends Options { /** * @param string $customMessage The text of a custom message to use for the * verification * @param string $sendDigits The digits to send after a phone call is answered * @param string $locale The locale to use for the verification SMS or call * @param string $customCode A pre-generated code * @param string $amount The amount of the associated PSD2 compliant * transaction. * @param string $payee The payee of the associated PSD2 compliant transaction * @param array $rateLimits The custom key-value pairs of Programmable Rate * Limits. * @param array $channelConfiguration Channel specific configuration in json * format. */ public function __construct($customMessage = Values::NONE, $sendDigits = Values::NONE, $locale = Values::NONE, $customCode = Values::NONE, $amount = Values::NONE, $payee = Values::NONE, $rateLimits = Values::NONE, $channelConfiguration = Values::NONE) { $this->options['customMessage'] = $customMessage; $this->options['sendDigits'] = $sendDigits; $this->options['locale'] = $locale; $this->options['customCode'] = $customCode; $this->options['amount'] = $amount; $this->options['payee'] = $payee; $this->options['rateLimits'] = $rateLimits; $this->options['channelConfiguration'] = $channelConfiguration; } /** * The text of a custom message to use for the verification. * * @param string $customMessage The text of a custom message to use for the * verification * @return $this Fluent Builder */ public function setCustomMessage($customMessage) { $this->options['customMessage'] = $customMessage; return $this; } /** * The digits to send after a phone call is answered, for example, to dial an extension. For more information, see the Programmable Voice documentation of [sendDigits](https://www.twilio.com/docs/voice/twiml/number#attributes-sendDigits). * * @param string $sendDigits The digits to send after a phone call is answered * @return $this Fluent Builder */ public function setSendDigits($sendDigits) { $this->options['sendDigits'] = $sendDigits; return $this; } /** * The locale to use for the verification SMS or call. Can be: `af`, `ar`, `ca`, `cs`, `da`, `de`, `el`, `en`, `es`, `fi`, `fr`, `he`, `hi`, `hr`, `hu`, `id`, `it`, `ja`, `ko`, `ms`, `nb`, `nl`, `pl`, `pt`, `pr-BR`, `ro`, `ru`, `sv`, `th`, `tl`, `tr`, `vi`, `zh`, `zh-CN`, or `zh-HK.` * * @param string $locale The locale to use for the verification SMS or call * @return $this Fluent Builder */ public function setLocale($locale) { $this->options['locale'] = $locale; return $this; } /** * A pre-generated code to use for verification. The code can be between 4 and 10 characters, inclusive. * * @param string $customCode A pre-generated code * @return $this Fluent Builder */ public function setCustomCode($customCode) { $this->options['customCode'] = $customCode; return $this; } /** * The amount of the associated PSD2 compliant transaction. Requires the PSD2 Service flag enabled. * * @param string $amount The amount of the associated PSD2 compliant * transaction. * @return $this Fluent Builder */ public function setAmount($amount) { $this->options['amount'] = $amount; return $this; } /** * The payee of the associated PSD2 compliant transaction. Requires the PSD2 Service flag enabled. * * @param string $payee The payee of the associated PSD2 compliant transaction * @return $this Fluent Builder */ public function setPayee($payee) { $this->options['payee'] = $payee; return $this; } /** * The custom key-value pairs of Programmable Rate Limits. Keys should be the unique_name configured while creating you Rate Limit along with the associated values for each particular request. You may include multiple Rate Limit values in each request. * * @param array $rateLimits The custom key-value pairs of Programmable Rate * Limits. * @return $this Fluent Builder */ public function setRateLimits($rateLimits) { $this->options['rateLimits'] = $rateLimits; return $this; } /** * `email` channel configuration in json format. Must include 'from' and 'from_name'. * * @param array $channelConfiguration Channel specific configuration in json * format. * @return $this Fluent Builder */ public function setChannelConfiguration($channelConfiguration) { $this->options['channelConfiguration'] = $channelConfiguration; 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.Verify.V2.CreateVerificationOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Verify/V2/Service/MessagingConfigurationInstance.php 0000644 00000011412 15002236443 0022274 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Verify\V2\Service; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $accountSid * @property string $serviceSid * @property string $country * @property string $messagingServiceSid * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $url */ class MessagingConfigurationInstance extends InstanceResource { /** * Initialize the MessagingConfigurationInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the Service that the resource is * associated with * @param string $country The ISO-3166-1 country code of the country or `all`. * @return \Twilio\Rest\Verify\V2\Service\MessagingConfigurationInstance */ public function __construct(Version $version, array $payload, $serviceSid, $country = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'country' => Values::array_get($payload, 'country'), 'messagingServiceSid' => Values::array_get($payload, 'messaging_service_sid'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), ); $this->solution = array( 'serviceSid' => $serviceSid, 'country' => $country ?: $this->properties['country'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Verify\V2\Service\MessagingConfigurationContext Context * for * this * MessagingConfigurationInstance */ protected function proxy() { if (!$this->context) { $this->context = new MessagingConfigurationContext( $this->version, $this->solution['serviceSid'], $this->solution['country'] ); } return $this->context; } /** * Update the MessagingConfigurationInstance * * @param string $messagingServiceSid The SID of the Messaging Service used for * this configuration. * @return MessagingConfigurationInstance Updated MessagingConfigurationInstance * @throws TwilioException When an HTTP error occurs. */ public function update($messagingServiceSid) { return $this->proxy()->update($messagingServiceSid); } /** * Fetch a MessagingConfigurationInstance * * @return MessagingConfigurationInstance Fetched MessagingConfigurationInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the MessagingConfigurationInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Verify.V2.MessagingConfigurationInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Verify/V2/Service/MessagingConfigurationPage.php 0000644 00000001442 15002236443 0021406 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Verify\V2\Service; use Twilio\Page; class MessagingConfigurationPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new MessagingConfigurationInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Verify.V2.MessagingConfigurationPage]'; } } sdk/src/Twilio/Rest/Verify/V2/Service/RateLimitList.php 0000644 00000013366 15002236443 0016702 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Verify\V2\Service; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; class RateLimitList extends ListResource { /** * Construct the RateLimitList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Service that the resource is * associated with * @return \Twilio\Rest\Verify\V2\Service\RateLimitList */ public function __construct(Version $version, $serviceSid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/RateLimits'; } /** * Create a new RateLimitInstance * * @param string $uniqueName A unique, developer assigned name of this Rate * Limit. * @param array|Options $options Optional Arguments * @return RateLimitInstance Newly created RateLimitInstance * @throws TwilioException When an HTTP error occurs. */ public function create($uniqueName, $options = array()) { $options = new Values($options); $data = Values::of(array('UniqueName' => $uniqueName, 'Description' => $options['description'], )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new RateLimitInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Streams RateLimitInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads RateLimitInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return RateLimitInstance[] Array of results */ public function read($limit = null, $pageSize = null) { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of RateLimitInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of RateLimitInstance */ public function page($pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $params = Values::of(array( 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new RateLimitPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of RateLimitInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of RateLimitInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new RateLimitPage($this->version, $response, $this->solution); } /** * Constructs a RateLimitContext * * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Verify\V2\Service\RateLimitContext */ public function getContext($sid) { return new RateLimitContext($this->version, $this->solution['serviceSid'], $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Verify.V2.RateLimitList]'; } } sdk/src/Twilio/Rest/Verify/V2/Service/MessagingConfigurationContext.php 0000644 00000006253 15002236443 0022163 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Verify\V2\Service; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Values; use Twilio\Version; class MessagingConfigurationContext extends InstanceContext { /** * Initialize the MessagingConfigurationContext * * @param \Twilio\Version $version Version that contains the resource * @param string $serviceSid The SID of the Service that the resource is * associated with * @param string $country The ISO-3166-1 country code of the country or `all`. * @return \Twilio\Rest\Verify\V2\Service\MessagingConfigurationContext */ public function __construct(Version $version, $serviceSid, $country) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, 'country' => $country, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/MessagingConfigurations/' . \rawurlencode($country) . ''; } /** * Update the MessagingConfigurationInstance * * @param string $messagingServiceSid The SID of the Messaging Service used for * this configuration. * @return MessagingConfigurationInstance Updated MessagingConfigurationInstance * @throws TwilioException When an HTTP error occurs. */ public function update($messagingServiceSid) { $data = Values::of(array('MessagingServiceSid' => $messagingServiceSid, )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new MessagingConfigurationInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['country'] ); } /** * Fetch a MessagingConfigurationInstance * * @return MessagingConfigurationInstance Fetched MessagingConfigurationInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new MessagingConfigurationInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['country'] ); } /** * Deletes the MessagingConfigurationInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Verify.V2.MessagingConfigurationContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Verify/V2/Service/VerificationInstance.php 0000644 00000011000 15002236443 0020242 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Verify\V2\Service; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $serviceSid * @property string $accountSid * @property string $to * @property string $channel * @property string $status * @property bool $valid * @property array $lookup * @property string $amount * @property string $payee * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $url */ class VerificationInstance extends InstanceResource { /** * Initialize the VerificationInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the Service that the resource is * associated with * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Verify\V2\Service\VerificationInstance */ public function __construct(Version $version, array $payload, $serviceSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'sid' => Values::array_get($payload, 'sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'to' => Values::array_get($payload, 'to'), 'channel' => Values::array_get($payload, 'channel'), 'status' => Values::array_get($payload, 'status'), 'valid' => Values::array_get($payload, 'valid'), 'lookup' => Values::array_get($payload, 'lookup'), 'amount' => Values::array_get($payload, 'amount'), 'payee' => Values::array_get($payload, 'payee'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), ); $this->solution = array('serviceSid' => $serviceSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Verify\V2\Service\VerificationContext Context for this * VerificationInstance */ protected function proxy() { if (!$this->context) { $this->context = new VerificationContext( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->context; } /** * Update the VerificationInstance * * @param string $status The new status of the resource * @return VerificationInstance Updated VerificationInstance * @throws TwilioException When an HTTP error occurs. */ public function update($status) { return $this->proxy()->update($status); } /** * Fetch a VerificationInstance * * @return VerificationInstance Fetched VerificationInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Verify.V2.VerificationInstance ' . \implode(' ', $context) . ']'; } }sdk/src/Twilio/Rest/Verify/V2/Service/VerificationCheckList.php 0000644 00000004051 15002236443 0020357 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Verify\V2\Service; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; class VerificationCheckList extends ListResource { /** * Construct the VerificationCheckList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Service that the resource is * associated with * @return \Twilio\Rest\Verify\V2\Service\VerificationCheckList */ public function __construct(Version $version, $serviceSid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/VerificationCheck'; } /** * Create a new VerificationCheckInstance * * @param string $code The verification string * @param array|Options $options Optional Arguments * @return VerificationCheckInstance Newly created VerificationCheckInstance * @throws TwilioException When an HTTP error occurs. */ public function create($code, $options = array()) { $options = new Values($options); $data = Values::of(array( 'Code' => $code, 'To' => $options['to'], 'VerificationSid' => $options['verificationSid'], 'Amount' => $options['amount'], 'Payee' => $options['payee'], )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new VerificationCheckInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Verify.V2.VerificationCheckList]'; } } sdk/src/Twilio/Rest/Verify/V2/Service/MessagingConfigurationList.php 0000644 00000014121 15002236443 0021443 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Verify\V2\Service; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Values; use Twilio\Version; class MessagingConfigurationList extends ListResource { /** * Construct the MessagingConfigurationList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Service that the resource is * associated with * @return \Twilio\Rest\Verify\V2\Service\MessagingConfigurationList */ public function __construct(Version $version, $serviceSid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/MessagingConfigurations'; } /** * Create a new MessagingConfigurationInstance * * @param string $country The ISO-3166-1 country code of the country or `all`. * @param string $messagingServiceSid The SID of the Messaging Service used for * this configuration. * @return MessagingConfigurationInstance Newly created * MessagingConfigurationInstance * @throws TwilioException When an HTTP error occurs. */ public function create($country, $messagingServiceSid) { $data = Values::of(array('Country' => $country, 'MessagingServiceSid' => $messagingServiceSid, )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new MessagingConfigurationInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Streams MessagingConfigurationInstance records from the API as a generator * stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads MessagingConfigurationInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return MessagingConfigurationInstance[] Array of results */ public function read($limit = null, $pageSize = null) { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of MessagingConfigurationInstance records from the * API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of MessagingConfigurationInstance */ public function page($pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $params = Values::of(array( 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new MessagingConfigurationPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of MessagingConfigurationInstance records from the * API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of MessagingConfigurationInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new MessagingConfigurationPage($this->version, $response, $this->solution); } /** * Constructs a MessagingConfigurationContext * * @param string $country The ISO-3166-1 country code of the country or `all`. * @return \Twilio\Rest\Verify\V2\Service\MessagingConfigurationContext */ public function getContext($country) { return new MessagingConfigurationContext($this->version, $this->solution['serviceSid'], $country); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Verify.V2.MessagingConfigurationList]'; } } sdk/src/Twilio/Rest/Verify/V2/Service/RateLimit/BucketPage.php 0000644 00000001527 15002236443 0020054 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Verify\V2\Service\RateLimit; use Twilio\Page; class BucketPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new BucketInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['rateLimitSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Verify.V2.BucketPage]'; } } sdk/src/Twilio/Rest/Verify/V2/Service/RateLimit/BucketInstance.php 0000644 00000011252 15002236443 0020740 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Verify\V2\Service\RateLimit; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $rateLimitSid * @property string $serviceSid * @property string $accountSid * @property int $max * @property int $interval * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $url */ class BucketInstance extends InstanceResource { /** * Initialize the BucketInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the Service that the resource is * associated with * @param string $rateLimitSid Rate Limit Sid. * @param string $sid A string that uniquely identifies this Bucket. * @return \Twilio\Rest\Verify\V2\Service\RateLimit\BucketInstance */ public function __construct(Version $version, array $payload, $serviceSid, $rateLimitSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'sid' => Values::array_get($payload, 'sid'), 'rateLimitSid' => Values::array_get($payload, 'rate_limit_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'max' => Values::array_get($payload, 'max'), 'interval' => Values::array_get($payload, 'interval'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), ); $this->solution = array( 'serviceSid' => $serviceSid, 'rateLimitSid' => $rateLimitSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Verify\V2\Service\RateLimit\BucketContext Context for * this * BucketInstance */ protected function proxy() { if (!$this->context) { $this->context = new BucketContext( $this->version, $this->solution['serviceSid'], $this->solution['rateLimitSid'], $this->solution['sid'] ); } return $this->context; } /** * Update the BucketInstance * * @param array|Options $options Optional Arguments * @return BucketInstance Updated BucketInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Fetch a BucketInstance * * @return BucketInstance Fetched BucketInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the BucketInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Verify.V2.BucketInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Verify/V2/Service/RateLimit/BucketOptions.php 0000644 00000004064 15002236443 0020632 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Verify\V2\Service\RateLimit; use Twilio\Options; use Twilio\Values; abstract class BucketOptions { /** * @param int $max Max number of requests. * @param int $interval Number of seconds that the rate limit will be enforced * over. * @return UpdateBucketOptions Options builder */ public static function update($max = Values::NONE, $interval = Values::NONE) { return new UpdateBucketOptions($max, $interval); } } class UpdateBucketOptions extends Options { /** * @param int $max Max number of requests. * @param int $interval Number of seconds that the rate limit will be enforced * over. */ public function __construct($max = Values::NONE, $interval = Values::NONE) { $this->options['max'] = $max; $this->options['interval'] = $interval; } /** * Maximum number of requests permitted in during the interval. * * @param int $max Max number of requests. * @return $this Fluent Builder */ public function setMax($max) { $this->options['max'] = $max; return $this; } /** * Number of seconds that the rate limit will be enforced over. * * @param int $interval Number of seconds that the rate limit will be enforced * over. * @return $this Fluent Builder */ public function setInterval($interval) { $this->options['interval'] = $interval; 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.Verify.V2.UpdateBucketOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Verify/V2/Service/RateLimit/BucketList.php 0000644 00000013645 15002236443 0020117 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Verify\V2\Service\RateLimit; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Values; use Twilio\Version; class BucketList extends ListResource { /** * Construct the BucketList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Service that the resource is * associated with * @param string $rateLimitSid Rate Limit Sid. * @return \Twilio\Rest\Verify\V2\Service\RateLimit\BucketList */ public function __construct(Version $version, $serviceSid, $rateLimitSid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, 'rateLimitSid' => $rateLimitSid, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/RateLimits/' . \rawurlencode($rateLimitSid) . '/Buckets'; } /** * Create a new BucketInstance * * @param int $max Max number of requests. * @param int $interval Number of seconds that the rate limit will be enforced * over. * @return BucketInstance Newly created BucketInstance * @throws TwilioException When an HTTP error occurs. */ public function create($max, $interval) { $data = Values::of(array('Max' => $max, 'Interval' => $interval, )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new BucketInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['rateLimitSid'] ); } /** * Streams BucketInstance records from the API as a generator stream. * This operation lazily loads records as efficiently as possible until the * limit * is reached. * The results are returned as a generator, so this operation is memory * efficient. * * @param int $limit Upper limit for the number of records to return. stream() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, stream() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return \Twilio\Stream stream of results */ public function stream($limit = null, $pageSize = null) { $limits = $this->version->readLimits($limit, $pageSize); $page = $this->page($limits['pageSize']); return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); } /** * Reads BucketInstance records from the API as a list. * Unlike stream(), this operation is eager and will load `limit` records into * memory before returning. * * @param int $limit Upper limit for the number of records to return. read() * guarantees to never return more than limit. Default is no * limit * @param mixed $pageSize Number of records to fetch per request, when not set * will use the default value of 50 records. If no * page_size is defined but a limit is defined, read() * will attempt to read the limit with the most * efficient page size, i.e. min(limit, 1000) * @return BucketInstance[] Array of results */ public function read($limit = null, $pageSize = null) { return \iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of BucketInstance records from the API. * Request is executed immediately * * @param mixed $pageSize Number of records to return, defaults to 50 * @param string $pageToken PageToken provided by the API * @param mixed $pageNumber Page Number, this value is simply for client state * @return \Twilio\Page Page of BucketInstance */ public function page($pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $params = Values::of(array( 'PageToken' => $pageToken, 'Page' => $pageNumber, 'PageSize' => $pageSize, )); $response = $this->version->page( 'GET', $this->uri, $params ); return new BucketPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of BucketInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of BucketInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new BucketPage($this->version, $response, $this->solution); } /** * Constructs a BucketContext * * @param string $sid A string that uniquely identifies this Bucket. * @return \Twilio\Rest\Verify\V2\Service\RateLimit\BucketContext */ public function getContext($sid) { return new BucketContext( $this->version, $this->solution['serviceSid'], $this->solution['rateLimitSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Verify.V2.BucketList]'; } } sdk/src/Twilio/Rest/Verify/V2/Service/RateLimit/BucketContext.php 0000644 00000006310 15002236443 0020617 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Verify\V2\Service\RateLimit; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Values; use Twilio\Version; class BucketContext extends InstanceContext { /** * Initialize the BucketContext * * @param \Twilio\Version $version Version that contains the resource * @param string $serviceSid The SID of the Service that the resource is * associated with * @param string $rateLimitSid Rate Limit Sid. * @param string $sid A string that uniquely identifies this Bucket. * @return \Twilio\Rest\Verify\V2\Service\RateLimit\BucketContext */ public function __construct(Version $version, $serviceSid, $rateLimitSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array( 'serviceSid' => $serviceSid, 'rateLimitSid' => $rateLimitSid, 'sid' => $sid, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/RateLimits/' . \rawurlencode($rateLimitSid) . '/Buckets/' . \rawurlencode($sid) . ''; } /** * Update the BucketInstance * * @param array|Options $options Optional Arguments * @return BucketInstance Updated BucketInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { $options = new Values($options); $data = Values::of(array('Max' => $options['max'], 'Interval' => $options['interval'], )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new BucketInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['rateLimitSid'], $this->solution['sid'] ); } /** * Fetch a BucketInstance * * @return BucketInstance Fetched BucketInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new BucketInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['rateLimitSid'], $this->solution['sid'] ); } /** * Deletes the BucketInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Verify.V2.BucketContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Verify/V2/Service/RateLimitInstance.php 0000644 00000011237 15002236443 0017526 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Verify\V2\Service; use Twilio\Deserialize; use Twilio\Exceptions\TwilioException; use Twilio\InstanceResource; use Twilio\Options; use Twilio\Values; use Twilio\Version; /** * @property string $sid * @property string $serviceSid * @property string $accountSid * @property string $uniqueName * @property string $description * @property \DateTime $dateCreated * @property \DateTime $dateUpdated * @property string $url * @property array $links */ class RateLimitInstance extends InstanceResource { protected $_buckets = null; /** * Initialize the RateLimitInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The SID of the Service that the resource is * associated with * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Verify\V2\Service\RateLimitInstance */ public function __construct(Version $version, array $payload, $serviceSid, $sid = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'sid' => Values::array_get($payload, 'sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'accountSid' => Values::array_get($payload, 'account_sid'), 'uniqueName' => Values::array_get($payload, 'unique_name'), 'description' => Values::array_get($payload, 'description'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'url' => Values::array_get($payload, 'url'), 'links' => Values::array_get($payload, 'links'), ); $this->solution = array('serviceSid' => $serviceSid, 'sid' => $sid ?: $this->properties['sid'], ); } /** * Generate an instance context for the instance, the context is capable of * performing various actions. All instance actions are proxied to the context * * @return \Twilio\Rest\Verify\V2\Service\RateLimitContext Context for this * RateLimitInstance */ protected function proxy() { if (!$this->context) { $this->context = new RateLimitContext( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->context; } /** * Update the RateLimitInstance * * @param array|Options $options Optional Arguments * @return RateLimitInstance Updated RateLimitInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Fetch a RateLimitInstance * * @return RateLimitInstance Fetched RateLimitInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the RateLimitInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->proxy()->delete(); } /** * Access the buckets * * @return \Twilio\Rest\Verify\V2\Service\RateLimit\BucketList */ protected function getBuckets() { return $this->proxy()->buckets; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (\array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Verify.V2.RateLimitInstance ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Verify/V2/Service/RateLimitOptions.php 0000644 00000005273 15002236443 0017420 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Verify\V2\Service; use Twilio\Options; use Twilio\Values; abstract class RateLimitOptions { /** * @param string $description Description of this Rate Limit * @return CreateRateLimitOptions Options builder */ public static function create($description = Values::NONE) { return new CreateRateLimitOptions($description); } /** * @param string $description Description of this Rate Limit * @return UpdateRateLimitOptions Options builder */ public static function update($description = Values::NONE) { return new UpdateRateLimitOptions($description); } } class CreateRateLimitOptions extends Options { /** * @param string $description Description of this Rate Limit */ public function __construct($description = Values::NONE) { $this->options['description'] = $description; } /** * Description of this Rate Limit * * @param string $description Description of this Rate Limit * @return $this Fluent Builder */ public function setDescription($description) { $this->options['description'] = $description; 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.Verify.V2.CreateRateLimitOptions ' . \implode(' ', $options) . ']'; } } class UpdateRateLimitOptions extends Options { /** * @param string $description Description of this Rate Limit */ public function __construct($description = Values::NONE) { $this->options['description'] = $description; } /** * Description of this Rate Limit * * @param string $description Description of this Rate Limit * @return $this Fluent Builder */ public function setDescription($description) { $this->options['description'] = $description; 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.Verify.V2.UpdateRateLimitOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Verify/V2/Service/RateLimitPage.php 0000644 00000001373 15002236443 0016636 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Verify\V2\Service; use Twilio\Page; class RateLimitPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new RateLimitInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Verify.V2.RateLimitPage]'; } } sdk/src/Twilio/Rest/Verify/V2/Service/VerificationList.php 0000644 00000005354 15002236443 0017430 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Verify\V2\Service; use Twilio\Exceptions\TwilioException; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; class VerificationList extends ListResource { /** * Construct the VerificationList * * @param Version $version Version that contains the resource * @param string $serviceSid The SID of the Service that the resource is * associated with * @return \Twilio\Rest\Verify\V2\Service\VerificationList */ public function __construct(Version $version, $serviceSid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/Verifications'; } /** * Create a new VerificationInstance * * @param string $to The phone number or email to verify * @param string $channel The verification method to use * @param array|Options $options Optional Arguments * @return VerificationInstance Newly created VerificationInstance * @throws TwilioException When an HTTP error occurs. */ public function create($to, $channel, $options = array()) { $options = new Values($options); $data = Values::of(array( 'To' => $to, 'Channel' => $channel, 'CustomMessage' => $options['customMessage'], 'SendDigits' => $options['sendDigits'], 'Locale' => $options['locale'], 'CustomCode' => $options['customCode'], 'Amount' => $options['amount'], 'Payee' => $options['payee'], 'RateLimits' => Serialize::jsonObject($options['rateLimits']), 'ChannelConfiguration' => Serialize::jsonObject($options['channelConfiguration']), )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new VerificationInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Constructs a VerificationContext * * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Verify\V2\Service\VerificationContext */ public function getContext($sid) { return new VerificationContext($this->version, $this->solution['serviceSid'], $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Verify.V2.VerificationList]'; } } sdk/src/Twilio/Rest/Verify/V2/Service/VerificationCheckPage.php 0000644 00000001423 15002236443 0020320 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Verify\V2\Service; use Twilio\Page; class VerificationCheckPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new VerificationCheckInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Verify.V2.VerificationCheckPage]'; } } sdk/src/Twilio/Rest/Verify/V2/Service/RateLimitContext.php 0000644 00000011223 15002236443 0017401 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Verify\V2\Service; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Rest\Verify\V2\Service\RateLimit\BucketList; use Twilio\Values; use Twilio\Version; /** * @property \Twilio\Rest\Verify\V2\Service\RateLimit\BucketList $buckets * @method \Twilio\Rest\Verify\V2\Service\RateLimit\BucketContext buckets(string $sid) */ class RateLimitContext extends InstanceContext { protected $_buckets = null; /** * Initialize the RateLimitContext * * @param \Twilio\Version $version Version that contains the resource * @param string $serviceSid The SID of the Service that the resource is * associated with * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Verify\V2\Service\RateLimitContext */ public function __construct(Version $version, $serviceSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, 'sid' => $sid, ); $this->uri = '/Services/' . \rawurlencode($serviceSid) . '/RateLimits/' . \rawurlencode($sid) . ''; } /** * Update the RateLimitInstance * * @param array|Options $options Optional Arguments * @return RateLimitInstance Updated RateLimitInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { $options = new Values($options); $data = Values::of(array('Description' => $options['description'], )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new RateLimitInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Fetch a RateLimitInstance * * @return RateLimitInstance Fetched RateLimitInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new RateLimitInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Deletes the RateLimitInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Access the buckets * * @return \Twilio\Rest\Verify\V2\Service\RateLimit\BucketList */ protected function getBuckets() { if (!$this->_buckets) { $this->_buckets = new BucketList( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->_buckets; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get($name) { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Verify.V2.RateLimitContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Rest/Verify/V2/Service/VerificationCheckOptions.php 0000644 00000007526 15002236443 0021111 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Verify\V2\Service; use Twilio\Options; use Twilio\Values; abstract class VerificationCheckOptions { /** * @param string $to The phone number or email to verify * @param string $verificationSid A SID that uniquely identifies the * Verification Check * @param string $amount The amount of the associated PSD2 compliant * transaction. * @param string $payee The payee of the associated PSD2 compliant transaction * @return CreateVerificationCheckOptions Options builder */ public static function create($to = Values::NONE, $verificationSid = Values::NONE, $amount = Values::NONE, $payee = Values::NONE) { return new CreateVerificationCheckOptions($to, $verificationSid, $amount, $payee); } } class CreateVerificationCheckOptions extends Options { /** * @param string $to The phone number or email to verify * @param string $verificationSid A SID that uniquely identifies the * Verification Check * @param string $amount The amount of the associated PSD2 compliant * transaction. * @param string $payee The payee of the associated PSD2 compliant transaction */ public function __construct($to = Values::NONE, $verificationSid = Values::NONE, $amount = Values::NONE, $payee = Values::NONE) { $this->options['to'] = $to; $this->options['verificationSid'] = $verificationSid; $this->options['amount'] = $amount; $this->options['payee'] = $payee; } /** * The phone number or [email](https://www.twilio.com/docs/verify/tutorials/email) to verify. Either this parameter or the `verification_sid` must be specified. Phone numbers must be in [E.164 format](https://www.twilio.com/docs/glossary/what-e164). * * @param string $to The phone number or email to verify * @return $this Fluent Builder */ public function setTo($to) { $this->options['to'] = $to; return $this; } /** * A SID that uniquely identifies the Verification Check. Either this parameter or the `to` phone number/[email](https://www.twilio.com/docs/verify/tutorials/email) must be specified. * * @param string $verificationSid A SID that uniquely identifies the * Verification Check * @return $this Fluent Builder */ public function setVerificationSid($verificationSid) { $this->options['verificationSid'] = $verificationSid; return $this; } /** * The amount of the associated PSD2 compliant transaction. Requires the PSD2 Service flag enabled. * * @param string $amount The amount of the associated PSD2 compliant * transaction. * @return $this Fluent Builder */ public function setAmount($amount) { $this->options['amount'] = $amount; return $this; } /** * The payee of the associated PSD2 compliant transaction. Requires the PSD2 Service flag enabled. * * @param string $payee The payee of the associated PSD2 compliant transaction * @return $this Fluent Builder */ public function setPayee($payee) { $this->options['payee'] = $payee; 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.Verify.V2.CreateVerificationCheckOptions ' . \implode(' ', $options) . ']'; } } sdk/src/Twilio/Rest/Verify/V2/ServiceContext.php 0000644 00000015055 15002236443 0015516 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Verify\V2; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Rest\Verify\V2\Service\MessagingConfigurationList; use Twilio\Rest\Verify\V2\Service\RateLimitList; use Twilio\Rest\Verify\V2\Service\VerificationCheckList; use Twilio\Rest\Verify\V2\Service\VerificationList; use Twilio\Serialize; use Twilio\Values; use Twilio\Version; /** * @property \Twilio\Rest\Verify\V2\Service\VerificationList $verifications * @property \Twilio\Rest\Verify\V2\Service\VerificationCheckList $verificationChecks * @property \Twilio\Rest\Verify\V2\Service\RateLimitList $rateLimits * @property \Twilio\Rest\Verify\V2\Service\MessagingConfigurationList $messagingConfigurations * @method \Twilio\Rest\Verify\V2\Service\VerificationContext verifications(string $sid) * @method \Twilio\Rest\Verify\V2\Service\RateLimitContext rateLimits(string $sid) * @method \Twilio\Rest\Verify\V2\Service\MessagingConfigurationContext messagingConfigurations(string $country) */ class ServiceContext extends InstanceContext { protected $_verifications = null; protected $_verificationChecks = null; protected $_rateLimits = null; protected $_messagingConfigurations = null; /** * Initialize the ServiceContext * * @param \Twilio\Version $version Version that contains the resource * @param string $sid The unique string that identifies the resource * @return \Twilio\Rest\Verify\V2\ServiceContext */ public function __construct(Version $version, $sid) { parent::__construct($version); // Path Solution $this->solution = array('sid' => $sid, ); $this->uri = '/Services/' . \rawurlencode($sid) . ''; } /** * Fetch a ServiceInstance * * @return ServiceInstance Fetched ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new ServiceInstance($this->version, $payload, $this->solution['sid']); } /** * Deletes the ServiceInstance * * @return boolean True if delete succeeds, false otherwise * @throws TwilioException When an HTTP error occurs. */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Update the ServiceInstance * * @param array|Options $options Optional Arguments * @return ServiceInstance Updated ServiceInstance * @throws TwilioException When an HTTP error occurs. */ public function update($options = array()) { $options = new Values($options); $data = Values::of(array( 'FriendlyName' => $options['friendlyName'], 'CodeLength' => $options['codeLength'], 'LookupEnabled' => Serialize::booleanToString($options['lookupEnabled']), 'SkipSmsToLandlines' => Serialize::booleanToString($options['skipSmsToLandlines']), 'DtmfInputRequired' => Serialize::booleanToString($options['dtmfInputRequired']), 'TtsName' => $options['ttsName'], 'Psd2Enabled' => Serialize::booleanToString($options['psd2Enabled']), )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new ServiceInstance($this->version, $payload, $this->solution['sid']); } /** * Access the verifications * * @return \Twilio\Rest\Verify\V2\Service\VerificationList */ protected function getVerifications() { if (!$this->_verifications) { $this->_verifications = new VerificationList($this->version, $this->solution['sid']); } return $this->_verifications; } /** * Access the verificationChecks * * @return \Twilio\Rest\Verify\V2\Service\VerificationCheckList */ protected function getVerificationChecks() { if (!$this->_verificationChecks) { $this->_verificationChecks = new VerificationCheckList($this->version, $this->solution['sid']); } return $this->_verificationChecks; } /** * Access the rateLimits * * @return \Twilio\Rest\Verify\V2\Service\RateLimitList */ protected function getRateLimits() { if (!$this->_rateLimits) { $this->_rateLimits = new RateLimitList($this->version, $this->solution['sid']); } return $this->_rateLimits; } /** * Access the messagingConfigurations * * @return \Twilio\Rest\Verify\V2\Service\MessagingConfigurationList */ protected function getMessagingConfigurations() { if (!$this->_messagingConfigurations) { $this->_messagingConfigurations = new MessagingConfigurationList( $this->version, $this->solution['sid'] ); } return $this->_messagingConfigurations; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws TwilioException For unknown subresources */ public function __get($name) { if (\property_exists($this, '_' . $name)) { $method = 'get' . \ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown subresource ' . $name); } /** * Magic caller to get resource contexts * * @param string $name Resource to return * @param array $arguments Context parameters * @return \Twilio\InstanceContext The requested resource context * @throws TwilioException For unknown resource */ public function __call($name, $arguments) { $property = $this->$name; if (\method_exists($property, 'getContext')) { return \call_user_func_array(array($property, 'getContext'), $arguments); } throw new TwilioException('Resource does not have a context'); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $context = array(); foreach ($this->solution as $key => $value) { $context[] = "$key=$value"; } return '[Twilio.Verify.V2.ServiceContext ' . \implode(' ', $context) . ']'; } } sdk/src/Twilio/Http/CurlClient.php 0000644 00000014163 15002236443 0013063 0 ustar 00 <?php namespace Twilio\Http; use Twilio\Exceptions\EnvironmentException; class CurlClient implements Client { const DEFAULT_TIMEOUT = 60; protected $curlOptions = array(); protected $debugHttp = false; public $lastRequest = null; public $lastResponse = null; public function __construct(array $options = array()) { $this->curlOptions = $options; $this->debugHttp = \getenv('DEBUG_HTTP_TRAFFIC') === 'true'; } public function request($method, $url, $params = array(), $data = array(), $headers = array(), $user = null, $password = null, $timeout = null) { $options = $this->options($method, $url, $params, $data, $headers, $user, $password, $timeout); $this->lastRequest = $options; $this->lastResponse = null; try { if (!$curl = \curl_init()) { throw new EnvironmentException('Unable to initialize cURL'); } if (!\curl_setopt_array($curl, $options)) { throw new EnvironmentException(\curl_error($curl)); } if (!$response = \curl_exec($curl)) { throw new EnvironmentException(\curl_error($curl)); } $parts = \explode("\r\n\r\n", $response, 3); list($head, $body) = (\preg_match('/\AHTTP\/1.\d 100 Continue\Z/', $parts[0]) || \preg_match('/\AHTTP\/1.\d 200 Connection established\Z/', $parts[0])) ? array($parts[1], $parts[2]) : array($parts[0], $parts[1]); if ($this->debugHttp) { $u = \parse_url($url); $hdrLine = $method . ' ' . $u['path']; if (isset($u['query']) && \strlen($u['query']) > 0 ) { $hdrLine = $hdrLine . '?' . $u['query']; } \error_log($hdrLine); foreach ($headers as $key => $value) { \error_log("$key: $value"); } if ($method === 'POST') { \error_log("\n" . $options[CURLOPT_POSTFIELDS] . "\n"); } } $statusCode = \curl_getinfo($curl, CURLINFO_HTTP_CODE); $responseHeaders = array(); $headerLines = \explode("\r\n", $head); \array_shift($headerLines); foreach ($headerLines as $line) { list($key, $value) = \explode(':', $line, 2); $responseHeaders[$key] = $value; } \curl_close($curl); if (isset($buffer) && \is_resource($buffer)) { \fclose($buffer); } if ($this->debugHttp) { \error_log("HTTP/1.1 $statusCode"); foreach ($responseHeaders as $key => $value) { \error_log("$key: $value"); } \error_log("\n$body"); } $this->lastResponse = new Response($statusCode, $body, $responseHeaders); return $this->lastResponse; } catch (\ErrorException $e) { if (isset($curl) && \is_resource($curl)) { \curl_close($curl); } if (isset($buffer) && \is_resource($buffer)) { \fclose($buffer); } throw $e; } } public function options($method, $url, $params = array(), $data = array(), $headers = array(), $user = null, $password = null, $timeout = null) { $timeout = \is_null($timeout) ? self::DEFAULT_TIMEOUT : $timeout; $options = $this->curlOptions + array( CURLOPT_URL => $url, CURLOPT_HEADER => true, CURLOPT_RETURNTRANSFER => true, CURLOPT_INFILESIZE => Null, CURLOPT_HTTPHEADER => array(), CURLOPT_TIMEOUT => $timeout, ); foreach ($headers as $key => $value) { $options[CURLOPT_HTTPHEADER][] = "$key: $value"; } if ($user && $password) { $options[CURLOPT_HTTPHEADER][] = 'Authorization: Basic ' . \base64_encode("$user:$password"); } $body = $this->buildQuery($params); if ($body) { $options[CURLOPT_URL] .= '?' . $body; } switch (\strtolower(\trim($method))) { case 'get': $options[CURLOPT_HTTPGET] = true; break; case 'post': $options[CURLOPT_POST] = true; $options[CURLOPT_POSTFIELDS] = $this->buildQuery($data); break; case 'put': $options[CURLOPT_PUT] = true; if ($data) { if ($buffer = \fopen('php://memory', 'w+')) { $dataString = $this->buildQuery($data); \fwrite($buffer, $dataString); \fseek($buffer, 0); $options[CURLOPT_INFILE] = $buffer; $options[CURLOPT_INFILESIZE] = \strlen($dataString); } else { throw new EnvironmentException('Unable to open a temporary file'); } } break; case 'head': $options[CURLOPT_NOBODY] = true; break; default: $options[CURLOPT_CUSTOMREQUEST] = \strtoupper($method); } return $options; } public function buildQuery($params) { $parts = array(); if (\is_string($params)) { return $params; } $params = $params ?: array(); foreach ($params as $key => $value) { if (\is_array($value)) { foreach ($value as $item) { $parts[] = \urlencode((string)$key) . '=' . \urlencode((string)$item); } } else { $parts[] = \urlencode((string)$key) . '=' . \urlencode((string)$value); } } return \implode('&', $parts); } } sdk/src/Twilio/Http/GuzzleClient.php 0000644 00000002576 15002236443 0013443 0 ustar 00 <?php namespace Twilio\Http; use GuzzleHttp\ClientInterface; use GuzzleHttp\Exception\BadResponseException; use GuzzleHttp\Psr7\Request; use Twilio\Exceptions\HttpException; final class GuzzleClient implements Client { /** * @var ClientInterface */ private $client; public function __construct(ClientInterface $client) { $this->client = $client; } public function request( $method, $url, $params = [], $data = [], $headers = [], $user = null, $password = null, $timeout = null ) { try { $response = $this->client->send(new Request($method, $url, $headers), [ 'timeout' => $timeout, 'auth' => [$user, $password], 'query' => $params, 'form_params' => $data, ]); } catch (BadResponseException $exception) { $response = $exception->getResponse(); } catch (\Exception $exception) { throw new HttpException('Unable to complete the HTTP request', 0, $exception); } // Casting the body (stream) to a string performs a rewind, ensuring we return the entire response. // See https://stackoverflow.com/a/30549372/86696 return new Response($response->getStatusCode(), (string) $response->getBody(), $response->getHeaders()); } } sdk/src/Twilio/Http/Response.php 0000644 00000001515 15002236443 0012612 0 ustar 00 <?php namespace Twilio\Http; class Response { protected $headers; protected $content; protected $statusCode; public function __construct($statusCode, $content, $headers = array()) { $this->statusCode = $statusCode; $this->content = $content; $this->headers = $headers; } /** * @return mixed */ public function getContent() { return \json_decode($this->content, true); } /** * @return mixed */ public function getStatusCode() { return $this->statusCode; } public function getHeaders() { return $this->headers; } public function ok() { return $this->getStatusCode() < 400; } public function __toString() { return '[Response] HTTP ' . $this->getStatusCode() . ' ' . $this->content; } } sdk/src/Twilio/Http/Client.php 0000644 00000000402 15002236443 0012224 0 ustar 00 <?php namespace Twilio\Http; interface Client { public function request($method, $url, $params = array(), $data = array(), $headers = array(), $user = null, $password = null, $timeout = null); } sdk/src/Twilio/Twiml.php 0000644 00000011025 15002236443 0011166 0 ustar 00 <?php namespace Twilio; use Twilio\Exceptions\TwimlException; /** * Twiml response generator. * @deprecated Use the generated types in the Twilio\TwiML namespace instead */ class Twiml { protected $element; /** * Constructs a Twiml response. * * @param \SimpleXmlElement|array $arg * @throws TwimlException * :param SimpleXmlElement|array $arg: Can be any of * * - the element to wrap * - attributes to add to the element * - if null, initialize an empty element named 'Response' */ public function __construct($arg = null) { switch (true) { case $arg instanceof \SimpleXMLElement: $this->element = $arg; break; case $arg === null: $this->element = new \SimpleXMLElement('<Response/>'); break; case \is_array($arg): $this->element = new \SimpleXMLElement('<Response/>'); foreach ($arg as $name => $value) { $this->element->addAttribute($name, $value); } break; default: throw new TwimlException('Invalid argument'); } } /** * Converts method calls into Twiml verbs. * * A basic example: * * .. code-block:: php * * php> print $this->say('hello'); * <Say>hello</Say> * * An example with attributes: * * .. code-block:: php * * print $this->say('hello', array('voice' => 'woman')); * <Say voice="woman">hello</Say> * * You could even just pass in an attributes array, omitting the noun: * * .. code-block:: php * * print $this->gather(array('timeout' => '20')); * <Gather timeout="20"/> * * @param string $verb The Twiml verb. * @param mixed[] $args * @return self * :param string $verb: The Twiml verb. * :param array $args: * - (noun string) * - (noun string, attributes array) * - (attributes array) * * :return: A SimpleXmlElement * :rtype: SimpleXmlElement */ public function __call($verb, array $args) { list($noun, $attrs) = $args + array('', array()); if (\is_array($noun)) { list($attrs, $noun) = array($noun, ''); } /* addChild does not escape XML, while addAttribute does. This means if * you pass unescaped ampersands ("&") to addChild, you will generate * an error. * * Some inexperienced developers will pass in unescaped ampersands, and * we want to make their code work, by escaping the ampersands for them * before passing the string to addChild. (with htmlentities) * * However other people will know what to do, and their code * already escapes ampersands before passing them to addChild. We don't * want to break their existing code by turning their &'s into * &amp; * * We also want to use numeric entities, not named entities so that we * are fully compatible with XML * * The following lines accomplish the desired behavior. */ $decoded = \html_entity_decode($noun, ENT_COMPAT, 'UTF-8'); $normalized = \htmlspecialchars($decoded, ENT_COMPAT, 'UTF-8', false); $hasNoun = \is_scalar($noun) && \strlen($noun); $child = $hasNoun ? $this->element->addChild(\ucfirst($verb), $normalized) : $this->element->addChild(\ucfirst($verb)); if (\is_array($attrs)) { foreach ($attrs as $name => $value) { /* Note that addAttribute escapes raw ampersands by default, so we * haven't touched its implementation. So this is the matrix for * addAttribute: * * & turns into & * & turns into &amp; */ if (\is_bool($value)) { $value = ($value === true) ? 'true' : 'false'; } $child->addAttribute($name, $value); } } return new static($child); } /** * Returns the object as XML. * * :return: The response as an XML string * :rtype: string */ public function __toString() { $xml = $this->element->asXML(); return (string)\str_replace( '<?xml version="1.0"?>', '<?xml version="1.0" encoding="UTF-8"?>', $xml); } }
| ver. 1.4 |
Github
|
.
| PHP 8.2.28 | Generation time: 0.11 |
proxy
|
phpinfo
|
Settings