File manager - Edit - /home/opticamezl/www/newok/twilio.tar
Back
sdk/Makefile 0000604 00000002366 15174325125 0006775 0 ustar 00 # Twilio API helper library. # See LICENSE file for copyright and license details. COMPOSER = $(shell which composer) ifeq ($(strip $(COMPOSER)),) COMPOSER = php composer.phar endif all: test clean: @rm -rf venv vendor install: @composer --version || (echo "Composer is not installed, please install Composer"; exit 1); # Composer: http://getcomposer.org/download/ $(COMPOSER) install vendor: install # if these fail, you may need to install the helper library test: install @PATH=vendor/bin:$(PATH) phpunit --report-useless-tests --strict-coverage --disallow-test-output --colors --configuration Twilio/Tests/phpunit.xml @PATH=vendor/bin:$(PATH) phpunit --report-useless-tests --strict-coverage --disallow-test-output --colors Services/Tests/TwilioTest.php docs-install: composer require --dev apigen/apigen docs: docs-install vendor/bin/apigen generate -s ./ -d docs/api --exclude="Tests/*" --exclude="vendor/*" --exclude="autoload.php" --template-theme bootstrap --main Twilio authors: echo "Authors\n=======\n\nA huge thanks to all of our contributors:\n\n" > AUTHORS.md git log --raw | grep "^Author: " | cut -d ' ' -f2- | cut -d '<' -f1 | sed 's/^/- /' | sort | uniq >> AUTHORS.md .PHONY: all clean test docs docs-install test-install authors sdk/Twilio/ListResource.php 0000604 00000000452 15174325125 0011732 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/Twilio/Serialize.php 0000604 00000004564 15174325125 0011246 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/Twilio/Security/RequestValidator.php 0000604 00000003261 15174325125 0014415 0 ustar 00 <?php namespace Twilio\Security; class RequestValidator { protected $authToken; function __construct($authToken) { $this->authToken = $authToken; } 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"; // This function calculates the HMAC hash of the data with the key // passed in // Note: hash_hmac requires PHP 5 >= 5.1.2 or PECL hash:1.1-1.5 // Or http://pear.php.net/package/Crypt_HMAC/ return base64_encode(hash_hmac("sha1", $url, $this->authToken, true)); } public function validate($expectedSignature, $url, $data = array()) { return self::compare( $this->computeSignature($url, $data), $expectedSignature ); } /** * 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) { $result = true; if (strlen($a) != strlen($b)) { return false; } if (!$a && !$b) { return true; } $limit = strlen($a); for ($i = 0; $i < $limit; ++$i) { if ($a[$i] != $b[$i]) { $result = false; } } return $result; } } sdk/Twilio/InstanceContext.php 0000604 00000000460 15174325125 0012417 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/Twilio/autoload.php 0000604 00000012320 15174325125 0011114 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/Twilio/TwiML/FaxResponse.php 0000604 00000001064 15174325125 0012540 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'); } /** * Add Receive child. * * @param array $attributes Optional attributes * @return TwiML Child element. */ public function receive($attributes = array()) { return $this->nest(new Fax\Receive($attributes)); } } sdk/Twilio/TwiML/VoiceResponse.php 0000604 00000007646 15174325125 0013103 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'); } /** * Add Dial child. * * @param string $number Phone number to dial * @param array $attributes Optional attributes * @return TwiML Child element. */ public function dial($number, $attributes = array()) { return $this->nest(new Voice\Dial($number, $attributes)); } /** * Add Echo child. * * @return TwiML 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 TwiML 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 TwiML Child element. */ public function gather($attributes = array()) { return $this->nest(new Voice\Gather($attributes)); } /** * Add Hangup child. * * @return TwiML Child element. */ public function hangup() { return $this->nest(new Voice\Hangup()); } /** * Add Leave child. * * @return TwiML Child element. */ public function leave() { return $this->nest(new Voice\Leave()); } /** * Add Pause child. * * @param array $attributes Optional attributes * @return TwiML Child element. */ public function pause($attributes = array()) { return $this->nest(new Voice\Pause($attributes)); } /** * Add Play child. * * @param url $url Media URL * @param array $attributes Optional attributes * @return TwiML 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 TwiML 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 TwiML Child element. */ public function record($attributes = array()) { return $this->nest(new Voice\Record($attributes)); } /** * Add Redirect child. * * @param url $url Redirect URL * @param array $attributes Optional attributes * @return TwiML 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 TwiML 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 TwiML 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 TwiML Child element. */ public function sms($message, $attributes = array()) { return $this->nest(new Voice\Sms($message, $attributes)); } } sdk/Twilio/TwiML/MessagingResponse.php 0000604 00000001665 15174325125 0013746 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'); } /** * Add Message child. * * @param string $body Message Body * @param array $attributes Optional attributes * @return TwiML Child element. */ public function message($body, $attributes = array()) { return $this->nest(new Messaging\Message($body, $attributes)); } /** * Add Redirect child. * * @param url $url Redirect URL * @param array $attributes Optional attributes * @return TwiML Child element. */ public function redirect($url, $attributes = array()) { return $this->nest(new Messaging\Redirect($url, $attributes)); } } sdk/Twilio/TwiML/TwiML.php 0000604 00000006527 15174325125 0011310 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\TwiML; /** * @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 { private $name; private $attributes; private $value; private $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 = array()) { $this->name = $name; $this->value = $value; $this->attributes = $attributes; $this->children = array(); } /** * Add a TwiML element. * * @param TwiML $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 TwiML $this */ public function setAttribute($key, $value) { return $this->attributes[$key] = $value; } /** * 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 str_replace( '<?xml version="1.0"?>', '<?xml version="1.0" encoding="UTF-8"?>', $this->xml()->asXML() ); } /** * Build TwiML children. * * @param TwiML[] $children Children to build * @param \SimpleXMLElement $element Base XML element */ private function buildChildren($children, $element) { foreach ($children as $child) { $childElement = $element->addChild($child->name); self::buildElement($child, $childElement); self::buildChildren($child->children, $childElement); } } /** * Build TwiML element. * * @param TwiML $twiml TwiML element to build * @param \SimpleXMLElement $element Base XML element */ private function buildElement($twiml, $element) { if (is_string($twiml->value)) { $element[0] = $twiml->value; } foreach ($twiml->attributes as $name => $value) { if (is_bool($value)) { $value = ($value === true) ? 'true' : 'false'; } $element->addAttribute($name, $value); } } /** * Build XML element. * * @return \SimpleXMLElement Build TwiML element */ private function xml() { $element = new \SimpleXMLElement('<' . $this->name . '/>'); self::buildElement($this, $element); self::buildChildren($this->children, $element); return $element; } } sdk/Twilio/TwiML/Messaging/Message.php 0000604 00000004215 15174325125 0013605 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 TwiML Child element. */ public function body($message) { return $this->nest(new Messaging\Body($message)); } /** * Add Media child. * * @param url $url Media URL * @return TwiML Child element. */ public function media($url) { return $this->nest(new Messaging\Media($url)); } /** * Add To attribute. * * @param phoneNumber $to Phone Number to send Message to * @return TwiML $this. */ public function setTo($to) { return $this->setAttribute('to', $to); } /** * Add From attribute. * * @param phoneNumber $from Phone Number to send Message from * @return TwiML $this. */ public function setFrom($from) { return $this->setAttribute('from', $from); } /** * Add Action attribute. * * @param url $action Action URL * @return TwiML $this. */ public function setAction($action) { return $this->setAttribute('action', $action); } /** * Add Method attribute. * * @param httpMethod $method Action URL Method * @return TwiML $this. */ public function setMethod($method) { return $this->setAttribute('method', $method); } /** * Add StatusCallback attribute. * * @param url $statusCallback Status callback URL. Deprecated in favor of * action. * @return TwiML $this. */ public function setStatusCallback($statusCallback) { return $this->setAttribute('statusCallback', $statusCallback); } } sdk/Twilio/TwiML/Messaging/Redirect.php 0000604 00000001314 15174325125 0013757 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 url $url Redirect URL * @param array $attributes Optional attributes */ public function __construct($url, $attributes = array()) { parent::__construct('Redirect', $url, $attributes); } /** * Add Method attribute. * * @param httpMethod $method Redirect URL method * @return TwiML $this. */ public function setMethod($method) { return $this->setAttribute('method', $method); } } sdk/Twilio/TwiML/Messaging/Body.php 0000604 00000000612 15174325125 0013113 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/Twilio/TwiML/Messaging/Media.php 0000604 00000000573 15174325125 0013243 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 url $url Media URL */ public function __construct($url) { parent::__construct('Media', $url); } } sdk/Twilio/TwiML/Voice/Queue.php 0000604 00000002747 15174325125 0012445 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 url $url Action URL * @return TwiML $this. */ public function setUrl($url) { return $this->setAttribute('url', $url); } /** * Add Method attribute. * * @param httpMethod $method Action URL method * @return TwiML $this. */ public function setMethod($method) { return $this->setAttribute('method', $method); } /** * Add ReservationSid attribute. * * @param string $reservationSid TaskRouter Reservation SID * @return TwiML $this. */ public function setReservationSid($reservationSid) { return $this->setAttribute('reservationSid', $reservationSid); } /** * Add PostWorkActivitySid attribute. * * @param string $postWorkActivitySid TaskRouter Activity SID * @return TwiML $this. */ public function setPostWorkActivitySid($postWorkActivitySid) { return $this->setAttribute('postWorkActivitySid', $postWorkActivitySid); } } sdk/Twilio/TwiML/Voice/Enqueue.php 0000604 00000003752 15174325125 0012765 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 TwiML Child element. */ public function task($body, $attributes = array()) { return $this->nest(new Voice\Task($body, $attributes)); } /** * Add Action attribute. * * @param url $action Action URL * @return TwiML $this. */ public function setAction($action) { return $this->setAttribute('action', $action); } /** * Add Method attribute. * * @param httpMethod $method Action URL method * @return TwiML $this. */ public function setMethod($method) { return $this->setAttribute('method', $method); } /** * Add WaitUrl attribute. * * @param url $waitUrl Wait URL * @return TwiML $this. */ public function setWaitUrl($waitUrl) { return $this->setAttribute('waitUrl', $waitUrl); } /** * Add WaitUrlMethod attribute. * * @param httpMethod $waitUrlMethod Wait URL method * @return TwiML $this. */ public function setWaitUrlMethod($waitUrlMethod) { return $this->setAttribute('waitUrlMethod', $waitUrlMethod); } /** * Add WorkflowSid attribute. * * @param string $workflowSid TaskRouter Workflow SID * @return TwiML $this. */ public function setWorkflowSid($workflowSid) { return $this->setAttribute('workflowSid', $workflowSid); } } sdk/Twilio/TwiML/Voice/Number.php 0000604 00000004166 15174325125 0012606 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 phoneNumber $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 TwiML $this. */ public function setSendDigits($sendDigits) { return $this->setAttribute('sendDigits', $sendDigits); } /** * Add Url attribute. * * @param url $url TwiML URL * @return TwiML $this. */ public function setUrl($url) { return $this->setAttribute('url', $url); } /** * Add Method attribute. * * @param httpMethod $method TwiML URL method * @return TwiML $this. */ public function setMethod($method) { return $this->setAttribute('method', $method); } /** * Add StatusCallbackEvent attribute. * * @param number:Enum:Event $statusCallbackEvent Events to call status callback * @return TwiML $this. */ public function setStatusCallbackEvent($statusCallbackEvent) { return $this->setAttribute('statusCallbackEvent', $statusCallbackEvent); } /** * Add StatusCallback attribute. * * @param url $statusCallback Status callback URL * @return TwiML $this. */ public function setStatusCallback($statusCallback) { return $this->setAttribute('statusCallback', $statusCallback); } /** * Add StatusCallbackMethod attribute. * * @param httpMethod $statusCallbackMethod Status callback URL method * @return TwiML $this. */ public function setStatusCallbackMethod($statusCallbackMethod) { return $this->setAttribute('statusCallbackMethod', $statusCallbackMethod); } } sdk/Twilio/TwiML/Voice/Play.php 0000604 00000001641 15174325125 0012256 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 url $url Media URL * @param array $attributes Optional attributes */ public function __construct($url = null, $attributes = array()) { parent::__construct('Play', $url, $attributes); } /** * Add Loop attribute. * * @param integer $loop Times to loop media * @return TwiML $this. */ public function setLoop($loop) { return $this->setAttribute('loop', $loop); } /** * Add Digits attribute. * * @param string $digits Play DTMF tones for digits * @return TwiML $this. */ public function setDigits($digits) { return $this->setAttribute('digits', $digits); } } sdk/Twilio/TwiML/Voice/Sms.php 0000604 00000003177 15174325125 0012121 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 phoneNumber $to Number to send message to * @return TwiML $this. */ public function setTo($to) { return $this->setAttribute('to', $to); } /** * Add From attribute. * * @param phoneNumber $from Number to send message from * @return TwiML $this. */ public function setFrom($from) { return $this->setAttribute('from', $from); } /** * Add Action attribute. * * @param url $action Action URL * @return TwiML $this. */ public function setAction($action) { return $this->setAttribute('action', $action); } /** * Add Method attribute. * * @param httpMethod $method Action URL method * @return TwiML $this. */ public function setMethod($method) { return $this->setAttribute('method', $method); } /** * Add StatusCallback attribute. * * @param url $statusCallback Status callback URL * @return TwiML $this. */ public function setStatusCallback($statusCallback) { return $this->setAttribute('statusCallback', $statusCallback); } } sdk/Twilio/TwiML/Voice/Dial.php 0000604 00000014317 15174325125 0012226 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, $attributes = array()) { parent::__construct('Dial', $number, $attributes); } /** * Add Client child. * * @param string $name Client name * @param array $attributes Optional attributes * @return TwiML Child element. */ public function client($name, $attributes = array()) { return $this->nest(new Voice\Client($name, $attributes)); } /** * Add Conference child. * * @param string $name Conference name * @param array $attributes Optional attributes * @return TwiML Child element. */ public function conference($name, $attributes = array()) { return $this->nest(new Voice\Conference($name, $attributes)); } /** * Add Number child. * * @param phoneNumber $phoneNumber Phone Number to dial * @param array $attributes Optional attributes * @return TwiML Child element. */ public function number($phoneNumber, $attributes = array()) { return $this->nest(new Voice\Number($phoneNumber, $attributes)); } /** * Add Queue child. * * @param string $name Queue name * @param array $attributes Optional attributes * @return TwiML Child element. */ public function queue($name, $attributes = array()) { return $this->nest(new Voice\Queue($name, $attributes)); } /** * Add Sim child. * * @param sid $simSid SIM SID * @return TwiML Child element. */ public function sim($simSid) { return $this->nest(new Voice\Sim($simSid)); } /** * Add Sip child. * * @param url $sipUrl SIP URL * @param array $attributes Optional attributes * @return TwiML Child element. */ public function sip($sipUrl, $attributes = array()) { return $this->nest(new Voice\Sip($sipUrl, $attributes)); } /** * Add Action attribute. * * @param url $action Action URL * @return TwiML $this. */ public function setAction($action) { return $this->setAttribute('action', $action); } /** * Add Method attribute. * * @param httpMethod $method Action URL method * @return TwiML $this. */ public function setMethod($method) { return $this->setAttribute('method', $method); } /** * Add Timeout attribute. * * @param integer $timeout Time to wait for answer * @return TwiML $this. */ public function setTimeout($timeout) { return $this->setAttribute('timeout', $timeout); } /** * Add HangupOnStar attribute. * * @param boolean $hangupOnStar Hangup call on star press * @return TwiML $this. */ public function setHangupOnStar($hangupOnStar) { return $this->setAttribute('hangupOnStar', $hangupOnStar); } /** * Add TimeLimit attribute. * * @param integer $timeLimit Max time length * @return TwiML $this. */ public function setTimeLimit($timeLimit) { return $this->setAttribute('timeLimit', $timeLimit); } /** * Add CallerId attribute. * * @param string $callerId Caller ID to display * @return TwiML $this. */ public function setCallerId($callerId) { return $this->setAttribute('callerId', $callerId); } /** * Add Record attribute. * * @param dial:Enum:Record $record Record the call * @return TwiML $this. */ public function setRecord($record) { return $this->setAttribute('record', $record); } /** * Add Trim attribute. * * @param dial:Enum:Trim $trim Trim the recording * @return TwiML $this. */ public function setTrim($trim) { return $this->setAttribute('trim', $trim); } /** * Add RecordingStatusCallback attribute. * * @param url $recordingStatusCallback Recording status callback URL * @return TwiML $this. */ public function setRecordingStatusCallback($recordingStatusCallback) { return $this->setAttribute('recordingStatusCallback', $recordingStatusCallback); } /** * Add RecordingStatusCallbackMethod attribute. * * @param httpMethod $recordingStatusCallbackMethod Recording status callback * URL method * @return TwiML $this. */ public function setRecordingStatusCallbackMethod($recordingStatusCallbackMethod) { return $this->setAttribute('recordingStatusCallbackMethod', $recordingStatusCallbackMethod); } /** * Add RecordingStatusCallbackEvent attribute. * * @param dial:Enum:RecordingEvent $recordingStatusCallbackEvent Recording * status * callback events * @return TwiML $this. */ public function setRecordingStatusCallbackEvent($recordingStatusCallbackEvent) { return $this->setAttribute('recordingStatusCallbackEvent', $recordingStatusCallbackEvent); } /** * Add AnswerOnBridge attribute. * * @param boolean $answerOnBridge Preserve the ringing behavior of the inbound * call until the Dialed call picks up * @return TwiML $this. */ public function setAnswerOnBridge($answerOnBridge) { return $this->setAttribute('answerOnBridge', $answerOnBridge); } /** * Add RingTone attribute. * * @param dial:Enum:RingTone $ringTone Ringtone allows you to override the * ringback tone that Twilio will play back * to the caller while executing the Dial * @return TwiML $this. */ public function setRingTone($ringTone) { return $this->setAttribute('ringTone', $ringTone); } } sdk/Twilio/TwiML/Voice/Gather.php 0000604 00000012152 15174325125 0012562 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', $attributes); } /** * Add Say child. * * @param string $message Message to say * @param array $attributes Optional attributes * @return TwiML Child element. */ public function say($message, $attributes = array()) { return $this->nest(new Voice\Say($message, $attributes)); } /** * Add Pause child. * * @param array $attributes Optional attributes * @return TwiML Child element. */ public function pause($attributes = array()) { return $this->nest(new Voice\Pause($attributes)); } /** * Add Play child. * * @param url $url Media URL * @param array $attributes Optional attributes * @return TwiML Child element. */ public function play($url = null, $attributes = array()) { return $this->nest(new Voice\Play($url, $attributes)); } /** * Add Input attribute. * * @param gather:Enum:Input $input Input type Twilio should accept * @return TwiML $this. */ public function setInput($input) { return $this->setAttribute('input', $input); } /** * Add Action attribute. * * @param url $action Action URL * @return TwiML $this. */ public function setAction($action) { return $this->setAttribute('action', $action); } /** * Add Method attribute. * * @param httpMethod $method Action URL method * @return TwiML $this. */ public function setMethod($method) { return $this->setAttribute('method', $method); } /** * Add Timeout attribute. * * @param integer $timeout Time to wait to gather input * @return TwiML $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 TwiML $this. */ public function setSpeechTimeout($speechTimeout) { return $this->setAttribute('speechTimeout', $speechTimeout); } /** * Add MaxSpeechTime attribute. * * @param integer $maxSpeechTime Max allowed time for speech input * @return TwiML $this. */ public function setMaxSpeechTime($maxSpeechTime) { return $this->setAttribute('maxSpeechTime', $maxSpeechTime); } /** * Add ProfanityFilter attribute. * * @param boolean $profanityFilter Profanity Filter on speech * @return TwiML $this. */ public function setProfanityFilter($profanityFilter) { return $this->setAttribute('profanityFilter', $profanityFilter); } /** * Add FinishOnKey attribute. * * @param string $finishOnKey Finish gather on key * @return TwiML $this. */ public function setFinishOnKey($finishOnKey) { return $this->setAttribute('finishOnKey', $finishOnKey); } /** * Add NumDigits attribute. * * @param integer $numDigits Number of digits to collect * @return TwiML $this. */ public function setNumDigits($numDigits) { return $this->setAttribute('numDigits', $numDigits); } /** * Add PartialResultCallback attribute. * * @param url $partialResultCallback Partial result callback URL * @return TwiML $this. */ public function setPartialResultCallback($partialResultCallback) { return $this->setAttribute('partialResultCallback', $partialResultCallback); } /** * Add PartialResultCallbackMethod attribute. * * @param httpMethod $partialResultCallbackMethod Partial result callback URL * method * @return TwiML $this. */ public function setPartialResultCallbackMethod($partialResultCallbackMethod) { return $this->setAttribute('partialResultCallbackMethod', $partialResultCallbackMethod); } /** * Add Language attribute. * * @param gather:Enum:Language $language Language to use * @return TwiML $this. */ public function setLanguage($language) { return $this->setAttribute('language', $language); } /** * Add Hints attribute. * * @param string $hints Speech recognition hints * @return TwiML $this. */ public function setHints($hints) { return $this->setAttribute('hints', $hints); } /** * Add BargeIn attribute. * * @param boolean $bargeIn Stop playing media upon speech * @return TwiML $this. */ public function setBargeIn($bargeIn) { return $this->setAttribute('bargeIn', $bargeIn); } } sdk/Twilio/TwiML/Voice/Record.php 0000604 00000006512 15174325125 0012571 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', $attributes); } /** * Add Action attribute. * * @param url $action Action URL * @return TwiML $this. */ public function setAction($action) { return $this->setAttribute('action', $action); } /** * Add Method attribute. * * @param httpMethod $method Action URL method * @return TwiML $this. */ public function setMethod($method) { return $this->setAttribute('method', $method); } /** * Add Timeout attribute. * * @param integer $timeout Timeout to begin recording * @return TwiML $this. */ public function setTimeout($timeout) { return $this->setAttribute('timeout', $timeout); } /** * Add FinishOnKey attribute. * * @param string $finishOnKey Finish recording on key * @return TwiML $this. */ public function setFinishOnKey($finishOnKey) { return $this->setAttribute('finishOnKey', $finishOnKey); } /** * Add MaxLength attribute. * * @param integer $maxLength Max time to record in seconds * @return TwiML $this. */ public function setMaxLength($maxLength) { return $this->setAttribute('maxLength', $maxLength); } /** * Add PlayBeep attribute. * * @param boolean $playBeep Play beep * @return TwiML $this. */ public function setPlayBeep($playBeep) { return $this->setAttribute('playBeep', $playBeep); } /** * Add Trim attribute. * * @param record:Enum:Trim $trim Trim the recording * @return TwiML $this. */ public function setTrim($trim) { return $this->setAttribute('trim', $trim); } /** * Add RecordingStatusCallback attribute. * * @param url $recordingStatusCallback Status callback URL * @return TwiML $this. */ public function setRecordingStatusCallback($recordingStatusCallback) { return $this->setAttribute('recordingStatusCallback', $recordingStatusCallback); } /** * Add RecordingStatusCallbackMethod attribute. * * @param httpMethod $recordingStatusCallbackMethod Status callback URL method * @return TwiML $this. */ public function setRecordingStatusCallbackMethod($recordingStatusCallbackMethod) { return $this->setAttribute('recordingStatusCallbackMethod', $recordingStatusCallbackMethod); } /** * Add Transcribe attribute. * * @param boolean $transcribe Transcribe the recording * @return TwiML $this. */ public function setTranscribe($transcribe) { return $this->setAttribute('transcribe', $transcribe); } /** * Add TranscribeCallback attribute. * * @param url $transcribeCallback Transcribe callback URL * @return TwiML $this. */ public function setTranscribeCallback($transcribeCallback) { return $this->setAttribute('transcribeCallback', $transcribeCallback); } } sdk/Twilio/TwiML/Voice/Reject.php 0000604 00000001227 15174325125 0012565 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', $attributes); } /** * Add Reason attribute. * * @param reject:Enum:Reason $reason Rejection reason * @return TwiML $this. */ public function setReason($reason) { return $this->setAttribute('reason', $reason); } } sdk/Twilio/TwiML/Voice/Sim.php 0000604 00000000570 15174325125 0012101 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 sid $simSid SIM SID */ public function __construct($simSid) { parent::__construct('Sim', $simSid); } } sdk/Twilio/TwiML/Voice/Redirect.php 0000604 00000001310 15174325125 0013103 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 url $url Redirect URL * @param array $attributes Optional attributes */ public function __construct($url, $attributes = array()) { parent::__construct('Redirect', $url, $attributes); } /** * Add Method attribute. * * @param httpMethod $method Redirect URL method * @return TwiML $this. */ public function setMethod($method) { return $this->setAttribute('method', $method); } } sdk/Twilio/TwiML/Voice/Conference.php 0000604 00000013342 15174325125 0013421 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 boolean $muted Join the conference muted * @return TwiML $this. */ public function setMuted($muted) { return $this->setAttribute('muted', $muted); } /** * Add Beep attribute. * * @param conference:Enum:Beep $beep Play beep when joining * @return TwiML $this. */ public function setBeep($beep) { return $this->setAttribute('beep', $beep); } /** * Add StartConferenceOnEnter attribute. * * @param boolean $startConferenceOnEnter Start the conference on enter * @return TwiML $this. */ public function setStartConferenceOnEnter($startConferenceOnEnter) { return $this->setAttribute('startConferenceOnEnter', $startConferenceOnEnter); } /** * Add EndConferenceOnExit attribute. * * @param boolean $endConferenceOnExit End the conferenceon exit * @return TwiML $this. */ public function setEndConferenceOnExit($endConferenceOnExit) { return $this->setAttribute('endConferenceOnExit', $endConferenceOnExit); } /** * Add WaitUrl attribute. * * @param url $waitUrl Wait URL * @return TwiML $this. */ public function setWaitUrl($waitUrl) { return $this->setAttribute('waitUrl', $waitUrl); } /** * Add WaitMethod attribute. * * @param httpMethod $waitMethod Wait URL method * @return TwiML $this. */ public function setWaitMethod($waitMethod) { return $this->setAttribute('waitMethod', $waitMethod); } /** * Add MaxParticipants attribute. * * @param integer $maxParticipants Maximum number of participants * @return TwiML $this. */ public function setMaxParticipants($maxParticipants) { return $this->setAttribute('maxParticipants', $maxParticipants); } /** * Add Record attribute. * * @param conference:Enum:Record $record Record the conference * @return TwiML $this. */ public function setRecord($record) { return $this->setAttribute('record', $record); } /** * Add Region attribute. * * @param conference:Enum:Region $region Conference region * @return TwiML $this. */ public function setRegion($region) { return $this->setAttribute('region', $region); } /** * Add Whisper attribute. * * @param sid $whisper Call whisper * @return TwiML $this. */ public function setWhisper($whisper) { return $this->setAttribute('whisper', $whisper); } /** * Add Trim attribute. * * @param conference:Enum:Trim $trim Trim the conference recording * @return TwiML $this. */ public function setTrim($trim) { return $this->setAttribute('trim', $trim); } /** * Add StatusCallbackEvent attribute. * * @param conference:Enum:Event $statusCallbackEvent Events to call status * callback URL * @return TwiML $this. */ public function setStatusCallbackEvent($statusCallbackEvent) { return $this->setAttribute('statusCallbackEvent', $statusCallbackEvent); } /** * Add StatusCallback attribute. * * @param url $statusCallback Status callback URL * @return TwiML $this. */ public function setStatusCallback($statusCallback) { return $this->setAttribute('statusCallback', $statusCallback); } /** * Add StatusCallbackMethod attribute. * * @param httpMethod $statusCallbackMethod Status callback URL method * @return TwiML $this. */ public function setStatusCallbackMethod($statusCallbackMethod) { return $this->setAttribute('statusCallbackMethod', $statusCallbackMethod); } /** * Add RecordingStatusCallback attribute. * * @param url $recordingStatusCallback Recording status callback URL * @return TwiML $this. */ public function setRecordingStatusCallback($recordingStatusCallback) { return $this->setAttribute('recordingStatusCallback', $recordingStatusCallback); } /** * Add RecordingStatusCallbackMethod attribute. * * @param httpMethod $recordingStatusCallbackMethod Recording status callback * URL method * @return TwiML $this. */ public function setRecordingStatusCallbackMethod($recordingStatusCallbackMethod) { return $this->setAttribute('recordingStatusCallbackMethod', $recordingStatusCallbackMethod); } /** * Add RecordingStatusCallbackEvent attribute. * * @param conference:Enum:RecordingEvent $recordingStatusCallbackEvent Recording status callback events * @return TwiML $this. */ public function setRecordingStatusCallbackEvent($recordingStatusCallbackEvent) { return $this->setAttribute('recordingStatusCallbackEvent', $recordingStatusCallbackEvent); } /** * Add EventCallbackUrl attribute. * * @param url $eventCallbackUrl Event callback URL * @return TwiML $this. */ public function setEventCallbackUrl($eventCallbackUrl) { return $this->setAttribute('eventCallbackUrl', $eventCallbackUrl); } } sdk/Twilio/TwiML/Voice/Client.php 0000604 00000003563 15174325125 0012574 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 $name Client name * @param array $attributes Optional attributes */ public function __construct($name, $attributes = array()) { parent::__construct('Client', $name, $attributes); } /** * Add Url attribute. * * @param url $url Client URL * @return TwiML $this. */ public function setUrl($url) { return $this->setAttribute('url', $url); } /** * Add Method attribute. * * @param httpMethod $method Client URL Method * @return TwiML $this. */ public function setMethod($method) { return $this->setAttribute('method', $method); } /** * Add StatusCallbackEvent attribute. * * @param client:Enum:Event $statusCallbackEvent Events to trigger status * callback * @return TwiML $this. */ public function setStatusCallbackEvent($statusCallbackEvent) { return $this->setAttribute('statusCallbackEvent', $statusCallbackEvent); } /** * Add StatusCallback attribute. * * @param url $statusCallback Status Callback URL * @return TwiML $this. */ public function setStatusCallback($statusCallback) { return $this->setAttribute('statusCallback', $statusCallback); } /** * Add StatusCallbackMethod attribute. * * @param httpMethod $statusCallbackMethod Status Callback URL Method * @return TwiML $this. */ public function setStatusCallbackMethod($statusCallbackMethod) { return $this->setAttribute('statusCallbackMethod', $statusCallbackMethod); } } sdk/Twilio/TwiML/Voice/Sip.php 0000604 00000004402 15174325125 0012102 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 url $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 TwiML $this. */ public function setUsername($username) { return $this->setAttribute('username', $username); } /** * Add Password attribute. * * @param string $password SIP Password * @return TwiML $this. */ public function setPassword($password) { return $this->setAttribute('password', $password); } /** * Add Url attribute. * * @param url $url Action URL * @return TwiML $this. */ public function setUrl($url) { return $this->setAttribute('url', $url); } /** * Add Method attribute. * * @param httpMethod $method Action URL method * @return TwiML $this. */ public function setMethod($method) { return $this->setAttribute('method', $method); } /** * Add StatusCallbackEvent attribute. * * @param sip:Enum:Event $statusCallbackEvent Status callback events * @return TwiML $this. */ public function setStatusCallbackEvent($statusCallbackEvent) { return $this->setAttribute('statusCallbackEvent', $statusCallbackEvent); } /** * Add StatusCallback attribute. * * @param url $statusCallback Status callback URL * @return TwiML $this. */ public function setStatusCallback($statusCallback) { return $this->setAttribute('statusCallback', $statusCallback); } /** * Add StatusCallbackMethod attribute. * * @param httpMethod $statusCallbackMethod Status callback URL method * @return TwiML $this. */ public function setStatusCallbackMethod($statusCallbackMethod) { return $this->setAttribute('statusCallbackMethod', $statusCallbackMethod); } } sdk/Twilio/TwiML/Voice/Hangup.php 0000604 00000000507 15174325125 0012573 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'); } } sdk/Twilio/TwiML/Voice/Pause.php 0000604 00000001223 15174325125 0012422 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', $attributes); } /** * Add Length attribute. * * @param integer $length Length in seconds to pause * @return TwiML $this. */ public function setLength($length) { return $this->setAttribute('length', $length); } } sdk/Twilio/TwiML/Voice/Say.php 0000604 00000002236 15174325125 0012106 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 Voice attribute. * * @param say:Enum:Voice $voice Voice to use * @return TwiML $this. */ public function setVoice($voice) { return $this->setAttribute('voice', $voice); } /** * Add Loop attribute. * * @param integer $loop Times to loop message * @return TwiML $this. */ public function setLoop($loop) { return $this->setAttribute('loop', $loop); } /** * Add Language attribute. * * @param say:Enum:Language $language Message langauge * @return TwiML $this. */ public function setLanguage($language) { return $this->setAttribute('language', $language); } } sdk/Twilio/TwiML/Voice/Leave.php 0000604 00000000504 15174325125 0012402 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'); } } sdk/Twilio/TwiML/Voice/Task.php 0000604 00000001714 15174325125 0012254 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 integer $priority Task priority * @return TwiML $this. */ public function setPriority($priority) { return $this->setAttribute('priority', $priority); } /** * Add Timeout attribute. * * @param integer $timeout Timeout associated with task * @return TwiML $this. */ public function setTimeout($timeout) { return $this->setAttribute('timeout', $timeout); } } sdk/Twilio/TwiML/Voice/Echo.php 0000604 00000000502 15174325125 0012222 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'); } } sdk/Twilio/TwiML/Fax/Receive.php 0000604 00000001576 15174325125 0012413 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', $attributes); } /** * Add Action attribute. * * @param url $action Receive action URL * @return TwiML $this. */ public function setAction($action) { return $this->setAttribute('action', $action); } /** * Add Method attribute. * * @param httpMethod $method Receive action URL method * @return TwiML $this. */ public function setMethod($method) { return $this->setAttribute('method', $method); } } sdk/Twilio/Rest/Messaging/V1.php 0000604 00000004466 15174325125 0012440 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\Version; /** * @property \Twilio\Rest\Messaging\V1\ServiceList services * @method \Twilio\Rest\Messaging\V1\ServiceContext services(string $sid) */ class V1 extends Version { protected $_services = 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; } /** * Magic getter to lazy load root resources * * @param string $name Resource to return * @return \Twilio\ListResource The requested resource * @throws \Twilio\Exceptions\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 \Twilio\Exceptions\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/Twilio/Rest/Messaging/V1/ServicePage.php 0000604 00000001506 15174325125 0014625 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/Twilio/Rest/Messaging/V1/ServiceList.php 0000604 00000014456 15174325125 0014674 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Messaging\V1; 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 The friendly_name * @param array|Options $options Optional Arguments * @return ServiceInstance Newly created ServiceInstance */ 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 * @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/Twilio/Rest/Messaging/V1/ServiceInstance.php 0000604 00000014074 15174325125 0015521 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 boolean stickySender * @property boolean mmsConverter * @property boolean smartEncoding * @property string scanMessageContent * @property boolean fallbackToLongCode * @property boolean areaCodeGeomatch * @property boolean synchronousValidation * @property integer 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 * @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 */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Fetch a ServiceInstance * * @return ServiceInstance Fetched ServiceInstance */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the ServiceInstance * * @return boolean True if delete succeeds, false otherwise */ 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/Twilio/Rest/Messaging/V1/ServiceOptions.php 0000604 00000040730 15174325125 0015406 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 inbound_request_url * @param string $inboundMethod The inbound_method * @param string $fallbackUrl The fallback_url * @param string $fallbackMethod The fallback_method * @param string $statusCallback The status_callback * @param boolean $stickySender The sticky_sender * @param boolean $mmsConverter The mms_converter * @param boolean $smartEncoding The smart_encoding * @param string $scanMessageContent The scan_message_content * @param boolean $fallbackToLongCode The fallback_to_long_code * @param boolean $areaCodeGeomatch The area_code_geomatch * @param integer $validityPeriod The validity_period * @param boolean $synchronousValidation The synchronous_validation * @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 The friendly_name * @param string $inboundRequestUrl The inbound_request_url * @param string $inboundMethod The inbound_method * @param string $fallbackUrl The fallback_url * @param string $fallbackMethod The fallback_method * @param string $statusCallback The status_callback * @param boolean $stickySender The sticky_sender * @param boolean $mmsConverter The mms_converter * @param boolean $smartEncoding The smart_encoding * @param string $scanMessageContent The scan_message_content * @param boolean $fallbackToLongCode The fallback_to_long_code * @param boolean $areaCodeGeomatch The area_code_geomatch * @param integer $validityPeriod The validity_period * @param boolean $synchronousValidation The synchronous_validation * @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 inbound_request_url * @param string $inboundMethod The inbound_method * @param string $fallbackUrl The fallback_url * @param string $fallbackMethod The fallback_method * @param string $statusCallback The status_callback * @param boolean $stickySender The sticky_sender * @param boolean $mmsConverter The mms_converter * @param boolean $smartEncoding The smart_encoding * @param string $scanMessageContent The scan_message_content * @param boolean $fallbackToLongCode The fallback_to_long_code * @param boolean $areaCodeGeomatch The area_code_geomatch * @param integer $validityPeriod The validity_period * @param boolean $synchronousValidation The synchronous_validation */ 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 inbound_request_url * * @param string $inboundRequestUrl The inbound_request_url * @return $this Fluent Builder */ public function setInboundRequestUrl($inboundRequestUrl) { $this->options['inboundRequestUrl'] = $inboundRequestUrl; return $this; } /** * The inbound_method * * @param string $inboundMethod The inbound_method * @return $this Fluent Builder */ public function setInboundMethod($inboundMethod) { $this->options['inboundMethod'] = $inboundMethod; return $this; } /** * The fallback_url * * @param string $fallbackUrl The fallback_url * @return $this Fluent Builder */ public function setFallbackUrl($fallbackUrl) { $this->options['fallbackUrl'] = $fallbackUrl; return $this; } /** * The fallback_method * * @param string $fallbackMethod The fallback_method * @return $this Fluent Builder */ public function setFallbackMethod($fallbackMethod) { $this->options['fallbackMethod'] = $fallbackMethod; return $this; } /** * The status_callback * * @param string $statusCallback The status_callback * @return $this Fluent Builder */ public function setStatusCallback($statusCallback) { $this->options['statusCallback'] = $statusCallback; return $this; } /** * The sticky_sender * * @param boolean $stickySender The sticky_sender * @return $this Fluent Builder */ public function setStickySender($stickySender) { $this->options['stickySender'] = $stickySender; return $this; } /** * The mms_converter * * @param boolean $mmsConverter The mms_converter * @return $this Fluent Builder */ public function setMmsConverter($mmsConverter) { $this->options['mmsConverter'] = $mmsConverter; return $this; } /** * The smart_encoding * * @param boolean $smartEncoding The smart_encoding * @return $this Fluent Builder */ public function setSmartEncoding($smartEncoding) { $this->options['smartEncoding'] = $smartEncoding; return $this; } /** * The scan_message_content * * @param string $scanMessageContent The scan_message_content * @return $this Fluent Builder */ public function setScanMessageContent($scanMessageContent) { $this->options['scanMessageContent'] = $scanMessageContent; return $this; } /** * The fallback_to_long_code * * @param boolean $fallbackToLongCode The fallback_to_long_code * @return $this Fluent Builder */ public function setFallbackToLongCode($fallbackToLongCode) { $this->options['fallbackToLongCode'] = $fallbackToLongCode; return $this; } /** * The area_code_geomatch * * @param boolean $areaCodeGeomatch The area_code_geomatch * @return $this Fluent Builder */ public function setAreaCodeGeomatch($areaCodeGeomatch) { $this->options['areaCodeGeomatch'] = $areaCodeGeomatch; return $this; } /** * The validity_period * * @param integer $validityPeriod The validity_period * @return $this Fluent Builder */ public function setValidityPeriod($validityPeriod) { $this->options['validityPeriod'] = $validityPeriod; return $this; } /** * The synchronous_validation * * @param boolean $synchronousValidation The synchronous_validation * @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 The friendly_name * @param string $inboundRequestUrl The inbound_request_url * @param string $inboundMethod The inbound_method * @param string $fallbackUrl The fallback_url * @param string $fallbackMethod The fallback_method * @param string $statusCallback The status_callback * @param boolean $stickySender The sticky_sender * @param boolean $mmsConverter The mms_converter * @param boolean $smartEncoding The smart_encoding * @param string $scanMessageContent The scan_message_content * @param boolean $fallbackToLongCode The fallback_to_long_code * @param boolean $areaCodeGeomatch The area_code_geomatch * @param integer $validityPeriod The validity_period * @param boolean $synchronousValidation The synchronous_validation */ 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; } /** * The friendly_name * * @param string $friendlyName The friendly_name * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The inbound_request_url * * @param string $inboundRequestUrl The inbound_request_url * @return $this Fluent Builder */ public function setInboundRequestUrl($inboundRequestUrl) { $this->options['inboundRequestUrl'] = $inboundRequestUrl; return $this; } /** * The inbound_method * * @param string $inboundMethod The inbound_method * @return $this Fluent Builder */ public function setInboundMethod($inboundMethod) { $this->options['inboundMethod'] = $inboundMethod; return $this; } /** * The fallback_url * * @param string $fallbackUrl The fallback_url * @return $this Fluent Builder */ public function setFallbackUrl($fallbackUrl) { $this->options['fallbackUrl'] = $fallbackUrl; return $this; } /** * The fallback_method * * @param string $fallbackMethod The fallback_method * @return $this Fluent Builder */ public function setFallbackMethod($fallbackMethod) { $this->options['fallbackMethod'] = $fallbackMethod; return $this; } /** * The status_callback * * @param string $statusCallback The status_callback * @return $this Fluent Builder */ public function setStatusCallback($statusCallback) { $this->options['statusCallback'] = $statusCallback; return $this; } /** * The sticky_sender * * @param boolean $stickySender The sticky_sender * @return $this Fluent Builder */ public function setStickySender($stickySender) { $this->options['stickySender'] = $stickySender; return $this; } /** * The mms_converter * * @param boolean $mmsConverter The mms_converter * @return $this Fluent Builder */ public function setMmsConverter($mmsConverter) { $this->options['mmsConverter'] = $mmsConverter; return $this; } /** * The smart_encoding * * @param boolean $smartEncoding The smart_encoding * @return $this Fluent Builder */ public function setSmartEncoding($smartEncoding) { $this->options['smartEncoding'] = $smartEncoding; return $this; } /** * The scan_message_content * * @param string $scanMessageContent The scan_message_content * @return $this Fluent Builder */ public function setScanMessageContent($scanMessageContent) { $this->options['scanMessageContent'] = $scanMessageContent; return $this; } /** * The fallback_to_long_code * * @param boolean $fallbackToLongCode The fallback_to_long_code * @return $this Fluent Builder */ public function setFallbackToLongCode($fallbackToLongCode) { $this->options['fallbackToLongCode'] = $fallbackToLongCode; return $this; } /** * The area_code_geomatch * * @param boolean $areaCodeGeomatch The area_code_geomatch * @return $this Fluent Builder */ public function setAreaCodeGeomatch($areaCodeGeomatch) { $this->options['areaCodeGeomatch'] = $areaCodeGeomatch; return $this; } /** * The validity_period * * @param integer $validityPeriod The validity_period * @return $this Fluent Builder */ public function setValidityPeriod($validityPeriod) { $this->options['validityPeriod'] = $validityPeriod; return $this; } /** * The synchronous_validation * * @param boolean $synchronousValidation The synchronous_validation * @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/Twilio/Rest/Messaging/V1/ServiceContext.php 0000604 00000014422 15174325125 0015376 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 * @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 */ 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 */ 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 */ 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 \Twilio\Exceptions\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 \Twilio\Exceptions\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/Twilio/Rest/Messaging/V1/Service/PhoneNumberList.php 0000604 00000012752 15174325125 0017113 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Messaging\V1\Service; 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 service_sid * @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 phone_number_sid * @return PhoneNumberInstance Newly created PhoneNumberInstance */ 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 * @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/Twilio/Rest/Messaging/V1/Service/ShortCodePage.php 0000604 00000001563 15174325125 0016522 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/Twilio/Rest/Messaging/V1/Service/AlphaSenderContext.php 0000604 00000004110 15174325125 0017555 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Messaging\V1\Service; 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 service_sid * @param string $sid The sid * @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 */ 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 */ 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/Twilio/Rest/Messaging/V1/Service/ShortCodeList.php 0000604 00000012666 15174325125 0016567 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Messaging\V1\Service; 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 service_sid * @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 short_code_sid * @return ShortCodeInstance Newly created ShortCodeInstance */ 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 * @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/Twilio/Rest/Messaging/V1/Service/ShortCodeInstance.php 0000604 00000007761 15174325125 0017420 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 array 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 service_sid * @param string $sid The sid * @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 */ public function delete() { return $this->proxy()->delete(); } /** * Fetch a ShortCodeInstance * * @return ShortCodeInstance Fetched ShortCodeInstance */ 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/Twilio/Rest/Messaging/V1/Service/PhoneNumberPage.php 0000604 00000001571 15174325125 0017051 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/Twilio/Rest/Messaging/V1/Service/PhoneNumberInstance.php 0000604 00000010124 15174325125 0017733 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 service_sid * @param string $sid The sid * @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 */ public function delete() { return $this->proxy()->delete(); } /** * Fetch a PhoneNumberInstance * * @return PhoneNumberInstance Fetched PhoneNumberInstance */ 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/Twilio/Rest/Messaging/V1/Service/AlphaSenderInstance.php 0000604 00000007751 15174325125 0017713 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 service_sid * @param string $sid The sid * @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 */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the AlphaSenderInstance * * @return boolean True if delete succeeds, false otherwise */ 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/Twilio/Rest/Messaging/V1/Service/AlphaSenderList.php 0000604 00000012732 15174325125 0017055 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Messaging\V1\Service; 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 service_sid * @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 alpha_sender * @return AlphaSenderInstance Newly created AlphaSenderInstance */ 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 * @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/Twilio/Rest/Messaging/V1/Service/ShortCodeContext.php 0000604 00000004064 15174325125 0017271 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Messaging\V1\Service; 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 service_sid * @param string $sid The sid * @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 */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Fetch a ShortCodeInstance * * @return ShortCodeInstance Fetched ShortCodeInstance */ 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/Twilio/Rest/Messaging/V1/Service/AlphaSenderPage.php 0000604 00000001571 15174325125 0017015 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/Twilio/Rest/Messaging/V1/Service/PhoneNumberContext.php 0000604 00000004110 15174325125 0017611 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Messaging\V1\Service; 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 service_sid * @param string $sid The sid * @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 */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Fetch a PhoneNumberInstance * * @return PhoneNumberInstance Fetched PhoneNumberInstance */ 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/Twilio/Rest/Sync/V1.php 0000604 00000004411 15174325125 0011425 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 \Twilio\Exceptions\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 \Twilio\Exceptions\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/Twilio/Rest/Sync/V1/ServicePage.php 0000604 00000001474 15174325125 0013630 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/Twilio/Rest/Sync/V1/ServiceInstance.php 0000604 00000012172 15174325125 0014515 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 boolean reachabilityWebhooksEnabled * @property boolean aclEnabled * @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 * @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'), '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\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 */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the ServiceInstance * * @return boolean True if delete succeeds, false otherwise */ public function delete() { return $this->proxy()->delete(); } /** * Update the ServiceInstance * * @param array|Options $options Optional Arguments * @return ServiceInstance Updated ServiceInstance */ 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/Twilio/Rest/Sync/V1/ServiceList.php 0000604 00000013015 15174325125 0013661 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Sync\V1; 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 */ 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\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/Twilio/Rest/Sync/V1/ServiceOptions.php 0000604 00000014070 15174325125 0014403 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 The friendly_name * @param string $webhookUrl The webhook_url * @param boolean $reachabilityWebhooksEnabled The reachability_webhooks_enabled * @param boolean $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 boolean $reachabilityWebhooksEnabled The reachability_webhooks_enabled * @param boolean $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 boolean $reachabilityWebhooksEnabled The reachability_webhooks_enabled * @param boolean $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 boolean $reachabilityWebhooksEnabled The reachability_webhooks_enabled * @return $this Fluent Builder */ public function setReachabilityWebhooksEnabled($reachabilityWebhooksEnabled) { $this->options['reachabilityWebhooksEnabled'] = $reachabilityWebhooksEnabled; return $this; } /** * The acl_enabled * * @param boolean $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.Sync.V1.CreateServiceOptions ' . implode(' ', $options) . ']'; } } class UpdateServiceOptions extends Options { /** * @param string $webhookUrl The webhook_url * @param string $friendlyName The friendly_name * @param boolean $reachabilityWebhooksEnabled The reachability_webhooks_enabled * @param boolean $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 boolean $reachabilityWebhooksEnabled The reachability_webhooks_enabled * @return $this Fluent Builder */ public function setReachabilityWebhooksEnabled($reachabilityWebhooksEnabled) { $this->options['reachabilityWebhooksEnabled'] = $reachabilityWebhooksEnabled; return $this; } /** * The acl_enabled * * @param boolean $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.Sync.V1.UpdateServiceOptions ' . implode(' ', $options) . ']'; } } sdk/Twilio/Rest/Sync/V1/ServiceContext.php 0000604 00000013713 15174325125 0014377 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 * @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 */ 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 */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Update the ServiceInstance * * @param array|Options $options Optional Arguments * @return ServiceInstance Updated ServiceInstance */ 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\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 \Twilio\Exceptions\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 \Twilio\Exceptions\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/Twilio/Rest/Sync/V1/Service/DocumentOptions.php 0000604 00000007202 15174325125 0016160 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 The unique_name * @param array $data The data * @param integer $ttl The ttl * @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 The data * @param integer $ttl The ttl * @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 The unique_name * @param array $data The data * @param integer $ttl The ttl */ public function __construct($uniqueName = Values::NONE, $data = Values::NONE, $ttl = Values::NONE) { $this->options['uniqueName'] = $uniqueName; $this->options['data'] = $data; $this->options['ttl'] = $ttl; } /** * 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; } /** * The ttl * * @param integer $ttl The ttl * @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 The data * @param integer $ttl The ttl */ public function __construct($data = Values::NONE, $ttl = Values::NONE) { $this->options['data'] = $data; $this->options['ttl'] = $ttl; } /** * The data * * @param array $data The data * @return $this Fluent Builder */ public function setData($data) { $this->options['data'] = $data; return $this; } /** * The ttl * * @param integer $ttl The ttl * @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/Twilio/Rest/Sync/V1/Service/SyncStreamContext.php 0000604 00000011000 15174325125 0016452 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 service_sid * @param string $sid Stream SID or unique name. * @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 */ 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 */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Update the SyncStreamInstance * * @param array|Options $options Optional Arguments * @return SyncStreamInstance Updated SyncStreamInstance */ 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 \Twilio\Exceptions\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 \Twilio\Exceptions\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/Twilio/Rest/Sync/V1/Service/SyncMapPage.php 0000604 00000001543 15174325125 0015177 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/Twilio/Rest/Sync/V1/Service/SyncStreamList.php 0000604 00000013062 15174325125 0015753 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Sync\V1\Service; 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 Service Instance SID. * @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 */ 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 Stream SID or unique name. * @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/Twilio/Rest/Sync/V1/Service/Document/DocumentPermissionInstance.php 0000604 00000011021 15174325125 0022112 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 boolean read * @property boolean write * @property boolean 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\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 */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the DocumentPermissionInstance * * @return boolean True if delete succeeds, false otherwise */ public function delete() { return $this->proxy()->delete(); } /** * Update the DocumentPermissionInstance * * @param boolean $read Read access. * @param boolean $write Write access. * @param boolean $manage Manage access. * @return DocumentPermissionInstance Updated DocumentPermissionInstance */ 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/Twilio/Rest/Sync/V1/Service/Document/DocumentPermissionContext.php 0000604 00000006662 15174325125 0022011 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Sync\V1\Service\Document; 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 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\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 */ 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 */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Update the DocumentPermissionInstance * * @param boolean $read Read access. * @param boolean $write Write access. * @param boolean $manage Manage access. * @return DocumentPermissionInstance Updated DocumentPermissionInstance */ 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/Twilio/Rest/Sync/V1/Service/Document/DocumentPermissionPage.php 0000604 00000001747 15174325125 0021240 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/Twilio/Rest/Sync/V1/Service/Document/DocumentPermissionList.php 0000604 00000012632 15174325125 0021272 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 Sync Service Instance SID. * @param string $documentSid 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 Identity of the user to whom the Sync Document * Permission applies. * @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/Twilio/Rest/Sync/V1/Service/SyncStreamOptions.php 0000604 00000006306 15174325125 0016476 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 Stream unique name. * @param integer $ttl Stream TTL. * @return CreateSyncStreamOptions Options builder */ public static function create($uniqueName = Values::NONE, $ttl = Values::NONE) { return new CreateSyncStreamOptions($uniqueName, $ttl); } /** * @param integer $ttl Stream TTL. * @return UpdateSyncStreamOptions Options builder */ public static function update($ttl = Values::NONE) { return new UpdateSyncStreamOptions($ttl); } } class CreateSyncStreamOptions extends Options { /** * @param string $uniqueName Stream unique name. * @param integer $ttl Stream TTL. */ public function __construct($uniqueName = Values::NONE, $ttl = Values::NONE) { $this->options['uniqueName'] = $uniqueName; $this->options['ttl'] = $ttl; } /** * The unique and addressable name of this Stream. Optional, up to 256 characters long. * * @param string $uniqueName Stream unique name. * @return $this Fluent Builder */ public function setUniqueName($uniqueName) { $this->options['uniqueName'] = $uniqueName; return $this; } /** * Optional time-to-live of this Stream in seconds. In the range [1, 31 536 000 (1 year)], or 0 for infinity. * * @param integer $ttl Stream TTL. * @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 integer $ttl Stream TTL. */ public function __construct($ttl = Values::NONE) { $this->options['ttl'] = $ttl; } /** * Time-to-live of this Stream in seconds. In the range [1, 31 536 000 (1 year)], or 0 for infinity. * * @param integer $ttl Stream TTL. * @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/Twilio/Rest/Sync/V1/Service/DocumentContext.php 0000604 00000011341 15174325125 0016150 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 service_sid * @param string $sid The sid * @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 */ 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 */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Update the DocumentInstance * * @param array|Options $options Optional Arguments * @return DocumentInstance Updated DocumentInstance */ 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 \Twilio\Exceptions\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 \Twilio\Exceptions\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/Twilio/Rest/Sync/V1/Service/DocumentList.php 0000604 00000013151 15174325125 0015440 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Sync\V1\Service; 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 service_sid * @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 */ 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 * @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/Twilio/Rest/Sync/V1/Service/SyncMapList.php 0000604 00000012732 15174325125 0015240 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Sync\V1\Service; 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 service_sid * @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 */ 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 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\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/Twilio/Rest/Sync/V1/Service/SyncStreamPage.php 0000604 00000001554 15174325125 0015717 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/Twilio/Rest/Sync/V1/Service/SyncList/SyncListItemContext.php 0000604 00000006065 15174325125 0020540 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Sync\V1\Service\SyncList; 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 service_sid * @param string $listSid The list_sid * @param integer $index The index * @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 */ 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 */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Update the SyncListItemInstance * * @param array|Options $options Optional Arguments * @return SyncListItemInstance Updated SyncListItemInstance */ 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 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/Twilio/Rest/Sync/V1/Service/SyncList/SyncListItemOptions.php 0000604 00000011274 15174325125 0020545 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 integer $ttl The ttl * @return CreateSyncListItemOptions Options builder */ public static function create($ttl = Values::NONE) { return new CreateSyncListItemOptions($ttl); } /** * @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); } /** * @param array $data The data * @param integer $ttl The ttl * @return UpdateSyncListItemOptions Options builder */ public static function update($data = Values::NONE, $ttl = Values::NONE) { return new UpdateSyncListItemOptions($data, $ttl); } } class CreateSyncListItemOptions extends Options { /** * @param integer $ttl The ttl */ public function __construct($ttl = Values::NONE) { $this->options['ttl'] = $ttl; } /** * The ttl * * @param integer $ttl The ttl * @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.CreateSyncListItemOptions ' . implode(' ', $options) . ']'; } } 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.Sync.V1.ReadSyncListItemOptions ' . implode(' ', $options) . ']'; } } class UpdateSyncListItemOptions extends Options { /** * @param array $data The data * @param integer $ttl The ttl */ public function __construct($data = Values::NONE, $ttl = Values::NONE) { $this->options['data'] = $data; $this->options['ttl'] = $ttl; } /** * The data * * @param array $data The data * @return $this Fluent Builder */ public function setData($data) { $this->options['data'] = $data; return $this; } /** * The ttl * * @param integer $ttl The ttl * @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.UpdateSyncListItemOptions ' . implode(' ', $options) . ']'; } } sdk/Twilio/Rest/Sync/V1/Service/SyncList/SyncListPermissionContext.php 0000604 00000006535 15174325125 0021774 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Sync\V1\Service\SyncList; 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 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\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 */ 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 */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Update the SyncListPermissionInstance * * @param boolean $read Read access. * @param boolean $write Write access. * @param boolean $manage Manage access. * @return SyncListPermissionInstance Updated SyncListPermissionInstance */ 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/Twilio/Rest/Sync/V1/Service/SyncList/SyncListItemInstance.php 0000604 00000011431 15174325125 0020651 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 integer 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 service_sid * @param string $listSid The list_sid * @param integer $index The index * @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 */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the SyncListItemInstance * * @return boolean True if delete succeeds, false otherwise */ public function delete() { return $this->proxy()->delete(); } /** * Update the SyncListItemInstance * * @param array|Options $options Optional Arguments * @return SyncListItemInstance Updated SyncListItemInstance */ 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/Twilio/Rest/Sync/V1/Service/SyncList/SyncListItemList.php 0000604 00000014537 15174325125 0020032 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Sync\V1\Service\SyncList; 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 service_sid * @param string $listSid The list_sid * @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 The data * @param array|Options $options Optional Arguments * @return SyncListItemInstance Newly created SyncListItemInstance */ public function create($data, $options = array()) { $options = new Values($options); $data = Values::of(array('Data' => Serialize::jsonObject($data), 'Ttl' => $options['ttl'], )); $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 integer $index The index * @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/Twilio/Rest/Sync/V1/Service/SyncList/SyncListPermissionInstance.php 0000604 00000010751 15174325125 0022107 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 boolean read * @property boolean write * @property boolean 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\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 */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the SyncListPermissionInstance * * @return boolean True if delete succeeds, false otherwise */ public function delete() { return $this->proxy()->delete(); } /** * Update the SyncListPermissionInstance * * @param boolean $read Read access. * @param boolean $write Write access. * @param boolean $manage Manage access. * @return SyncListPermissionInstance Updated SyncListPermissionInstance */ 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/Twilio/Rest/Sync/V1/Service/SyncList/SyncListPermissionPage.php 0000604 00000001743 15174325125 0021220 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/Twilio/Rest/Sync/V1/Service/SyncList/SyncListItemPage.php 0000604 00000001721 15174325125 0017762 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/Twilio/Rest/Sync/V1/Service/SyncList/SyncListPermissionList.php 0000604 00000012566 15174325125 0021264 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 Sync Service Instance SID. * @param string $listSid Sync List SID. * @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 Identity of the user to whom the Sync List * Permission applies. * @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/Twilio/Rest/Sync/V1/Service/SyncMap/SyncMapItemPage.php 0000604 00000001714 15174325125 0017370 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/Twilio/Rest/Sync/V1/Service/SyncMap/SyncMapItemList.php 0000604 00000014632 15174325125 0017432 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Sync\V1\Service\SyncMap; 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 service_sid * @param string $mapSid The map_sid * @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 key * @param array $data The data * @param array|Options $options Optional Arguments * @return SyncMapItemInstance Newly created SyncMapItemInstance */ public function create($key, $data, $options = array()) { $options = new Values($options); $data = Values::of(array( 'Key' => $key, 'Data' => Serialize::jsonObject($data), 'Ttl' => $options['ttl'], )); $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\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/Twilio/Rest/Sync/V1/Service/SyncMap/SyncMapItemInstance.php 0000604 00000011345 15174325125 0020261 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 service_sid * @param string $mapSid The map_sid * @param string $key The key * @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 */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the SyncMapItemInstance * * @return boolean True if delete succeeds, false otherwise */ public function delete() { return $this->proxy()->delete(); } /** * Update the SyncMapItemInstance * * @param array|Options $options Optional Arguments * @return SyncMapItemInstance Updated SyncMapItemInstance */ 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/Twilio/Rest/Sync/V1/Service/SyncMap/SyncMapPermissionList.php 0000604 00000012523 15174325125 0020661 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 Sync Service Instance SID. * @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 Identity of the user to whom the Sync Map Permission * applies. * @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/Twilio/Rest/Sync/V1/Service/SyncMap/SyncMapPermissionInstance.php 0000604 00000010716 15174325125 0021514 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 boolean read * @property boolean write * @property boolean 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\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 */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the SyncMapPermissionInstance * * @return boolean True if delete succeeds, false otherwise */ public function delete() { return $this->proxy()->delete(); } /** * Update the SyncMapPermissionInstance * * @param boolean $read Read access. * @param boolean $write Write access. * @param boolean $manage Manage access. * @return SyncMapPermissionInstance Updated SyncMapPermissionInstance */ 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/Twilio/Rest/Sync/V1/Service/SyncMap/SyncMapItemOptions.php 0000604 00000011256 15174325125 0020151 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 integer $ttl The ttl * @return CreateSyncMapItemOptions Options builder */ public static function create($ttl = Values::NONE) { return new CreateSyncMapItemOptions($ttl); } /** * @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); } /** * @param array $data The data * @param integer $ttl The ttl * @return UpdateSyncMapItemOptions Options builder */ public static function update($data = Values::NONE, $ttl = Values::NONE) { return new UpdateSyncMapItemOptions($data, $ttl); } } class CreateSyncMapItemOptions extends Options { /** * @param integer $ttl The ttl */ public function __construct($ttl = Values::NONE) { $this->options['ttl'] = $ttl; } /** * The ttl * * @param integer $ttl The ttl * @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.CreateSyncMapItemOptions ' . implode(' ', $options) . ']'; } } 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.Sync.V1.ReadSyncMapItemOptions ' . implode(' ', $options) . ']'; } } class UpdateSyncMapItemOptions extends Options { /** * @param array $data The data * @param integer $ttl The ttl */ public function __construct($data = Values::NONE, $ttl = Values::NONE) { $this->options['data'] = $data; $this->options['ttl'] = $ttl; } /** * The data * * @param array $data The data * @return $this Fluent Builder */ public function setData($data) { $this->options['data'] = $data; return $this; } /** * The ttl * * @param integer $ttl The ttl * @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.UpdateSyncMapItemOptions ' . implode(' ', $options) . ']'; } } sdk/Twilio/Rest/Sync/V1/Service/SyncMap/SyncMapPermissionContext.php 0000604 00000006504 15174325125 0021374 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Sync\V1\Service\SyncMap; 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 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\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 */ 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 */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Update the SyncMapPermissionInstance * * @param boolean $read Read access. * @param boolean $write Write access. * @param boolean $manage Manage access. * @return SyncMapPermissionInstance Updated SyncMapPermissionInstance */ 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/Twilio/Rest/Sync/V1/Service/SyncMap/SyncMapPermissionPage.php 0000604 00000001736 15174325125 0020626 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/Twilio/Rest/Sync/V1/Service/SyncMap/SyncMapItemContext.php 0000604 00000006014 15174325125 0020136 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Sync\V1\Service\SyncMap; 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 service_sid * @param string $mapSid The map_sid * @param string $key The key * @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 */ 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 */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Update the SyncMapItemInstance * * @param array|Options $options Optional Arguments * @return SyncMapItemInstance Updated SyncMapItemInstance */ 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 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/Twilio/Rest/Sync/V1/Service/DocumentPage.php 0000604 00000001546 15174325125 0015406 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/Twilio/Rest/Sync/V1/Service/SyncMapOptions.php 0000604 00000005605 15174325125 0015761 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 The unique_name * @param integer $ttl The ttl * @return CreateSyncMapOptions Options builder */ public static function create($uniqueName = Values::NONE, $ttl = Values::NONE) { return new CreateSyncMapOptions($uniqueName, $ttl); } /** * @param integer $ttl The ttl * @return UpdateSyncMapOptions Options builder */ public static function update($ttl = Values::NONE) { return new UpdateSyncMapOptions($ttl); } } class CreateSyncMapOptions extends Options { /** * @param string $uniqueName The unique_name * @param integer $ttl The ttl */ public function __construct($uniqueName = Values::NONE, $ttl = Values::NONE) { $this->options['uniqueName'] = $uniqueName; $this->options['ttl'] = $ttl; } /** * The unique_name * * @param string $uniqueName The unique_name * @return $this Fluent Builder */ public function setUniqueName($uniqueName) { $this->options['uniqueName'] = $uniqueName; return $this; } /** * The ttl * * @param integer $ttl The ttl * @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.CreateSyncMapOptions ' . implode(' ', $options) . ']'; } } class UpdateSyncMapOptions extends Options { /** * @param integer $ttl The ttl */ public function __construct($ttl = Values::NONE) { $this->options['ttl'] = $ttl; } /** * The ttl * * @param integer $ttl The ttl * @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.UpdateSyncMapOptions ' . implode(' ', $options) . ']'; } } sdk/Twilio/Rest/Sync/V1/Service/SyncMapContext.php 0000604 00000012436 15174325125 0015752 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 service_sid * @param string $sid The sid * @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 */ 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 */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Update the SyncMapInstance * * @param array|Options $options Optional Arguments * @return SyncMapInstance Updated SyncMapInstance */ 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 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 \Twilio\Exceptions\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 \Twilio\Exceptions\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/Twilio/Rest/Sync/V1/Service/SyncStream/StreamMessageList.php 0000604 00000003602 15174325125 0020512 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Sync\V1\Service\SyncStream; 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 Service Instance SID. * @param string $streamSid Stream SID. * @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 Stream Message body. * @return StreamMessageInstance Newly created StreamMessageInstance */ 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/Twilio/Rest/Sync/V1/Service/SyncStream/StreamMessagePage.php 0000604 00000001730 15174325125 0020453 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/Twilio/Rest/Sync/V1/Service/SyncStream/StreamMessageInstance.php 0000604 00000004046 15174325125 0021346 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 Service Instance SID. * @param string $streamSid Stream SID. * @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/Twilio/Rest/Sync/V1/Service/SyncMapInstance.php 0000604 00000011721 15174325125 0016066 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 service_sid * @param string $sid The sid * @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 */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the SyncMapInstance * * @return boolean True if delete succeeds, false otherwise */ public function delete() { return $this->proxy()->delete(); } /** * Update the SyncMapInstance * * @param array|Options $options Optional Arguments * @return SyncMapInstance Updated SyncMapInstance */ 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/Twilio/Rest/Sync/V1/Service/DocumentInstance.php 0000604 00000011471 15174325125 0016274 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 service_sid * @param string $sid The sid * @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 */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the DocumentInstance * * @return boolean True if delete succeeds, false otherwise */ public function delete() { return $this->proxy()->delete(); } /** * Update the DocumentInstance * * @param array|Options $options Optional Arguments * @return DocumentInstance Updated DocumentInstance */ 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/Twilio/Rest/Sync/V1/Service/SyncListPage.php 0000604 00000001546 15174325125 0015400 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/Twilio/Rest/Sync/V1/Service/SyncListInstance.php 0000604 00000011754 15174325125 0016272 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 service_sid * @param string $sid The sid * @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 */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the SyncListInstance * * @return boolean True if delete succeeds, false otherwise */ public function delete() { return $this->proxy()->delete(); } /** * Update the SyncListInstance * * @param array|Options $options Optional Arguments * @return SyncListInstance Updated SyncListInstance */ 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/Twilio/Rest/Sync/V1/Service/SyncListContext.php 0000604 00000012521 15174325125 0016143 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(integer $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 service_sid * @param string $sid The sid * @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 */ 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 */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Update the SyncListInstance * * @param array|Options $options Optional Arguments * @return SyncListInstance Updated SyncListInstance */ 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 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 \Twilio\Exceptions\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 \Twilio\Exceptions\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/Twilio/Rest/Sync/V1/Service/SyncListList.php 0000604 00000012757 15174325125 0015445 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Sync\V1\Service; 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 service_sid * @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 */ 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 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\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/Twilio/Rest/Sync/V1/Service/SyncStreamInstance.php 0000604 00000011246 15174325125 0016606 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 Service Instance SID. * @param string $sid Stream SID or unique name. * @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 */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the SyncStreamInstance * * @return boolean True if delete succeeds, false otherwise */ public function delete() { return $this->proxy()->delete(); } /** * Update the SyncStreamInstance * * @param array|Options $options Optional Arguments * @return SyncStreamInstance Updated SyncStreamInstance */ 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/Twilio/Rest/Sync/V1/Service/SyncListOptions.php 0000604 00000005616 15174325125 0016161 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 The unique_name * @param integer $ttl The ttl * @return CreateSyncListOptions Options builder */ public static function create($uniqueName = Values::NONE, $ttl = Values::NONE) { return new CreateSyncListOptions($uniqueName, $ttl); } /** * @param integer $ttl The ttl * @return UpdateSyncListOptions Options builder */ public static function update($ttl = Values::NONE) { return new UpdateSyncListOptions($ttl); } } class CreateSyncListOptions extends Options { /** * @param string $uniqueName The unique_name * @param integer $ttl The ttl */ public function __construct($uniqueName = Values::NONE, $ttl = Values::NONE) { $this->options['uniqueName'] = $uniqueName; $this->options['ttl'] = $ttl; } /** * The unique_name * * @param string $uniqueName The unique_name * @return $this Fluent Builder */ public function setUniqueName($uniqueName) { $this->options['uniqueName'] = $uniqueName; return $this; } /** * The ttl * * @param integer $ttl The ttl * @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.CreateSyncListOptions ' . implode(' ', $options) . ']'; } } class UpdateSyncListOptions extends Options { /** * @param integer $ttl The ttl */ public function __construct($ttl = Values::NONE) { $this->options['ttl'] = $ttl; } /** * The ttl * * @param integer $ttl The ttl * @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.UpdateSyncListOptions ' . implode(' ', $options) . ']'; } } sdk/Twilio/Rest/Taskrouter/V1.php 0000604 00000004527 15174325125 0012664 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 \Twilio\Exceptions\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 \Twilio\Exceptions\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/Twilio/Rest/Taskrouter/V1/Workspace/WorkflowPage.php 0000604 00000001405 15174325125 0017221 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/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueuePage.php 0000604 00000001410 15174325125 0017312 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/Twilio/Rest/Taskrouter/V1/Workspace/TaskContext.php 0000604 00000011241 15174325125 0017060 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 workspace_sid * @param string $sid The sid * @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 */ 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 */ 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 */ 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 \Twilio\Exceptions\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 \Twilio\Exceptions\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/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceStatisticsOptions.php 0000604 00000006517 15174325125 0022210 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 integer $minutes The minutes * @param \DateTime $startDate The start_date * @param \DateTime $endDate The end_date * @param string $taskChannel The task_channel * @param string $splitByWaitTime The split_by_wait_time * @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 integer $minutes The minutes * @param \DateTime $startDate The start_date * @param \DateTime $endDate The end_date * @param string $taskChannel The task_channel * @param string $splitByWaitTime The split_by_wait_time */ 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; } /** * The minutes * * @param integer $minutes The minutes * @return $this Fluent Builder */ public function setMinutes($minutes) { $this->options['minutes'] = $minutes; return $this; } /** * The start_date * * @param \DateTime $startDate The start_date * @return $this Fluent Builder */ public function setStartDate($startDate) { $this->options['startDate'] = $startDate; return $this; } /** * The end_date * * @param \DateTime $endDate The end_date * @return $this Fluent Builder */ public function setEndDate($endDate) { $this->options['endDate'] = $endDate; return $this; } /** * The task_channel * * @param string $taskChannel The task_channel * @return $this Fluent Builder */ public function setTaskChannel($taskChannel) { $this->options['taskChannel'] = $taskChannel; return $this; } /** * The split_by_wait_time * * @param string $splitByWaitTime The split_by_wait_time * @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/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceStatisticsList.php 0000604 00000002343 15174325125 0021461 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 workspace_sid * @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/Twilio/Rest/Taskrouter/V1/Workspace/EventList.php 0000604 00000013106 15174325125 0016530 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 * @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'], '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 * @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/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceStatisticsContext.php 0000604 00000004207 15174325125 0022173 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace; 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 workspace_sid * @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 */ 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/Twilio/Rest/Taskrouter/V1/Workspace/TaskOptions.php 0000604 00000026721 15174325125 0017100 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 attributes * @param string $assignmentStatus The assignment_status * @param string $reason The reason * @param integer $priority The priority * @param string $taskChannel The task_channel * @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 integer $priority The priority * @param string $assignmentStatus The assignment_status * @param string $workflowSid The workflow_sid * @param string $workflowName The workflow_name * @param string $taskQueueSid The task_queue_sid * @param string $taskQueueName The task_queue_name * @param string $evaluateTaskAttributes The evaluate_task_attributes * @param string $ordering The ordering * @param boolean $hasAddons The has_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 integer $timeout The timeout * @param integer $priority The priority * @param string $taskChannel The task_channel * @param string $workflowSid The workflow_sid * @param string $attributes The attributes * @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 attributes * @param string $assignmentStatus The assignment_status * @param string $reason The reason * @param integer $priority The priority * @param string $taskChannel The task_channel */ 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 attributes * * @param string $attributes The attributes * @return $this Fluent Builder */ public function setAttributes($attributes) { $this->options['attributes'] = $attributes; return $this; } /** * The assignment_status * * @param string $assignmentStatus The assignment_status * @return $this Fluent Builder */ public function setAssignmentStatus($assignmentStatus) { $this->options['assignmentStatus'] = $assignmentStatus; return $this; } /** * The reason * * @param string $reason The reason * @return $this Fluent Builder */ public function setReason($reason) { $this->options['reason'] = $reason; return $this; } /** * The priority * * @param integer $priority The priority * @return $this Fluent Builder */ public function setPriority($priority) { $this->options['priority'] = $priority; return $this; } /** * The task_channel * * @param string $taskChannel The task_channel * @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 integer $priority The priority * @param string $assignmentStatus The assignment_status * @param string $workflowSid The workflow_sid * @param string $workflowName The workflow_name * @param string $taskQueueSid The task_queue_sid * @param string $taskQueueName The task_queue_name * @param string $evaluateTaskAttributes The evaluate_task_attributes * @param string $ordering The ordering * @param boolean $hasAddons The has_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 * * @param integer $priority The priority * @return $this Fluent Builder */ public function setPriority($priority) { $this->options['priority'] = $priority; return $this; } /** * The assignment_status * * @param string $assignmentStatus The assignment_status * @return $this Fluent Builder */ public function setAssignmentStatus($assignmentStatus) { $this->options['assignmentStatus'] = $assignmentStatus; return $this; } /** * The workflow_sid * * @param string $workflowSid The workflow_sid * @return $this Fluent Builder */ public function setWorkflowSid($workflowSid) { $this->options['workflowSid'] = $workflowSid; return $this; } /** * The workflow_name * * @param string $workflowName The workflow_name * @return $this Fluent Builder */ public function setWorkflowName($workflowName) { $this->options['workflowName'] = $workflowName; return $this; } /** * The task_queue_sid * * @param string $taskQueueSid The task_queue_sid * @return $this Fluent Builder */ public function setTaskQueueSid($taskQueueSid) { $this->options['taskQueueSid'] = $taskQueueSid; return $this; } /** * The task_queue_name * * @param string $taskQueueName The task_queue_name * @return $this Fluent Builder */ public function setTaskQueueName($taskQueueName) { $this->options['taskQueueName'] = $taskQueueName; return $this; } /** * The evaluate_task_attributes * * @param string $evaluateTaskAttributes The evaluate_task_attributes * @return $this Fluent Builder */ public function setEvaluateTaskAttributes($evaluateTaskAttributes) { $this->options['evaluateTaskAttributes'] = $evaluateTaskAttributes; return $this; } /** * The ordering * * @param string $ordering The ordering * @return $this Fluent Builder */ public function setOrdering($ordering) { $this->options['ordering'] = $ordering; return $this; } /** * The has_addons * * @param boolean $hasAddons The has_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 integer $timeout The timeout * @param integer $priority The priority * @param string $taskChannel The task_channel * @param string $workflowSid The workflow_sid * @param string $attributes The attributes */ 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 timeout * * @param integer $timeout The timeout * @return $this Fluent Builder */ public function setTimeout($timeout) { $this->options['timeout'] = $timeout; return $this; } /** * The priority * * @param integer $priority The priority * @return $this Fluent Builder */ public function setPriority($priority) { $this->options['priority'] = $priority; return $this; } /** * The task_channel * * @param string $taskChannel The task_channel * @return $this Fluent Builder */ public function setTaskChannel($taskChannel) { $this->options['taskChannel'] = $taskChannel; return $this; } /** * The workflow_sid * * @param string $workflowSid The workflow_sid * @return $this Fluent Builder */ public function setWorkflowSid($workflowSid) { $this->options['workflowSid'] = $workflowSid; return $this; } /** * The attributes * * @param string $attributes The attributes * @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/Twilio/Rest/Taskrouter/V1/Workspace/TaskChannelList.php 0000604 00000011551 15174325125 0017644 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace; use Twilio\ListResource; 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 workspace_sid * @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); } /** * Constructs a TaskChannelContext * * @param string $sid The sid * @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/Twilio/Rest/Taskrouter/V1/Workspace/WorkerList.php 0000604 00000017664 15174325125 0016735 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 workspace_sid * @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 The friendly_name * @param array|Options $options Optional Arguments * @return WorkerInstance Newly created WorkerInstance */ 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 * @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 \Twilio\Exceptions\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 \Twilio\Exceptions\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/Twilio/Rest/Taskrouter/V1/Workspace/EventOptions.php 0000604 00000012104 15174325125 0017245 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 The end_date * @param string $eventType The event_type * @param integer $minutes The minutes * @param string $reservationSid The reservation_sid * @param \DateTime $startDate The start_date * @param string $taskQueueSid The task_queue_sid * @param string $taskSid The task_sid * @param string $workerSid The worker_sid * @param string $workflowSid The workflow_sid * @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) { return new ReadEventOptions($endDate, $eventType, $minutes, $reservationSid, $startDate, $taskQueueSid, $taskSid, $workerSid, $workflowSid); } } class ReadEventOptions extends Options { /** * @param \DateTime $endDate The end_date * @param string $eventType The event_type * @param integer $minutes The minutes * @param string $reservationSid The reservation_sid * @param \DateTime $startDate The start_date * @param string $taskQueueSid The task_queue_sid * @param string $taskSid The task_sid * @param string $workerSid The worker_sid * @param string $workflowSid The workflow_sid */ 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) { $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; } /** * The end_date * * @param \DateTime $endDate The end_date * @return $this Fluent Builder */ public function setEndDate($endDate) { $this->options['endDate'] = $endDate; return $this; } /** * The event_type * * @param string $eventType The event_type * @return $this Fluent Builder */ public function setEventType($eventType) { $this->options['eventType'] = $eventType; return $this; } /** * The minutes * * @param integer $minutes The minutes * @return $this Fluent Builder */ public function setMinutes($minutes) { $this->options['minutes'] = $minutes; return $this; } /** * The reservation_sid * * @param string $reservationSid The reservation_sid * @return $this Fluent Builder */ public function setReservationSid($reservationSid) { $this->options['reservationSid'] = $reservationSid; return $this; } /** * The start_date * * @param \DateTime $startDate The start_date * @return $this Fluent Builder */ public function setStartDate($startDate) { $this->options['startDate'] = $startDate; return $this; } /** * The task_queue_sid * * @param string $taskQueueSid The task_queue_sid * @return $this Fluent Builder */ public function setTaskQueueSid($taskQueueSid) { $this->options['taskQueueSid'] = $taskQueueSid; return $this; } /** * The task_sid * * @param string $taskSid The task_sid * @return $this Fluent Builder */ public function setTaskSid($taskSid) { $this->options['taskSid'] = $taskSid; return $this; } /** * The worker_sid * * @param string $workerSid The worker_sid * @return $this Fluent Builder */ public function setWorkerSid($workerSid) { $this->options['workerSid'] = $workerSid; return $this; } /** * The workflow_sid * * @param string $workflowSid The workflow_sid * @return $this Fluent Builder */ public function setWorkflowSid($workflowSid) { $this->options['workflowSid'] = $workflowSid; return $this; } /** * Provide a friendly representation * * @return 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/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceCumulativeStatisticsContext.php 0000604 00000004504 15174325125 0024232 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace; 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 workspace_sid * @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 */ 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/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceCumulativeStatisticsInstance.php 0000604 00000013074 15174325125 0024354 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 integer avgTaskAcceptanceTime * @property \DateTime startTime * @property \DateTime endTime * @property integer reservationsCreated * @property integer reservationsAccepted * @property integer reservationsRejected * @property integer reservationsTimedOut * @property integer reservationsCanceled * @property integer reservationsRescinded * @property array splitByWaitTime * @property array waitDurationUntilAccepted * @property array waitDurationUntilCanceled * @property integer tasksCanceled * @property integer tasksCompleted * @property integer tasksCreated * @property integer tasksDeleted * @property integer tasksMoved * @property integer 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 workspace_sid * @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 */ 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/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceCumulativeStatisticsOptions.php 0000604 00000006601 15174325125 0024241 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 The end_date * @param integer $minutes The minutes * @param \DateTime $startDate The start_date * @param string $taskChannel The task_channel * @param string $splitByWaitTime The split_by_wait_time * @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 The end_date * @param integer $minutes The minutes * @param \DateTime $startDate The start_date * @param string $taskChannel The task_channel * @param string $splitByWaitTime The split_by_wait_time */ 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; } /** * The end_date * * @param \DateTime $endDate The end_date * @return $this Fluent Builder */ public function setEndDate($endDate) { $this->options['endDate'] = $endDate; return $this; } /** * The minutes * * @param integer $minutes The minutes * @return $this Fluent Builder */ public function setMinutes($minutes) { $this->options['minutes'] = $minutes; return $this; } /** * The start_date * * @param \DateTime $startDate The start_date * @return $this Fluent Builder */ public function setStartDate($startDate) { $this->options['startDate'] = $startDate; return $this; } /** * The task_channel * * @param string $taskChannel The task_channel * @return $this Fluent Builder */ public function setTaskChannel($taskChannel) { $this->options['taskChannel'] = $taskChannel; return $this; } /** * The split_by_wait_time * * @param string $splitByWaitTime The split_by_wait_time * @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/Twilio/Rest/Taskrouter/V1/Workspace/EventContext.php 0000604 00000003326 15174325125 0017244 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace; 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 workspace_sid * @param string $sid The sid * @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 */ 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/Twilio/Rest/Taskrouter/V1/Workspace/ActivityContext.php 0000604 00000005201 15174325125 0017751 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace; 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 workspace_sid * @param string $sid The sid * @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 */ 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 */ 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 */ 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/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueueList.php 0000604 00000020120 15174325125 0017350 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 workspace_sid * @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 The friendly_name * @param string $reservationActivitySid The reservation_activity_sid * @param string $assignmentActivitySid The assignment_activity_sid * @param array|Options $options Optional Arguments * @return TaskQueueInstance Newly created TaskQueueInstance */ public function create($friendlyName, $reservationActivitySid, $assignmentActivitySid, $options = array()) { $options = new Values($options); $data = Values::of(array( 'FriendlyName' => $friendlyName, 'ReservationActivitySid' => $reservationActivitySid, 'AssignmentActivitySid' => $assignmentActivitySid, 'TargetWorkers' => $options['targetWorkers'], 'MaxReservedWorkers' => $options['maxReservedWorkers'], 'TaskOrder' => $options['taskOrder'], )); $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 * @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 \Twilio\Exceptions\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 \Twilio\Exceptions\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/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceStatisticsPage.php 0000604 00000001446 15174325125 0021425 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/Twilio/Rest/Taskrouter/V1/Workspace/WorkflowList.php 0000604 00000014250 15174325125 0017262 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\Values; use Twilio\Version; class WorkflowList extends ListResource { /** * Construct the WorkflowList * * @param Version $version Version that contains the resource * @param string $workspaceSid The workspace_sid * @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 The friendly_name * @param string $configuration The configuration * @param array|Options $options Optional Arguments * @return WorkflowInstance Newly created WorkflowInstance */ 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 * @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/Twilio/Rest/Taskrouter/V1/Workspace/WorkerPage.php 0000604 00000001377 15174325125 0016670 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/Twilio/Rest/Taskrouter/V1/Workspace/TaskChannelPage.php 0000604 00000001416 15174325125 0017604 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/Twilio/Rest/Taskrouter/V1/Workspace/EventPage.php 0000604 00000001374 15174325125 0016475 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/Twilio/Rest/Taskrouter/V1/Workspace/ActivityOptions.php 0000604 00000010306 15174325125 0017762 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 The friendly_name * @return UpdateActivityOptions Options builder */ public static function update($friendlyName = Values::NONE) { return new UpdateActivityOptions($friendlyName); } /** * @param string $friendlyName The friendly_name * @param string $available The available * @return ReadActivityOptions Options builder */ public static function read($friendlyName = Values::NONE, $available = Values::NONE) { return new ReadActivityOptions($friendlyName, $available); } /** * @param boolean $available The available * @return CreateActivityOptions Options builder */ public static function create($available = Values::NONE) { return new CreateActivityOptions($available); } } class UpdateActivityOptions 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.Taskrouter.V1.UpdateActivityOptions ' . implode(' ', $options) . ']'; } } class ReadActivityOptions extends Options { /** * @param string $friendlyName The friendly_name * @param string $available The available */ public function __construct($friendlyName = Values::NONE, $available = Values::NONE) { $this->options['friendlyName'] = $friendlyName; $this->options['available'] = $available; } /** * The friendly_name * * @param string $friendlyName The friendly_name * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The available * * @param string $available The 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.ReadActivityOptions ' . implode(' ', $options) . ']'; } } class CreateActivityOptions extends Options { /** * @param boolean $available The available */ public function __construct($available = Values::NONE) { $this->options['available'] = $available; } /** * The available * * @param boolean $available The 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.CreateActivityOptions ' . implode(' ', $options) . ']'; } } sdk/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceStatisticsInstance.php 0000604 00000006306 15174325125 0022315 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 workspace_sid * @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 */ 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/Twilio/Rest/Taskrouter/V1/Workspace/TaskChannelContext.php 0000604 00000003414 15174325125 0020354 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace; use Twilio\InstanceContext; 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 workspace_sid * @param string $sid The sid * @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 */ 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'] ); } /** * Provide 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/Twilio/Rest/Taskrouter/V1/Workspace/WorkflowOptions.php 0000604 00000020432 15174325125 0020001 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 The friendly_name * @param string $assignmentCallbackUrl The assignment_callback_url * @param string $fallbackAssignmentCallbackUrl The * fallback_assignment_callback_url * @param string $configuration The configuration * @param integer $taskReservationTimeout The task_reservation_timeout * @return UpdateWorkflowOptions Options builder */ public static function update($friendlyName = Values::NONE, $assignmentCallbackUrl = Values::NONE, $fallbackAssignmentCallbackUrl = Values::NONE, $configuration = Values::NONE, $taskReservationTimeout = Values::NONE) { return new UpdateWorkflowOptions($friendlyName, $assignmentCallbackUrl, $fallbackAssignmentCallbackUrl, $configuration, $taskReservationTimeout); } /** * @param string $friendlyName The friendly_name * @return ReadWorkflowOptions Options builder */ public static function read($friendlyName = Values::NONE) { return new ReadWorkflowOptions($friendlyName); } /** * @param string $assignmentCallbackUrl The assignment_callback_url * @param string $fallbackAssignmentCallbackUrl The * fallback_assignment_callback_url * @param integer $taskReservationTimeout The task_reservation_timeout * @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 The friendly_name * @param string $assignmentCallbackUrl The assignment_callback_url * @param string $fallbackAssignmentCallbackUrl The * fallback_assignment_callback_url * @param string $configuration The configuration * @param integer $taskReservationTimeout The task_reservation_timeout */ public function __construct($friendlyName = Values::NONE, $assignmentCallbackUrl = Values::NONE, $fallbackAssignmentCallbackUrl = Values::NONE, $configuration = Values::NONE, $taskReservationTimeout = Values::NONE) { $this->options['friendlyName'] = $friendlyName; $this->options['assignmentCallbackUrl'] = $assignmentCallbackUrl; $this->options['fallbackAssignmentCallbackUrl'] = $fallbackAssignmentCallbackUrl; $this->options['configuration'] = $configuration; $this->options['taskReservationTimeout'] = $taskReservationTimeout; } /** * The friendly_name * * @param string $friendlyName The friendly_name * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The assignment_callback_url * * @param string $assignmentCallbackUrl The assignment_callback_url * @return $this Fluent Builder */ public function setAssignmentCallbackUrl($assignmentCallbackUrl) { $this->options['assignmentCallbackUrl'] = $assignmentCallbackUrl; return $this; } /** * The fallback_assignment_callback_url * * @param string $fallbackAssignmentCallbackUrl The * fallback_assignment_callback_url * @return $this Fluent Builder */ public function setFallbackAssignmentCallbackUrl($fallbackAssignmentCallbackUrl) { $this->options['fallbackAssignmentCallbackUrl'] = $fallbackAssignmentCallbackUrl; return $this; } /** * The configuration * * @param string $configuration The configuration * @return $this Fluent Builder */ public function setConfiguration($configuration) { $this->options['configuration'] = $configuration; return $this; } /** * The task_reservation_timeout * * @param integer $taskReservationTimeout The task_reservation_timeout * @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.UpdateWorkflowOptions ' . implode(' ', $options) . ']'; } } class ReadWorkflowOptions 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.Taskrouter.V1.ReadWorkflowOptions ' . implode(' ', $options) . ']'; } } class CreateWorkflowOptions extends Options { /** * @param string $assignmentCallbackUrl The assignment_callback_url * @param string $fallbackAssignmentCallbackUrl The * fallback_assignment_callback_url * @param integer $taskReservationTimeout The task_reservation_timeout */ 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 assignment_callback_url * * @param string $assignmentCallbackUrl The assignment_callback_url * @return $this Fluent Builder */ public function setAssignmentCallbackUrl($assignmentCallbackUrl) { $this->options['assignmentCallbackUrl'] = $assignmentCallbackUrl; return $this; } /** * The fallback_assignment_callback_url * * @param string $fallbackAssignmentCallbackUrl The * fallback_assignment_callback_url * @return $this Fluent Builder */ public function setFallbackAssignmentCallbackUrl($fallbackAssignmentCallbackUrl) { $this->options['fallbackAssignmentCallbackUrl'] = $fallbackAssignmentCallbackUrl; return $this; } /** * The task_reservation_timeout * * @param integer $taskReservationTimeout The task_reservation_timeout * @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/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowStatisticsOptions.php 0000604 00000006523 15174325125 0023673 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 integer $minutes The minutes * @param \DateTime $startDate The start_date * @param \DateTime $endDate The end_date * @param string $taskChannel The task_channel * @param string $splitByWaitTime The split_by_wait_time * @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 integer $minutes The minutes * @param \DateTime $startDate The start_date * @param \DateTime $endDate The end_date * @param string $taskChannel The task_channel * @param string $splitByWaitTime The split_by_wait_time */ 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; } /** * The minutes * * @param integer $minutes The minutes * @return $this Fluent Builder */ public function setMinutes($minutes) { $this->options['minutes'] = $minutes; return $this; } /** * The start_date * * @param \DateTime $startDate The start_date * @return $this Fluent Builder */ public function setStartDate($startDate) { $this->options['startDate'] = $startDate; return $this; } /** * The end_date * * @param \DateTime $endDate The end_date * @return $this Fluent Builder */ public function setEndDate($endDate) { $this->options['endDate'] = $endDate; return $this; } /** * The task_channel * * @param string $taskChannel The task_channel * @return $this Fluent Builder */ public function setTaskChannel($taskChannel) { $this->options['taskChannel'] = $taskChannel; return $this; } /** * The split_by_wait_time * * @param string $splitByWaitTime The split_by_wait_time * @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/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowCumulativeStatisticsPage.php 0000604 00000001644 15174325125 0025152 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/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowCumulativeStatisticsInstance.php 0000604 00000013516 15174325125 0026043 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 integer avgTaskAcceptanceTime * @property \DateTime startTime * @property \DateTime endTime * @property integer reservationsCreated * @property integer reservationsAccepted * @property integer reservationsRejected * @property integer reservationsTimedOut * @property integer reservationsCanceled * @property integer reservationsRescinded * @property array splitByWaitTime * @property array waitDurationUntilAccepted * @property array waitDurationUntilCanceled * @property integer tasksCanceled * @property integer tasksCompleted * @property integer tasksEntered * @property integer tasksDeleted * @property integer tasksMoved * @property integer 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 workspace_sid * @param string $workflowSid The workflow_sid * @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 */ 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/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowStatisticsContext.php 0000604 00000004570 15174325125 0023664 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\Workflow; 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 workspace_sid * @param string $workflowSid The workflow_sid * @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 */ 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/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowStatisticsInstance.php 0000604 00000007126 15174325125 0024004 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 workspace_sid * @param string $workflowSid The workflow_sid * @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 */ 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/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowCumulativeStatisticsList.php 0000604 00000002753 15174325125 0025213 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 workspace_sid * @param string $workflowSid The workflow_sid * @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/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowRealTimeStatisticsOptions.php 0000604 00000002776 15174325125 0025324 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 The task_channel * @return FetchWorkflowRealTimeStatisticsOptions Options builder */ public static function fetch($taskChannel = Values::NONE) { return new FetchWorkflowRealTimeStatisticsOptions($taskChannel); } } class FetchWorkflowRealTimeStatisticsOptions extends Options { /** * @param string $taskChannel The task_channel */ public function __construct($taskChannel = Values::NONE) { $this->options['taskChannel'] = $taskChannel; } /** * The task_channel * * @param string $taskChannel The task_channel * @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/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowCumulativeStatisticsContext.php 0000604 00000005006 15174325125 0025716 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\Workflow; 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 workspace_sid * @param string $workflowSid The workflow_sid * @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 */ 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/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowCumulativeStatisticsOptions.php 0000604 00000006605 15174325125 0025733 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 The end_date * @param integer $minutes The minutes * @param \DateTime $startDate The start_date * @param string $taskChannel The task_channel * @param string $splitByWaitTime The split_by_wait_time * @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 The end_date * @param integer $minutes The minutes * @param \DateTime $startDate The start_date * @param string $taskChannel The task_channel * @param string $splitByWaitTime The split_by_wait_time */ 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; } /** * The end_date * * @param \DateTime $endDate The end_date * @return $this Fluent Builder */ public function setEndDate($endDate) { $this->options['endDate'] = $endDate; return $this; } /** * The minutes * * @param integer $minutes The minutes * @return $this Fluent Builder */ public function setMinutes($minutes) { $this->options['minutes'] = $minutes; return $this; } /** * The start_date * * @param \DateTime $startDate The start_date * @return $this Fluent Builder */ public function setStartDate($startDate) { $this->options['startDate'] = $startDate; return $this; } /** * The task_channel * * @param string $taskChannel The task_channel * @return $this Fluent Builder */ public function setTaskChannel($taskChannel) { $this->options['taskChannel'] = $taskChannel; return $this; } /** * The split_by_wait_time * * @param string $splitByWaitTime The split_by_wait_time * @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/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowRealTimeStatisticsContext.php 0000604 00000004303 15174325125 0025301 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\Workflow; 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 workspace_sid * @param string $workflowSid The workflow_sid * @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 */ 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/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowRealTimeStatisticsPage.php 0000604 00000001636 15174325125 0024537 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/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowStatisticsPage.php 0000604 00000001606 15174325125 0023111 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/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowRealTimeStatisticsInstance.php 0000604 00000007765 15174325125 0025440 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 integer longestTaskWaitingAge * @property array tasksByPriority * @property array tasksByStatus * @property integer 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 workspace_sid * @param string $workflowSid The workflow_sid * @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'), '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 */ 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/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowStatisticsList.php 0000604 00000002645 15174325125 0023154 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 workspace_sid * @param string $workflowSid The workflow_sid * @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/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowRealTimeStatisticsList.php 0000604 00000002735 15174325125 0024577 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 workspace_sid * @param string $workflowSid The workflow_sid * @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/Twilio/Rest/Taskrouter/V1/Workspace/WorkflowContext.php 0000604 00000015047 15174325125 0020000 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 workspace_sid * @param string $sid The sid * @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 */ 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 */ 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'], )); $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 */ 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 \Twilio\Exceptions\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 \Twilio\Exceptions\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/Twilio/Rest/Taskrouter/V1/Workspace/TaskInstance.php 0000604 00000013061 15174325125 0017202 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 integer age * @property string assignmentStatus * @property string attributes * @property string addons * @property \DateTime dateCreated * @property \DateTime dateUpdated * @property integer priority * @property string reason * @property string sid * @property string taskQueueSid * @property string taskQueueFriendlyName * @property string taskChannelSid * @property string taskChannelUniqueName * @property integer 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 workspace_sid * @param string $sid The sid * @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 */ public function fetch() { return $this->proxy()->fetch(); } /** * Update the TaskInstance * * @param array|Options $options Optional Arguments * @return TaskInstance Updated TaskInstance */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Deletes the TaskInstance * * @return boolean True if delete succeeds, false otherwise */ 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/Twilio/Rest/Taskrouter/V1/Workspace/TaskChannelInstance.php 0000604 00000007317 15174325125 0020502 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 \DateTime dateCreated * @property \DateTime dateUpdated * @property string friendlyName * @property string sid * @property string uniqueName * @property string workspaceSid * @property string url */ 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 workspace_sid * @param string $sid The sid * @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'), '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\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 */ 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.TaskChannelInstance ' . implode(' ', $context) . ']'; } } sdk/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceRealTimeStatisticsInstance.php 0000604 00000007717 15174325125 0023747 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 integer longestTaskWaitingAge * @property array tasksByPriority * @property array tasksByStatus * @property integer totalTasks * @property integer 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 workspace_sid * @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'), '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 */ 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/Twilio/Rest/Taskrouter/V1/Workspace/WorkflowInstance.php 0000604 00000013253 15174325126 0020116 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 integer 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 workspace_sid * @param string $sid The sid * @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 */ public function fetch() { return $this->proxy()->fetch(); } /** * Update the WorkflowInstance * * @param array|Options $options Optional Arguments * @return WorkflowInstance Updated WorkflowInstance */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Deletes the WorkflowInstance * * @return boolean True if delete succeeds, false otherwise */ 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/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueRealTimeStatisticsList.php 0000604 00000002756 15174325126 0024775 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 workspace_sid * @param string $taskQueueSid The task_queue_sid * @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/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueRealTimeStatisticsOptions.php 0000604 00000003004 15174325126 0025500 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 task_channel * @return FetchTaskQueueRealTimeStatisticsOptions Options builder */ public static function fetch($taskChannel = Values::NONE) { return new FetchTaskQueueRealTimeStatisticsOptions($taskChannel); } } class FetchTaskQueueRealTimeStatisticsOptions extends Options { /** * @param string $taskChannel The task_channel */ public function __construct($taskChannel = Values::NONE) { $this->options['taskChannel'] = $taskChannel; } /** * The task_channel * * @param string $taskChannel The task_channel * @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/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueStatisticsPage.php 0000604 00000001613 15174325126 0023302 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/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueRealTimeStatisticsContext.php 0000604 00000004327 15174325126 0025502 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\TaskQueue; 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 workspace_sid * @param string $taskQueueSid The task_queue_sid * @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 */ 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/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueCumulativeStatisticsInstance.php 0000604 00000013327 15174325126 0026236 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 integer avgTaskAcceptanceTime * @property \DateTime startTime * @property \DateTime endTime * @property integer reservationsCreated * @property integer reservationsAccepted * @property integer reservationsRejected * @property integer reservationsTimedOut * @property integer reservationsCanceled * @property integer reservationsRescinded * @property array splitByWaitTime * @property string taskQueueSid * @property array waitDurationUntilAccepted * @property array waitDurationUntilCanceled * @property integer tasksCanceled * @property integer tasksCompleted * @property integer tasksDeleted * @property integer tasksEntered * @property integer 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 workspace_sid * @param string $taskQueueSid The task_queue_sid * @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 */ 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/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueuesStatisticsOptions.php 0000604 00000007532 15174325126 0024252 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 The end_date * @param string $friendlyName The friendly_name * @param integer $minutes The minutes * @param \DateTime $startDate The start_date * @param string $taskChannel The task_channel * @param string $splitByWaitTime The split_by_wait_time * @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 The end_date * @param string $friendlyName The friendly_name * @param integer $minutes The minutes * @param \DateTime $startDate The start_date * @param string $taskChannel The task_channel * @param string $splitByWaitTime The split_by_wait_time */ 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; } /** * The end_date * * @param \DateTime $endDate The end_date * @return $this Fluent Builder */ public function setEndDate($endDate) { $this->options['endDate'] = $endDate; 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 minutes * * @param integer $minutes The minutes * @return $this Fluent Builder */ public function setMinutes($minutes) { $this->options['minutes'] = $minutes; return $this; } /** * The start_date * * @param \DateTime $startDate The start_date * @return $this Fluent Builder */ public function setStartDate($startDate) { $this->options['startDate'] = $startDate; return $this; } /** * The task_channel * * @param string $taskChannel The task_channel * @return $this Fluent Builder */ public function setTaskChannel($taskChannel) { $this->options['taskChannel'] = $taskChannel; return $this; } /** * The split_by_wait_time * * @param string $splitByWaitTime The split_by_wait_time * @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/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueCumulativeStatisticsPage.php 0000604 00000001651 15174325126 0025343 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/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueStatisticsOptions.php 0000604 00000006531 15174325126 0024065 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 The end_date * @param integer $minutes The minutes * @param \DateTime $startDate The start_date * @param string $taskChannel The task_channel * @param string $splitByWaitTime The split_by_wait_time * @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 The end_date * @param integer $minutes The minutes * @param \DateTime $startDate The start_date * @param string $taskChannel The task_channel * @param string $splitByWaitTime The split_by_wait_time */ 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; } /** * The end_date * * @param \DateTime $endDate The end_date * @return $this Fluent Builder */ public function setEndDate($endDate) { $this->options['endDate'] = $endDate; return $this; } /** * The minutes * * @param integer $minutes The minutes * @return $this Fluent Builder */ public function setMinutes($minutes) { $this->options['minutes'] = $minutes; return $this; } /** * The start_date * * @param \DateTime $startDate The start_date * @return $this Fluent Builder */ public function setStartDate($startDate) { $this->options['startDate'] = $startDate; return $this; } /** * The task_channel * * @param string $taskChannel The task_channel * @return $this Fluent Builder */ public function setTaskChannel($taskChannel) { $this->options['taskChannel'] = $taskChannel; return $this; } /** * The split_by_wait_time * * @param string $splitByWaitTime The split_by_wait_time * @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/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueRealTimeStatisticsPage.php 0000604 00000001643 15174325126 0024730 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/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueStatisticsList.php 0000604 00000002666 15174325126 0023352 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 workspace_sid * @param string $taskQueueSid The task_queue_sid * @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/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueStatisticsContext.php 0000604 00000004613 15174325126 0024055 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\TaskQueue; 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 workspace_sid * @param string $taskQueueSid The task_queue_sid * @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 */ 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/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueCumulativeStatisticsList.php 0000604 00000002774 15174325126 0025411 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 workspace_sid * @param string $taskQueueSid The task_queue_sid * @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/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueRealTimeStatisticsInstance.php 0000604 00000010637 15174325126 0025623 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 integer longestTaskWaitingAge * @property string taskQueueSid * @property array tasksByPriority * @property array tasksByStatus * @property integer totalAvailableWorkers * @property integer totalEligibleWorkers * @property integer 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 workspace_sid * @param string $taskQueueSid The task_queue_sid * @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'), '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 */ 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/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueuesStatisticsInstance.php 0000604 00000004374 15174325126 0024364 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 workspace_sid * @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/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueuesStatisticsList.php 0000604 00000012621 15174325126 0023525 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 workspace_sid * @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/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueCumulativeStatisticsOptions.php 0000604 00000006613 15174325126 0026125 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 The end_date * @param integer $minutes The minutes * @param \DateTime $startDate The start_date * @param string $taskChannel The task_channel * @param string $splitByWaitTime The split_by_wait_time * @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 The end_date * @param integer $minutes The minutes * @param \DateTime $startDate The start_date * @param string $taskChannel The task_channel * @param string $splitByWaitTime The split_by_wait_time */ 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; } /** * The end_date * * @param \DateTime $endDate The end_date * @return $this Fluent Builder */ public function setEndDate($endDate) { $this->options['endDate'] = $endDate; return $this; } /** * The minutes * * @param integer $minutes The minutes * @return $this Fluent Builder */ public function setMinutes($minutes) { $this->options['minutes'] = $minutes; return $this; } /** * The start_date * * @param \DateTime $startDate The start_date * @return $this Fluent Builder */ public function setStartDate($startDate) { $this->options['startDate'] = $startDate; return $this; } /** * The task_channel * * @param string $taskChannel The task_channel * @return $this Fluent Builder */ public function setTaskChannel($taskChannel) { $this->options['taskChannel'] = $taskChannel; return $this; } /** * The split_by_wait_time * * @param string $splitByWaitTime The split_by_wait_time * @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/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueCumulativeStatisticsContext.php 0000604 00000005032 15174325126 0026110 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\TaskQueue; 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 workspace_sid * @param string $taskQueueSid The task_queue_sid * @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 */ 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/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueStatisticsInstance.php 0000604 00000007160 15174325126 0024175 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 workspace_sid * @param string $taskQueueSid The task_queue_sid * @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 */ 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/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueuesStatisticsPage.php 0000604 00000001463 15174325126 0023470 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/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkerChannelList.php 0000604 00000012161 15174325126 0021463 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 workspace_sid * @param string $workerSid The worker_sid * @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 * @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/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersStatisticsContext.php 0000604 00000004371 15174325126 0023145 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\Worker; 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 workspace_sid * @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 */ 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/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkerChannelOptions.php 0000604 00000003537 15174325126 0022212 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 integer $capacity The capacity * @param boolean $available The 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 integer $capacity The capacity * @param boolean $available The available */ public function __construct($capacity = Values::NONE, $available = Values::NONE) { $this->options['capacity'] = $capacity; $this->options['available'] = $available; } /** * The capacity * * @param integer $capacity The capacity * @return $this Fluent Builder */ public function setCapacity($capacity) { $this->options['capacity'] = $capacity; return $this; } /** * The available * * @param boolean $available The 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/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersStatisticsList.php 0000604 00000002352 15174325126 0022431 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 workspace_sid * @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/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkerChannelContext.php 0000604 00000005456 15174325126 0022205 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\Worker; 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 workspace_sid * @param string $workerSid The worker_sid * @param string $sid The sid * @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 */ 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 */ 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/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersStatisticsOptions.php 0000604 00000010456 15174325126 0023155 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 integer $minutes The minutes * @param \DateTime $startDate The start_date * @param \DateTime $endDate The end_date * @param string $taskQueueSid The task_queue_sid * @param string $taskQueueName The task_queue_name * @param string $friendlyName The friendly_name * @param string $taskChannel The task_channel * @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 integer $minutes The minutes * @param \DateTime $startDate The start_date * @param \DateTime $endDate The end_date * @param string $taskQueueSid The task_queue_sid * @param string $taskQueueName The task_queue_name * @param string $friendlyName The friendly_name * @param string $taskChannel The task_channel */ 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; } /** * The minutes * * @param integer $minutes The minutes * @return $this Fluent Builder */ public function setMinutes($minutes) { $this->options['minutes'] = $minutes; return $this; } /** * The start_date * * @param \DateTime $startDate The start_date * @return $this Fluent Builder */ public function setStartDate($startDate) { $this->options['startDate'] = $startDate; return $this; } /** * The end_date * * @param \DateTime $endDate The end_date * @return $this Fluent Builder */ public function setEndDate($endDate) { $this->options['endDate'] = $endDate; return $this; } /** * The task_queue_sid * * @param string $taskQueueSid The task_queue_sid * @return $this Fluent Builder */ public function setTaskQueueSid($taskQueueSid) { $this->options['taskQueueSid'] = $taskQueueSid; return $this; } /** * The task_queue_name * * @param string $taskQueueName The task_queue_name * @return $this Fluent Builder */ public function setTaskQueueName($taskQueueName) { $this->options['taskQueueName'] = $taskQueueName; 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 task_channel * * @param string $taskChannel The task_channel * @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/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkerChannelInstance.php 0000604 00000011322 15174325126 0022312 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 integer assignedTasks * @property boolean available * @property integer availableCapacityPercentage * @property integer 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 workspace_sid * @param string $workerSid The worker_sid * @param string $sid The sid * @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 */ public function fetch() { return $this->proxy()->fetch(); } /** * Update the WorkerChannelInstance * * @param array|Options $options Optional Arguments * @return WorkerChannelInstance Updated WorkerChannelInstance */ 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/Twilio/Rest/Taskrouter/V1/Workspace/Worker/ReservationOptions.php 0000604 00000074454 15174325126 0021757 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 The reservation_status * @return ReadReservationOptions Options builder */ public static function read($reservationStatus = Values::NONE) { return new ReadReservationOptions($reservationStatus); } /** * @param string $reservationStatus The reservation_status * @param string $workerActivitySid The worker_activity_sid * @param string $instruction The instruction * @param string $dequeuePostWorkActivitySid The dequeue_post_work_activity_sid * @param string $dequeueFrom The dequeue_from * @param string $dequeueRecord The dequeue_record * @param integer $dequeueTimeout The dequeue_timeout * @param string $dequeueTo The dequeue_to * @param string $dequeueStatusCallbackUrl The dequeue_status_callback_url * @param string $callFrom The call_from * @param string $callRecord The call_record * @param integer $callTimeout The call_timeout * @param string $callTo The call_to * @param string $callUrl The call_url * @param string $callStatusCallbackUrl The call_status_callback_url * @param boolean $callAccept The call_accept * @param string $redirectCallSid The redirect_call_sid * @param boolean $redirectAccept The redirect_accept * @param string $redirectUrl The redirect_url * @param string $to The to * @param string $from The from * @param string $statusCallback The status_callback * @param string $statusCallbackMethod The status_callback_method * @param string $statusCallbackEvent The status_callback_event * @param integer $timeout The timeout * @param boolean $record The record * @param boolean $muted The muted * @param string $beep The beep * @param boolean $startConferenceOnEnter The start_conference_on_enter * @param boolean $endConferenceOnExit The end_conference_on_exit * @param string $waitUrl The wait_url * @param string $waitMethod The wait_method * @param boolean $earlyMedia The early_media * @param integer $maxParticipants The max_participants * @param string $conferenceStatusCallback The conference_status_callback * @param string $conferenceStatusCallbackMethod The * conference_status_callback_method * @param string $conferenceStatusCallbackEvent The * conference_status_callback_event * @param string $conferenceRecord The conference_record * @param string $conferenceTrim The conference_trim * @param string $recordingChannels The recording_channels * @param string $recordingStatusCallback The recording_status_callback * @param string $recordingStatusCallbackMethod The * recording_status_callback_method * @param string $conferenceRecordingStatusCallback The * conference_recording_status_callback * @param string $conferenceRecordingStatusCallbackMethod The * conference_recording_status_callback_method * @param string $region The region * @param string $sipAuthUsername The sip_auth_username * @param string $sipAuthPassword The sip_auth_password * @param string $dequeueStatusCallbackEvent The dequeue_status_callback_event * @param string $postWorkActivitySid The post_work_activity_sid * @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) { 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); } } class ReadReservationOptions extends Options { /** * @param string $reservationStatus The reservation_status */ public function __construct($reservationStatus = Values::NONE) { $this->options['reservationStatus'] = $reservationStatus; } /** * The reservation_status * * @param string $reservationStatus The reservation_status * @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 reservation_status * @param string $workerActivitySid The worker_activity_sid * @param string $instruction The instruction * @param string $dequeuePostWorkActivitySid The dequeue_post_work_activity_sid * @param string $dequeueFrom The dequeue_from * @param string $dequeueRecord The dequeue_record * @param integer $dequeueTimeout The dequeue_timeout * @param string $dequeueTo The dequeue_to * @param string $dequeueStatusCallbackUrl The dequeue_status_callback_url * @param string $callFrom The call_from * @param string $callRecord The call_record * @param integer $callTimeout The call_timeout * @param string $callTo The call_to * @param string $callUrl The call_url * @param string $callStatusCallbackUrl The call_status_callback_url * @param boolean $callAccept The call_accept * @param string $redirectCallSid The redirect_call_sid * @param boolean $redirectAccept The redirect_accept * @param string $redirectUrl The redirect_url * @param string $to The to * @param string $from The from * @param string $statusCallback The status_callback * @param string $statusCallbackMethod The status_callback_method * @param string $statusCallbackEvent The status_callback_event * @param integer $timeout The timeout * @param boolean $record The record * @param boolean $muted The muted * @param string $beep The beep * @param boolean $startConferenceOnEnter The start_conference_on_enter * @param boolean $endConferenceOnExit The end_conference_on_exit * @param string $waitUrl The wait_url * @param string $waitMethod The wait_method * @param boolean $earlyMedia The early_media * @param integer $maxParticipants The max_participants * @param string $conferenceStatusCallback The conference_status_callback * @param string $conferenceStatusCallbackMethod The * conference_status_callback_method * @param string $conferenceStatusCallbackEvent The * conference_status_callback_event * @param string $conferenceRecord The conference_record * @param string $conferenceTrim The conference_trim * @param string $recordingChannels The recording_channels * @param string $recordingStatusCallback The recording_status_callback * @param string $recordingStatusCallbackMethod The * recording_status_callback_method * @param string $conferenceRecordingStatusCallback The * conference_recording_status_callback * @param string $conferenceRecordingStatusCallbackMethod The * conference_recording_status_callback_method * @param string $region The region * @param string $sipAuthUsername The sip_auth_username * @param string $sipAuthPassword The sip_auth_password * @param string $dequeueStatusCallbackEvent The dequeue_status_callback_event * @param string $postWorkActivitySid The post_work_activity_sid */ 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) { $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; } /** * The reservation_status * * @param string $reservationStatus The reservation_status * @return $this Fluent Builder */ public function setReservationStatus($reservationStatus) { $this->options['reservationStatus'] = $reservationStatus; return $this; } /** * The worker_activity_sid * * @param string $workerActivitySid The worker_activity_sid * @return $this Fluent Builder */ public function setWorkerActivitySid($workerActivitySid) { $this->options['workerActivitySid'] = $workerActivitySid; return $this; } /** * The instruction * * @param string $instruction The instruction * @return $this Fluent Builder */ public function setInstruction($instruction) { $this->options['instruction'] = $instruction; return $this; } /** * The dequeue_post_work_activity_sid * * @param string $dequeuePostWorkActivitySid The dequeue_post_work_activity_sid * @return $this Fluent Builder */ public function setDequeuePostWorkActivitySid($dequeuePostWorkActivitySid) { $this->options['dequeuePostWorkActivitySid'] = $dequeuePostWorkActivitySid; return $this; } /** * The dequeue_from * * @param string $dequeueFrom The dequeue_from * @return $this Fluent Builder */ public function setDequeueFrom($dequeueFrom) { $this->options['dequeueFrom'] = $dequeueFrom; return $this; } /** * The dequeue_record * * @param string $dequeueRecord The dequeue_record * @return $this Fluent Builder */ public function setDequeueRecord($dequeueRecord) { $this->options['dequeueRecord'] = $dequeueRecord; return $this; } /** * The dequeue_timeout * * @param integer $dequeueTimeout The dequeue_timeout * @return $this Fluent Builder */ public function setDequeueTimeout($dequeueTimeout) { $this->options['dequeueTimeout'] = $dequeueTimeout; return $this; } /** * The dequeue_to * * @param string $dequeueTo The dequeue_to * @return $this Fluent Builder */ public function setDequeueTo($dequeueTo) { $this->options['dequeueTo'] = $dequeueTo; return $this; } /** * The dequeue_status_callback_url * * @param string $dequeueStatusCallbackUrl The dequeue_status_callback_url * @return $this Fluent Builder */ public function setDequeueStatusCallbackUrl($dequeueStatusCallbackUrl) { $this->options['dequeueStatusCallbackUrl'] = $dequeueStatusCallbackUrl; return $this; } /** * The call_from * * @param string $callFrom The call_from * @return $this Fluent Builder */ public function setCallFrom($callFrom) { $this->options['callFrom'] = $callFrom; return $this; } /** * The call_record * * @param string $callRecord The call_record * @return $this Fluent Builder */ public function setCallRecord($callRecord) { $this->options['callRecord'] = $callRecord; return $this; } /** * The call_timeout * * @param integer $callTimeout The call_timeout * @return $this Fluent Builder */ public function setCallTimeout($callTimeout) { $this->options['callTimeout'] = $callTimeout; return $this; } /** * The call_to * * @param string $callTo The call_to * @return $this Fluent Builder */ public function setCallTo($callTo) { $this->options['callTo'] = $callTo; return $this; } /** * The call_url * * @param string $callUrl The call_url * @return $this Fluent Builder */ public function setCallUrl($callUrl) { $this->options['callUrl'] = $callUrl; return $this; } /** * The call_status_callback_url * * @param string $callStatusCallbackUrl The call_status_callback_url * @return $this Fluent Builder */ public function setCallStatusCallbackUrl($callStatusCallbackUrl) { $this->options['callStatusCallbackUrl'] = $callStatusCallbackUrl; return $this; } /** * The call_accept * * @param boolean $callAccept The call_accept * @return $this Fluent Builder */ public function setCallAccept($callAccept) { $this->options['callAccept'] = $callAccept; return $this; } /** * The redirect_call_sid * * @param string $redirectCallSid The redirect_call_sid * @return $this Fluent Builder */ public function setRedirectCallSid($redirectCallSid) { $this->options['redirectCallSid'] = $redirectCallSid; return $this; } /** * The redirect_accept * * @param boolean $redirectAccept The redirect_accept * @return $this Fluent Builder */ public function setRedirectAccept($redirectAccept) { $this->options['redirectAccept'] = $redirectAccept; return $this; } /** * The redirect_url * * @param string $redirectUrl The redirect_url * @return $this Fluent Builder */ public function setRedirectUrl($redirectUrl) { $this->options['redirectUrl'] = $redirectUrl; return $this; } /** * The to * * @param string $to The to * @return $this Fluent Builder */ public function setTo($to) { $this->options['to'] = $to; return $this; } /** * The from * * @param string $from The from * @return $this Fluent Builder */ public function setFrom($from) { $this->options['from'] = $from; return $this; } /** * The status_callback * * @param string $statusCallback The status_callback * @return $this Fluent Builder */ public function setStatusCallback($statusCallback) { $this->options['statusCallback'] = $statusCallback; return $this; } /** * The status_callback_method * * @param string $statusCallbackMethod The status_callback_method * @return $this Fluent Builder */ public function setStatusCallbackMethod($statusCallbackMethod) { $this->options['statusCallbackMethod'] = $statusCallbackMethod; return $this; } /** * The status_callback_event * * @param string $statusCallbackEvent The status_callback_event * @return $this Fluent Builder */ public function setStatusCallbackEvent($statusCallbackEvent) { $this->options['statusCallbackEvent'] = $statusCallbackEvent; return $this; } /** * The timeout * * @param integer $timeout The timeout * @return $this Fluent Builder */ public function setTimeout($timeout) { $this->options['timeout'] = $timeout; return $this; } /** * The record * * @param boolean $record The record * @return $this Fluent Builder */ public function setRecord($record) { $this->options['record'] = $record; return $this; } /** * The muted * * @param boolean $muted The muted * @return $this Fluent Builder */ public function setMuted($muted) { $this->options['muted'] = $muted; return $this; } /** * The beep * * @param string $beep The beep * @return $this Fluent Builder */ public function setBeep($beep) { $this->options['beep'] = $beep; return $this; } /** * The start_conference_on_enter * * @param boolean $startConferenceOnEnter The start_conference_on_enter * @return $this Fluent Builder */ public function setStartConferenceOnEnter($startConferenceOnEnter) { $this->options['startConferenceOnEnter'] = $startConferenceOnEnter; return $this; } /** * The end_conference_on_exit * * @param boolean $endConferenceOnExit The end_conference_on_exit * @return $this Fluent Builder */ public function setEndConferenceOnExit($endConferenceOnExit) { $this->options['endConferenceOnExit'] = $endConferenceOnExit; return $this; } /** * The wait_url * * @param string $waitUrl The wait_url * @return $this Fluent Builder */ public function setWaitUrl($waitUrl) { $this->options['waitUrl'] = $waitUrl; return $this; } /** * The wait_method * * @param string $waitMethod The wait_method * @return $this Fluent Builder */ public function setWaitMethod($waitMethod) { $this->options['waitMethod'] = $waitMethod; return $this; } /** * The early_media * * @param boolean $earlyMedia The early_media * @return $this Fluent Builder */ public function setEarlyMedia($earlyMedia) { $this->options['earlyMedia'] = $earlyMedia; return $this; } /** * The max_participants * * @param integer $maxParticipants The max_participants * @return $this Fluent Builder */ public function setMaxParticipants($maxParticipants) { $this->options['maxParticipants'] = $maxParticipants; return $this; } /** * The conference_status_callback * * @param string $conferenceStatusCallback The conference_status_callback * @return $this Fluent Builder */ public function setConferenceStatusCallback($conferenceStatusCallback) { $this->options['conferenceStatusCallback'] = $conferenceStatusCallback; return $this; } /** * The conference_status_callback_method * * @param string $conferenceStatusCallbackMethod The * conference_status_callback_method * @return $this Fluent Builder */ public function setConferenceStatusCallbackMethod($conferenceStatusCallbackMethod) { $this->options['conferenceStatusCallbackMethod'] = $conferenceStatusCallbackMethod; return $this; } /** * The conference_status_callback_event * * @param string $conferenceStatusCallbackEvent The * conference_status_callback_event * @return $this Fluent Builder */ public function setConferenceStatusCallbackEvent($conferenceStatusCallbackEvent) { $this->options['conferenceStatusCallbackEvent'] = $conferenceStatusCallbackEvent; return $this; } /** * The conference_record * * @param string $conferenceRecord The conference_record * @return $this Fluent Builder */ public function setConferenceRecord($conferenceRecord) { $this->options['conferenceRecord'] = $conferenceRecord; return $this; } /** * The conference_trim * * @param string $conferenceTrim The conference_trim * @return $this Fluent Builder */ public function setConferenceTrim($conferenceTrim) { $this->options['conferenceTrim'] = $conferenceTrim; return $this; } /** * The recording_channels * * @param string $recordingChannels The recording_channels * @return $this Fluent Builder */ public function setRecordingChannels($recordingChannels) { $this->options['recordingChannels'] = $recordingChannels; return $this; } /** * The recording_status_callback * * @param string $recordingStatusCallback The recording_status_callback * @return $this Fluent Builder */ public function setRecordingStatusCallback($recordingStatusCallback) { $this->options['recordingStatusCallback'] = $recordingStatusCallback; return $this; } /** * The recording_status_callback_method * * @param string $recordingStatusCallbackMethod The * recording_status_callback_method * @return $this Fluent Builder */ public function setRecordingStatusCallbackMethod($recordingStatusCallbackMethod) { $this->options['recordingStatusCallbackMethod'] = $recordingStatusCallbackMethod; return $this; } /** * The conference_recording_status_callback * * @param string $conferenceRecordingStatusCallback The * conference_recording_status_callback * @return $this Fluent Builder */ public function setConferenceRecordingStatusCallback($conferenceRecordingStatusCallback) { $this->options['conferenceRecordingStatusCallback'] = $conferenceRecordingStatusCallback; return $this; } /** * The conference_recording_status_callback_method * * @param string $conferenceRecordingStatusCallbackMethod The * conference_recording_status_callback_method * @return $this Fluent Builder */ public function setConferenceRecordingStatusCallbackMethod($conferenceRecordingStatusCallbackMethod) { $this->options['conferenceRecordingStatusCallbackMethod'] = $conferenceRecordingStatusCallbackMethod; return $this; } /** * The region * * @param string $region The region * @return $this Fluent Builder */ public function setRegion($region) { $this->options['region'] = $region; return $this; } /** * The sip_auth_username * * @param string $sipAuthUsername The sip_auth_username * @return $this Fluent Builder */ public function setSipAuthUsername($sipAuthUsername) { $this->options['sipAuthUsername'] = $sipAuthUsername; return $this; } /** * The sip_auth_password * * @param string $sipAuthPassword The sip_auth_password * @return $this Fluent Builder */ public function setSipAuthPassword($sipAuthPassword) { $this->options['sipAuthPassword'] = $sipAuthPassword; return $this; } /** * The dequeue_status_callback_event * * @param string $dequeueStatusCallbackEvent The dequeue_status_callback_event * @return $this Fluent Builder */ public function setDequeueStatusCallbackEvent($dequeueStatusCallbackEvent) { $this->options['dequeueStatusCallbackEvent'] = $dequeueStatusCallbackEvent; return $this; } /** * The post_work_activity_sid * * @param string $postWorkActivitySid The post_work_activity_sid * @return $this Fluent Builder */ public function setPostWorkActivitySid($postWorkActivitySid) { $this->options['postWorkActivitySid'] = $postWorkActivitySid; return $this; } /** * Provide a friendly representation * * @return 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/Twilio/Rest/Taskrouter/V1/Workspace/Worker/ReservationContext.php 0000604 00000013753 15174325126 0021743 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\Worker; 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 workspace_sid * @param string $workerSid The worker_sid * @param string $sid The sid * @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 */ 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 */ 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'], )); $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/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkerChannelPage.php 0000604 00000001563 15174325126 0021430 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/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersStatisticsInstance.php 0000604 00000006307 15174325126 0023266 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 workspace_sid * @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 */ 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/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersStatisticsPage.php 0000604 00000001447 15174325126 0022376 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/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersCumulativeStatisticsInstance.php 0000604 00000010724 15174325126 0025323 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 integer reservationsCreated * @property integer reservationsAccepted * @property integer reservationsRejected * @property integer reservationsTimedOut * @property integer reservationsCanceled * @property integer 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 workspace_sid * @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 */ 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/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersRealTimeStatisticsInstance.php 0000604 00000006772 15174325126 0024717 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 integer 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 workspace_sid * @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 */ 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/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersCumulativeStatisticsOptions.php 0000604 00000005505 15174325126 0025213 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 The end_date * @param integer $minutes The minutes * @param \DateTime $startDate The start_date * @param string $taskChannel The task_channel * @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 The end_date * @param integer $minutes The minutes * @param \DateTime $startDate The start_date * @param string $taskChannel The task_channel */ 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; } /** * The end_date * * @param \DateTime $endDate The end_date * @return $this Fluent Builder */ public function setEndDate($endDate) { $this->options['endDate'] = $endDate; return $this; } /** * The minutes * * @param integer $minutes The minutes * @return $this Fluent Builder */ public function setMinutes($minutes) { $this->options['minutes'] = $minutes; return $this; } /** * The start_date * * @param \DateTime $startDate The start_date * @return $this Fluent Builder */ public function setStartDate($startDate) { $this->options['startDate'] = $startDate; return $this; } /** * The task_channel * * @param string $taskChannel The task_channel * @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/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersRealTimeStatisticsPage.php 0000604 00000001555 15174325126 0024021 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/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersCumulativeStatisticsContext.php 0000604 00000004412 15174325126 0025200 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\Worker; 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 workspace_sid * @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 */ 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/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkerStatisticsList.php 0000604 00000002605 15174325126 0022247 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 workspace_sid * @param string $workerSid The worker_sid * @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/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersRealTimeStatisticsContext.php 0000604 00000004005 15174325126 0024562 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\Worker; 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 workspace_sid * @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 */ 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/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkerStatisticsOptions.php 0000604 00000005416 15174325126 0022772 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 integer $minutes The minutes * @param \DateTime $startDate The start_date * @param \DateTime $endDate The end_date * @param string $taskChannel The task_channel * @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 integer $minutes The minutes * @param \DateTime $startDate The start_date * @param \DateTime $endDate The end_date * @param string $taskChannel The task_channel */ 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; } /** * The minutes * * @param integer $minutes The minutes * @return $this Fluent Builder */ public function setMinutes($minutes) { $this->options['minutes'] = $minutes; return $this; } /** * The start_date * * @param \DateTime $startDate The start_date * @return $this Fluent Builder */ public function setStartDate($startDate) { $this->options['startDate'] = $startDate; return $this; } /** * The end_date * * @param \DateTime $endDate The end_date * @return $this Fluent Builder */ public function setEndDate($endDate) { $this->options['endDate'] = $endDate; return $this; } /** * The task_channel * * @param string $taskChannel The task_channel * @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/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkerStatisticsContext.php 0000604 00000004426 15174325126 0022763 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\Worker; 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 workspace_sid * @param string $workerSid The worker_sid * @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 */ 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/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersCumulativeStatisticsList.php 0000604 00000002460 15174325126 0024470 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 workspace_sid * @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/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersRealTimeStatisticsOptions.php 0000604 00000002767 15174325126 0024606 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 The task_channel * @return FetchWorkersRealTimeStatisticsOptions Options builder */ public static function fetch($taskChannel = Values::NONE) { return new FetchWorkersRealTimeStatisticsOptions($taskChannel); } } class FetchWorkersRealTimeStatisticsOptions extends Options { /** * @param string $taskChannel The task_channel */ public function __construct($taskChannel = Values::NONE) { $this->options['taskChannel'] = $taskChannel; } /** * The task_channel * * @param string $taskChannel The task_channel * @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/Twilio/Rest/Taskrouter/V1/Workspace/Worker/ReservationPage.php 0000604 00000001555 15174325126 0021170 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/Twilio/Rest/Taskrouter/V1/Workspace/Worker/ReservationInstance.php 0000604 00000010540 15174325126 0022052 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 workspace_sid * @param string $workerSid The worker_sid * @param string $sid The sid * @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 */ public function fetch() { return $this->proxy()->fetch(); } /** * Update the ReservationInstance * * @param array|Options $options Optional Arguments * @return ReservationInstance Updated ReservationInstance */ 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/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersRealTimeStatisticsList.php 0000604 00000002442 15174325126 0024054 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 workspace_sid * @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/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkerStatisticsInstance.php 0000604 00000006564 15174325126 0023110 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 workspace_sid * @param string $workerSid The worker_sid * @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 */ 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/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkerStatisticsPage.php 0000604 00000001574 15174325126 0022214 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/Twilio/Rest/Taskrouter/V1/Workspace/Worker/ReservationList.php 0000604 00000012714 15174325126 0021226 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 workspace_sid * @param string $workerSid The worker_sid * @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 * @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/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersCumulativeStatisticsPage.php 0000604 00000001563 15174325126 0024434 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/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceCumulativeStatisticsList.php 0000604 00000002451 15174325126 0023521 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 workspace_sid * @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/Twilio/Rest/Taskrouter/V1/Workspace/WorkerInstance.php 0000604 00000013745 15174325126 0017563 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 boolean 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 workspace_sid * @param string $sid The sid * @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 */ public function fetch() { return $this->proxy()->fetch(); } /** * Update the WorkerInstance * * @param array|Options $options Optional Arguments * @return WorkerInstance Updated WorkerInstance */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Deletes the WorkerInstance * * @return boolean True if delete succeeds, false otherwise */ 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/Twilio/Rest/Taskrouter/V1/Workspace/TaskPage.php 0000604 00000001371 15174325126 0016314 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/Twilio/Rest/Taskrouter/V1/Workspace/Task/ReservationInstance.php 0000604 00000011062 15174325126 0021503 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 workspace_sid * @param string $taskSid The task_sid * @param string $sid The sid * @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 */ public function fetch() { return $this->proxy()->fetch(); } /** * Update the ReservationInstance * * @param array|Options $options Optional Arguments * @return ReservationInstance Updated ReservationInstance */ 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/Twilio/Rest/Taskrouter/V1/Workspace/Task/ReservationOptions.php 0000604 00000074452 15174325126 0021406 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 The reservation_status * @return ReadReservationOptions Options builder */ public static function read($reservationStatus = Values::NONE) { return new ReadReservationOptions($reservationStatus); } /** * @param string $reservationStatus The reservation_status * @param string $workerActivitySid The worker_activity_sid * @param string $instruction The instruction * @param string $dequeuePostWorkActivitySid The dequeue_post_work_activity_sid * @param string $dequeueFrom The dequeue_from * @param string $dequeueRecord The dequeue_record * @param integer $dequeueTimeout The dequeue_timeout * @param string $dequeueTo The dequeue_to * @param string $dequeueStatusCallbackUrl The dequeue_status_callback_url * @param string $callFrom The call_from * @param string $callRecord The call_record * @param integer $callTimeout The call_timeout * @param string $callTo The call_to * @param string $callUrl The call_url * @param string $callStatusCallbackUrl The call_status_callback_url * @param boolean $callAccept The call_accept * @param string $redirectCallSid The redirect_call_sid * @param boolean $redirectAccept The redirect_accept * @param string $redirectUrl The redirect_url * @param string $to The to * @param string $from The from * @param string $statusCallback The status_callback * @param string $statusCallbackMethod The status_callback_method * @param string $statusCallbackEvent The status_callback_event * @param integer $timeout The timeout * @param boolean $record The record * @param boolean $muted The muted * @param string $beep The beep * @param boolean $startConferenceOnEnter The start_conference_on_enter * @param boolean $endConferenceOnExit The end_conference_on_exit * @param string $waitUrl The wait_url * @param string $waitMethod The wait_method * @param boolean $earlyMedia The early_media * @param integer $maxParticipants The max_participants * @param string $conferenceStatusCallback The conference_status_callback * @param string $conferenceStatusCallbackMethod The * conference_status_callback_method * @param string $conferenceStatusCallbackEvent The * conference_status_callback_event * @param string $conferenceRecord The conference_record * @param string $conferenceTrim The conference_trim * @param string $recordingChannels The recording_channels * @param string $recordingStatusCallback The recording_status_callback * @param string $recordingStatusCallbackMethod The * recording_status_callback_method * @param string $conferenceRecordingStatusCallback The * conference_recording_status_callback * @param string $conferenceRecordingStatusCallbackMethod The * conference_recording_status_callback_method * @param string $region The region * @param string $sipAuthUsername The sip_auth_username * @param string $sipAuthPassword The sip_auth_password * @param string $dequeueStatusCallbackEvent The dequeue_status_callback_event * @param string $postWorkActivitySid The post_work_activity_sid * @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) { 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); } } class ReadReservationOptions extends Options { /** * @param string $reservationStatus The reservation_status */ public function __construct($reservationStatus = Values::NONE) { $this->options['reservationStatus'] = $reservationStatus; } /** * The reservation_status * * @param string $reservationStatus The reservation_status * @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 reservation_status * @param string $workerActivitySid The worker_activity_sid * @param string $instruction The instruction * @param string $dequeuePostWorkActivitySid The dequeue_post_work_activity_sid * @param string $dequeueFrom The dequeue_from * @param string $dequeueRecord The dequeue_record * @param integer $dequeueTimeout The dequeue_timeout * @param string $dequeueTo The dequeue_to * @param string $dequeueStatusCallbackUrl The dequeue_status_callback_url * @param string $callFrom The call_from * @param string $callRecord The call_record * @param integer $callTimeout The call_timeout * @param string $callTo The call_to * @param string $callUrl The call_url * @param string $callStatusCallbackUrl The call_status_callback_url * @param boolean $callAccept The call_accept * @param string $redirectCallSid The redirect_call_sid * @param boolean $redirectAccept The redirect_accept * @param string $redirectUrl The redirect_url * @param string $to The to * @param string $from The from * @param string $statusCallback The status_callback * @param string $statusCallbackMethod The status_callback_method * @param string $statusCallbackEvent The status_callback_event * @param integer $timeout The timeout * @param boolean $record The record * @param boolean $muted The muted * @param string $beep The beep * @param boolean $startConferenceOnEnter The start_conference_on_enter * @param boolean $endConferenceOnExit The end_conference_on_exit * @param string $waitUrl The wait_url * @param string $waitMethod The wait_method * @param boolean $earlyMedia The early_media * @param integer $maxParticipants The max_participants * @param string $conferenceStatusCallback The conference_status_callback * @param string $conferenceStatusCallbackMethod The * conference_status_callback_method * @param string $conferenceStatusCallbackEvent The * conference_status_callback_event * @param string $conferenceRecord The conference_record * @param string $conferenceTrim The conference_trim * @param string $recordingChannels The recording_channels * @param string $recordingStatusCallback The recording_status_callback * @param string $recordingStatusCallbackMethod The * recording_status_callback_method * @param string $conferenceRecordingStatusCallback The * conference_recording_status_callback * @param string $conferenceRecordingStatusCallbackMethod The * conference_recording_status_callback_method * @param string $region The region * @param string $sipAuthUsername The sip_auth_username * @param string $sipAuthPassword The sip_auth_password * @param string $dequeueStatusCallbackEvent The dequeue_status_callback_event * @param string $postWorkActivitySid The post_work_activity_sid */ 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) { $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; } /** * The reservation_status * * @param string $reservationStatus The reservation_status * @return $this Fluent Builder */ public function setReservationStatus($reservationStatus) { $this->options['reservationStatus'] = $reservationStatus; return $this; } /** * The worker_activity_sid * * @param string $workerActivitySid The worker_activity_sid * @return $this Fluent Builder */ public function setWorkerActivitySid($workerActivitySid) { $this->options['workerActivitySid'] = $workerActivitySid; return $this; } /** * The instruction * * @param string $instruction The instruction * @return $this Fluent Builder */ public function setInstruction($instruction) { $this->options['instruction'] = $instruction; return $this; } /** * The dequeue_post_work_activity_sid * * @param string $dequeuePostWorkActivitySid The dequeue_post_work_activity_sid * @return $this Fluent Builder */ public function setDequeuePostWorkActivitySid($dequeuePostWorkActivitySid) { $this->options['dequeuePostWorkActivitySid'] = $dequeuePostWorkActivitySid; return $this; } /** * The dequeue_from * * @param string $dequeueFrom The dequeue_from * @return $this Fluent Builder */ public function setDequeueFrom($dequeueFrom) { $this->options['dequeueFrom'] = $dequeueFrom; return $this; } /** * The dequeue_record * * @param string $dequeueRecord The dequeue_record * @return $this Fluent Builder */ public function setDequeueRecord($dequeueRecord) { $this->options['dequeueRecord'] = $dequeueRecord; return $this; } /** * The dequeue_timeout * * @param integer $dequeueTimeout The dequeue_timeout * @return $this Fluent Builder */ public function setDequeueTimeout($dequeueTimeout) { $this->options['dequeueTimeout'] = $dequeueTimeout; return $this; } /** * The dequeue_to * * @param string $dequeueTo The dequeue_to * @return $this Fluent Builder */ public function setDequeueTo($dequeueTo) { $this->options['dequeueTo'] = $dequeueTo; return $this; } /** * The dequeue_status_callback_url * * @param string $dequeueStatusCallbackUrl The dequeue_status_callback_url * @return $this Fluent Builder */ public function setDequeueStatusCallbackUrl($dequeueStatusCallbackUrl) { $this->options['dequeueStatusCallbackUrl'] = $dequeueStatusCallbackUrl; return $this; } /** * The call_from * * @param string $callFrom The call_from * @return $this Fluent Builder */ public function setCallFrom($callFrom) { $this->options['callFrom'] = $callFrom; return $this; } /** * The call_record * * @param string $callRecord The call_record * @return $this Fluent Builder */ public function setCallRecord($callRecord) { $this->options['callRecord'] = $callRecord; return $this; } /** * The call_timeout * * @param integer $callTimeout The call_timeout * @return $this Fluent Builder */ public function setCallTimeout($callTimeout) { $this->options['callTimeout'] = $callTimeout; return $this; } /** * The call_to * * @param string $callTo The call_to * @return $this Fluent Builder */ public function setCallTo($callTo) { $this->options['callTo'] = $callTo; return $this; } /** * The call_url * * @param string $callUrl The call_url * @return $this Fluent Builder */ public function setCallUrl($callUrl) { $this->options['callUrl'] = $callUrl; return $this; } /** * The call_status_callback_url * * @param string $callStatusCallbackUrl The call_status_callback_url * @return $this Fluent Builder */ public function setCallStatusCallbackUrl($callStatusCallbackUrl) { $this->options['callStatusCallbackUrl'] = $callStatusCallbackUrl; return $this; } /** * The call_accept * * @param boolean $callAccept The call_accept * @return $this Fluent Builder */ public function setCallAccept($callAccept) { $this->options['callAccept'] = $callAccept; return $this; } /** * The redirect_call_sid * * @param string $redirectCallSid The redirect_call_sid * @return $this Fluent Builder */ public function setRedirectCallSid($redirectCallSid) { $this->options['redirectCallSid'] = $redirectCallSid; return $this; } /** * The redirect_accept * * @param boolean $redirectAccept The redirect_accept * @return $this Fluent Builder */ public function setRedirectAccept($redirectAccept) { $this->options['redirectAccept'] = $redirectAccept; return $this; } /** * The redirect_url * * @param string $redirectUrl The redirect_url * @return $this Fluent Builder */ public function setRedirectUrl($redirectUrl) { $this->options['redirectUrl'] = $redirectUrl; return $this; } /** * The to * * @param string $to The to * @return $this Fluent Builder */ public function setTo($to) { $this->options['to'] = $to; return $this; } /** * The from * * @param string $from The from * @return $this Fluent Builder */ public function setFrom($from) { $this->options['from'] = $from; return $this; } /** * The status_callback * * @param string $statusCallback The status_callback * @return $this Fluent Builder */ public function setStatusCallback($statusCallback) { $this->options['statusCallback'] = $statusCallback; return $this; } /** * The status_callback_method * * @param string $statusCallbackMethod The status_callback_method * @return $this Fluent Builder */ public function setStatusCallbackMethod($statusCallbackMethod) { $this->options['statusCallbackMethod'] = $statusCallbackMethod; return $this; } /** * The status_callback_event * * @param string $statusCallbackEvent The status_callback_event * @return $this Fluent Builder */ public function setStatusCallbackEvent($statusCallbackEvent) { $this->options['statusCallbackEvent'] = $statusCallbackEvent; return $this; } /** * The timeout * * @param integer $timeout The timeout * @return $this Fluent Builder */ public function setTimeout($timeout) { $this->options['timeout'] = $timeout; return $this; } /** * The record * * @param boolean $record The record * @return $this Fluent Builder */ public function setRecord($record) { $this->options['record'] = $record; return $this; } /** * The muted * * @param boolean $muted The muted * @return $this Fluent Builder */ public function setMuted($muted) { $this->options['muted'] = $muted; return $this; } /** * The beep * * @param string $beep The beep * @return $this Fluent Builder */ public function setBeep($beep) { $this->options['beep'] = $beep; return $this; } /** * The start_conference_on_enter * * @param boolean $startConferenceOnEnter The start_conference_on_enter * @return $this Fluent Builder */ public function setStartConferenceOnEnter($startConferenceOnEnter) { $this->options['startConferenceOnEnter'] = $startConferenceOnEnter; return $this; } /** * The end_conference_on_exit * * @param boolean $endConferenceOnExit The end_conference_on_exit * @return $this Fluent Builder */ public function setEndConferenceOnExit($endConferenceOnExit) { $this->options['endConferenceOnExit'] = $endConferenceOnExit; return $this; } /** * The wait_url * * @param string $waitUrl The wait_url * @return $this Fluent Builder */ public function setWaitUrl($waitUrl) { $this->options['waitUrl'] = $waitUrl; return $this; } /** * The wait_method * * @param string $waitMethod The wait_method * @return $this Fluent Builder */ public function setWaitMethod($waitMethod) { $this->options['waitMethod'] = $waitMethod; return $this; } /** * The early_media * * @param boolean $earlyMedia The early_media * @return $this Fluent Builder */ public function setEarlyMedia($earlyMedia) { $this->options['earlyMedia'] = $earlyMedia; return $this; } /** * The max_participants * * @param integer $maxParticipants The max_participants * @return $this Fluent Builder */ public function setMaxParticipants($maxParticipants) { $this->options['maxParticipants'] = $maxParticipants; return $this; } /** * The conference_status_callback * * @param string $conferenceStatusCallback The conference_status_callback * @return $this Fluent Builder */ public function setConferenceStatusCallback($conferenceStatusCallback) { $this->options['conferenceStatusCallback'] = $conferenceStatusCallback; return $this; } /** * The conference_status_callback_method * * @param string $conferenceStatusCallbackMethod The * conference_status_callback_method * @return $this Fluent Builder */ public function setConferenceStatusCallbackMethod($conferenceStatusCallbackMethod) { $this->options['conferenceStatusCallbackMethod'] = $conferenceStatusCallbackMethod; return $this; } /** * The conference_status_callback_event * * @param string $conferenceStatusCallbackEvent The * conference_status_callback_event * @return $this Fluent Builder */ public function setConferenceStatusCallbackEvent($conferenceStatusCallbackEvent) { $this->options['conferenceStatusCallbackEvent'] = $conferenceStatusCallbackEvent; return $this; } /** * The conference_record * * @param string $conferenceRecord The conference_record * @return $this Fluent Builder */ public function setConferenceRecord($conferenceRecord) { $this->options['conferenceRecord'] = $conferenceRecord; return $this; } /** * The conference_trim * * @param string $conferenceTrim The conference_trim * @return $this Fluent Builder */ public function setConferenceTrim($conferenceTrim) { $this->options['conferenceTrim'] = $conferenceTrim; return $this; } /** * The recording_channels * * @param string $recordingChannels The recording_channels * @return $this Fluent Builder */ public function setRecordingChannels($recordingChannels) { $this->options['recordingChannels'] = $recordingChannels; return $this; } /** * The recording_status_callback * * @param string $recordingStatusCallback The recording_status_callback * @return $this Fluent Builder */ public function setRecordingStatusCallback($recordingStatusCallback) { $this->options['recordingStatusCallback'] = $recordingStatusCallback; return $this; } /** * The recording_status_callback_method * * @param string $recordingStatusCallbackMethod The * recording_status_callback_method * @return $this Fluent Builder */ public function setRecordingStatusCallbackMethod($recordingStatusCallbackMethod) { $this->options['recordingStatusCallbackMethod'] = $recordingStatusCallbackMethod; return $this; } /** * The conference_recording_status_callback * * @param string $conferenceRecordingStatusCallback The * conference_recording_status_callback * @return $this Fluent Builder */ public function setConferenceRecordingStatusCallback($conferenceRecordingStatusCallback) { $this->options['conferenceRecordingStatusCallback'] = $conferenceRecordingStatusCallback; return $this; } /** * The conference_recording_status_callback_method * * @param string $conferenceRecordingStatusCallbackMethod The * conference_recording_status_callback_method * @return $this Fluent Builder */ public function setConferenceRecordingStatusCallbackMethod($conferenceRecordingStatusCallbackMethod) { $this->options['conferenceRecordingStatusCallbackMethod'] = $conferenceRecordingStatusCallbackMethod; return $this; } /** * The region * * @param string $region The region * @return $this Fluent Builder */ public function setRegion($region) { $this->options['region'] = $region; return $this; } /** * The sip_auth_username * * @param string $sipAuthUsername The sip_auth_username * @return $this Fluent Builder */ public function setSipAuthUsername($sipAuthUsername) { $this->options['sipAuthUsername'] = $sipAuthUsername; return $this; } /** * The sip_auth_password * * @param string $sipAuthPassword The sip_auth_password * @return $this Fluent Builder */ public function setSipAuthPassword($sipAuthPassword) { $this->options['sipAuthPassword'] = $sipAuthPassword; return $this; } /** * The dequeue_status_callback_event * * @param string $dequeueStatusCallbackEvent The dequeue_status_callback_event * @return $this Fluent Builder */ public function setDequeueStatusCallbackEvent($dequeueStatusCallbackEvent) { $this->options['dequeueStatusCallbackEvent'] = $dequeueStatusCallbackEvent; return $this; } /** * The post_work_activity_sid * * @param string $postWorkActivitySid The post_work_activity_sid * @return $this Fluent Builder */ public function setPostWorkActivitySid($postWorkActivitySid) { $this->options['postWorkActivitySid'] = $postWorkActivitySid; return $this; } /** * Provide a friendly representation * * @return 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/Twilio/Rest/Taskrouter/V1/Workspace/Task/ReservationContext.php 0000604 00000013725 15174325126 0021373 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace\Task; 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 workspace_sid * @param string $taskSid The task_sid * @param string $sid The sid * @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 */ 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 */ 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'], )); $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/Twilio/Rest/Taskrouter/V1/Workspace/Task/ReservationList.php 0000604 00000012666 15174325126 0020665 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 workspace_sid * @param string $taskSid The task_sid * @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 * @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/Twilio/Rest/Taskrouter/V1/Workspace/Task/ReservationPage.php 0000604 00000001551 15174325126 0020615 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/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueueInstance.php 0000604 00000013634 15174325126 0020216 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 integer 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 workspace_sid * @param string $sid The sid * @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 */ public function fetch() { return $this->proxy()->fetch(); } /** * Update the TaskQueueInstance * * @param array|Options $options Optional Arguments * @return TaskQueueInstance Updated TaskQueueInstance */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Deletes the TaskQueueInstance * * @return boolean True if delete succeeds, false otherwise */ 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/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceRealTimeStatisticsContext.php 0000604 00000004001 15174325126 0023607 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1\Workspace; 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 workspace_sid * @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 */ 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/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceRealTimeStatisticsPage.php 0000604 00000001554 15174325126 0023051 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/Twilio/Rest/Taskrouter/V1/Workspace/ActivityList.php 0000604 00000013732 15174325126 0017251 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 ActivityList extends ListResource { /** * Construct the ActivityList * * @param Version $version Version that contains the resource * @param string $workspaceSid The workspace_sid * @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 The friendly_name * @param array|Options $options Optional Arguments * @return ActivityInstance Newly created ActivityInstance */ 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 * @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/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceRealTimeStatisticsOptions.php 0000604 00000002772 15174325126 0023633 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 The task_channel * @return FetchWorkspaceRealTimeStatisticsOptions Options builder */ public static function fetch($taskChannel = Values::NONE) { return new FetchWorkspaceRealTimeStatisticsOptions($taskChannel); } } class FetchWorkspaceRealTimeStatisticsOptions extends Options { /** * @param string $taskChannel The task_channel */ public function __construct($taskChannel = Values::NONE) { $this->options['taskChannel'] = $taskChannel; } /** * The task_channel * * @param string $taskChannel The task_channel * @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/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueueContext.php 0000604 00000015154 15174325126 0020075 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 workspace_sid * @param string $sid The sid * @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 */ 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 */ 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 */ 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 \Twilio\Exceptions\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 \Twilio\Exceptions\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/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueueOptions.php 0000604 00000021632 15174325126 0020102 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 The friendly_name * @param string $targetWorkers The target_workers * @param string $reservationActivitySid The reservation_activity_sid * @param string $assignmentActivitySid The assignment_activity_sid * @param integer $maxReservedWorkers The max_reserved_workers * @param string $taskOrder The task_order * @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 * @param string $evaluateWorkerAttributes The evaluate_worker_attributes * @param string $workerSid The worker_sid * @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 The target_workers * @param integer $maxReservedWorkers The max_reserved_workers * @param string $taskOrder The task_order * @return CreateTaskQueueOptions Options builder */ public static function create($targetWorkers = Values::NONE, $maxReservedWorkers = Values::NONE, $taskOrder = Values::NONE) { return new CreateTaskQueueOptions($targetWorkers, $maxReservedWorkers, $taskOrder); } } class UpdateTaskQueueOptions extends Options { /** * @param string $friendlyName The friendly_name * @param string $targetWorkers The target_workers * @param string $reservationActivitySid The reservation_activity_sid * @param string $assignmentActivitySid The assignment_activity_sid * @param integer $maxReservedWorkers The max_reserved_workers * @param string $taskOrder The task_order */ 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; } /** * The friendly_name * * @param string $friendlyName The friendly_name * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The target_workers * * @param string $targetWorkers The target_workers * @return $this Fluent Builder */ public function setTargetWorkers($targetWorkers) { $this->options['targetWorkers'] = $targetWorkers; return $this; } /** * The reservation_activity_sid * * @param string $reservationActivitySid The reservation_activity_sid * @return $this Fluent Builder */ public function setReservationActivitySid($reservationActivitySid) { $this->options['reservationActivitySid'] = $reservationActivitySid; return $this; } /** * The assignment_activity_sid * * @param string $assignmentActivitySid The assignment_activity_sid * @return $this Fluent Builder */ public function setAssignmentActivitySid($assignmentActivitySid) { $this->options['assignmentActivitySid'] = $assignmentActivitySid; return $this; } /** * The max_reserved_workers * * @param integer $maxReservedWorkers The max_reserved_workers * @return $this Fluent Builder */ public function setMaxReservedWorkers($maxReservedWorkers) { $this->options['maxReservedWorkers'] = $maxReservedWorkers; return $this; } /** * The task_order * * @param string $taskOrder The task_order * @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 * @param string $evaluateWorkerAttributes The evaluate_worker_attributes * @param string $workerSid The worker_sid */ 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 * * @param string $friendlyName The friendly_name * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The evaluate_worker_attributes * * @param string $evaluateWorkerAttributes The evaluate_worker_attributes * @return $this Fluent Builder */ public function setEvaluateWorkerAttributes($evaluateWorkerAttributes) { $this->options['evaluateWorkerAttributes'] = $evaluateWorkerAttributes; return $this; } /** * The worker_sid * * @param string $workerSid The worker_sid * @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 The target_workers * @param integer $maxReservedWorkers The max_reserved_workers * @param string $taskOrder The task_order */ public function __construct($targetWorkers = Values::NONE, $maxReservedWorkers = Values::NONE, $taskOrder = Values::NONE) { $this->options['targetWorkers'] = $targetWorkers; $this->options['maxReservedWorkers'] = $maxReservedWorkers; $this->options['taskOrder'] = $taskOrder; } /** * The target_workers * * @param string $targetWorkers The target_workers * @return $this Fluent Builder */ public function setTargetWorkers($targetWorkers) { $this->options['targetWorkers'] = $targetWorkers; return $this; } /** * The max_reserved_workers * * @param integer $maxReservedWorkers The max_reserved_workers * @return $this Fluent Builder */ public function setMaxReservedWorkers($maxReservedWorkers) { $this->options['maxReservedWorkers'] = $maxReservedWorkers; return $this; } /** * The task_order * * @param string $taskOrder The task_order * @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.CreateTaskQueueOptions ' . implode(' ', $options) . ']'; } } sdk/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceCumulativeStatisticsPage.php 0000604 00000001562 15174325126 0023464 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/Twilio/Rest/Taskrouter/V1/Workspace/EventInstance.php 0000604 00000010332 15174325126 0017360 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 string eventData * @property \DateTime eventDate * @property string eventType * @property string resourceSid * @property string resourceType * @property string resourceUrl * @property string sid * @property string source * @property string sourceIpAddress * @property string url */ 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 * @param string $sid The sid * @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')), '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'), ); $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 */ 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/Twilio/Rest/Taskrouter/V1/Workspace/WorkerContext.php 0000604 00000017271 15174325126 0017441 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\WorkersCumulativeStatisticsList; use Twilio\Rest\Taskrouter\V1\Workspace\Worker\WorkersRealTimeStatisticsList; use Twilio\Rest\Taskrouter\V1\Workspace\Worker\WorkerStatisticsList; 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 workspace_sid * @param string $sid The sid * @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 */ 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 */ public function update($options = array()) { $options = new Values($options); $data = Values::of(array( 'ActivitySid' => $options['activitySid'], 'Attributes' => $options['attributes'], 'FriendlyName' => $options['friendlyName'], )); $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 */ 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 \Twilio\Exceptions\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 \Twilio\Exceptions\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/Twilio/Rest/Taskrouter/V1/Workspace/ActivityPage.php 0000604 00000001405 15174325126 0017204 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/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceRealTimeStatisticsList.php 0000604 00000002433 15174325126 0023105 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 workspace_sid * @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/Twilio/Rest/Taskrouter/V1/Workspace/TaskList.php 0000604 00000014641 15174325126 0016357 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 TaskList extends ListResource { /** * Construct the TaskList * * @param Version $version Version that contains the resource * @param string $workspaceSid The workspace_sid * @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 */ 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 * @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/Twilio/Rest/Taskrouter/V1/Workspace/ActivityInstance.php 0000604 00000010234 15174325126 0020074 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 boolean 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 workspace_sid * @param string $sid The sid * @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 */ public function fetch() { return $this->proxy()->fetch(); } /** * Update the ActivityInstance * * @param array|Options $options Optional Arguments * @return ActivityInstance Updated ActivityInstance */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Deletes the ActivityInstance * * @return boolean True if delete succeeds, false otherwise */ 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/Twilio/Rest/Taskrouter/V1/Workspace/WorkerOptions.php 0000604 00000020471 15174325126 0017444 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 * @param string $activitySid The activity_sid * @param string $available The available * @param string $friendlyName The friendly_name * @param string $targetWorkersExpression The target_workers_expression * @param string $taskQueueName The task_queue_name * @param string $taskQueueSid The task_queue_sid * @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 activity_sid * @param string $attributes The attributes * @return CreateWorkerOptions Options builder */ public static function create($activitySid = Values::NONE, $attributes = Values::NONE) { return new CreateWorkerOptions($activitySid, $attributes); } /** * @param string $activitySid The activity_sid * @param string $attributes The attributes * @param string $friendlyName The friendly_name * @return UpdateWorkerOptions Options builder */ public static function update($activitySid = Values::NONE, $attributes = Values::NONE, $friendlyName = Values::NONE) { return new UpdateWorkerOptions($activitySid, $attributes, $friendlyName); } } class ReadWorkerOptions extends Options { /** * @param string $activityName The activity_name * @param string $activitySid The activity_sid * @param string $available The available * @param string $friendlyName The friendly_name * @param string $targetWorkersExpression The target_workers_expression * @param string $taskQueueName The task_queue_name * @param string $taskQueueSid The task_queue_sid */ 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 * * @param string $activityName The activity_name * @return $this Fluent Builder */ public function setActivityName($activityName) { $this->options['activityName'] = $activityName; return $this; } /** * The activity_sid * * @param string $activitySid The activity_sid * @return $this Fluent Builder */ public function setActivitySid($activitySid) { $this->options['activitySid'] = $activitySid; return $this; } /** * The available * * @param string $available The available * @return $this Fluent Builder */ public function setAvailable($available) { $this->options['available'] = $available; 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 target_workers_expression * * @param string $targetWorkersExpression The target_workers_expression * @return $this Fluent Builder */ public function setTargetWorkersExpression($targetWorkersExpression) { $this->options['targetWorkersExpression'] = $targetWorkersExpression; return $this; } /** * The task_queue_name * * @param string $taskQueueName The task_queue_name * @return $this Fluent Builder */ public function setTaskQueueName($taskQueueName) { $this->options['taskQueueName'] = $taskQueueName; return $this; } /** * The task_queue_sid * * @param string $taskQueueSid The task_queue_sid * @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 activity_sid * @param string $attributes The attributes */ public function __construct($activitySid = Values::NONE, $attributes = Values::NONE) { $this->options['activitySid'] = $activitySid; $this->options['attributes'] = $attributes; } /** * The activity_sid * * @param string $activitySid The activity_sid * @return $this Fluent Builder */ public function setActivitySid($activitySid) { $this->options['activitySid'] = $activitySid; return $this; } /** * The attributes * * @param string $attributes The attributes * @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 activity_sid * @param string $attributes The attributes * @param string $friendlyName The friendly_name */ public function __construct($activitySid = Values::NONE, $attributes = Values::NONE, $friendlyName = Values::NONE) { $this->options['activitySid'] = $activitySid; $this->options['attributes'] = $attributes; $this->options['friendlyName'] = $friendlyName; } /** * The activity_sid * * @param string $activitySid The activity_sid * @return $this Fluent Builder */ public function setActivitySid($activitySid) { $this->options['activitySid'] = $activitySid; return $this; } /** * The attributes * * @param string $attributes The attributes * @return $this Fluent Builder */ public function setAttributes($attributes) { $this->options['attributes'] = $attributes; 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.Taskrouter.V1.UpdateWorkerOptions ' . implode(' ', $options) . ']'; } } sdk/Twilio/Rest/Taskrouter/V1/WorkspaceOptions.php 0000604 00000022731 15174325126 0016174 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 default_activity_sid * @param string $eventCallbackUrl The event_callback_url * @param string $eventsFilter The events_filter * @param string $friendlyName The friendly_name * @param boolean $multiTaskEnabled The multi_task_enabled * @param string $timeoutActivitySid The timeout_activity_sid * @param string $prioritizeQueueOrder The prioritize_queue_order * @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 * @return ReadWorkspaceOptions Options builder */ public static function read($friendlyName = Values::NONE) { return new ReadWorkspaceOptions($friendlyName); } /** * @param string $eventCallbackUrl The event_callback_url * @param string $eventsFilter The events_filter * @param boolean $multiTaskEnabled The multi_task_enabled * @param string $template The template * @param string $prioritizeQueueOrder The prioritize_queue_order * @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 default_activity_sid * @param string $eventCallbackUrl The event_callback_url * @param string $eventsFilter The events_filter * @param string $friendlyName The friendly_name * @param boolean $multiTaskEnabled The multi_task_enabled * @param string $timeoutActivitySid The timeout_activity_sid * @param string $prioritizeQueueOrder The prioritize_queue_order */ 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 default_activity_sid * * @param string $defaultActivitySid The default_activity_sid * @return $this Fluent Builder */ public function setDefaultActivitySid($defaultActivitySid) { $this->options['defaultActivitySid'] = $defaultActivitySid; return $this; } /** * The event_callback_url * * @param string $eventCallbackUrl The event_callback_url * @return $this Fluent Builder */ public function setEventCallbackUrl($eventCallbackUrl) { $this->options['eventCallbackUrl'] = $eventCallbackUrl; return $this; } /** * The events_filter * * @param string $eventsFilter The events_filter * @return $this Fluent Builder */ public function setEventsFilter($eventsFilter) { $this->options['eventsFilter'] = $eventsFilter; 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 multi_task_enabled * * @param boolean $multiTaskEnabled The multi_task_enabled * @return $this Fluent Builder */ public function setMultiTaskEnabled($multiTaskEnabled) { $this->options['multiTaskEnabled'] = $multiTaskEnabled; return $this; } /** * The timeout_activity_sid * * @param string $timeoutActivitySid The timeout_activity_sid * @return $this Fluent Builder */ public function setTimeoutActivitySid($timeoutActivitySid) { $this->options['timeoutActivitySid'] = $timeoutActivitySid; return $this; } /** * The prioritize_queue_order * * @param string $prioritizeQueueOrder The prioritize_queue_order * @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 */ 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.Taskrouter.V1.ReadWorkspaceOptions ' . implode(' ', $options) . ']'; } } class CreateWorkspaceOptions extends Options { /** * @param string $eventCallbackUrl The event_callback_url * @param string $eventsFilter The events_filter * @param boolean $multiTaskEnabled The multi_task_enabled * @param string $template The template * @param string $prioritizeQueueOrder The prioritize_queue_order */ 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 event_callback_url * * @param string $eventCallbackUrl The event_callback_url * @return $this Fluent Builder */ public function setEventCallbackUrl($eventCallbackUrl) { $this->options['eventCallbackUrl'] = $eventCallbackUrl; return $this; } /** * The events_filter * * @param string $eventsFilter The events_filter * @return $this Fluent Builder */ public function setEventsFilter($eventsFilter) { $this->options['eventsFilter'] = $eventsFilter; return $this; } /** * The multi_task_enabled * * @param boolean $multiTaskEnabled The multi_task_enabled * @return $this Fluent Builder */ public function setMultiTaskEnabled($multiTaskEnabled) { $this->options['multiTaskEnabled'] = $multiTaskEnabled; return $this; } /** * The template * * @param string $template The template * @return $this Fluent Builder */ public function setTemplate($template) { $this->options['template'] = $template; return $this; } /** * The prioritize_queue_order * * @param string $prioritizeQueueOrder The prioritize_queue_order * @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/Twilio/Rest/Taskrouter/V1/WorkspaceContext.php 0000604 00000023772 15174325126 0016173 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 * @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 */ 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 */ 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 */ 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 \Twilio\Exceptions\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 \Twilio\Exceptions\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/Twilio/Rest/Taskrouter/V1/WorkspaceInstance.php 0000604 00000016313 15174325126 0016304 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 boolean 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 * @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 */ public function fetch() { return $this->proxy()->fetch(); } /** * Update the WorkspaceInstance * * @param array|Options $options Optional Arguments * @return WorkspaceInstance Updated WorkspaceInstance */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Deletes the WorkspaceInstance * * @return boolean True if delete succeeds, false otherwise */ 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/Twilio/Rest/Taskrouter/V1/WorkspaceList.php 0000604 00000013706 15174325126 0015456 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Taskrouter\V1; 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 The friendly_name * @param array|Options $options Optional Arguments * @return WorkspaceInstance Newly created WorkspaceInstance */ 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 * @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/Twilio/Rest/Taskrouter/V1/WorkspacePage.php 0000604 00000001335 15174325126 0015412 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/Twilio/Rest/IpMessaging/V2/CredentialContext.php 0000604 00000005170 15174325126 0016343 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V2; 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 * @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 */ 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 */ 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 */ 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/Twilio/Rest/IpMessaging/V2/CredentialOptions.php 0000604 00000015765 15174325126 0016365 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 The friendly_name * @param string $certificate The certificate * @param string $privateKey The private_key * @param boolean $sandbox The sandbox * @param string $apiKey The api_key * @param string $secret The secret * @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 The friendly_name * @param string $certificate The certificate * @param string $privateKey The private_key * @param boolean $sandbox The sandbox * @param string $apiKey The api_key * @param string $secret The secret * @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 The friendly_name * @param string $certificate The certificate * @param string $privateKey The private_key * @param boolean $sandbox The sandbox * @param string $apiKey The api_key * @param string $secret The secret */ 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; } /** * The friendly_name * * @param string $friendlyName The friendly_name * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The certificate * * @param string $certificate The certificate * @return $this Fluent Builder */ public function setCertificate($certificate) { $this->options['certificate'] = $certificate; return $this; } /** * The private_key * * @param string $privateKey The private_key * @return $this Fluent Builder */ public function setPrivateKey($privateKey) { $this->options['privateKey'] = $privateKey; return $this; } /** * The sandbox * * @param boolean $sandbox The sandbox * @return $this Fluent Builder */ public function setSandbox($sandbox) { $this->options['sandbox'] = $sandbox; return $this; } /** * The api_key * * @param string $apiKey The api_key * @return $this Fluent Builder */ public function setApiKey($apiKey) { $this->options['apiKey'] = $apiKey; return $this; } /** * The secret * * @param string $secret The secret * @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 The friendly_name * @param string $certificate The certificate * @param string $privateKey The private_key * @param boolean $sandbox The sandbox * @param string $apiKey The api_key * @param string $secret The secret */ 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; } /** * The friendly_name * * @param string $friendlyName The friendly_name * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The certificate * * @param string $certificate The certificate * @return $this Fluent Builder */ public function setCertificate($certificate) { $this->options['certificate'] = $certificate; return $this; } /** * The private_key * * @param string $privateKey The private_key * @return $this Fluent Builder */ public function setPrivateKey($privateKey) { $this->options['privateKey'] = $privateKey; return $this; } /** * The sandbox * * @param boolean $sandbox The sandbox * @return $this Fluent Builder */ public function setSandbox($sandbox) { $this->options['sandbox'] = $sandbox; return $this; } /** * The api_key * * @param string $apiKey The api_key * @return $this Fluent Builder */ public function setApiKey($apiKey) { $this->options['apiKey'] = $apiKey; return $this; } /** * The secret * * @param string $secret The secret * @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/Twilio/Rest/IpMessaging/V2/ServiceInstance.php 0000604 00000015106 15174325126 0016011 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 boolean readStatusEnabled * @property boolean reachabilityEnabled * @property integer typingIndicatorTimeout * @property integer consumptionReportInterval * @property array limits * @property string preWebhookUrl * @property string postWebhookUrl * @property string webhookMethod * @property string webhookFilters * @property integer preWebhookRetryCount * @property integer 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 * @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 */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the ServiceInstance * * @return boolean True if delete succeeds, false otherwise */ public function delete() { return $this->proxy()->delete(); } /** * Update the ServiceInstance * * @param array|Options $options Optional Arguments * @return ServiceInstance Updated ServiceInstance */ 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/Twilio/Rest/IpMessaging/V2/ServiceOptions.php 0000604 00000063276 15174325126 0015713 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 The friendly_name * @param string $defaultServiceRoleSid The default_service_role_sid * @param string $defaultChannelRoleSid The default_channel_role_sid * @param string $defaultChannelCreatorRoleSid The * default_channel_creator_role_sid * @param boolean $readStatusEnabled The read_status_enabled * @param boolean $reachabilityEnabled The reachability_enabled * @param integer $typingIndicatorTimeout The typing_indicator_timeout * @param integer $consumptionReportInterval The consumption_report_interval * @param boolean $notificationsNewMessageEnabled The * notifications.new_message.enabled * @param string $notificationsNewMessageTemplate The * notifications.new_message.template * @param string $notificationsNewMessageSound The * notifications.new_message.sound * @param boolean $notificationsNewMessageBadgeCountEnabled The * notifications.new_message.badge_count_enabled * @param boolean $notificationsAddedToChannelEnabled The * notifications.added_to_channel.enabled * @param string $notificationsAddedToChannelTemplate The * notifications.added_to_channel.template * @param string $notificationsAddedToChannelSound The * notifications.added_to_channel.sound * @param boolean $notificationsRemovedFromChannelEnabled The * notifications.removed_from_channel.enabled * @param string $notificationsRemovedFromChannelTemplate The * notifications.removed_from_channel.template * @param string $notificationsRemovedFromChannelSound The * notifications.removed_from_channel.sound * @param boolean $notificationsInvitedToChannelEnabled The * notifications.invited_to_channel.enabled * @param string $notificationsInvitedToChannelTemplate The * notifications.invited_to_channel.template * @param string $notificationsInvitedToChannelSound The * notifications.invited_to_channel.sound * @param string $preWebhookUrl The pre_webhook_url * @param string $postWebhookUrl The post_webhook_url * @param string $webhookMethod The webhook_method * @param string $webhookFilters The webhook_filters * @param integer $limitsChannelMembers The limits.channel_members * @param integer $limitsUserChannels The limits.user_channels * @param string $mediaCompatibilityMessage The media.compatibility_message * @param integer $preWebhookRetryCount The pre_webhook_retry_count * @param integer $postWebhookRetryCount The post_webhook_retry_count * @param boolean $notificationsLogEnabled The notifications.log_enabled * @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 The friendly_name * @param string $defaultServiceRoleSid The default_service_role_sid * @param string $defaultChannelRoleSid The default_channel_role_sid * @param string $defaultChannelCreatorRoleSid The * default_channel_creator_role_sid * @param boolean $readStatusEnabled The read_status_enabled * @param boolean $reachabilityEnabled The reachability_enabled * @param integer $typingIndicatorTimeout The typing_indicator_timeout * @param integer $consumptionReportInterval The consumption_report_interval * @param boolean $notificationsNewMessageEnabled The * notifications.new_message.enabled * @param string $notificationsNewMessageTemplate The * notifications.new_message.template * @param string $notificationsNewMessageSound The * notifications.new_message.sound * @param boolean $notificationsNewMessageBadgeCountEnabled The * notifications.new_message.badge_count_enabled * @param boolean $notificationsAddedToChannelEnabled The * notifications.added_to_channel.enabled * @param string $notificationsAddedToChannelTemplate The * notifications.added_to_channel.template * @param string $notificationsAddedToChannelSound The * notifications.added_to_channel.sound * @param boolean $notificationsRemovedFromChannelEnabled The * notifications.removed_from_channel.enabled * @param string $notificationsRemovedFromChannelTemplate The * notifications.removed_from_channel.template * @param string $notificationsRemovedFromChannelSound The * notifications.removed_from_channel.sound * @param boolean $notificationsInvitedToChannelEnabled The * notifications.invited_to_channel.enabled * @param string $notificationsInvitedToChannelTemplate The * notifications.invited_to_channel.template * @param string $notificationsInvitedToChannelSound The * notifications.invited_to_channel.sound * @param string $preWebhookUrl The pre_webhook_url * @param string $postWebhookUrl The post_webhook_url * @param string $webhookMethod The webhook_method * @param string $webhookFilters The webhook_filters * @param integer $limitsChannelMembers The limits.channel_members * @param integer $limitsUserChannels The limits.user_channels * @param string $mediaCompatibilityMessage The media.compatibility_message * @param integer $preWebhookRetryCount The pre_webhook_retry_count * @param integer $postWebhookRetryCount The post_webhook_retry_count * @param boolean $notificationsLogEnabled The notifications.log_enabled */ 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; } /** * The friendly_name * * @param string $friendlyName The friendly_name * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The default_service_role_sid * * @param string $defaultServiceRoleSid The default_service_role_sid * @return $this Fluent Builder */ public function setDefaultServiceRoleSid($defaultServiceRoleSid) { $this->options['defaultServiceRoleSid'] = $defaultServiceRoleSid; return $this; } /** * The default_channel_role_sid * * @param string $defaultChannelRoleSid The default_channel_role_sid * @return $this Fluent Builder */ public function setDefaultChannelRoleSid($defaultChannelRoleSid) { $this->options['defaultChannelRoleSid'] = $defaultChannelRoleSid; return $this; } /** * The default_channel_creator_role_sid * * @param string $defaultChannelCreatorRoleSid The * default_channel_creator_role_sid * @return $this Fluent Builder */ public function setDefaultChannelCreatorRoleSid($defaultChannelCreatorRoleSid) { $this->options['defaultChannelCreatorRoleSid'] = $defaultChannelCreatorRoleSid; return $this; } /** * The read_status_enabled * * @param boolean $readStatusEnabled The read_status_enabled * @return $this Fluent Builder */ public function setReadStatusEnabled($readStatusEnabled) { $this->options['readStatusEnabled'] = $readStatusEnabled; return $this; } /** * The reachability_enabled * * @param boolean $reachabilityEnabled The reachability_enabled * @return $this Fluent Builder */ public function setReachabilityEnabled($reachabilityEnabled) { $this->options['reachabilityEnabled'] = $reachabilityEnabled; return $this; } /** * The typing_indicator_timeout * * @param integer $typingIndicatorTimeout The typing_indicator_timeout * @return $this Fluent Builder */ public function setTypingIndicatorTimeout($typingIndicatorTimeout) { $this->options['typingIndicatorTimeout'] = $typingIndicatorTimeout; return $this; } /** * The consumption_report_interval * * @param integer $consumptionReportInterval The consumption_report_interval * @return $this Fluent Builder */ public function setConsumptionReportInterval($consumptionReportInterval) { $this->options['consumptionReportInterval'] = $consumptionReportInterval; return $this; } /** * The notifications.new_message.enabled * * @param boolean $notificationsNewMessageEnabled The * notifications.new_message.enabled * @return $this Fluent Builder */ public function setNotificationsNewMessageEnabled($notificationsNewMessageEnabled) { $this->options['notificationsNewMessageEnabled'] = $notificationsNewMessageEnabled; return $this; } /** * The notifications.new_message.template * * @param string $notificationsNewMessageTemplate The * notifications.new_message.template * @return $this Fluent Builder */ public function setNotificationsNewMessageTemplate($notificationsNewMessageTemplate) { $this->options['notificationsNewMessageTemplate'] = $notificationsNewMessageTemplate; return $this; } /** * The notifications.new_message.sound * * @param string $notificationsNewMessageSound The * notifications.new_message.sound * @return $this Fluent Builder */ public function setNotificationsNewMessageSound($notificationsNewMessageSound) { $this->options['notificationsNewMessageSound'] = $notificationsNewMessageSound; return $this; } /** * The notifications.new_message.badge_count_enabled * * @param boolean $notificationsNewMessageBadgeCountEnabled The * notifications.new_message.badge_count_enabled * @return $this Fluent Builder */ public function setNotificationsNewMessageBadgeCountEnabled($notificationsNewMessageBadgeCountEnabled) { $this->options['notificationsNewMessageBadgeCountEnabled'] = $notificationsNewMessageBadgeCountEnabled; return $this; } /** * The notifications.added_to_channel.enabled * * @param boolean $notificationsAddedToChannelEnabled The * notifications.added_to_channel.enabled * @return $this Fluent Builder */ public function setNotificationsAddedToChannelEnabled($notificationsAddedToChannelEnabled) { $this->options['notificationsAddedToChannelEnabled'] = $notificationsAddedToChannelEnabled; return $this; } /** * The notifications.added_to_channel.template * * @param string $notificationsAddedToChannelTemplate The * notifications.added_to_channel.template * @return $this Fluent Builder */ public function setNotificationsAddedToChannelTemplate($notificationsAddedToChannelTemplate) { $this->options['notificationsAddedToChannelTemplate'] = $notificationsAddedToChannelTemplate; return $this; } /** * The notifications.added_to_channel.sound * * @param string $notificationsAddedToChannelSound The * notifications.added_to_channel.sound * @return $this Fluent Builder */ public function setNotificationsAddedToChannelSound($notificationsAddedToChannelSound) { $this->options['notificationsAddedToChannelSound'] = $notificationsAddedToChannelSound; return $this; } /** * The notifications.removed_from_channel.enabled * * @param boolean $notificationsRemovedFromChannelEnabled The * notifications.removed_from_channel.enabled * @return $this Fluent Builder */ public function setNotificationsRemovedFromChannelEnabled($notificationsRemovedFromChannelEnabled) { $this->options['notificationsRemovedFromChannelEnabled'] = $notificationsRemovedFromChannelEnabled; return $this; } /** * The notifications.removed_from_channel.template * * @param string $notificationsRemovedFromChannelTemplate The * notifications.removed_from_channel.template * @return $this Fluent Builder */ public function setNotificationsRemovedFromChannelTemplate($notificationsRemovedFromChannelTemplate) { $this->options['notificationsRemovedFromChannelTemplate'] = $notificationsRemovedFromChannelTemplate; return $this; } /** * The notifications.removed_from_channel.sound * * @param string $notificationsRemovedFromChannelSound The * notifications.removed_from_channel.sound * @return $this Fluent Builder */ public function setNotificationsRemovedFromChannelSound($notificationsRemovedFromChannelSound) { $this->options['notificationsRemovedFromChannelSound'] = $notificationsRemovedFromChannelSound; return $this; } /** * The notifications.invited_to_channel.enabled * * @param boolean $notificationsInvitedToChannelEnabled The * notifications.invited_to_channel.enabled * @return $this Fluent Builder */ public function setNotificationsInvitedToChannelEnabled($notificationsInvitedToChannelEnabled) { $this->options['notificationsInvitedToChannelEnabled'] = $notificationsInvitedToChannelEnabled; return $this; } /** * The notifications.invited_to_channel.template * * @param string $notificationsInvitedToChannelTemplate The * notifications.invited_to_channel.template * @return $this Fluent Builder */ public function setNotificationsInvitedToChannelTemplate($notificationsInvitedToChannelTemplate) { $this->options['notificationsInvitedToChannelTemplate'] = $notificationsInvitedToChannelTemplate; return $this; } /** * The notifications.invited_to_channel.sound * * @param string $notificationsInvitedToChannelSound The * notifications.invited_to_channel.sound * @return $this Fluent Builder */ public function setNotificationsInvitedToChannelSound($notificationsInvitedToChannelSound) { $this->options['notificationsInvitedToChannelSound'] = $notificationsInvitedToChannelSound; return $this; } /** * The pre_webhook_url * * @param string $preWebhookUrl The pre_webhook_url * @return $this Fluent Builder */ public function setPreWebhookUrl($preWebhookUrl) { $this->options['preWebhookUrl'] = $preWebhookUrl; return $this; } /** * The post_webhook_url * * @param string $postWebhookUrl The post_webhook_url * @return $this Fluent Builder */ public function setPostWebhookUrl($postWebhookUrl) { $this->options['postWebhookUrl'] = $postWebhookUrl; 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 webhook_filters * * @param string $webhookFilters The webhook_filters * @return $this Fluent Builder */ public function setWebhookFilters($webhookFilters) { $this->options['webhookFilters'] = $webhookFilters; return $this; } /** * The limits.channel_members * * @param integer $limitsChannelMembers The limits.channel_members * @return $this Fluent Builder */ public function setLimitsChannelMembers($limitsChannelMembers) { $this->options['limitsChannelMembers'] = $limitsChannelMembers; return $this; } /** * The limits.user_channels * * @param integer $limitsUserChannels The limits.user_channels * @return $this Fluent Builder */ public function setLimitsUserChannels($limitsUserChannels) { $this->options['limitsUserChannels'] = $limitsUserChannels; return $this; } /** * The media.compatibility_message * * @param string $mediaCompatibilityMessage The media.compatibility_message * @return $this Fluent Builder */ public function setMediaCompatibilityMessage($mediaCompatibilityMessage) { $this->options['mediaCompatibilityMessage'] = $mediaCompatibilityMessage; return $this; } /** * The pre_webhook_retry_count * * @param integer $preWebhookRetryCount The pre_webhook_retry_count * @return $this Fluent Builder */ public function setPreWebhookRetryCount($preWebhookRetryCount) { $this->options['preWebhookRetryCount'] = $preWebhookRetryCount; return $this; } /** * The post_webhook_retry_count * * @param integer $postWebhookRetryCount The post_webhook_retry_count * @return $this Fluent Builder */ public function setPostWebhookRetryCount($postWebhookRetryCount) { $this->options['postWebhookRetryCount'] = $postWebhookRetryCount; return $this; } /** * The notifications.log_enabled * * @param boolean $notificationsLogEnabled The notifications.log_enabled * @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/Twilio/Rest/IpMessaging/V2/ServiceContext.php 0000604 00000020551 15174325126 0015671 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 * @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 */ 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 */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Update the ServiceInstance * * @param array|Options $options Optional Arguments * @return ServiceInstance Updated ServiceInstance */ 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 \Twilio\Exceptions\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 \Twilio\Exceptions\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/Twilio/Rest/IpMessaging/V2/CredentialList.php 0000604 00000013125 15174325126 0015631 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V2; 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 * @param array|Options $options Optional Arguments * @return CredentialInstance Newly created CredentialInstance */ 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 * @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/Twilio/Rest/IpMessaging/V2/Service/User/UserChannelInstance.php 0000604 00000005145 15174325126 0021140 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\Values; use Twilio\Version; /** * @property string accountSid * @property string serviceSid * @property string channelSid * @property string memberSid * @property string status * @property integer lastConsumedMessageIndex * @property integer 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 service_sid * @param string $userSid The sid * @return \Twilio\Rest\IpMessaging\V2\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.V2.UserChannelInstance]'; } } sdk/Twilio/Rest/IpMessaging/V2/Service/User/UserBindingOptions.php 0000604 00000002652 15174325126 0021031 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 binding_type * @return ReadUserBindingOptions Options builder */ public static function read($bindingType = Values::NONE) { return new ReadUserBindingOptions($bindingType); } } class ReadUserBindingOptions extends Options { /** * @param string $bindingType The binding_type */ public function __construct($bindingType = Values::NONE) { $this->options['bindingType'] = $bindingType; } /** * The binding_type * * @param string $bindingType The binding_type * @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/Twilio/Rest/IpMessaging/V2/Service/User/UserBindingContext.php 0000604 00000004174 15174325126 0021023 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V2\Service\User; 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 service_sid * @param string $userSid The user_sid * @param string $sid The sid * @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 */ 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 */ 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/Twilio/Rest/IpMessaging/V2/Service/User/UserBindingPage.php 0000604 00000001547 15174325126 0020254 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/Twilio/Rest/IpMessaging/V2/Service/User/UserChannelList.php 0000604 00000011227 15174325126 0020305 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 service_sid * @param string $userSid The sid * @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); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.IpMessaging.V2.UserChannelList]'; } } sdk/Twilio/Rest/IpMessaging/V2/Service/User/UserBindingInstance.php 0000604 00000010726 15174325126 0021143 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 service_sid * @param string $userSid The user_sid * @param string $sid The sid * @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 */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the UserBindingInstance * * @return boolean True if delete succeeds, false otherwise */ 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/Twilio/Rest/IpMessaging/V2/Service/User/UserChannelPage.php 0000604 00000001547 15174325126 0020252 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/Twilio/Rest/IpMessaging/V2/Service/User/UserBindingList.php 0000604 00000012727 15174325126 0020315 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 service_sid * @param string $userSid The user_sid * @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 * @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/Twilio/Rest/IpMessaging/V2/Service/BindingList.php 0000604 00000012436 15174325126 0016535 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 service_sid * @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 * @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/Twilio/Rest/IpMessaging/V2/Service/ChannelPage.php 0000604 00000001400 15174325126 0016461 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/Twilio/Rest/IpMessaging/V2/Service/UserInstance.php 0000604 00000012172 15174325126 0016727 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 boolean isOnline * @property boolean isNotifiable * @property \DateTime dateCreated * @property \DateTime dateUpdated * @property integer 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 service_sid * @param string $sid The sid * @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 */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the UserInstance * * @return boolean True if delete succeeds, false otherwise */ public function delete() { return $this->proxy()->delete(); } /** * Update the UserInstance * * @param array|Options $options Optional Arguments * @return UserInstance Updated UserInstance */ 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/Twilio/Rest/IpMessaging/V2/Service/RoleInstance.php 0000604 00000010100 15174325126 0016677 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 service_sid * @param string $sid The sid * @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 */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the RoleInstance * * @return boolean True if delete succeeds, false otherwise */ public function delete() { return $this->proxy()->delete(); } /** * Update the RoleInstance * * @param string $permission The permission * @return RoleInstance Updated RoleInstance */ 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/Twilio/Rest/IpMessaging/V2/Service/ChannelList.php 0000604 00000014172 15174325126 0016532 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 ChannelList extends ListResource { /** * Construct the ChannelList * * @param Version $version Version that contains the resource * @param string $serviceSid The service_sid * @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 */ 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 * @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/Twilio/Rest/IpMessaging/V2/Service/BindingPage.php 0000604 00000001400 15174325126 0016463 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/Twilio/Rest/IpMessaging/V2/Service/BindingOptions.php 0000604 00000003516 15174325126 0017254 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 binding_type * @param string $identity The identity * @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 binding_type * @param string $identity The identity */ public function __construct($bindingType = Values::NONE, $identity = Values::NONE) { $this->options['bindingType'] = $bindingType; $this->options['identity'] = $identity; } /** * The binding_type * * @param string $bindingType The binding_type * @return $this Fluent Builder */ public function setBindingType($bindingType) { $this->options['bindingType'] = $bindingType; return $this; } /** * The identity * * @param string $identity The identity * @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/Twilio/Rest/IpMessaging/V2/Service/ChannelInstance.php 0000604 00000012532 15174325126 0017361 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 integer membersCount * @property integer 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 service_sid * @param string $sid The sid * @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 */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the ChannelInstance * * @return boolean True if delete succeeds, false otherwise */ public function delete() { return $this->proxy()->delete(); } /** * Update the ChannelInstance * * @param array|Options $options Optional Arguments * @return ChannelInstance Updated ChannelInstance */ 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; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (property_exists($this, '_' . $name)) { $method = 'get' . ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide 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/Twilio/Rest/IpMessaging/V2/Service/BindingContext.php 0000604 00000003665 15174325126 0017252 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V2\Service; 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 service_sid * @param string $sid The sid * @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 */ 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 */ 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/Twilio/Rest/IpMessaging/V2/Service/RolePage.php 0000604 00000001367 15174325126 0016026 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/Twilio/Rest/IpMessaging/V2/Service/UserContext.php 0000604 00000012225 15174325126 0016606 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\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 service_sid * @param string $sid The sid * @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 */ 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 */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Update the UserInstance * * @param array|Options $options Optional Arguments * @return UserInstance Updated UserInstance */ 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 \Twilio\Exceptions\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 \Twilio\Exceptions\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/Twilio/Rest/IpMessaging/V2/Service/UserPage.php 0000604 00000001367 15174325126 0016043 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/Twilio/Rest/IpMessaging/V2/Service/UserOptions.php 0000604 00000010553 15174325126 0016617 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 role_sid * @param string $attributes The attributes * @param string $friendlyName The friendly_name * @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 role_sid * @param string $attributes The attributes * @param string $friendlyName The friendly_name * @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 role_sid * @param string $attributes The attributes * @param string $friendlyName The friendly_name */ 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 role_sid * * @param string $roleSid The role_sid * @return $this Fluent Builder */ public function setRoleSid($roleSid) { $this->options['roleSid'] = $roleSid; return $this; } /** * The attributes * * @param string $attributes The attributes * @return $this Fluent Builder */ public function setAttributes($attributes) { $this->options['attributes'] = $attributes; 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.IpMessaging.V2.CreateUserOptions ' . implode(' ', $options) . ']'; } } class UpdateUserOptions extends Options { /** * @param string $roleSid The role_sid * @param string $attributes The attributes * @param string $friendlyName The friendly_name */ 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 role_sid * * @param string $roleSid The role_sid * @return $this Fluent Builder */ public function setRoleSid($roleSid) { $this->options['roleSid'] = $roleSid; return $this; } /** * The attributes * * @param string $attributes The attributes * @return $this Fluent Builder */ public function setAttributes($attributes) { $this->options['attributes'] = $attributes; 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.IpMessaging.V2.UpdateUserOptions ' . implode(' ', $options) . ']'; } } sdk/Twilio/Rest/IpMessaging/V2/Service/Channel/MessagePage.php 0000604 00000001541 15174325126 0020053 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/Twilio/Rest/IpMessaging/V2/Service/Channel/MessageOptions.php 0000604 00000020265 15174325126 0020636 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 from * @param string $attributes The attributes * @param \DateTime $dateCreated The date_created * @param \DateTime $dateUpdated The date_updated * @param string $lastUpdatedBy The last_updated_by * @param string $body The body * @param string $mediaSid The media_sid * @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 order * @return ReadMessageOptions Options builder */ public static function read($order = Values::NONE) { return new ReadMessageOptions($order); } /** * @param string $body The body * @param string $attributes The attributes * @param \DateTime $dateCreated The date_created * @param \DateTime $dateUpdated The date_updated * @param string $lastUpdatedBy The last_updated_by * @return UpdateMessageOptions Options builder */ public static function update($body = Values::NONE, $attributes = Values::NONE, $dateCreated = Values::NONE, $dateUpdated = Values::NONE, $lastUpdatedBy = Values::NONE) { return new UpdateMessageOptions($body, $attributes, $dateCreated, $dateUpdated, $lastUpdatedBy); } } class CreateMessageOptions extends Options { /** * @param string $from The from * @param string $attributes The attributes * @param \DateTime $dateCreated The date_created * @param \DateTime $dateUpdated The date_updated * @param string $lastUpdatedBy The last_updated_by * @param string $body The body * @param string $mediaSid The media_sid */ 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 from * * @param string $from The from * @return $this Fluent Builder */ public function setFrom($from) { $this->options['from'] = $from; return $this; } /** * The attributes * * @param string $attributes The attributes * @return $this Fluent Builder */ public function setAttributes($attributes) { $this->options['attributes'] = $attributes; return $this; } /** * The date_created * * @param \DateTime $dateCreated The date_created * @return $this Fluent Builder */ public function setDateCreated($dateCreated) { $this->options['dateCreated'] = $dateCreated; return $this; } /** * The date_updated * * @param \DateTime $dateUpdated The date_updated * @return $this Fluent Builder */ public function setDateUpdated($dateUpdated) { $this->options['dateUpdated'] = $dateUpdated; return $this; } /** * The last_updated_by * * @param string $lastUpdatedBy The last_updated_by * @return $this Fluent Builder */ public function setLastUpdatedBy($lastUpdatedBy) { $this->options['lastUpdatedBy'] = $lastUpdatedBy; return $this; } /** * The body * * @param string $body The body * @return $this Fluent Builder */ public function setBody($body) { $this->options['body'] = $body; return $this; } /** * The media_sid * * @param string $mediaSid The media_sid * @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 order */ public function __construct($order = Values::NONE) { $this->options['order'] = $order; } /** * The order * * @param string $order The order * @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 body * @param string $attributes The attributes * @param \DateTime $dateCreated The date_created * @param \DateTime $dateUpdated The date_updated * @param string $lastUpdatedBy The last_updated_by */ public function __construct($body = Values::NONE, $attributes = Values::NONE, $dateCreated = Values::NONE, $dateUpdated = Values::NONE, $lastUpdatedBy = Values::NONE) { $this->options['body'] = $body; $this->options['attributes'] = $attributes; $this->options['dateCreated'] = $dateCreated; $this->options['dateUpdated'] = $dateUpdated; $this->options['lastUpdatedBy'] = $lastUpdatedBy; } /** * The body * * @param string $body The body * @return $this Fluent Builder */ public function setBody($body) { $this->options['body'] = $body; return $this; } /** * The attributes * * @param string $attributes The attributes * @return $this Fluent Builder */ public function setAttributes($attributes) { $this->options['attributes'] = $attributes; return $this; } /** * The date_created * * @param \DateTime $dateCreated The date_created * @return $this Fluent Builder */ public function setDateCreated($dateCreated) { $this->options['dateCreated'] = $dateCreated; return $this; } /** * The date_updated * * @param \DateTime $dateUpdated The date_updated * @return $this Fluent Builder */ public function setDateUpdated($dateUpdated) { $this->options['dateUpdated'] = $dateUpdated; return $this; } /** * The last_updated_by * * @param string $lastUpdatedBy The last_updated_by * @return $this Fluent Builder */ public function setLastUpdatedBy($lastUpdatedBy) { $this->options['lastUpdatedBy'] = $lastUpdatedBy; return $this; } /** * Provide a friendly representation * * @return 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/Twilio/Rest/IpMessaging/V2/Service/Channel/MessageContext.php 0000604 00000006170 15174325126 0020626 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V2\Service\Channel; 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 service_sid * @param string $channelSid The channel_sid * @param string $sid The sid * @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 */ 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 */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Update the MessageInstance * * @param array|Options $options Optional Arguments * @return MessageInstance Updated MessageInstance */ 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'], )); $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/Twilio/Rest/IpMessaging/V2/Service/Channel/MemberInstance.php 0000604 00000011331 15174325126 0020564 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 integer 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 service_sid * @param string $channelSid The channel_sid * @param string $sid The sid * @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'), ); $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 */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the MemberInstance * * @return boolean True if delete succeeds, false otherwise */ public function delete() { return $this->proxy()->delete(); } /** * Update the MemberInstance * * @param array|Options $options Optional Arguments * @return MemberInstance Updated MemberInstance */ 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/Twilio/Rest/IpMessaging/V2/Service/Channel/MessageList.php 0000604 00000014623 15174325126 0020117 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V2\Service\Channel; 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 service_sid * @param string $channelSid The channel_sid * @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 */ 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 * @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/Twilio/Rest/IpMessaging/V2/Service/Channel/MemberOptions.php 0000604 00000020522 15174325126 0020455 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 role_sid * @param integer $lastConsumedMessageIndex The last_consumed_message_index * @param \DateTime $lastConsumptionTimestamp The last_consumption_timestamp * @param \DateTime $dateCreated The date_created * @param \DateTime $dateUpdated The date_updated * @return CreateMemberOptions Options builder */ public static function create($roleSid = Values::NONE, $lastConsumedMessageIndex = Values::NONE, $lastConsumptionTimestamp = Values::NONE, $dateCreated = Values::NONE, $dateUpdated = Values::NONE) { return new CreateMemberOptions($roleSid, $lastConsumedMessageIndex, $lastConsumptionTimestamp, $dateCreated, $dateUpdated); } /** * @param string $identity The identity * @return ReadMemberOptions Options builder */ public static function read($identity = Values::NONE) { return new ReadMemberOptions($identity); } /** * @param string $roleSid The role_sid * @param integer $lastConsumedMessageIndex The last_consumed_message_index * @param \DateTime $lastConsumptionTimestamp The last_consumption_timestamp * @param \DateTime $dateCreated The date_created * @param \DateTime $dateUpdated The date_updated * @return UpdateMemberOptions Options builder */ public static function update($roleSid = Values::NONE, $lastConsumedMessageIndex = Values::NONE, $lastConsumptionTimestamp = Values::NONE, $dateCreated = Values::NONE, $dateUpdated = Values::NONE) { return new UpdateMemberOptions($roleSid, $lastConsumedMessageIndex, $lastConsumptionTimestamp, $dateCreated, $dateUpdated); } } class CreateMemberOptions extends Options { /** * @param string $roleSid The role_sid * @param integer $lastConsumedMessageIndex The last_consumed_message_index * @param \DateTime $lastConsumptionTimestamp The last_consumption_timestamp * @param \DateTime $dateCreated The date_created * @param \DateTime $dateUpdated The date_updated */ public function __construct($roleSid = Values::NONE, $lastConsumedMessageIndex = Values::NONE, $lastConsumptionTimestamp = Values::NONE, $dateCreated = Values::NONE, $dateUpdated = Values::NONE) { $this->options['roleSid'] = $roleSid; $this->options['lastConsumedMessageIndex'] = $lastConsumedMessageIndex; $this->options['lastConsumptionTimestamp'] = $lastConsumptionTimestamp; $this->options['dateCreated'] = $dateCreated; $this->options['dateUpdated'] = $dateUpdated; } /** * The role_sid * * @param string $roleSid The role_sid * @return $this Fluent Builder */ public function setRoleSid($roleSid) { $this->options['roleSid'] = $roleSid; return $this; } /** * The last_consumed_message_index * * @param integer $lastConsumedMessageIndex The last_consumed_message_index * @return $this Fluent Builder */ public function setLastConsumedMessageIndex($lastConsumedMessageIndex) { $this->options['lastConsumedMessageIndex'] = $lastConsumedMessageIndex; return $this; } /** * The last_consumption_timestamp * * @param \DateTime $lastConsumptionTimestamp The last_consumption_timestamp * @return $this Fluent Builder */ public function setLastConsumptionTimestamp($lastConsumptionTimestamp) { $this->options['lastConsumptionTimestamp'] = $lastConsumptionTimestamp; return $this; } /** * The date_created * * @param \DateTime $dateCreated The date_created * @return $this Fluent Builder */ public function setDateCreated($dateCreated) { $this->options['dateCreated'] = $dateCreated; return $this; } /** * The date_updated * * @param \DateTime $dateUpdated The date_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.IpMessaging.V2.CreateMemberOptions ' . implode(' ', $options) . ']'; } } class ReadMemberOptions extends Options { /** * @param string $identity The identity */ public function __construct($identity = Values::NONE) { $this->options['identity'] = $identity; } /** * The identity * * @param string $identity The identity * @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 role_sid * @param integer $lastConsumedMessageIndex The last_consumed_message_index * @param \DateTime $lastConsumptionTimestamp The last_consumption_timestamp * @param \DateTime $dateCreated The date_created * @param \DateTime $dateUpdated The date_updated */ public function __construct($roleSid = Values::NONE, $lastConsumedMessageIndex = Values::NONE, $lastConsumptionTimestamp = Values::NONE, $dateCreated = Values::NONE, $dateUpdated = Values::NONE) { $this->options['roleSid'] = $roleSid; $this->options['lastConsumedMessageIndex'] = $lastConsumedMessageIndex; $this->options['lastConsumptionTimestamp'] = $lastConsumptionTimestamp; $this->options['dateCreated'] = $dateCreated; $this->options['dateUpdated'] = $dateUpdated; } /** * The role_sid * * @param string $roleSid The role_sid * @return $this Fluent Builder */ public function setRoleSid($roleSid) { $this->options['roleSid'] = $roleSid; return $this; } /** * The last_consumed_message_index * * @param integer $lastConsumedMessageIndex The last_consumed_message_index * @return $this Fluent Builder */ public function setLastConsumedMessageIndex($lastConsumedMessageIndex) { $this->options['lastConsumedMessageIndex'] = $lastConsumedMessageIndex; return $this; } /** * The last_consumption_timestamp * * @param \DateTime $lastConsumptionTimestamp The last_consumption_timestamp * @return $this Fluent Builder */ public function setLastConsumptionTimestamp($lastConsumptionTimestamp) { $this->options['lastConsumptionTimestamp'] = $lastConsumptionTimestamp; return $this; } /** * The date_created * * @param \DateTime $dateCreated The date_created * @return $this Fluent Builder */ public function setDateCreated($dateCreated) { $this->options['dateCreated'] = $dateCreated; return $this; } /** * The date_updated * * @param \DateTime $dateUpdated The date_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.IpMessaging.V2.UpdateMemberOptions ' . implode(' ', $options) . ']'; } } sdk/Twilio/Rest/IpMessaging/V2/Service/Channel/InviteContext.php 0000604 00000004154 15174325126 0020500 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V2\Service\Channel; 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 service_sid * @param string $channelSid The channel_sid * @param string $sid The sid * @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 */ 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 */ 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/Twilio/Rest/IpMessaging/V2/Service/Channel/InvitePage.php 0000604 00000001536 15174325126 0017731 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/Twilio/Rest/IpMessaging/V2/Service/Channel/InviteOptions.php 0000604 00000004713 15174325126 0020510 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_sid * @return CreateInviteOptions Options builder */ public static function create($roleSid = Values::NONE) { return new CreateInviteOptions($roleSid); } /** * @param string $identity The identity * @return ReadInviteOptions Options builder */ public static function read($identity = Values::NONE) { return new ReadInviteOptions($identity); } } class CreateInviteOptions extends Options { /** * @param string $roleSid The role_sid */ public function __construct($roleSid = Values::NONE) { $this->options['roleSid'] = $roleSid; } /** * The role_sid * * @param string $roleSid The role_sid * @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 */ public function __construct($identity = Values::NONE) { $this->options['identity'] = $identity; } /** * The identity * * @param string $identity The identity * @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/Twilio/Rest/IpMessaging/V2/Service/Channel/MemberContext.php 0000604 00000006276 15174325126 0020460 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V2\Service\Channel; 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 service_sid * @param string $channelSid The channel_sid * @param string $sid The sid * @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 */ 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 */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Update the MemberInstance * * @param array|Options $options Optional Arguments * @return MemberInstance Updated MemberInstance */ 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']), )); $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/Twilio/Rest/IpMessaging/V2/Service/Channel/MemberList.php 0000604 00000015011 15174325126 0017732 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V2\Service\Channel; 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 service_sid * @param string $channelSid The channel_sid * @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 * @param array|Options $options Optional Arguments * @return MemberInstance Newly created MemberInstance */ 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']), )); $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 * @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/Twilio/Rest/IpMessaging/V2/Service/Channel/InviteInstance.php 0000604 00000010332 15174325126 0020613 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 service_sid * @param string $channelSid The channel_sid * @param string $sid The sid * @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 */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the InviteInstance * * @return boolean True if delete succeeds, false otherwise */ 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/Twilio/Rest/IpMessaging/V2/Service/Channel/InviteList.php 0000604 00000014210 15174325126 0017761 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V2\Service\Channel; 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 service_sid * @param string $channelSid The channel_sid * @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 * @param array|Options $options Optional Arguments * @return InviteInstance Newly created InviteInstance */ 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 * @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/Twilio/Rest/IpMessaging/V2/Service/Channel/MemberPage.php 0000604 00000001536 15174325126 0017702 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/Twilio/Rest/IpMessaging/V2/Service/Channel/MessageInstance.php 0000604 00000012037 15174325126 0020745 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 boolean wasEdited * @property string from * @property string body * @property integer 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 service_sid * @param string $channelSid The channel_sid * @param string $sid The sid * @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 */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the MessageInstance * * @return boolean True if delete succeeds, false otherwise */ public function delete() { return $this->proxy()->delete(); } /** * Update the MessageInstance * * @param array|Options $options Optional Arguments * @return MessageInstance Updated MessageInstance */ 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/Twilio/Rest/IpMessaging/V2/Service/ChannelContext.php 0000604 00000014132 15174325126 0017237 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\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 * @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) */ 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 service_sid * @param string $sid The sid * @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 */ 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 */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Update the ChannelInstance * * @param array|Options $options Optional Arguments * @return ChannelInstance Updated ChannelInstance */ 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; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws \Twilio\Exceptions\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 \Twilio\Exceptions\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/Twilio/Rest/IpMessaging/V2/Service/RoleContext.php 0000604 00000005034 15174325126 0016571 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V2\Service; 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 service_sid * @param string $sid The sid * @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 */ 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 */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Update the RoleInstance * * @param string $permission The permission * @return RoleInstance Updated RoleInstance */ 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/Twilio/Rest/IpMessaging/V2/Service/RoleList.php 0000604 00000012751 15174325126 0016064 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V2\Service; 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 service_sid * @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 The friendly_name * @param string $type The type * @param string $permission The permission * @return RoleInstance Newly created RoleInstance */ 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 * @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/Twilio/Rest/IpMessaging/V2/Service/BindingInstance.php 0000604 00000010232 15174325126 0017356 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 service_sid * @param string $sid The sid * @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 */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the BindingInstance * * @return boolean True if delete succeeds, false otherwise */ 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/Twilio/Rest/IpMessaging/V2/Service/UserList.php 0000604 00000013007 15174325126 0016074 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\Values; use Twilio\Version; class UserList extends ListResource { /** * Construct the UserList * * @param Version $version Version that contains the resource * @param string $serviceSid The service_sid * @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 * @param array|Options $options Optional Arguments * @return UserInstance Newly created UserInstance */ 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 * @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/Twilio/Rest/IpMessaging/V2/Service/ChannelOptions.php 0000604 00000021436 15174325126 0017253 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 The friendly_name * @param string $uniqueName The unique_name * @param string $attributes The attributes * @param string $type The type * @param \DateTime $dateCreated The date_created * @param \DateTime $dateUpdated The date_updated * @param string $createdBy The created_by * @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 type * @return ReadChannelOptions Options builder */ public static function read($type = Values::NONE) { return new ReadChannelOptions($type); } /** * @param string $friendlyName The friendly_name * @param string $uniqueName The unique_name * @param string $attributes The attributes * @param \DateTime $dateCreated The date_created * @param \DateTime $dateUpdated The date_updated * @param string $createdBy The created_by * @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 The friendly_name * @param string $uniqueName The unique_name * @param string $attributes The attributes * @param string $type The type * @param \DateTime $dateCreated The date_created * @param \DateTime $dateUpdated The date_updated * @param string $createdBy The created_by */ 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; } /** * The friendly_name * * @param string $friendlyName The friendly_name * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The unique_name * * @param string $uniqueName The unique_name * @return $this Fluent Builder */ public function setUniqueName($uniqueName) { $this->options['uniqueName'] = $uniqueName; return $this; } /** * The attributes * * @param string $attributes The attributes * @return $this Fluent Builder */ public function setAttributes($attributes) { $this->options['attributes'] = $attributes; return $this; } /** * The type * * @param string $type The type * @return $this Fluent Builder */ public function setType($type) { $this->options['type'] = $type; return $this; } /** * The date_created * * @param \DateTime $dateCreated The date_created * @return $this Fluent Builder */ public function setDateCreated($dateCreated) { $this->options['dateCreated'] = $dateCreated; return $this; } /** * The date_updated * * @param \DateTime $dateUpdated The date_updated * @return $this Fluent Builder */ public function setDateUpdated($dateUpdated) { $this->options['dateUpdated'] = $dateUpdated; return $this; } /** * The created_by * * @param string $createdBy The created_by * @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 type */ public function __construct($type = Values::NONE) { $this->options['type'] = $type; } /** * The type * * @param string $type The type * @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 The friendly_name * @param string $uniqueName The unique_name * @param string $attributes The attributes * @param \DateTime $dateCreated The date_created * @param \DateTime $dateUpdated The date_updated * @param string $createdBy The created_by */ 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; } /** * The friendly_name * * @param string $friendlyName The friendly_name * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The unique_name * * @param string $uniqueName The unique_name * @return $this Fluent Builder */ public function setUniqueName($uniqueName) { $this->options['uniqueName'] = $uniqueName; return $this; } /** * The attributes * * @param string $attributes The attributes * @return $this Fluent Builder */ public function setAttributes($attributes) { $this->options['attributes'] = $attributes; return $this; } /** * The date_created * * @param \DateTime $dateCreated The date_created * @return $this Fluent Builder */ public function setDateCreated($dateCreated) { $this->options['dateCreated'] = $dateCreated; return $this; } /** * The date_updated * * @param \DateTime $dateUpdated The date_updated * @return $this Fluent Builder */ public function setDateUpdated($dateUpdated) { $this->options['dateUpdated'] = $dateUpdated; return $this; } /** * The created_by * * @param string $createdBy The created_by * @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/Twilio/Rest/IpMessaging/V2/ServiceList.php 0000604 00000012106 15174325126 0015155 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V2; 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 The friendly_name * @return ServiceInstance Newly created ServiceInstance */ 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 * @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/Twilio/Rest/IpMessaging/V2/CredentialPage.php 0000604 00000001342 15174325126 0015570 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/Twilio/Rest/IpMessaging/V2/CredentialInstance.php 0000604 00000007557 15174325126 0016476 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 * @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 */ public function fetch() { return $this->proxy()->fetch(); } /** * Update the CredentialInstance * * @param array|Options $options Optional Arguments * @return CredentialInstance Updated CredentialInstance */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Deletes the CredentialInstance * * @return boolean True if delete succeeds, false otherwise */ 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/Twilio/Rest/IpMessaging/V2/ServicePage.php 0000604 00000001331 15174325126 0015114 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/Twilio/Rest/IpMessaging/V1/CredentialPage.php 0000604 00000001342 15174325126 0015567 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/Twilio/Rest/IpMessaging/V1/ServicePage.php 0000604 00000001331 15174325126 0015113 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/Twilio/Rest/IpMessaging/V1/ServiceInstance.php 0000604 00000014121 15174325126 0016004 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 boolean readStatusEnabled * @property boolean reachabilityEnabled * @property integer typingIndicatorTimeout * @property integer 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 sid * @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 */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the ServiceInstance * * @return boolean True if delete succeeds, false otherwise */ public function delete() { return $this->proxy()->delete(); } /** * Update the ServiceInstance * * @param array|Options $options Optional Arguments * @return ServiceInstance Updated ServiceInstance */ 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/Twilio/Rest/IpMessaging/V1/CredentialList.php 0000604 00000013125 15174325126 0015630 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V1; 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 * @param array|Options $options Optional Arguments * @return CredentialInstance Newly created CredentialInstance */ 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 * @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/Twilio/Rest/IpMessaging/V1/ServiceList.php 0000604 00000012106 15174325126 0015154 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V1; 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 The friendly_name * @return ServiceInstance Newly created ServiceInstance */ 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 * @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/Twilio/Rest/IpMessaging/V1/CredentialOptions.php 0000604 00000015765 15174325126 0016364 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 The friendly_name * @param string $certificate The certificate * @param string $privateKey The private_key * @param boolean $sandbox The sandbox * @param string $apiKey The api_key * @param string $secret The secret * @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 The friendly_name * @param string $certificate The certificate * @param string $privateKey The private_key * @param boolean $sandbox The sandbox * @param string $apiKey The api_key * @param string $secret The secret * @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 The friendly_name * @param string $certificate The certificate * @param string $privateKey The private_key * @param boolean $sandbox The sandbox * @param string $apiKey The api_key * @param string $secret The secret */ 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; } /** * The friendly_name * * @param string $friendlyName The friendly_name * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The certificate * * @param string $certificate The certificate * @return $this Fluent Builder */ public function setCertificate($certificate) { $this->options['certificate'] = $certificate; return $this; } /** * The private_key * * @param string $privateKey The private_key * @return $this Fluent Builder */ public function setPrivateKey($privateKey) { $this->options['privateKey'] = $privateKey; return $this; } /** * The sandbox * * @param boolean $sandbox The sandbox * @return $this Fluent Builder */ public function setSandbox($sandbox) { $this->options['sandbox'] = $sandbox; return $this; } /** * The api_key * * @param string $apiKey The api_key * @return $this Fluent Builder */ public function setApiKey($apiKey) { $this->options['apiKey'] = $apiKey; return $this; } /** * The secret * * @param string $secret The secret * @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 The friendly_name * @param string $certificate The certificate * @param string $privateKey The private_key * @param boolean $sandbox The sandbox * @param string $apiKey The api_key * @param string $secret The secret */ 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; } /** * The friendly_name * * @param string $friendlyName The friendly_name * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The certificate * * @param string $certificate The certificate * @return $this Fluent Builder */ public function setCertificate($certificate) { $this->options['certificate'] = $certificate; return $this; } /** * The private_key * * @param string $privateKey The private_key * @return $this Fluent Builder */ public function setPrivateKey($privateKey) { $this->options['privateKey'] = $privateKey; return $this; } /** * The sandbox * * @param boolean $sandbox The sandbox * @return $this Fluent Builder */ public function setSandbox($sandbox) { $this->options['sandbox'] = $sandbox; return $this; } /** * The api_key * * @param string $apiKey The api_key * @return $this Fluent Builder */ public function setApiKey($apiKey) { $this->options['apiKey'] = $apiKey; return $this; } /** * The secret * * @param string $secret The secret * @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/Twilio/Rest/IpMessaging/V1/CredentialContext.php 0000604 00000005170 15174325126 0016342 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V1; 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 * @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 */ 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 */ 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 */ 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/Twilio/Rest/IpMessaging/V1/Service/User/UserChannelPage.php 0000604 00000001547 15174325126 0020251 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/Twilio/Rest/IpMessaging/V1/Service/User/UserChannelList.php 0000604 00000011227 15174325126 0020304 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 service_sid * @param string $userSid The sid * @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/Twilio/Rest/IpMessaging/V1/Service/User/UserChannelInstance.php 0000604 00000005145 15174325126 0021137 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 integer lastConsumedMessageIndex * @property integer 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 service_sid * @param string $userSid The sid * @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/Twilio/Rest/IpMessaging/V1/Service/RoleContext.php 0000604 00000005034 15174325126 0016570 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V1\Service; 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 service_sid * @param string $sid The sid * @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 */ 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 */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Update the RoleInstance * * @param string $permission The permission * @return RoleInstance Updated RoleInstance */ 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/Twilio/Rest/IpMessaging/V1/Service/UserPage.php 0000604 00000001367 15174325126 0016042 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/Twilio/Rest/IpMessaging/V1/Service/RolePage.php 0000604 00000001367 15174325126 0016025 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/Twilio/Rest/IpMessaging/V1/Service/UserList.php 0000604 00000013007 15174325126 0016073 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V1\Service; 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 service_sid * @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 * @param array|Options $options Optional Arguments * @return UserInstance Newly created UserInstance */ 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 * @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/Twilio/Rest/IpMessaging/V1/Service/UserContext.php 0000604 00000010673 15174325126 0016612 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 service_sid * @param string $sid The sid * @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 */ 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 */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Update the UserInstance * * @param array|Options $options Optional Arguments * @return UserInstance Updated UserInstance */ 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 \Twilio\Exceptions\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 \Twilio\Exceptions\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/Twilio/Rest/IpMessaging/V1/Service/ChannelContext.php 0000604 00000013556 15174325126 0017247 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 service_sid * @param string $sid The sid * @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 */ 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 */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Update the ChannelInstance * * @param array|Options $options Optional Arguments * @return ChannelInstance Updated ChannelInstance */ 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 \Twilio\Exceptions\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 \Twilio\Exceptions\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/Twilio/Rest/IpMessaging/V1/Service/ChannelOptions.php 0000604 00000013624 15174325126 0017252 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 The friendly_name * @param string $uniqueName The unique_name * @param string $attributes The attributes * @param string $type The type * @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 type * @return ReadChannelOptions Options builder */ public static function read($type = Values::NONE) { return new ReadChannelOptions($type); } /** * @param string $friendlyName The friendly_name * @param string $uniqueName The unique_name * @param string $attributes The attributes * @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 The friendly_name * @param string $uniqueName The unique_name * @param string $attributes The attributes * @param string $type The type */ 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; } /** * The friendly_name * * @param string $friendlyName The friendly_name * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The unique_name * * @param string $uniqueName The unique_name * @return $this Fluent Builder */ public function setUniqueName($uniqueName) { $this->options['uniqueName'] = $uniqueName; return $this; } /** * The attributes * * @param string $attributes The attributes * @return $this Fluent Builder */ public function setAttributes($attributes) { $this->options['attributes'] = $attributes; return $this; } /** * The type * * @param string $type The type * @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 type */ public function __construct($type = Values::NONE) { $this->options['type'] = $type; } /** * The type * * @param string $type The type * @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 The friendly_name * @param string $uniqueName The unique_name * @param string $attributes The attributes */ public function __construct($friendlyName = Values::NONE, $uniqueName = Values::NONE, $attributes = Values::NONE) { $this->options['friendlyName'] = $friendlyName; $this->options['uniqueName'] = $uniqueName; $this->options['attributes'] = $attributes; } /** * The friendly_name * * @param string $friendlyName The friendly_name * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The unique_name * * @param string $uniqueName The unique_name * @return $this Fluent Builder */ public function setUniqueName($uniqueName) { $this->options['uniqueName'] = $uniqueName; return $this; } /** * The attributes * * @param string $attributes The attributes * @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/Twilio/Rest/IpMessaging/V1/Service/RoleList.php 0000604 00000012751 15174325126 0016063 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V1\Service; 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 service_sid * @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 The friendly_name * @param string $type The type * @param string $permission The permission * @return RoleInstance Newly created RoleInstance */ 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 * @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/Twilio/Rest/IpMessaging/V1/Service/UserOptions.php 0000604 00000010553 15174325126 0016616 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 role_sid * @param string $attributes The attributes * @param string $friendlyName The friendly_name * @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 role_sid * @param string $attributes The attributes * @param string $friendlyName The friendly_name * @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 role_sid * @param string $attributes The attributes * @param string $friendlyName The friendly_name */ 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 role_sid * * @param string $roleSid The role_sid * @return $this Fluent Builder */ public function setRoleSid($roleSid) { $this->options['roleSid'] = $roleSid; return $this; } /** * The attributes * * @param string $attributes The attributes * @return $this Fluent Builder */ public function setAttributes($attributes) { $this->options['attributes'] = $attributes; 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.IpMessaging.V1.CreateUserOptions ' . implode(' ', $options) . ']'; } } class UpdateUserOptions extends Options { /** * @param string $roleSid The role_sid * @param string $attributes The attributes * @param string $friendlyName The friendly_name */ 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 role_sid * * @param string $roleSid The role_sid * @return $this Fluent Builder */ public function setRoleSid($roleSid) { $this->options['roleSid'] = $roleSid; return $this; } /** * The attributes * * @param string $attributes The attributes * @return $this Fluent Builder */ public function setAttributes($attributes) { $this->options['attributes'] = $attributes; 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.IpMessaging.V1.UpdateUserOptions ' . implode(' ', $options) . ']'; } } sdk/Twilio/Rest/IpMessaging/V1/Service/ChannelInstance.php 0000604 00000012532 15174325126 0017360 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 integer membersCount * @property integer 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 service_sid * @param string $sid The sid * @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 */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the ChannelInstance * * @return boolean True if delete succeeds, false otherwise */ public function delete() { return $this->proxy()->delete(); } /** * Update the ChannelInstance * * @param array|Options $options Optional Arguments * @return ChannelInstance Updated ChannelInstance */ 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/Twilio/Rest/IpMessaging/V1/Service/Channel/InviteInstance.php 0000604 00000010332 15174325126 0020612 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 service_sid * @param string $channelSid The channel_sid * @param string $sid The sid * @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 */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the InviteInstance * * @return boolean True if delete succeeds, false otherwise */ 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/Twilio/Rest/IpMessaging/V1/Service/Channel/MemberContext.php 0000604 00000005630 15174325126 0020450 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V1\Service\Channel; 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 service_sid * @param string $channelSid The channel_sid * @param string $sid The sid * @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 */ 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 */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Update the MemberInstance * * @param array|Options $options Optional Arguments * @return MemberInstance Updated MemberInstance */ 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/Twilio/Rest/IpMessaging/V1/Service/Channel/InviteOptions.php 0000604 00000004713 15174325126 0020507 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_sid * @return CreateInviteOptions Options builder */ public static function create($roleSid = Values::NONE) { return new CreateInviteOptions($roleSid); } /** * @param string $identity The identity * @return ReadInviteOptions Options builder */ public static function read($identity = Values::NONE) { return new ReadInviteOptions($identity); } } class CreateInviteOptions extends Options { /** * @param string $roleSid The role_sid */ public function __construct($roleSid = Values::NONE) { $this->options['roleSid'] = $roleSid; } /** * The role_sid * * @param string $roleSid The role_sid * @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 */ public function __construct($identity = Values::NONE) { $this->options['identity'] = $identity; } /** * The identity * * @param string $identity The identity * @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/Twilio/Rest/IpMessaging/V1/Service/Channel/MemberList.php 0000604 00000014210 15174325126 0017731 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V1\Service\Channel; 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 service_sid * @param string $channelSid The channel_sid * @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 * @param array|Options $options Optional Arguments * @return MemberInstance Newly created MemberInstance */ 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 sid * @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/Twilio/Rest/IpMessaging/V1/Service/Channel/InviteContext.php 0000604 00000004154 15174325126 0020477 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V1\Service\Channel; 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 service_sid * @param string $channelSid The channel_sid * @param string $sid The sid * @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 */ 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 */ 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/Twilio/Rest/IpMessaging/V1/Service/Channel/MemberOptions.php 0000604 00000010402 15174325126 0020450 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 role_sid * @return CreateMemberOptions Options builder */ public static function create($roleSid = Values::NONE) { return new CreateMemberOptions($roleSid); } /** * @param string $identity The identity * @return ReadMemberOptions Options builder */ public static function read($identity = Values::NONE) { return new ReadMemberOptions($identity); } /** * @param string $roleSid The role_sid * @param integer $lastConsumedMessageIndex The last_consumed_message_index * @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 role_sid */ public function __construct($roleSid = Values::NONE) { $this->options['roleSid'] = $roleSid; } /** * The role_sid * * @param string $roleSid The role_sid * @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 */ public function __construct($identity = Values::NONE) { $this->options['identity'] = $identity; } /** * The identity * * @param string $identity The identity * @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 role_sid * @param integer $lastConsumedMessageIndex The last_consumed_message_index */ public function __construct($roleSid = Values::NONE, $lastConsumedMessageIndex = Values::NONE) { $this->options['roleSid'] = $roleSid; $this->options['lastConsumedMessageIndex'] = $lastConsumedMessageIndex; } /** * The role_sid * * @param string $roleSid The role_sid * @return $this Fluent Builder */ public function setRoleSid($roleSid) { $this->options['roleSid'] = $roleSid; return $this; } /** * The last_consumed_message_index * * @param integer $lastConsumedMessageIndex The last_consumed_message_index * @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/Twilio/Rest/IpMessaging/V1/Service/Channel/MessageInstance.php 0000604 00000011404 15174325126 0020741 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 boolean wasEdited * @property string from * @property string body * @property integer 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 service_sid * @param string $channelSid The channel_sid * @param string $sid The sid * @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 */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the MessageInstance * * @return boolean True if delete succeeds, false otherwise */ public function delete() { return $this->proxy()->delete(); } /** * Update the MessageInstance * * @param array|Options $options Optional Arguments * @return MessageInstance Updated MessageInstance */ 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/Twilio/Rest/IpMessaging/V1/Service/Channel/InvitePage.php 0000604 00000001536 15174325126 0017730 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/Twilio/Rest/IpMessaging/V1/Service/Channel/MessageList.php 0000604 00000014217 15174325126 0020115 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V1\Service\Channel; 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 service_sid * @param string $channelSid The channel_sid * @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 body * @param array|Options $options Optional Arguments * @return MessageInstance Newly created MessageInstance */ 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 sid * @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/Twilio/Rest/IpMessaging/V1/Service/Channel/MessageContext.php 0000604 00000005543 15174325126 0020630 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V1\Service\Channel; 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 service_sid * @param string $channelSid The channel_sid * @param string $sid The sid * @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 */ 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 */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Update the MessageInstance * * @param array|Options $options Optional Arguments * @return MessageInstance Updated MessageInstance */ 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/Twilio/Rest/IpMessaging/V1/Service/Channel/MemberInstance.php 0000604 00000011331 15174325126 0020563 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 integer 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 service_sid * @param string $channelSid The channel_sid * @param string $sid The sid * @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 */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the MemberInstance * * @return boolean True if delete succeeds, false otherwise */ public function delete() { return $this->proxy()->delete(); } /** * Update the MemberInstance * * @param array|Options $options Optional Arguments * @return MemberInstance Updated MemberInstance */ 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/Twilio/Rest/IpMessaging/V1/Service/Channel/MessageOptions.php 0000604 00000010545 15174325126 0020635 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 from * @param string $attributes The attributes * @return CreateMessageOptions Options builder */ public static function create($from = Values::NONE, $attributes = Values::NONE) { return new CreateMessageOptions($from, $attributes); } /** * @param string $order The order * @return ReadMessageOptions Options builder */ public static function read($order = Values::NONE) { return new ReadMessageOptions($order); } /** * @param string $body The body * @param string $attributes The attributes * @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 from * @param string $attributes The attributes */ public function __construct($from = Values::NONE, $attributes = Values::NONE) { $this->options['from'] = $from; $this->options['attributes'] = $attributes; } /** * The from * * @param string $from The from * @return $this Fluent Builder */ public function setFrom($from) { $this->options['from'] = $from; return $this; } /** * The attributes * * @param string $attributes The attributes * @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 order */ public function __construct($order = Values::NONE) { $this->options['order'] = $order; } /** * The order * * @param string $order The order * @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 body * @param string $attributes The attributes */ public function __construct($body = Values::NONE, $attributes = Values::NONE) { $this->options['body'] = $body; $this->options['attributes'] = $attributes; } /** * The body * * @param string $body The body * @return $this Fluent Builder */ public function setBody($body) { $this->options['body'] = $body; return $this; } /** * The attributes * * @param string $attributes The attributes * @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/Twilio/Rest/IpMessaging/V1/Service/Channel/MemberPage.php 0000604 00000001536 15174325126 0017701 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/Twilio/Rest/IpMessaging/V1/Service/Channel/MessagePage.php 0000604 00000001541 15174325126 0020052 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/Twilio/Rest/IpMessaging/V1/Service/Channel/InviteList.php 0000604 00000014210 15174325126 0017760 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V1\Service\Channel; 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 service_sid * @param string $channelSid The channel_sid * @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 * @param array|Options $options Optional Arguments * @return InviteInstance Newly created InviteInstance */ 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 * @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/Twilio/Rest/IpMessaging/V1/Service/ChannelList.php 0000604 00000013644 15174325126 0016534 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\IpMessaging\V1\Service; 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 service_sid * @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 */ 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 sid * @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/Twilio/Rest/IpMessaging/V1/Service/RoleInstance.php 0000604 00000010100 15174325126 0016676 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 service_sid * @param string $sid The sid * @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 */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the RoleInstance * * @return boolean True if delete succeeds, false otherwise */ public function delete() { return $this->proxy()->delete(); } /** * Update the RoleInstance * * @param string $permission The permission * @return RoleInstance Updated RoleInstance */ 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/Twilio/Rest/IpMessaging/V1/Service/UserInstance.php 0000604 00000011566 15174325126 0016734 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 boolean isOnline * @property boolean isNotifiable * @property \DateTime dateCreated * @property \DateTime dateUpdated * @property integer 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 service_sid * @param string $sid The sid * @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 */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the UserInstance * * @return boolean True if delete succeeds, false otherwise */ public function delete() { return $this->proxy()->delete(); } /** * Update the UserInstance * * @param array|Options $options Optional Arguments * @return UserInstance Updated UserInstance */ 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/Twilio/Rest/IpMessaging/V1/Service/ChannelPage.php 0000604 00000001400 15174325126 0016460 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/Twilio/Rest/IpMessaging/V1/ServiceContext.php 0000604 00000026172 15174325126 0015675 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 sid * @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 */ 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 */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Update the ServiceInstance * * @param array|Options $options Optional Arguments * @return ServiceInstance Updated ServiceInstance */ 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.OnMessageSend.Format' => $options['webhooksOnMessageSendFormat'], 'Webhooks.OnMessageUpdate.Url' => $options['webhooksOnMessageUpdateUrl'], 'Webhooks.OnMessageUpdate.Method' => $options['webhooksOnMessageUpdateMethod'], 'Webhooks.OnMessageUpdate.Format' => $options['webhooksOnMessageUpdateFormat'], 'Webhooks.OnMessageRemove.Url' => $options['webhooksOnMessageRemoveUrl'], 'Webhooks.OnMessageRemove.Method' => $options['webhooksOnMessageRemoveMethod'], 'Webhooks.OnMessageRemove.Format' => $options['webhooksOnMessageRemoveFormat'], 'Webhooks.OnChannelAdd.Url' => $options['webhooksOnChannelAddUrl'], 'Webhooks.OnChannelAdd.Method' => $options['webhooksOnChannelAddMethod'], 'Webhooks.OnChannelAdd.Format' => $options['webhooksOnChannelAddFormat'], 'Webhooks.OnChannelDestroy.Url' => $options['webhooksOnChannelDestroyUrl'], 'Webhooks.OnChannelDestroy.Method' => $options['webhooksOnChannelDestroyMethod'], 'Webhooks.OnChannelDestroy.Format' => $options['webhooksOnChannelDestroyFormat'], 'Webhooks.OnChannelUpdate.Url' => $options['webhooksOnChannelUpdateUrl'], 'Webhooks.OnChannelUpdate.Method' => $options['webhooksOnChannelUpdateMethod'], 'Webhooks.OnChannelUpdate.Format' => $options['webhooksOnChannelUpdateFormat'], 'Webhooks.OnMemberAdd.Url' => $options['webhooksOnMemberAddUrl'], 'Webhooks.OnMemberAdd.Method' => $options['webhooksOnMemberAddMethod'], 'Webhooks.OnMemberAdd.Format' => $options['webhooksOnMemberAddFormat'], 'Webhooks.OnMemberRemove.Url' => $options['webhooksOnMemberRemoveUrl'], 'Webhooks.OnMemberRemove.Method' => $options['webhooksOnMemberRemoveMethod'], 'Webhooks.OnMemberRemove.Format' => $options['webhooksOnMemberRemoveFormat'], 'Webhooks.OnMessageSent.Url' => $options['webhooksOnMessageSentUrl'], 'Webhooks.OnMessageSent.Method' => $options['webhooksOnMessageSentMethod'], 'Webhooks.OnMessageSent.Format' => $options['webhooksOnMessageSentFormat'], 'Webhooks.OnMessageUpdated.Url' => $options['webhooksOnMessageUpdatedUrl'], 'Webhooks.OnMessageUpdated.Method' => $options['webhooksOnMessageUpdatedMethod'], 'Webhooks.OnMessageUpdated.Format' => $options['webhooksOnMessageUpdatedFormat'], 'Webhooks.OnMessageRemoved.Url' => $options['webhooksOnMessageRemovedUrl'], 'Webhooks.OnMessageRemoved.Method' => $options['webhooksOnMessageRemovedMethod'], 'Webhooks.OnMessageRemoved.Format' => $options['webhooksOnMessageRemovedFormat'], 'Webhooks.OnChannelAdded.Url' => $options['webhooksOnChannelAddedUrl'], 'Webhooks.OnChannelAdded.Method' => $options['webhooksOnChannelAddedMethod'], 'Webhooks.OnChannelAdded.Format' => $options['webhooksOnChannelAddedFormat'], 'Webhooks.OnChannelDestroyed.Url' => $options['webhooksOnChannelDestroyedUrl'], 'Webhooks.OnChannelDestroyed.Method' => $options['webhooksOnChannelDestroyedMethod'], 'Webhooks.OnChannelDestroyed.Format' => $options['webhooksOnChannelDestroyedFormat'], 'Webhooks.OnChannelUpdated.Url' => $options['webhooksOnChannelUpdatedUrl'], 'Webhooks.OnChannelUpdated.Method' => $options['webhooksOnChannelUpdatedMethod'], 'Webhooks.OnChannelUpdated.Format' => $options['webhooksOnChannelUpdatedFormat'], 'Webhooks.OnMemberAdded.Url' => $options['webhooksOnMemberAddedUrl'], 'Webhooks.OnMemberAdded.Method' => $options['webhooksOnMemberAddedMethod'], 'Webhooks.OnMemberAdded.Format' => $options['webhooksOnMemberAddedFormat'], 'Webhooks.OnMemberRemoved.Url' => $options['webhooksOnMemberRemovedUrl'], 'Webhooks.OnMemberRemoved.Method' => $options['webhooksOnMemberRemovedMethod'], 'Webhooks.OnMemberRemoved.Format' => $options['webhooksOnMemberRemovedFormat'], '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 \Twilio\Exceptions\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 \Twilio\Exceptions\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/Twilio/Rest/IpMessaging/V1/ServiceOptions.php 0000604 00000166171 15174325126 0015710 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 The friendly_name * @param string $defaultServiceRoleSid The default_service_role_sid * @param string $defaultChannelRoleSid The default_channel_role_sid * @param string $defaultChannelCreatorRoleSid The * default_channel_creator_role_sid * @param boolean $readStatusEnabled The read_status_enabled * @param boolean $reachabilityEnabled The reachability_enabled * @param integer $typingIndicatorTimeout The typing_indicator_timeout * @param integer $consumptionReportInterval The consumption_report_interval * @param boolean $notificationsNewMessageEnabled The * notifications.new_message.enabled * @param string $notificationsNewMessageTemplate The * notifications.new_message.template * @param boolean $notificationsAddedToChannelEnabled The * notifications.added_to_channel.enabled * @param string $notificationsAddedToChannelTemplate The * notifications.added_to_channel.template * @param boolean $notificationsRemovedFromChannelEnabled The * notifications.removed_from_channel.enabled * @param string $notificationsRemovedFromChannelTemplate The * notifications.removed_from_channel.template * @param boolean $notificationsInvitedToChannelEnabled The * notifications.invited_to_channel.enabled * @param string $notificationsInvitedToChannelTemplate The * notifications.invited_to_channel.template * @param string $preWebhookUrl The pre_webhook_url * @param string $postWebhookUrl The post_webhook_url * @param string $webhookMethod The webhook_method * @param string $webhookFilters The webhook_filters * @param string $webhooksOnMessageSendUrl The webhooks.on_message_send.url * @param string $webhooksOnMessageSendMethod The * webhooks.on_message_send.method * @param string $webhooksOnMessageSendFormat The * webhooks.on_message_send.format * @param string $webhooksOnMessageUpdateUrl The webhooks.on_message_update.url * @param string $webhooksOnMessageUpdateMethod The * webhooks.on_message_update.method * @param string $webhooksOnMessageUpdateFormat The * webhooks.on_message_update.format * @param string $webhooksOnMessageRemoveUrl The webhooks.on_message_remove.url * @param string $webhooksOnMessageRemoveMethod The * webhooks.on_message_remove.method * @param string $webhooksOnMessageRemoveFormat The * webhooks.on_message_remove.format * @param string $webhooksOnChannelAddUrl The webhooks.on_channel_add.url * @param string $webhooksOnChannelAddMethod The webhooks.on_channel_add.method * @param string $webhooksOnChannelAddFormat The webhooks.on_channel_add.format * @param string $webhooksOnChannelDestroyUrl The * webhooks.on_channel_destroy.url * @param string $webhooksOnChannelDestroyMethod The * webhooks.on_channel_destroy.method * @param string $webhooksOnChannelDestroyFormat The * webhooks.on_channel_destroy.format * @param string $webhooksOnChannelUpdateUrl The webhooks.on_channel_update.url * @param string $webhooksOnChannelUpdateMethod The * webhooks.on_channel_update.method * @param string $webhooksOnChannelUpdateFormat The * webhooks.on_channel_update.format * @param string $webhooksOnMemberAddUrl The webhooks.on_member_add.url * @param string $webhooksOnMemberAddMethod The webhooks.on_member_add.method * @param string $webhooksOnMemberAddFormat The webhooks.on_member_add.format * @param string $webhooksOnMemberRemoveUrl The webhooks.on_member_remove.url * @param string $webhooksOnMemberRemoveMethod The * webhooks.on_member_remove.method * @param string $webhooksOnMemberRemoveFormat The * webhooks.on_member_remove.format * @param string $webhooksOnMessageSentUrl The webhooks.on_message_sent.url * @param string $webhooksOnMessageSentMethod The * webhooks.on_message_sent.method * @param string $webhooksOnMessageSentFormat The * webhooks.on_message_sent.format * @param string $webhooksOnMessageUpdatedUrl The * webhooks.on_message_updated.url * @param string $webhooksOnMessageUpdatedMethod The * webhooks.on_message_updated.method * @param string $webhooksOnMessageUpdatedFormat The * webhooks.on_message_updated.format * @param string $webhooksOnMessageRemovedUrl The * webhooks.on_message_removed.url * @param string $webhooksOnMessageRemovedMethod The * webhooks.on_message_removed.method * @param string $webhooksOnMessageRemovedFormat The * webhooks.on_message_removed.format * @param string $webhooksOnChannelAddedUrl The webhooks.on_channel_added.url * @param string $webhooksOnChannelAddedMethod The * webhooks.on_channel_added.method * @param string $webhooksOnChannelAddedFormat The * webhooks.on_channel_added.format * @param string $webhooksOnChannelDestroyedUrl The * webhooks.on_channel_destroyed.url * @param string $webhooksOnChannelDestroyedMethod The * webhooks.on_channel_destroyed.method * @param string $webhooksOnChannelDestroyedFormat The * webhooks.on_channel_destroyed.format * @param string $webhooksOnChannelUpdatedUrl The * webhooks.on_channel_updated.url * @param string $webhooksOnChannelUpdatedMethod The * webhooks.on_channel_updated.method * @param string $webhooksOnChannelUpdatedFormat The * webhooks.on_channel_updated.format * @param string $webhooksOnMemberAddedUrl The webhooks.on_member_added.url * @param string $webhooksOnMemberAddedMethod The * webhooks.on_member_added.method * @param string $webhooksOnMemberAddedFormat The * webhooks.on_member_added.format * @param string $webhooksOnMemberRemovedUrl The webhooks.on_member_removed.url * @param string $webhooksOnMemberRemovedMethod The * webhooks.on_member_removed.method * @param string $webhooksOnMemberRemovedFormat The * webhooks.on_member_removed.format * @param integer $limitsChannelMembers The limits.channel_members * @param integer $limitsUserChannels The limits.user_channels * @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, $webhooksOnMessageSendFormat = Values::NONE, $webhooksOnMessageUpdateUrl = Values::NONE, $webhooksOnMessageUpdateMethod = Values::NONE, $webhooksOnMessageUpdateFormat = Values::NONE, $webhooksOnMessageRemoveUrl = Values::NONE, $webhooksOnMessageRemoveMethod = Values::NONE, $webhooksOnMessageRemoveFormat = Values::NONE, $webhooksOnChannelAddUrl = Values::NONE, $webhooksOnChannelAddMethod = Values::NONE, $webhooksOnChannelAddFormat = Values::NONE, $webhooksOnChannelDestroyUrl = Values::NONE, $webhooksOnChannelDestroyMethod = Values::NONE, $webhooksOnChannelDestroyFormat = Values::NONE, $webhooksOnChannelUpdateUrl = Values::NONE, $webhooksOnChannelUpdateMethod = Values::NONE, $webhooksOnChannelUpdateFormat = Values::NONE, $webhooksOnMemberAddUrl = Values::NONE, $webhooksOnMemberAddMethod = Values::NONE, $webhooksOnMemberAddFormat = Values::NONE, $webhooksOnMemberRemoveUrl = Values::NONE, $webhooksOnMemberRemoveMethod = Values::NONE, $webhooksOnMemberRemoveFormat = Values::NONE, $webhooksOnMessageSentUrl = Values::NONE, $webhooksOnMessageSentMethod = Values::NONE, $webhooksOnMessageSentFormat = Values::NONE, $webhooksOnMessageUpdatedUrl = Values::NONE, $webhooksOnMessageUpdatedMethod = Values::NONE, $webhooksOnMessageUpdatedFormat = Values::NONE, $webhooksOnMessageRemovedUrl = Values::NONE, $webhooksOnMessageRemovedMethod = Values::NONE, $webhooksOnMessageRemovedFormat = Values::NONE, $webhooksOnChannelAddedUrl = Values::NONE, $webhooksOnChannelAddedMethod = Values::NONE, $webhooksOnChannelAddedFormat = Values::NONE, $webhooksOnChannelDestroyedUrl = Values::NONE, $webhooksOnChannelDestroyedMethod = Values::NONE, $webhooksOnChannelDestroyedFormat = Values::NONE, $webhooksOnChannelUpdatedUrl = Values::NONE, $webhooksOnChannelUpdatedMethod = Values::NONE, $webhooksOnChannelUpdatedFormat = Values::NONE, $webhooksOnMemberAddedUrl = Values::NONE, $webhooksOnMemberAddedMethod = Values::NONE, $webhooksOnMemberAddedFormat = Values::NONE, $webhooksOnMemberRemovedUrl = Values::NONE, $webhooksOnMemberRemovedMethod = Values::NONE, $webhooksOnMemberRemovedFormat = 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, $webhooksOnMessageSendFormat, $webhooksOnMessageUpdateUrl, $webhooksOnMessageUpdateMethod, $webhooksOnMessageUpdateFormat, $webhooksOnMessageRemoveUrl, $webhooksOnMessageRemoveMethod, $webhooksOnMessageRemoveFormat, $webhooksOnChannelAddUrl, $webhooksOnChannelAddMethod, $webhooksOnChannelAddFormat, $webhooksOnChannelDestroyUrl, $webhooksOnChannelDestroyMethod, $webhooksOnChannelDestroyFormat, $webhooksOnChannelUpdateUrl, $webhooksOnChannelUpdateMethod, $webhooksOnChannelUpdateFormat, $webhooksOnMemberAddUrl, $webhooksOnMemberAddMethod, $webhooksOnMemberAddFormat, $webhooksOnMemberRemoveUrl, $webhooksOnMemberRemoveMethod, $webhooksOnMemberRemoveFormat, $webhooksOnMessageSentUrl, $webhooksOnMessageSentMethod, $webhooksOnMessageSentFormat, $webhooksOnMessageUpdatedUrl, $webhooksOnMessageUpdatedMethod, $webhooksOnMessageUpdatedFormat, $webhooksOnMessageRemovedUrl, $webhooksOnMessageRemovedMethod, $webhooksOnMessageRemovedFormat, $webhooksOnChannelAddedUrl, $webhooksOnChannelAddedMethod, $webhooksOnChannelAddedFormat, $webhooksOnChannelDestroyedUrl, $webhooksOnChannelDestroyedMethod, $webhooksOnChannelDestroyedFormat, $webhooksOnChannelUpdatedUrl, $webhooksOnChannelUpdatedMethod, $webhooksOnChannelUpdatedFormat, $webhooksOnMemberAddedUrl, $webhooksOnMemberAddedMethod, $webhooksOnMemberAddedFormat, $webhooksOnMemberRemovedUrl, $webhooksOnMemberRemovedMethod, $webhooksOnMemberRemovedFormat, $limitsChannelMembers, $limitsUserChannels); } } class UpdateServiceOptions extends Options { /** * @param string $friendlyName The friendly_name * @param string $defaultServiceRoleSid The default_service_role_sid * @param string $defaultChannelRoleSid The default_channel_role_sid * @param string $defaultChannelCreatorRoleSid The * default_channel_creator_role_sid * @param boolean $readStatusEnabled The read_status_enabled * @param boolean $reachabilityEnabled The reachability_enabled * @param integer $typingIndicatorTimeout The typing_indicator_timeout * @param integer $consumptionReportInterval The consumption_report_interval * @param boolean $notificationsNewMessageEnabled The * notifications.new_message.enabled * @param string $notificationsNewMessageTemplate The * notifications.new_message.template * @param boolean $notificationsAddedToChannelEnabled The * notifications.added_to_channel.enabled * @param string $notificationsAddedToChannelTemplate The * notifications.added_to_channel.template * @param boolean $notificationsRemovedFromChannelEnabled The * notifications.removed_from_channel.enabled * @param string $notificationsRemovedFromChannelTemplate The * notifications.removed_from_channel.template * @param boolean $notificationsInvitedToChannelEnabled The * notifications.invited_to_channel.enabled * @param string $notificationsInvitedToChannelTemplate The * notifications.invited_to_channel.template * @param string $preWebhookUrl The pre_webhook_url * @param string $postWebhookUrl The post_webhook_url * @param string $webhookMethod The webhook_method * @param string $webhookFilters The webhook_filters * @param string $webhooksOnMessageSendUrl The webhooks.on_message_send.url * @param string $webhooksOnMessageSendMethod The * webhooks.on_message_send.method * @param string $webhooksOnMessageSendFormat The * webhooks.on_message_send.format * @param string $webhooksOnMessageUpdateUrl The webhooks.on_message_update.url * @param string $webhooksOnMessageUpdateMethod The * webhooks.on_message_update.method * @param string $webhooksOnMessageUpdateFormat The * webhooks.on_message_update.format * @param string $webhooksOnMessageRemoveUrl The webhooks.on_message_remove.url * @param string $webhooksOnMessageRemoveMethod The * webhooks.on_message_remove.method * @param string $webhooksOnMessageRemoveFormat The * webhooks.on_message_remove.format * @param string $webhooksOnChannelAddUrl The webhooks.on_channel_add.url * @param string $webhooksOnChannelAddMethod The webhooks.on_channel_add.method * @param string $webhooksOnChannelAddFormat The webhooks.on_channel_add.format * @param string $webhooksOnChannelDestroyUrl The * webhooks.on_channel_destroy.url * @param string $webhooksOnChannelDestroyMethod The * webhooks.on_channel_destroy.method * @param string $webhooksOnChannelDestroyFormat The * webhooks.on_channel_destroy.format * @param string $webhooksOnChannelUpdateUrl The webhooks.on_channel_update.url * @param string $webhooksOnChannelUpdateMethod The * webhooks.on_channel_update.method * @param string $webhooksOnChannelUpdateFormat The * webhooks.on_channel_update.format * @param string $webhooksOnMemberAddUrl The webhooks.on_member_add.url * @param string $webhooksOnMemberAddMethod The webhooks.on_member_add.method * @param string $webhooksOnMemberAddFormat The webhooks.on_member_add.format * @param string $webhooksOnMemberRemoveUrl The webhooks.on_member_remove.url * @param string $webhooksOnMemberRemoveMethod The * webhooks.on_member_remove.method * @param string $webhooksOnMemberRemoveFormat The * webhooks.on_member_remove.format * @param string $webhooksOnMessageSentUrl The webhooks.on_message_sent.url * @param string $webhooksOnMessageSentMethod The * webhooks.on_message_sent.method * @param string $webhooksOnMessageSentFormat The * webhooks.on_message_sent.format * @param string $webhooksOnMessageUpdatedUrl The * webhooks.on_message_updated.url * @param string $webhooksOnMessageUpdatedMethod The * webhooks.on_message_updated.method * @param string $webhooksOnMessageUpdatedFormat The * webhooks.on_message_updated.format * @param string $webhooksOnMessageRemovedUrl The * webhooks.on_message_removed.url * @param string $webhooksOnMessageRemovedMethod The * webhooks.on_message_removed.method * @param string $webhooksOnMessageRemovedFormat The * webhooks.on_message_removed.format * @param string $webhooksOnChannelAddedUrl The webhooks.on_channel_added.url * @param string $webhooksOnChannelAddedMethod The * webhooks.on_channel_added.method * @param string $webhooksOnChannelAddedFormat The * webhooks.on_channel_added.format * @param string $webhooksOnChannelDestroyedUrl The * webhooks.on_channel_destroyed.url * @param string $webhooksOnChannelDestroyedMethod The * webhooks.on_channel_destroyed.method * @param string $webhooksOnChannelDestroyedFormat The * webhooks.on_channel_destroyed.format * @param string $webhooksOnChannelUpdatedUrl The * webhooks.on_channel_updated.url * @param string $webhooksOnChannelUpdatedMethod The * webhooks.on_channel_updated.method * @param string $webhooksOnChannelUpdatedFormat The * webhooks.on_channel_updated.format * @param string $webhooksOnMemberAddedUrl The webhooks.on_member_added.url * @param string $webhooksOnMemberAddedMethod The * webhooks.on_member_added.method * @param string $webhooksOnMemberAddedFormat The * webhooks.on_member_added.format * @param string $webhooksOnMemberRemovedUrl The webhooks.on_member_removed.url * @param string $webhooksOnMemberRemovedMethod The * webhooks.on_member_removed.method * @param string $webhooksOnMemberRemovedFormat The * webhooks.on_member_removed.format * @param integer $limitsChannelMembers The limits.channel_members * @param integer $limitsUserChannels The limits.user_channels */ 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, $webhooksOnMessageSendFormat = Values::NONE, $webhooksOnMessageUpdateUrl = Values::NONE, $webhooksOnMessageUpdateMethod = Values::NONE, $webhooksOnMessageUpdateFormat = Values::NONE, $webhooksOnMessageRemoveUrl = Values::NONE, $webhooksOnMessageRemoveMethod = Values::NONE, $webhooksOnMessageRemoveFormat = Values::NONE, $webhooksOnChannelAddUrl = Values::NONE, $webhooksOnChannelAddMethod = Values::NONE, $webhooksOnChannelAddFormat = Values::NONE, $webhooksOnChannelDestroyUrl = Values::NONE, $webhooksOnChannelDestroyMethod = Values::NONE, $webhooksOnChannelDestroyFormat = Values::NONE, $webhooksOnChannelUpdateUrl = Values::NONE, $webhooksOnChannelUpdateMethod = Values::NONE, $webhooksOnChannelUpdateFormat = Values::NONE, $webhooksOnMemberAddUrl = Values::NONE, $webhooksOnMemberAddMethod = Values::NONE, $webhooksOnMemberAddFormat = Values::NONE, $webhooksOnMemberRemoveUrl = Values::NONE, $webhooksOnMemberRemoveMethod = Values::NONE, $webhooksOnMemberRemoveFormat = Values::NONE, $webhooksOnMessageSentUrl = Values::NONE, $webhooksOnMessageSentMethod = Values::NONE, $webhooksOnMessageSentFormat = Values::NONE, $webhooksOnMessageUpdatedUrl = Values::NONE, $webhooksOnMessageUpdatedMethod = Values::NONE, $webhooksOnMessageUpdatedFormat = Values::NONE, $webhooksOnMessageRemovedUrl = Values::NONE, $webhooksOnMessageRemovedMethod = Values::NONE, $webhooksOnMessageRemovedFormat = Values::NONE, $webhooksOnChannelAddedUrl = Values::NONE, $webhooksOnChannelAddedMethod = Values::NONE, $webhooksOnChannelAddedFormat = Values::NONE, $webhooksOnChannelDestroyedUrl = Values::NONE, $webhooksOnChannelDestroyedMethod = Values::NONE, $webhooksOnChannelDestroyedFormat = Values::NONE, $webhooksOnChannelUpdatedUrl = Values::NONE, $webhooksOnChannelUpdatedMethod = Values::NONE, $webhooksOnChannelUpdatedFormat = Values::NONE, $webhooksOnMemberAddedUrl = Values::NONE, $webhooksOnMemberAddedMethod = Values::NONE, $webhooksOnMemberAddedFormat = Values::NONE, $webhooksOnMemberRemovedUrl = Values::NONE, $webhooksOnMemberRemovedMethod = Values::NONE, $webhooksOnMemberRemovedFormat = 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['webhooksOnMessageSendFormat'] = $webhooksOnMessageSendFormat; $this->options['webhooksOnMessageUpdateUrl'] = $webhooksOnMessageUpdateUrl; $this->options['webhooksOnMessageUpdateMethod'] = $webhooksOnMessageUpdateMethod; $this->options['webhooksOnMessageUpdateFormat'] = $webhooksOnMessageUpdateFormat; $this->options['webhooksOnMessageRemoveUrl'] = $webhooksOnMessageRemoveUrl; $this->options['webhooksOnMessageRemoveMethod'] = $webhooksOnMessageRemoveMethod; $this->options['webhooksOnMessageRemoveFormat'] = $webhooksOnMessageRemoveFormat; $this->options['webhooksOnChannelAddUrl'] = $webhooksOnChannelAddUrl; $this->options['webhooksOnChannelAddMethod'] = $webhooksOnChannelAddMethod; $this->options['webhooksOnChannelAddFormat'] = $webhooksOnChannelAddFormat; $this->options['webhooksOnChannelDestroyUrl'] = $webhooksOnChannelDestroyUrl; $this->options['webhooksOnChannelDestroyMethod'] = $webhooksOnChannelDestroyMethod; $this->options['webhooksOnChannelDestroyFormat'] = $webhooksOnChannelDestroyFormat; $this->options['webhooksOnChannelUpdateUrl'] = $webhooksOnChannelUpdateUrl; $this->options['webhooksOnChannelUpdateMethod'] = $webhooksOnChannelUpdateMethod; $this->options['webhooksOnChannelUpdateFormat'] = $webhooksOnChannelUpdateFormat; $this->options['webhooksOnMemberAddUrl'] = $webhooksOnMemberAddUrl; $this->options['webhooksOnMemberAddMethod'] = $webhooksOnMemberAddMethod; $this->options['webhooksOnMemberAddFormat'] = $webhooksOnMemberAddFormat; $this->options['webhooksOnMemberRemoveUrl'] = $webhooksOnMemberRemoveUrl; $this->options['webhooksOnMemberRemoveMethod'] = $webhooksOnMemberRemoveMethod; $this->options['webhooksOnMemberRemoveFormat'] = $webhooksOnMemberRemoveFormat; $this->options['webhooksOnMessageSentUrl'] = $webhooksOnMessageSentUrl; $this->options['webhooksOnMessageSentMethod'] = $webhooksOnMessageSentMethod; $this->options['webhooksOnMessageSentFormat'] = $webhooksOnMessageSentFormat; $this->options['webhooksOnMessageUpdatedUrl'] = $webhooksOnMessageUpdatedUrl; $this->options['webhooksOnMessageUpdatedMethod'] = $webhooksOnMessageUpdatedMethod; $this->options['webhooksOnMessageUpdatedFormat'] = $webhooksOnMessageUpdatedFormat; $this->options['webhooksOnMessageRemovedUrl'] = $webhooksOnMessageRemovedUrl; $this->options['webhooksOnMessageRemovedMethod'] = $webhooksOnMessageRemovedMethod; $this->options['webhooksOnMessageRemovedFormat'] = $webhooksOnMessageRemovedFormat; $this->options['webhooksOnChannelAddedUrl'] = $webhooksOnChannelAddedUrl; $this->options['webhooksOnChannelAddedMethod'] = $webhooksOnChannelAddedMethod; $this->options['webhooksOnChannelAddedFormat'] = $webhooksOnChannelAddedFormat; $this->options['webhooksOnChannelDestroyedUrl'] = $webhooksOnChannelDestroyedUrl; $this->options['webhooksOnChannelDestroyedMethod'] = $webhooksOnChannelDestroyedMethod; $this->options['webhooksOnChannelDestroyedFormat'] = $webhooksOnChannelDestroyedFormat; $this->options['webhooksOnChannelUpdatedUrl'] = $webhooksOnChannelUpdatedUrl; $this->options['webhooksOnChannelUpdatedMethod'] = $webhooksOnChannelUpdatedMethod; $this->options['webhooksOnChannelUpdatedFormat'] = $webhooksOnChannelUpdatedFormat; $this->options['webhooksOnMemberAddedUrl'] = $webhooksOnMemberAddedUrl; $this->options['webhooksOnMemberAddedMethod'] = $webhooksOnMemberAddedMethod; $this->options['webhooksOnMemberAddedFormat'] = $webhooksOnMemberAddedFormat; $this->options['webhooksOnMemberRemovedUrl'] = $webhooksOnMemberRemovedUrl; $this->options['webhooksOnMemberRemovedMethod'] = $webhooksOnMemberRemovedMethod; $this->options['webhooksOnMemberRemovedFormat'] = $webhooksOnMemberRemovedFormat; $this->options['limitsChannelMembers'] = $limitsChannelMembers; $this->options['limitsUserChannels'] = $limitsUserChannels; } /** * The friendly_name * * @param string $friendlyName The friendly_name * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The default_service_role_sid * * @param string $defaultServiceRoleSid The default_service_role_sid * @return $this Fluent Builder */ public function setDefaultServiceRoleSid($defaultServiceRoleSid) { $this->options['defaultServiceRoleSid'] = $defaultServiceRoleSid; return $this; } /** * The default_channel_role_sid * * @param string $defaultChannelRoleSid The default_channel_role_sid * @return $this Fluent Builder */ public function setDefaultChannelRoleSid($defaultChannelRoleSid) { $this->options['defaultChannelRoleSid'] = $defaultChannelRoleSid; return $this; } /** * The default_channel_creator_role_sid * * @param string $defaultChannelCreatorRoleSid The * default_channel_creator_role_sid * @return $this Fluent Builder */ public function setDefaultChannelCreatorRoleSid($defaultChannelCreatorRoleSid) { $this->options['defaultChannelCreatorRoleSid'] = $defaultChannelCreatorRoleSid; return $this; } /** * The read_status_enabled * * @param boolean $readStatusEnabled The read_status_enabled * @return $this Fluent Builder */ public function setReadStatusEnabled($readStatusEnabled) { $this->options['readStatusEnabled'] = $readStatusEnabled; return $this; } /** * The reachability_enabled * * @param boolean $reachabilityEnabled The reachability_enabled * @return $this Fluent Builder */ public function setReachabilityEnabled($reachabilityEnabled) { $this->options['reachabilityEnabled'] = $reachabilityEnabled; return $this; } /** * The typing_indicator_timeout * * @param integer $typingIndicatorTimeout The typing_indicator_timeout * @return $this Fluent Builder */ public function setTypingIndicatorTimeout($typingIndicatorTimeout) { $this->options['typingIndicatorTimeout'] = $typingIndicatorTimeout; return $this; } /** * The consumption_report_interval * * @param integer $consumptionReportInterval The consumption_report_interval * @return $this Fluent Builder */ public function setConsumptionReportInterval($consumptionReportInterval) { $this->options['consumptionReportInterval'] = $consumptionReportInterval; return $this; } /** * The notifications.new_message.enabled * * @param boolean $notificationsNewMessageEnabled The * notifications.new_message.enabled * @return $this Fluent Builder */ public function setNotificationsNewMessageEnabled($notificationsNewMessageEnabled) { $this->options['notificationsNewMessageEnabled'] = $notificationsNewMessageEnabled; return $this; } /** * The notifications.new_message.template * * @param string $notificationsNewMessageTemplate The * notifications.new_message.template * @return $this Fluent Builder */ public function setNotificationsNewMessageTemplate($notificationsNewMessageTemplate) { $this->options['notificationsNewMessageTemplate'] = $notificationsNewMessageTemplate; return $this; } /** * The notifications.added_to_channel.enabled * * @param boolean $notificationsAddedToChannelEnabled The * notifications.added_to_channel.enabled * @return $this Fluent Builder */ public function setNotificationsAddedToChannelEnabled($notificationsAddedToChannelEnabled) { $this->options['notificationsAddedToChannelEnabled'] = $notificationsAddedToChannelEnabled; return $this; } /** * The notifications.added_to_channel.template * * @param string $notificationsAddedToChannelTemplate The * notifications.added_to_channel.template * @return $this Fluent Builder */ public function setNotificationsAddedToChannelTemplate($notificationsAddedToChannelTemplate) { $this->options['notificationsAddedToChannelTemplate'] = $notificationsAddedToChannelTemplate; return $this; } /** * The notifications.removed_from_channel.enabled * * @param boolean $notificationsRemovedFromChannelEnabled The * notifications.removed_from_channel.enabled * @return $this Fluent Builder */ public function setNotificationsRemovedFromChannelEnabled($notificationsRemovedFromChannelEnabled) { $this->options['notificationsRemovedFromChannelEnabled'] = $notificationsRemovedFromChannelEnabled; return $this; } /** * The notifications.removed_from_channel.template * * @param string $notificationsRemovedFromChannelTemplate The * notifications.removed_from_channel.template * @return $this Fluent Builder */ public function setNotificationsRemovedFromChannelTemplate($notificationsRemovedFromChannelTemplate) { $this->options['notificationsRemovedFromChannelTemplate'] = $notificationsRemovedFromChannelTemplate; return $this; } /** * The notifications.invited_to_channel.enabled * * @param boolean $notificationsInvitedToChannelEnabled The * notifications.invited_to_channel.enabled * @return $this Fluent Builder */ public function setNotificationsInvitedToChannelEnabled($notificationsInvitedToChannelEnabled) { $this->options['notificationsInvitedToChannelEnabled'] = $notificationsInvitedToChannelEnabled; return $this; } /** * The notifications.invited_to_channel.template * * @param string $notificationsInvitedToChannelTemplate The * notifications.invited_to_channel.template * @return $this Fluent Builder */ public function setNotificationsInvitedToChannelTemplate($notificationsInvitedToChannelTemplate) { $this->options['notificationsInvitedToChannelTemplate'] = $notificationsInvitedToChannelTemplate; return $this; } /** * The pre_webhook_url * * @param string $preWebhookUrl The pre_webhook_url * @return $this Fluent Builder */ public function setPreWebhookUrl($preWebhookUrl) { $this->options['preWebhookUrl'] = $preWebhookUrl; return $this; } /** * The post_webhook_url * * @param string $postWebhookUrl The post_webhook_url * @return $this Fluent Builder */ public function setPostWebhookUrl($postWebhookUrl) { $this->options['postWebhookUrl'] = $postWebhookUrl; 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 webhook_filters * * @param string $webhookFilters The webhook_filters * @return $this Fluent Builder */ public function setWebhookFilters($webhookFilters) { $this->options['webhookFilters'] = $webhookFilters; return $this; } /** * The webhooks.on_message_send.url * * @param string $webhooksOnMessageSendUrl The webhooks.on_message_send.url * @return $this Fluent Builder */ public function setWebhooksOnMessageSendUrl($webhooksOnMessageSendUrl) { $this->options['webhooksOnMessageSendUrl'] = $webhooksOnMessageSendUrl; return $this; } /** * The webhooks.on_message_send.method * * @param string $webhooksOnMessageSendMethod The * webhooks.on_message_send.method * @return $this Fluent Builder */ public function setWebhooksOnMessageSendMethod($webhooksOnMessageSendMethod) { $this->options['webhooksOnMessageSendMethod'] = $webhooksOnMessageSendMethod; return $this; } /** * The webhooks.on_message_send.format * * @param string $webhooksOnMessageSendFormat The * webhooks.on_message_send.format * @return $this Fluent Builder */ public function setWebhooksOnMessageSendFormat($webhooksOnMessageSendFormat) { $this->options['webhooksOnMessageSendFormat'] = $webhooksOnMessageSendFormat; return $this; } /** * The webhooks.on_message_update.url * * @param string $webhooksOnMessageUpdateUrl The webhooks.on_message_update.url * @return $this Fluent Builder */ public function setWebhooksOnMessageUpdateUrl($webhooksOnMessageUpdateUrl) { $this->options['webhooksOnMessageUpdateUrl'] = $webhooksOnMessageUpdateUrl; return $this; } /** * The webhooks.on_message_update.method * * @param string $webhooksOnMessageUpdateMethod The * webhooks.on_message_update.method * @return $this Fluent Builder */ public function setWebhooksOnMessageUpdateMethod($webhooksOnMessageUpdateMethod) { $this->options['webhooksOnMessageUpdateMethod'] = $webhooksOnMessageUpdateMethod; return $this; } /** * The webhooks.on_message_update.format * * @param string $webhooksOnMessageUpdateFormat The * webhooks.on_message_update.format * @return $this Fluent Builder */ public function setWebhooksOnMessageUpdateFormat($webhooksOnMessageUpdateFormat) { $this->options['webhooksOnMessageUpdateFormat'] = $webhooksOnMessageUpdateFormat; return $this; } /** * The webhooks.on_message_remove.url * * @param string $webhooksOnMessageRemoveUrl The webhooks.on_message_remove.url * @return $this Fluent Builder */ public function setWebhooksOnMessageRemoveUrl($webhooksOnMessageRemoveUrl) { $this->options['webhooksOnMessageRemoveUrl'] = $webhooksOnMessageRemoveUrl; return $this; } /** * The webhooks.on_message_remove.method * * @param string $webhooksOnMessageRemoveMethod The * webhooks.on_message_remove.method * @return $this Fluent Builder */ public function setWebhooksOnMessageRemoveMethod($webhooksOnMessageRemoveMethod) { $this->options['webhooksOnMessageRemoveMethod'] = $webhooksOnMessageRemoveMethod; return $this; } /** * The webhooks.on_message_remove.format * * @param string $webhooksOnMessageRemoveFormat The * webhooks.on_message_remove.format * @return $this Fluent Builder */ public function setWebhooksOnMessageRemoveFormat($webhooksOnMessageRemoveFormat) { $this->options['webhooksOnMessageRemoveFormat'] = $webhooksOnMessageRemoveFormat; return $this; } /** * The webhooks.on_channel_add.url * * @param string $webhooksOnChannelAddUrl The webhooks.on_channel_add.url * @return $this Fluent Builder */ public function setWebhooksOnChannelAddUrl($webhooksOnChannelAddUrl) { $this->options['webhooksOnChannelAddUrl'] = $webhooksOnChannelAddUrl; return $this; } /** * The webhooks.on_channel_add.method * * @param string $webhooksOnChannelAddMethod The webhooks.on_channel_add.method * @return $this Fluent Builder */ public function setWebhooksOnChannelAddMethod($webhooksOnChannelAddMethod) { $this->options['webhooksOnChannelAddMethod'] = $webhooksOnChannelAddMethod; return $this; } /** * The webhooks.on_channel_add.format * * @param string $webhooksOnChannelAddFormat The webhooks.on_channel_add.format * @return $this Fluent Builder */ public function setWebhooksOnChannelAddFormat($webhooksOnChannelAddFormat) { $this->options['webhooksOnChannelAddFormat'] = $webhooksOnChannelAddFormat; return $this; } /** * The webhooks.on_channel_destroy.url * * @param string $webhooksOnChannelDestroyUrl The * webhooks.on_channel_destroy.url * @return $this Fluent Builder */ public function setWebhooksOnChannelDestroyUrl($webhooksOnChannelDestroyUrl) { $this->options['webhooksOnChannelDestroyUrl'] = $webhooksOnChannelDestroyUrl; return $this; } /** * The webhooks.on_channel_destroy.method * * @param string $webhooksOnChannelDestroyMethod The * webhooks.on_channel_destroy.method * @return $this Fluent Builder */ public function setWebhooksOnChannelDestroyMethod($webhooksOnChannelDestroyMethod) { $this->options['webhooksOnChannelDestroyMethod'] = $webhooksOnChannelDestroyMethod; return $this; } /** * The webhooks.on_channel_destroy.format * * @param string $webhooksOnChannelDestroyFormat The * webhooks.on_channel_destroy.format * @return $this Fluent Builder */ public function setWebhooksOnChannelDestroyFormat($webhooksOnChannelDestroyFormat) { $this->options['webhooksOnChannelDestroyFormat'] = $webhooksOnChannelDestroyFormat; return $this; } /** * The webhooks.on_channel_update.url * * @param string $webhooksOnChannelUpdateUrl The webhooks.on_channel_update.url * @return $this Fluent Builder */ public function setWebhooksOnChannelUpdateUrl($webhooksOnChannelUpdateUrl) { $this->options['webhooksOnChannelUpdateUrl'] = $webhooksOnChannelUpdateUrl; return $this; } /** * The webhooks.on_channel_update.method * * @param string $webhooksOnChannelUpdateMethod The * webhooks.on_channel_update.method * @return $this Fluent Builder */ public function setWebhooksOnChannelUpdateMethod($webhooksOnChannelUpdateMethod) { $this->options['webhooksOnChannelUpdateMethod'] = $webhooksOnChannelUpdateMethod; return $this; } /** * The webhooks.on_channel_update.format * * @param string $webhooksOnChannelUpdateFormat The * webhooks.on_channel_update.format * @return $this Fluent Builder */ public function setWebhooksOnChannelUpdateFormat($webhooksOnChannelUpdateFormat) { $this->options['webhooksOnChannelUpdateFormat'] = $webhooksOnChannelUpdateFormat; return $this; } /** * The webhooks.on_member_add.url * * @param string $webhooksOnMemberAddUrl The webhooks.on_member_add.url * @return $this Fluent Builder */ public function setWebhooksOnMemberAddUrl($webhooksOnMemberAddUrl) { $this->options['webhooksOnMemberAddUrl'] = $webhooksOnMemberAddUrl; return $this; } /** * The webhooks.on_member_add.method * * @param string $webhooksOnMemberAddMethod The webhooks.on_member_add.method * @return $this Fluent Builder */ public function setWebhooksOnMemberAddMethod($webhooksOnMemberAddMethod) { $this->options['webhooksOnMemberAddMethod'] = $webhooksOnMemberAddMethod; return $this; } /** * The webhooks.on_member_add.format * * @param string $webhooksOnMemberAddFormat The webhooks.on_member_add.format * @return $this Fluent Builder */ public function setWebhooksOnMemberAddFormat($webhooksOnMemberAddFormat) { $this->options['webhooksOnMemberAddFormat'] = $webhooksOnMemberAddFormat; return $this; } /** * The webhooks.on_member_remove.url * * @param string $webhooksOnMemberRemoveUrl The webhooks.on_member_remove.url * @return $this Fluent Builder */ public function setWebhooksOnMemberRemoveUrl($webhooksOnMemberRemoveUrl) { $this->options['webhooksOnMemberRemoveUrl'] = $webhooksOnMemberRemoveUrl; return $this; } /** * The webhooks.on_member_remove.method * * @param string $webhooksOnMemberRemoveMethod The * webhooks.on_member_remove.method * @return $this Fluent Builder */ public function setWebhooksOnMemberRemoveMethod($webhooksOnMemberRemoveMethod) { $this->options['webhooksOnMemberRemoveMethod'] = $webhooksOnMemberRemoveMethod; return $this; } /** * The webhooks.on_member_remove.format * * @param string $webhooksOnMemberRemoveFormat The * webhooks.on_member_remove.format * @return $this Fluent Builder */ public function setWebhooksOnMemberRemoveFormat($webhooksOnMemberRemoveFormat) { $this->options['webhooksOnMemberRemoveFormat'] = $webhooksOnMemberRemoveFormat; return $this; } /** * The webhooks.on_message_sent.url * * @param string $webhooksOnMessageSentUrl The webhooks.on_message_sent.url * @return $this Fluent Builder */ public function setWebhooksOnMessageSentUrl($webhooksOnMessageSentUrl) { $this->options['webhooksOnMessageSentUrl'] = $webhooksOnMessageSentUrl; return $this; } /** * The webhooks.on_message_sent.method * * @param string $webhooksOnMessageSentMethod The * webhooks.on_message_sent.method * @return $this Fluent Builder */ public function setWebhooksOnMessageSentMethod($webhooksOnMessageSentMethod) { $this->options['webhooksOnMessageSentMethod'] = $webhooksOnMessageSentMethod; return $this; } /** * The webhooks.on_message_sent.format * * @param string $webhooksOnMessageSentFormat The * webhooks.on_message_sent.format * @return $this Fluent Builder */ public function setWebhooksOnMessageSentFormat($webhooksOnMessageSentFormat) { $this->options['webhooksOnMessageSentFormat'] = $webhooksOnMessageSentFormat; return $this; } /** * The webhooks.on_message_updated.url * * @param string $webhooksOnMessageUpdatedUrl The * webhooks.on_message_updated.url * @return $this Fluent Builder */ public function setWebhooksOnMessageUpdatedUrl($webhooksOnMessageUpdatedUrl) { $this->options['webhooksOnMessageUpdatedUrl'] = $webhooksOnMessageUpdatedUrl; return $this; } /** * The webhooks.on_message_updated.method * * @param string $webhooksOnMessageUpdatedMethod The * webhooks.on_message_updated.method * @return $this Fluent Builder */ public function setWebhooksOnMessageUpdatedMethod($webhooksOnMessageUpdatedMethod) { $this->options['webhooksOnMessageUpdatedMethod'] = $webhooksOnMessageUpdatedMethod; return $this; } /** * The webhooks.on_message_updated.format * * @param string $webhooksOnMessageUpdatedFormat The * webhooks.on_message_updated.format * @return $this Fluent Builder */ public function setWebhooksOnMessageUpdatedFormat($webhooksOnMessageUpdatedFormat) { $this->options['webhooksOnMessageUpdatedFormat'] = $webhooksOnMessageUpdatedFormat; return $this; } /** * The webhooks.on_message_removed.url * * @param string $webhooksOnMessageRemovedUrl The * webhooks.on_message_removed.url * @return $this Fluent Builder */ public function setWebhooksOnMessageRemovedUrl($webhooksOnMessageRemovedUrl) { $this->options['webhooksOnMessageRemovedUrl'] = $webhooksOnMessageRemovedUrl; return $this; } /** * The webhooks.on_message_removed.method * * @param string $webhooksOnMessageRemovedMethod The * webhooks.on_message_removed.method * @return $this Fluent Builder */ public function setWebhooksOnMessageRemovedMethod($webhooksOnMessageRemovedMethod) { $this->options['webhooksOnMessageRemovedMethod'] = $webhooksOnMessageRemovedMethod; return $this; } /** * The webhooks.on_message_removed.format * * @param string $webhooksOnMessageRemovedFormat The * webhooks.on_message_removed.format * @return $this Fluent Builder */ public function setWebhooksOnMessageRemovedFormat($webhooksOnMessageRemovedFormat) { $this->options['webhooksOnMessageRemovedFormat'] = $webhooksOnMessageRemovedFormat; return $this; } /** * The webhooks.on_channel_added.url * * @param string $webhooksOnChannelAddedUrl The webhooks.on_channel_added.url * @return $this Fluent Builder */ public function setWebhooksOnChannelAddedUrl($webhooksOnChannelAddedUrl) { $this->options['webhooksOnChannelAddedUrl'] = $webhooksOnChannelAddedUrl; return $this; } /** * The webhooks.on_channel_added.method * * @param string $webhooksOnChannelAddedMethod The * webhooks.on_channel_added.method * @return $this Fluent Builder */ public function setWebhooksOnChannelAddedMethod($webhooksOnChannelAddedMethod) { $this->options['webhooksOnChannelAddedMethod'] = $webhooksOnChannelAddedMethod; return $this; } /** * The webhooks.on_channel_added.format * * @param string $webhooksOnChannelAddedFormat The * webhooks.on_channel_added.format * @return $this Fluent Builder */ public function setWebhooksOnChannelAddedFormat($webhooksOnChannelAddedFormat) { $this->options['webhooksOnChannelAddedFormat'] = $webhooksOnChannelAddedFormat; return $this; } /** * The webhooks.on_channel_destroyed.url * * @param string $webhooksOnChannelDestroyedUrl The * webhooks.on_channel_destroyed.url * @return $this Fluent Builder */ public function setWebhooksOnChannelDestroyedUrl($webhooksOnChannelDestroyedUrl) { $this->options['webhooksOnChannelDestroyedUrl'] = $webhooksOnChannelDestroyedUrl; return $this; } /** * The webhooks.on_channel_destroyed.method * * @param string $webhooksOnChannelDestroyedMethod The * webhooks.on_channel_destroyed.method * @return $this Fluent Builder */ public function setWebhooksOnChannelDestroyedMethod($webhooksOnChannelDestroyedMethod) { $this->options['webhooksOnChannelDestroyedMethod'] = $webhooksOnChannelDestroyedMethod; return $this; } /** * The webhooks.on_channel_destroyed.format * * @param string $webhooksOnChannelDestroyedFormat The * webhooks.on_channel_destroyed.format * @return $this Fluent Builder */ public function setWebhooksOnChannelDestroyedFormat($webhooksOnChannelDestroyedFormat) { $this->options['webhooksOnChannelDestroyedFormat'] = $webhooksOnChannelDestroyedFormat; return $this; } /** * The webhooks.on_channel_updated.url * * @param string $webhooksOnChannelUpdatedUrl The * webhooks.on_channel_updated.url * @return $this Fluent Builder */ public function setWebhooksOnChannelUpdatedUrl($webhooksOnChannelUpdatedUrl) { $this->options['webhooksOnChannelUpdatedUrl'] = $webhooksOnChannelUpdatedUrl; return $this; } /** * The webhooks.on_channel_updated.method * * @param string $webhooksOnChannelUpdatedMethod The * webhooks.on_channel_updated.method * @return $this Fluent Builder */ public function setWebhooksOnChannelUpdatedMethod($webhooksOnChannelUpdatedMethod) { $this->options['webhooksOnChannelUpdatedMethod'] = $webhooksOnChannelUpdatedMethod; return $this; } /** * The webhooks.on_channel_updated.format * * @param string $webhooksOnChannelUpdatedFormat The * webhooks.on_channel_updated.format * @return $this Fluent Builder */ public function setWebhooksOnChannelUpdatedFormat($webhooksOnChannelUpdatedFormat) { $this->options['webhooksOnChannelUpdatedFormat'] = $webhooksOnChannelUpdatedFormat; return $this; } /** * The webhooks.on_member_added.url * * @param string $webhooksOnMemberAddedUrl The webhooks.on_member_added.url * @return $this Fluent Builder */ public function setWebhooksOnMemberAddedUrl($webhooksOnMemberAddedUrl) { $this->options['webhooksOnMemberAddedUrl'] = $webhooksOnMemberAddedUrl; return $this; } /** * The webhooks.on_member_added.method * * @param string $webhooksOnMemberAddedMethod The * webhooks.on_member_added.method * @return $this Fluent Builder */ public function setWebhooksOnMemberAddedMethod($webhooksOnMemberAddedMethod) { $this->options['webhooksOnMemberAddedMethod'] = $webhooksOnMemberAddedMethod; return $this; } /** * The webhooks.on_member_added.format * * @param string $webhooksOnMemberAddedFormat The * webhooks.on_member_added.format * @return $this Fluent Builder */ public function setWebhooksOnMemberAddedFormat($webhooksOnMemberAddedFormat) { $this->options['webhooksOnMemberAddedFormat'] = $webhooksOnMemberAddedFormat; return $this; } /** * The webhooks.on_member_removed.url * * @param string $webhooksOnMemberRemovedUrl The webhooks.on_member_removed.url * @return $this Fluent Builder */ public function setWebhooksOnMemberRemovedUrl($webhooksOnMemberRemovedUrl) { $this->options['webhooksOnMemberRemovedUrl'] = $webhooksOnMemberRemovedUrl; return $this; } /** * The webhooks.on_member_removed.method * * @param string $webhooksOnMemberRemovedMethod The * webhooks.on_member_removed.method * @return $this Fluent Builder */ public function setWebhooksOnMemberRemovedMethod($webhooksOnMemberRemovedMethod) { $this->options['webhooksOnMemberRemovedMethod'] = $webhooksOnMemberRemovedMethod; return $this; } /** * The webhooks.on_member_removed.format * * @param string $webhooksOnMemberRemovedFormat The * webhooks.on_member_removed.format * @return $this Fluent Builder */ public function setWebhooksOnMemberRemovedFormat($webhooksOnMemberRemovedFormat) { $this->options['webhooksOnMemberRemovedFormat'] = $webhooksOnMemberRemovedFormat; return $this; } /** * The limits.channel_members * * @param integer $limitsChannelMembers The limits.channel_members * @return $this Fluent Builder */ public function setLimitsChannelMembers($limitsChannelMembers) { $this->options['limitsChannelMembers'] = $limitsChannelMembers; return $this; } /** * The limits.user_channels * * @param integer $limitsUserChannels The limits.user_channels * @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/Twilio/Rest/IpMessaging/V1/CredentialInstance.php 0000604 00000007557 15174325126 0016475 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 sid * @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 */ public function fetch() { return $this->proxy()->fetch(); } /** * Update the CredentialInstance * * @param array|Options $options Optional Arguments * @return CredentialInstance Updated CredentialInstance */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Deletes the CredentialInstance * * @return boolean True if delete succeeds, false otherwise */ 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/Twilio/Rest/IpMessaging/V1.php 0000604 00000005474 15174325127 0012733 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 \Twilio\Exceptions\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 \Twilio\Exceptions\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/Twilio/Rest/IpMessaging/V2.php 0000604 00000005474 15174325127 0012734 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 \Twilio\Exceptions\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 \Twilio\Exceptions\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/Twilio/Rest/Fax.php 0000604 00000005133 15174325127 0010745 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 \Twilio\Exceptions\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 \Twilio\Exceptions\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 A string that uniquely identifies this fax. * @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/Twilio/Rest/Sync.php 0000604 00000005147 15174325127 0011150 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 \Twilio\Exceptions\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 \Twilio\Exceptions\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 * @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/Twilio/Rest/Trunking/V1.php 0000604 00000004425 15174325127 0012321 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 \Twilio\Exceptions\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 \Twilio\Exceptions\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/Twilio/Rest/Trunking/V1/Trunk/PhoneNumberList.php 0000604 00000012535 15174325127 0016503 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Trunking\V1\Trunk; 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 trunk_sid * @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 phone_number_sid * @return PhoneNumberInstance Newly created PhoneNumberInstance */ 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 sid * @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/Twilio/Rest/Trunking/V1/Trunk/IpAccessControlListList.php 0000604 00000013066 15174325127 0020150 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Trunking\V1\Trunk; 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 trunk_sid * @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 ip_access_control_list_sid * @return IpAccessControlListInstance Newly created IpAccessControlListInstance */ 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 sid * @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/Twilio/Rest/Trunking/V1/Trunk/PhoneNumberContext.php 0000604 00000003700 15174325127 0017206 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Trunking\V1\Trunk; 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 trunk_sid * @param string $sid The sid * @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 */ 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 */ 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/Twilio/Rest/Trunking/V1/Trunk/OriginationUrlList.php 0000604 00000013463 15174325127 0017227 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Trunking\V1\Trunk; 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 trunk_sid * @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 integer $weight The weight * @param integer $priority The priority * @param boolean $enabled The enabled * @param string $friendlyName The friendly_name * @param string $sipUrl The sip_url * @return OriginationUrlInstance Newly created OriginationUrlInstance */ 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 sid * @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/Twilio/Rest/Trunking/V1/Trunk/CredentialListInstance.php 0000604 00000007431 15174325127 0020017 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 trunk_sid * @param string $sid The sid * @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 */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the CredentialListInstance * * @return boolean True if delete succeeds, false otherwise */ 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/Twilio/Rest/Trunking/V1/Trunk/CredentialListPage.php 0000604 00000001413 15174325127 0017121 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/Twilio/Rest/Trunking/V1/Trunk/IpAccessControlListPage.php 0000604 00000001432 15174325127 0020103 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/Twilio/Rest/Trunking/V1/Trunk/PhoneNumberPage.php 0000604 00000001402 15174325127 0016433 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/Twilio/Rest/Trunking/V1/Trunk/OriginationUrlPage.php 0000604 00000001413 15174325127 0017160 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/Twilio/Rest/Trunking/V1/Trunk/CredentialListList.php 0000604 00000012653 15174325127 0017170 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Trunking\V1\Trunk; 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 trunk_sid * @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 credential_list_sid * @return CredentialListInstance Newly created CredentialListInstance */ 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 sid * @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/Twilio/Rest/Trunking/V1/Trunk/IpAccessControlListContext.php 0000604 00000004020 15174325127 0020647 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Trunking\V1\Trunk; 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 trunk_sid * @param string $sid The sid * @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 */ 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 */ 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/Twilio/Rest/Trunking/V1/Trunk/OriginationUrlContext.php 0000604 00000005637 15174325127 0017744 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Trunking\V1\Trunk; 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 trunk_sid * @param string $sid The sid * @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 */ 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 */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Update the OriginationUrlInstance * * @param array|Options $options Optional Arguments * @return OriginationUrlInstance Updated OriginationUrlInstance */ 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/Twilio/Rest/Trunking/V1/Trunk/CredentialListContext.php 0000604 00000003736 15174325127 0017703 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Trunking\V1\Trunk; 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 trunk_sid * @param string $sid The sid * @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 */ 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 */ 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/Twilio/Rest/Trunking/V1/Trunk/OriginationUrlOptions.php 0000604 00000006167 15174325127 0017752 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 integer $weight The weight * @param integer $priority The priority * @param boolean $enabled The enabled * @param string $friendlyName The friendly_name * @param string $sipUrl The sip_url * @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 integer $weight The weight * @param integer $priority The priority * @param boolean $enabled The enabled * @param string $friendlyName The friendly_name * @param string $sipUrl The sip_url */ 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 weight * * @param integer $weight The weight * @return $this Fluent Builder */ public function setWeight($weight) { $this->options['weight'] = $weight; return $this; } /** * The priority * * @param integer $priority The priority * @return $this Fluent Builder */ public function setPriority($priority) { $this->options['priority'] = $priority; return $this; } /** * The enabled * * @param boolean $enabled The enabled * @return $this Fluent Builder */ public function setEnabled($enabled) { $this->options['enabled'] = $enabled; 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 sip_url * * @param string $sipUrl The sip_url * @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/Twilio/Rest/Trunking/V1/Trunk/IpAccessControlListInstance.php 0000604 00000007532 15174325127 0021002 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 trunk_sid * @param string $sid The sid * @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 */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the IpAccessControlListInstance * * @return boolean True if delete succeeds, false otherwise */ 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/Twilio/Rest/Trunking/V1/Trunk/PhoneNumberInstance.php 0000604 00000013421 15174325127 0017327 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 boolean beta * @property string 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 boolean 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 trunk_sid * @param string $sid The sid * @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 */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the PhoneNumberInstance * * @return boolean True if delete succeeds, false otherwise */ 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/Twilio/Rest/Trunking/V1/Trunk/OriginationUrlInstance.php 0000604 00000010711 15174325127 0020051 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 integer weight * @property boolean enabled * @property string sipUrl * @property string friendlyName * @property integer 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 trunk_sid * @param string $sid The sid * @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 */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the OriginationUrlInstance * * @return boolean True if delete succeeds, false otherwise */ public function delete() { return $this->proxy()->delete(); } /** * Update the OriginationUrlInstance * * @param array|Options $options Optional Arguments * @return OriginationUrlInstance Updated OriginationUrlInstance */ 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/Twilio/Rest/Trunking/V1/TrunkList.php 0000604 00000012714 15174325127 0014260 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Trunking\V1; 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 */ 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']), )); $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 sid * @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/Twilio/Rest/Trunking/V1/TrunkInstance.php 0000604 00000012667 15174325127 0015120 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 boolean secure * @property array recording * @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; /** * Initialize the TrunkInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The sid * @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'), '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 */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the TrunkInstance * * @return boolean True if delete succeeds, false otherwise */ public function delete() { return $this->proxy()->delete(); } /** * Update the TrunkInstance * * @param array|Options $options Optional Arguments * @return TrunkInstance Updated TrunkInstance */ 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; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (property_exists($this, '_' . $name)) { $method = 'get' . ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide 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/Twilio/Rest/Trunking/V1/TrunkContext.php 0000604 00000014405 15174325127 0014770 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\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 * @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) */ class TrunkContext extends InstanceContext { protected $_originationUrls = null; protected $_credentialsLists = null; protected $_ipAccessControlLists = null; protected $_phoneNumbers = null; /** * Initialize the TrunkContext * * @param \Twilio\Version $version Version that contains the resource * @param string $sid The sid * @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 */ 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 */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Update the TrunkInstance * * @param array|Options $options Optional Arguments * @return TrunkInstance Updated TrunkInstance */ 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']), )); $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; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws \Twilio\Exceptions\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 \Twilio\Exceptions\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/Twilio/Rest/Trunking/V1/TrunkOptions.php 0000604 00000017427 15174325127 0015006 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 The friendly_name * @param string $domainName The domain_name * @param string $disasterRecoveryUrl The disaster_recovery_url * @param string $disasterRecoveryMethod The disaster_recovery_method * @param string $recording The recording * @param boolean $secure The secure * @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) { return new CreateTrunkOptions($friendlyName, $domainName, $disasterRecoveryUrl, $disasterRecoveryMethod, $recording, $secure); } /** * @param string $friendlyName The friendly_name * @param string $domainName The domain_name * @param string $disasterRecoveryUrl The disaster_recovery_url * @param string $disasterRecoveryMethod The disaster_recovery_method * @param string $recording The recording * @param boolean $secure The secure * @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) { return new UpdateTrunkOptions($friendlyName, $domainName, $disasterRecoveryUrl, $disasterRecoveryMethod, $recording, $secure); } } class CreateTrunkOptions extends Options { /** * @param string $friendlyName The friendly_name * @param string $domainName The domain_name * @param string $disasterRecoveryUrl The disaster_recovery_url * @param string $disasterRecoveryMethod The disaster_recovery_method * @param string $recording The recording * @param boolean $secure The secure */ public function __construct($friendlyName = Values::NONE, $domainName = Values::NONE, $disasterRecoveryUrl = Values::NONE, $disasterRecoveryMethod = Values::NONE, $recording = Values::NONE, $secure = 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; } /** * The friendly_name * * @param string $friendlyName The friendly_name * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The domain_name * * @param string $domainName The domain_name * @return $this Fluent Builder */ public function setDomainName($domainName) { $this->options['domainName'] = $domainName; return $this; } /** * The disaster_recovery_url * * @param string $disasterRecoveryUrl The disaster_recovery_url * @return $this Fluent Builder */ public function setDisasterRecoveryUrl($disasterRecoveryUrl) { $this->options['disasterRecoveryUrl'] = $disasterRecoveryUrl; return $this; } /** * The disaster_recovery_method * * @param string $disasterRecoveryMethod The disaster_recovery_method * @return $this Fluent Builder */ public function setDisasterRecoveryMethod($disasterRecoveryMethod) { $this->options['disasterRecoveryMethod'] = $disasterRecoveryMethod; return $this; } /** * The recording * * @param string $recording The recording * @return $this Fluent Builder */ public function setRecording($recording) { $this->options['recording'] = $recording; return $this; } /** * The secure * * @param boolean $secure The secure * @return $this Fluent Builder */ public function setSecure($secure) { $this->options['secure'] = $secure; return $this; } /** * Provide a friendly representation * * @return 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 The friendly_name * @param string $domainName The domain_name * @param string $disasterRecoveryUrl The disaster_recovery_url * @param string $disasterRecoveryMethod The disaster_recovery_method * @param string $recording The recording * @param boolean $secure The secure */ public function __construct($friendlyName = Values::NONE, $domainName = Values::NONE, $disasterRecoveryUrl = Values::NONE, $disasterRecoveryMethod = Values::NONE, $recording = Values::NONE, $secure = 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; } /** * The friendly_name * * @param string $friendlyName The friendly_name * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The domain_name * * @param string $domainName The domain_name * @return $this Fluent Builder */ public function setDomainName($domainName) { $this->options['domainName'] = $domainName; return $this; } /** * The disaster_recovery_url * * @param string $disasterRecoveryUrl The disaster_recovery_url * @return $this Fluent Builder */ public function setDisasterRecoveryUrl($disasterRecoveryUrl) { $this->options['disasterRecoveryUrl'] = $disasterRecoveryUrl; return $this; } /** * The disaster_recovery_method * * @param string $disasterRecoveryMethod The disaster_recovery_method * @return $this Fluent Builder */ public function setDisasterRecoveryMethod($disasterRecoveryMethod) { $this->options['disasterRecoveryMethod'] = $disasterRecoveryMethod; return $this; } /** * The recording * * @param string $recording The recording * @return $this Fluent Builder */ public function setRecording($recording) { $this->options['recording'] = $recording; return $this; } /** * The secure * * @param boolean $secure The secure * @return $this Fluent Builder */ public function setSecure($secure) { $this->options['secure'] = $secure; return $this; } /** * Provide a friendly representation * * @return 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/Twilio/Rest/Trunking/V1/TrunkPage.php 0000604 00000001315 15174325127 0014214 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/Twilio/Rest/Proxy/V1.php 0000604 00000004422 15174325127 0011636 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 \Twilio\Exceptions\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 \Twilio\Exceptions\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/Twilio/Rest/Proxy/V1/ServiceOptions.php 0000604 00000027017 15174325127 0014617 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 integer $defaultTtl Default TTL for a Session, in seconds. * @param string $callbackUrl URL Twilio will send callbacks to * @param string $geoMatchLevel Whether to find proxy numbers in the same * areacode. * @param string $numberSelectionBehavior What behavior to use when choosing a * proxy number. * @param string $interceptCallbackUrl A URL for Twilio call before each * Interaction. * @param string $outOfSessionCallbackUrl A URL for Twilio call when a new * Interaction has no Session. * @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) { return new CreateServiceOptions($defaultTtl, $callbackUrl, $geoMatchLevel, $numberSelectionBehavior, $interceptCallbackUrl, $outOfSessionCallbackUrl); } /** * @param string $uniqueName A human readable description of this resource. * @param integer $defaultTtl Default TTL for a Session, in seconds. * @param string $callbackUrl URL Twilio will send callbacks to * @param string $geoMatchLevel Whether to find proxy numbers in the same * areacode. * @param string $numberSelectionBehavior What behavior to use when choosing a * proxy number. * @param string $interceptCallbackUrl A URL for Twilio call before each * Interaction. * @param string $outOfSessionCallbackUrl A URL for Twilio call when a new * Interaction has no Session. * @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) { return new UpdateServiceOptions($uniqueName, $defaultTtl, $callbackUrl, $geoMatchLevel, $numberSelectionBehavior, $interceptCallbackUrl, $outOfSessionCallbackUrl); } } class CreateServiceOptions extends Options { /** * @param integer $defaultTtl Default TTL for a Session, in seconds. * @param string $callbackUrl URL Twilio will send callbacks to * @param string $geoMatchLevel Whether to find proxy numbers in the same * areacode. * @param string $numberSelectionBehavior What behavior to use when choosing a * proxy number. * @param string $interceptCallbackUrl A URL for Twilio call before each * Interaction. * @param string $outOfSessionCallbackUrl A URL for Twilio call when a new * Interaction has no Session. */ public function __construct($defaultTtl = Values::NONE, $callbackUrl = Values::NONE, $geoMatchLevel = Values::NONE, $numberSelectionBehavior = Values::NONE, $interceptCallbackUrl = Values::NONE, $outOfSessionCallbackUrl = 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; } /** * The default Time to Live for a Session, in seconds. * * @param integer $defaultTtl Default TTL for a Session, in seconds. * @return $this Fluent Builder */ public function setDefaultTtl($defaultTtl) { $this->options['defaultTtl'] = $defaultTtl; return $this; } /** * The URL Twilio will send callbacks to. * * @param string $callbackUrl URL Twilio will send callbacks to * @return $this Fluent Builder */ public function setCallbackUrl($callbackUrl) { $this->options['callbackUrl'] = $callbackUrl; return $this; } /** * Whether to find proxy numbers in the same areacode. * * @param string $geoMatchLevel Whether to find proxy numbers in the same * areacode. * @return $this Fluent Builder */ public function setGeoMatchLevel($geoMatchLevel) { $this->options['geoMatchLevel'] = $geoMatchLevel; return $this; } /** * What behavior to use when choosing a proxy number. * * @param string $numberSelectionBehavior What behavior to use when choosing a * proxy number. * @return $this Fluent Builder */ public function setNumberSelectionBehavior($numberSelectionBehavior) { $this->options['numberSelectionBehavior'] = $numberSelectionBehavior; return $this; } /** * A URL for Twilio call before each Interaction. An error status code will prevent the interaction from continuing. * * @param string $interceptCallbackUrl A URL for Twilio call before each * Interaction. * @return $this Fluent Builder */ public function setInterceptCallbackUrl($interceptCallbackUrl) { $this->options['interceptCallbackUrl'] = $interceptCallbackUrl; return $this; } /** * A URL for Twilio call when a new Interaction has no Session. * * @param string $outOfSessionCallbackUrl A URL for Twilio call when a new * Interaction has no Session. * @return $this Fluent Builder */ public function setOutOfSessionCallbackUrl($outOfSessionCallbackUrl) { $this->options['outOfSessionCallbackUrl'] = $outOfSessionCallbackUrl; return $this; } /** * Provide a friendly representation * * @return 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 A human readable description of this resource. * @param integer $defaultTtl Default TTL for a Session, in seconds. * @param string $callbackUrl URL Twilio will send callbacks to * @param string $geoMatchLevel Whether to find proxy numbers in the same * areacode. * @param string $numberSelectionBehavior What behavior to use when choosing a * proxy number. * @param string $interceptCallbackUrl A URL for Twilio call before each * Interaction. * @param string $outOfSessionCallbackUrl A URL for Twilio call when a new * Interaction has no Session. */ public function __construct($uniqueName = Values::NONE, $defaultTtl = Values::NONE, $callbackUrl = Values::NONE, $geoMatchLevel = Values::NONE, $numberSelectionBehavior = Values::NONE, $interceptCallbackUrl = Values::NONE, $outOfSessionCallbackUrl = 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; } /** * A human readable description of this resource, up to 64 characters. * * @param string $uniqueName A human readable description of this resource. * @return $this Fluent Builder */ public function setUniqueName($uniqueName) { $this->options['uniqueName'] = $uniqueName; return $this; } /** * The default Time to Live for a Session, in seconds. * * @param integer $defaultTtl Default TTL for a Session, in seconds. * @return $this Fluent Builder */ public function setDefaultTtl($defaultTtl) { $this->options['defaultTtl'] = $defaultTtl; return $this; } /** * The URL Twilio will send callbacks to. * * @param string $callbackUrl URL Twilio will send callbacks to * @return $this Fluent Builder */ public function setCallbackUrl($callbackUrl) { $this->options['callbackUrl'] = $callbackUrl; return $this; } /** * Whether to find proxy numbers in the same areacode. * * @param string $geoMatchLevel Whether to find proxy numbers in the same * areacode. * @return $this Fluent Builder */ public function setGeoMatchLevel($geoMatchLevel) { $this->options['geoMatchLevel'] = $geoMatchLevel; return $this; } /** * What behavior to use when choosing a proxy number. * * @param string $numberSelectionBehavior What behavior to use when choosing a * proxy number. * @return $this Fluent Builder */ public function setNumberSelectionBehavior($numberSelectionBehavior) { $this->options['numberSelectionBehavior'] = $numberSelectionBehavior; return $this; } /** * A URL for Twilio call before each Interaction. An error status code will prevent the interaction from continuing. * * @param string $interceptCallbackUrl A URL for Twilio call before each * Interaction. * @return $this Fluent Builder */ public function setInterceptCallbackUrl($interceptCallbackUrl) { $this->options['interceptCallbackUrl'] = $interceptCallbackUrl; return $this; } /** * A URL for Twilio call when a new Interaction has no Session. * * @param string $outOfSessionCallbackUrl A URL for Twilio call when a new * Interaction has no Session. * @return $this Fluent Builder */ public function setOutOfSessionCallbackUrl($outOfSessionCallbackUrl) { $this->options['outOfSessionCallbackUrl'] = $outOfSessionCallbackUrl; return $this; } /** * Provide a friendly representation * * @return 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/Twilio/Rest/Proxy/V1/ServiceContext.php 0000604 00000013156 15174325127 0014607 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 A string that uniquely identifies this Service. * @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 */ 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 */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Update the ServiceInstance * * @param array|Options $options Optional Arguments * @return ServiceInstance Updated ServiceInstance */ 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'], )); $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 \Twilio\Exceptions\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 \Twilio\Exceptions\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/Twilio/Rest/Proxy/V1/Service/SessionContext.php 0000604 00000013176 15174325127 0016234 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 Service Sid. * @param string $sid A string that uniquely identifies this Session. * @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 */ 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 */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Update the SessionInstance * * @param array|Options $options Optional Arguments * @return SessionInstance Updated SessionInstance */ public function update($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->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 \Twilio\Exceptions\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 \Twilio\Exceptions\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/Twilio/Rest/Proxy/V1/Service/SessionOptions.php 0000604 00000024533 15174325127 0016242 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 A unique, developer assigned name of this Session. * @param string $status The Status of this Session * @return ReadSessionOptions Options builder */ public static function read($uniqueName = Values::NONE, $status = Values::NONE) { return new ReadSessionOptions($uniqueName, $status); } /** * @param string $uniqueName A unique, developer assigned name of this Session. * @param \DateTime $dateExpiry The date this Session was expiry * @param integer $ttl TTL for a Session, in seconds. * @param string $mode The Mode of this Session * @param string $status The Status of this Session * @param array $participants A list of phone numbers to add to this 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 string $uniqueName A unique, developer assigned name of this Session. * @param \DateTime $dateExpiry The date this Session was expiry * @param integer $ttl TTL for a Session, in seconds. * @param string $mode The Mode of this Session * @param string $status The Status of this Session * @param array $participants A list of phone numbers to add to this Session. * @return UpdateSessionOptions Options builder */ public static function update($uniqueName = Values::NONE, $dateExpiry = Values::NONE, $ttl = Values::NONE, $mode = Values::NONE, $status = Values::NONE, $participants = Values::NONE) { return new UpdateSessionOptions($uniqueName, $dateExpiry, $ttl, $mode, $status, $participants); } } class ReadSessionOptions extends Options { /** * @param string $uniqueName A unique, developer assigned name of this Session. * @param string $status The Status of this Session */ public function __construct($uniqueName = Values::NONE, $status = Values::NONE) { $this->options['uniqueName'] = $uniqueName; $this->options['status'] = $status; } /** * Provides a unique and addressable name to be assigned to this Session, assigned by the developer, to be optionally used in addition to SID. * * @param string $uniqueName A unique, developer assigned name of this Session. * @return $this Fluent Builder */ public function setUniqueName($uniqueName) { $this->options['uniqueName'] = $uniqueName; return $this; } /** * The Status of this Session. One of `in-progress`, `closed`, `failed`, `unknown` or `completed`. * * @param string $status The Status of this Session * @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.ReadSessionOptions ' . implode(' ', $options) . ']'; } } class CreateSessionOptions extends Options { /** * @param string $uniqueName A unique, developer assigned name of this Session. * @param \DateTime $dateExpiry The date this Session was expiry * @param integer $ttl TTL for a Session, in seconds. * @param string $mode The Mode of this Session * @param string $status The Status of this Session * @param array $participants A list of phone numbers to add to this 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; } /** * Provides a unique and addressable name to be assigned to this Session, assigned by the developer, to be optionally used in addition to SID. * * @param string $uniqueName A unique, developer assigned name of this Session. * @return $this Fluent Builder */ public function setUniqueName($uniqueName) { $this->options['uniqueName'] = $uniqueName; return $this; } /** * The date that this Session was expiry, given in ISO 8601 format. * * @param \DateTime $dateExpiry The date this Session was expiry * @return $this Fluent Builder */ public function setDateExpiry($dateExpiry) { $this->options['dateExpiry'] = $dateExpiry; return $this; } /** * The Time to Live for a Session, in seconds. * * @param integer $ttl TTL for a Session, in seconds. * @return $this Fluent Builder */ public function setTtl($ttl) { $this->options['ttl'] = $ttl; return $this; } /** * The Mode of this Session. One of `message-only`, `voice-only` or `voice-and-message`. * * @param string $mode The Mode of this Session * @return $this Fluent Builder */ public function setMode($mode) { $this->options['mode'] = $mode; return $this; } /** * The Status of this Session. One of `in-progress`, `closed`, `failed`, `unknown` or `completed`. * * @param string $status The Status of this Session * @return $this Fluent Builder */ public function setStatus($status) { $this->options['status'] = $status; return $this; } /** * A list of phone numbers to add to this Session. * * @param array $participants A list of phone numbers to add to this 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 string $uniqueName A unique, developer assigned name of this Session. * @param \DateTime $dateExpiry The date this Session was expiry * @param integer $ttl TTL for a Session, in seconds. * @param string $mode The Mode of this Session * @param string $status The Status of this Session * @param array $participants A list of phone numbers to add to this 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; } /** * Provides a unique and addressable name to be assigned to this Session, assigned by the developer, to be optionally used in addition to SID. * * @param string $uniqueName A unique, developer assigned name of this Session. * @return $this Fluent Builder */ public function setUniqueName($uniqueName) { $this->options['uniqueName'] = $uniqueName; return $this; } /** * The date that this Session was expiry, given in ISO 8601 format. * * @param \DateTime $dateExpiry The date this Session was expiry * @return $this Fluent Builder */ public function setDateExpiry($dateExpiry) { $this->options['dateExpiry'] = $dateExpiry; return $this; } /** * The Time to Live for a Session, in seconds. * * @param integer $ttl TTL for a Session, in seconds. * @return $this Fluent Builder */ public function setTtl($ttl) { $this->options['ttl'] = $ttl; return $this; } /** * The Mode of this Session. One of `message-only`, `voice-only` or `voice-and-message`. * * @param string $mode The Mode of this Session * @return $this Fluent Builder */ public function setMode($mode) { $this->options['mode'] = $mode; return $this; } /** * The Status of this Session. One of `in-progress`, `closed`, `failed`, `unknown` or `completed`. * * @param string $status The Status of this Session * @return $this Fluent Builder */ public function setStatus($status) { $this->options['status'] = $status; return $this; } /** * A list of phone numbers to add to this Session. * * @param array $participants A list of phone numbers to add to this 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.UpdateSessionOptions ' . implode(' ', $options) . ']'; } } sdk/Twilio/Rest/Proxy/V1/Service/SessionList.php 0000604 00000014337 15174325127 0015523 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Proxy\V1\Service; 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 Service Sid. * @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 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 SessionInstance 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 SessionInstance[] 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 SessionInstance 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 SessionInstance */ public function page($options = array(), $pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $options = new Values($options); $params = Values::of(array( 'UniqueName' => $options['uniqueName'], 'Status' => $options['status'], '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 */ 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 A string that uniquely identifies this Session. * @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/Twilio/Rest/Proxy/V1/Service/ShortCodeContext.php 0000604 00000004120 15174325127 0016470 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Proxy\V1\Service; 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 Service Sid. * @param string $sid A string that uniquely identifies this Short Code. * @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 */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Fetch a ShortCodeInstance * * @return ShortCodeInstance Fetched ShortCodeInstance */ 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.Proxy.V1.ShortCodeContext ' . implode(' ', $context) . ']'; } } sdk/Twilio/Rest/Proxy/V1/Service/Session/InteractionPage.php 0000604 00000001722 15174325127 0017735 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/Twilio/Rest/Proxy/V1/Service/Session/InteractionList.php 0000604 00000013244 15174325127 0017776 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Proxy\V1\Service\Session; 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 InteractionList extends ListResource { /** * Construct the InteractionList * * @param Version $version Version that contains the resource * @param string $serviceSid Service Sid. * @param string $sessionSid Session Sid. * @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 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 InteractionInstance 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 InteractionInstance[] 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 InteractionInstance 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 InteractionInstance */ public function page($options = array(), $pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $options = new Values($options); $params = Values::of(array( 'InboundParticipantStatus' => $options['inboundParticipantStatus'], 'OutboundParticipantStatus' => $options['outboundParticipantStatus'], '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 A string that uniquely identifies this Interaction. * @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/Twilio/Rest/Proxy/V1/Service/Session/ParticipantContext.php 0000604 00000012355 15174325127 0020510 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\Options; 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 Service Sid. * @param string $sessionSid Session Sid. * @param string $sid A string that uniquely identifies this Participant. * @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 */ 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 */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Update the ParticipantInstance * * @param array|Options $options Optional Arguments * @return ParticipantInstance Updated ParticipantInstance */ public function update($options = array()) { $options = new Values($options); $data = Values::of(array( 'Identifier' => $options['identifier'], 'FriendlyName' => $options['friendlyName'], 'ProxyIdentifier' => $options['proxyIdentifier'], 'ProxyIdentifierSid' => $options['proxyIdentifierSid'], )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new ParticipantInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sessionSid'], $this->solution['sid'] ); } /** * 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 \Twilio\Exceptions\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 \Twilio\Exceptions\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/Twilio/Rest/Proxy/V1/Service/Session/ParticipantInstance.php 0000604 00000012556 15174325127 0020633 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\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 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 Service Sid. * @param string $sessionSid Session Sid. * @param string $sid A string that uniquely identifies this Participant. * @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 */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the ParticipantInstance * * @return boolean True if delete succeeds, false otherwise */ public function delete() { return $this->proxy()->delete(); } /** * Update the ParticipantInstance * * @param array|Options $options Optional Arguments * @return ParticipantInstance Updated ParticipantInstance */ public function update($options = array()) { return $this->proxy()->update($options); } /** * 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/Twilio/Rest/Proxy/V1/Service/Session/ParticipantOptions.php 0000604 00000016351 15174325127 0020517 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 $identifier The identifier * @return ReadParticipantOptions Options builder */ public static function read($identifier = Values::NONE) { return new ReadParticipantOptions($identifier); } /** * @param string $friendlyName A human readable description of this resource. * @param string $proxyIdentifier The proxy phone number for this Participant. * @param string $proxyIdentifierSid 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); } /** * @param string $identifier The phone number of this Participant. * @param string $friendlyName A human readable description of this resource. * @param string $proxyIdentifier The proxy phone number for this Participant. * @param string $proxyIdentifierSid Proxy Identifier Sid. * @return UpdateParticipantOptions Options builder */ public static function update($identifier = Values::NONE, $friendlyName = Values::NONE, $proxyIdentifier = Values::NONE, $proxyIdentifierSid = Values::NONE) { return new UpdateParticipantOptions($identifier, $friendlyName, $proxyIdentifier, $proxyIdentifierSid); } } class ReadParticipantOptions extends Options { /** * @param string $identifier The identifier */ public function __construct($identifier = Values::NONE) { $this->options['identifier'] = $identifier; } /** * The identifier * * @param string $identifier The identifier * @return $this Fluent Builder */ public function setIdentifier($identifier) { $this->options['identifier'] = $identifier; return $this; } /** * Provide a friendly representation * * @return 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.ReadParticipantOptions ' . implode(' ', $options) . ']'; } } class CreateParticipantOptions extends Options { /** * @param string $friendlyName A human readable description of this resource. * @param string $proxyIdentifier The proxy phone number for this Participant. * @param string $proxyIdentifierSid 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; } /** * 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; } /** * The proxy phone number for this Participant. * * @param string $proxyIdentifier The proxy phone number for this Participant. * @return $this Fluent Builder */ public function setProxyIdentifier($proxyIdentifier) { $this->options['proxyIdentifier'] = $proxyIdentifier; return $this; } /** * The unique SID identifier of the Proxy Identifier. * * @param string $proxyIdentifierSid 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) . ']'; } } class UpdateParticipantOptions extends Options { /** * @param string $identifier The phone number of this Participant. * @param string $friendlyName A human readable description of this resource. * @param string $proxyIdentifier The proxy phone number for this Participant. * @param string $proxyIdentifierSid Proxy Identifier Sid. */ public function __construct($identifier = Values::NONE, $friendlyName = Values::NONE, $proxyIdentifier = Values::NONE, $proxyIdentifierSid = Values::NONE) { $this->options['identifier'] = $identifier; $this->options['friendlyName'] = $friendlyName; $this->options['proxyIdentifier'] = $proxyIdentifier; $this->options['proxyIdentifierSid'] = $proxyIdentifierSid; } /** * The phone number of this Participant. * * @param string $identifier The phone number of this Participant. * @return $this Fluent Builder */ public function setIdentifier($identifier) { $this->options['identifier'] = $identifier; 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; } /** * The proxy phone number for this Participant. * * @param string $proxyIdentifier The proxy phone number for this Participant. * @return $this Fluent Builder */ public function setProxyIdentifier($proxyIdentifier) { $this->options['proxyIdentifier'] = $proxyIdentifier; return $this; } /** * The unique SID identifier of the Proxy Identifier. * * @param string $proxyIdentifierSid 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.UpdateParticipantOptions ' . implode(' ', $options) . ']'; } } sdk/Twilio/Rest/Proxy/V1/Service/Session/ParticipantList.php 0000604 00000014777 15174325127 0020011 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Proxy\V1\Service\Session; 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 Service Sid. * @param string $sessionSid Session Sid. * @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 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( 'Identifier' => $options['identifier'], '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 this Participant. * @param array|Options $options Optional Arguments * @return ParticipantInstance Newly created ParticipantInstance */ 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 A string that uniquely identifies this Participant. * @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/Twilio/Rest/Proxy/V1/Service/Session/Participant/MessageInteractionList.php 0000604 00000015030 15174325127 0023554 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Proxy\V1\Service\Session\Participant; 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 Service Sid. * @param string $sessionSid Session Sid. * @param string $participantSid Participant Sid. * @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 */ 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 A string that uniquely identifies this Message * Interaction. * @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/Twilio/Rest/Proxy/V1/Service/Session/Participant/MessageInteractionPage.php 0000604 00000002042 15174325127 0023514 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/Twilio/Rest/Proxy/V1/Service/Session/Participant/MessageInteractionContext.php 0000604 00000004701 15174325127 0024270 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Proxy\V1\Service\Session\Participant; 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 Service Sid. * @param string $sessionSid Session Sid. * @param string $participantSid Participant Sid. * @param string $sid A string that uniquely identifies this Message * Interaction. * @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 */ 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/Twilio/Rest/Proxy/V1/Service/Session/Participant/MessageInteractionOptions.php 0000604 00000003630 15174325127 0024277 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 The body * @param string $mediaUrl The media_url * @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 The body * @param string $mediaUrl The media_url */ public function __construct($body = Values::NONE, $mediaUrl = Values::NONE) { $this->options['body'] = $body; $this->options['mediaUrl'] = $mediaUrl; } /** * The body * * @param string $body The body * @return $this Fluent Builder */ public function setBody($body) { $this->options['body'] = $body; return $this; } /** * The media_url * * @param string $mediaUrl The media_url * @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/Twilio/Rest/Proxy/V1/Service/Session/Participant/MessageInteractionInstance.php 0000604 00000013360 15174325127 0024411 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 Service Sid. * @param string $sessionSid Session Sid. * @param string $participantSid Participant Sid. * @param string $sid A string that uniquely identifies this Message * Interaction. * @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 */ 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/Twilio/Rest/Proxy/V1/Service/Session/InteractionInstance.php 0000604 00000013111 15174325127 0020620 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 Service Sid. * @param string $sessionSid Session Sid. * @param string $sid A string that uniquely identifies this Interaction. * @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 */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the InteractionInstance * * @return boolean True if delete succeeds, false otherwise */ 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/Twilio/Rest/Proxy/V1/Service/Session/InteractionOptions.php 0000604 00000006614 15174325127 0020521 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 InteractionOptions { /** * @param string $inboundParticipantStatus The Inbound Participant Status of * this Interaction * @param string $outboundParticipantStatus The Outbound Participant Status of * this Interaction * @return ReadInteractionOptions Options builder */ public static function read($inboundParticipantStatus = Values::NONE, $outboundParticipantStatus = Values::NONE) { return new ReadInteractionOptions($inboundParticipantStatus, $outboundParticipantStatus); } } class ReadInteractionOptions extends Options { /** * @param string $inboundParticipantStatus The Inbound Participant Status of * this Interaction * @param string $outboundParticipantStatus The Outbound Participant Status of * this Interaction */ public function __construct($inboundParticipantStatus = Values::NONE, $outboundParticipantStatus = Values::NONE) { $this->options['inboundParticipantStatus'] = $inboundParticipantStatus; $this->options['outboundParticipantStatus'] = $outboundParticipantStatus; } /** * The Inbound Participant Status of this Interaction. One of `accepted`, `answered`, `busy`, `canceled`, `completed`, `deleted`, `delivered`, `delivery-unknown`, `failed`, `in-progress`, `initiated`, `no-answer`, `queued`, `received`, `receiving`, `ringing`, `scheduled`, `sending`, `sent`, `undelivered` or `unknown`. * * @param string $inboundParticipantStatus The Inbound Participant Status of * this Interaction * @return $this Fluent Builder */ public function setInboundParticipantStatus($inboundParticipantStatus) { $this->options['inboundParticipantStatus'] = $inboundParticipantStatus; return $this; } /** * The Outbound Participant Status of this Interaction. One of `accepted`, `answered`, `busy`, `canceled`, `completed`, `deleted`, `delivered`, `delivery-unknown`, `failed`, `in-progress`, `initiated`, `no-answer`, `queued`, `received`, `receiving`, `ringing`, `scheduled`, `sending`, `sent`, `undelivered` or `unknown`. * * @param string $outboundParticipantStatus The Outbound Participant Status of * this Interaction * @return $this Fluent Builder */ public function setOutboundParticipantStatus($outboundParticipantStatus) { $this->options['outboundParticipantStatus'] = $outboundParticipantStatus; return $this; } /** * Provide a friendly representation * * @return 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.ReadInteractionOptions ' . implode(' ', $options) . ']'; } } sdk/Twilio/Rest/Proxy/V1/Service/Session/ParticipantPage.php 0000604 00000001722 15174325127 0017734 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/Twilio/Rest/Proxy/V1/Service/Session/InteractionContext.php 0000604 00000004443 15174325127 0020510 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Proxy\V1\Service\Session; 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 Service Sid. * @param string $sessionSid Session Sid. * @param string $sid A string that uniquely identifies this Interaction. * @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 */ 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 */ 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/Twilio/Rest/Proxy/V1/Service/SessionPage.php 0000604 00000001545 15174325127 0015461 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/Twilio/Rest/Proxy/V1/Service/PhoneNumberInstance.php 0000604 00000010220 15174325127 0017136 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\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 */ 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 Service Sid. * @param string $sid A string that uniquely identifies this Phone Number. * @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'), ); $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 */ public function delete() { return $this->proxy()->delete(); } /** * Fetch a PhoneNumberInstance * * @return PhoneNumberInstance Fetched PhoneNumberInstance */ 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.PhoneNumberInstance ' . implode(' ', $context) . ']'; } } sdk/Twilio/Rest/Proxy/V1/Service/PhoneNumberPage.php 0000604 00000001561 15174325127 0016256 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/Twilio/Rest/Proxy/V1/Service/ShortCodePage.php 0000604 00000001553 15174325127 0015727 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/Twilio/Rest/Proxy/V1/Service/SessionInstance.php 0000604 00000013044 15174325127 0016346 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 integer 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 Service Sid. * @param string $sid A string that uniquely identifies this Session. * @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 */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the SessionInstance * * @return boolean True if delete succeeds, false otherwise */ public function delete() { return $this->proxy()->delete(); } /** * Update the SessionInstance * * @param array|Options $options Optional Arguments * @return SessionInstance Updated SessionInstance */ 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/Twilio/Rest/Proxy/V1/Service/PhoneNumberList.php 0000604 00000013142 15174325127 0016313 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Proxy\V1\Service; 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 PhoneNumberList extends ListResource { /** * Construct the PhoneNumberList * * @param Version $version Version that contains the resource * @param string $serviceSid Service Sid. * @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 */ public function create($options = array()) { $options = new Values($options); $data = Values::of(array('Sid' => $options['sid'], 'PhoneNumber' => $options['phoneNumber'], )); $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 A string that uniquely identifies this Phone Number. * @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/Twilio/Rest/Proxy/V1/Service/PhoneNumberOptions.php 0000604 00000004102 15174325127 0017027 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 A string that uniquely identifies this Phone Number. * @param string $phoneNumber The phone_number * @return CreatePhoneNumberOptions Options builder */ public static function create($sid = Values::NONE, $phoneNumber = Values::NONE) { return new CreatePhoneNumberOptions($sid, $phoneNumber); } } class CreatePhoneNumberOptions extends Options { /** * @param string $sid A string that uniquely identifies this Phone Number. * @param string $phoneNumber The phone_number */ public function __construct($sid = Values::NONE, $phoneNumber = Values::NONE) { $this->options['sid'] = $sid; $this->options['phoneNumber'] = $phoneNumber; } /** * A 34 character string that uniquely identifies this Phone Number. * * @param string $sid A string that uniquely identifies this Phone Number. * @return $this Fluent Builder */ public function setSid($sid) { $this->options['sid'] = $sid; return $this; } /** * The phone_number * * @param string $phoneNumber The phone_number * @return $this Fluent Builder */ public function setPhoneNumber($phoneNumber) { $this->options['phoneNumber'] = $phoneNumber; return $this; } /** * Provide a friendly representation * * @return 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) . ']'; } } sdk/Twilio/Rest/Proxy/V1/Service/PhoneNumberContext.php 0000604 00000004146 15174325127 0017030 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Proxy\V1\Service; 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 Service Sid. * @param string $sid A string that uniquely identifies this Phone Number. * @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 */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Fetch a PhoneNumberInstance * * @return PhoneNumberInstance Fetched PhoneNumberInstance */ 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.Proxy.V1.PhoneNumberContext ' . implode(' ', $context) . ']'; } } sdk/Twilio/Rest/Proxy/V1/Service/ShortCodeInstance.php 0000604 00000010003 15174325127 0016605 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\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 */ 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 Service Sid. * @param string $sid A string that uniquely identifies this Short Code. * @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'), ); $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 */ public function delete() { return $this->proxy()->delete(); } /** * Fetch a ShortCodeInstance * * @return ShortCodeInstance Fetched ShortCodeInstance */ 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.ShortCodeInstance ' . implode(' ', $context) . ']'; } } sdk/Twilio/Rest/Proxy/V1/Service/ShortCodeList.php 0000604 00000012712 15174325127 0015765 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Proxy\V1\Service; 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 Service Sid. * @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 A string that uniquely identifies this Short Code. * @return ShortCodeInstance Newly created ShortCodeInstance */ 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 A string that uniquely identifies this Short Code. * @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/Twilio/Rest/Proxy/V1/ServiceList.php 0000604 00000013466 15174325127 0014102 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Proxy\V1; 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 The human-readable string that uniquely identifies * this Service. * @param array|Options $options Optional Arguments * @return ServiceInstance Newly created ServiceInstance */ 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'], )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new ServiceInstance($this->version, $payload); } /** * Constructs a ServiceContext * * @param string $sid A string that uniquely identifies this Service. * @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/Twilio/Rest/Proxy/V1/ServicePage.php 0000604 00000001476 15174325127 0014041 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/Twilio/Rest/Proxy/V1/ServiceInstance.php 0000604 00000012333 15174325127 0014723 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 callbackUrl * @property integer 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 A string that uniquely identifies this Service. * @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'), '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 */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the ServiceInstance * * @return boolean True if delete succeeds, false otherwise */ public function delete() { return $this->proxy()->delete(); } /** * Update the ServiceInstance * * @param array|Options $options Optional Arguments * @return ServiceInstance Updated ServiceInstance */ 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/Twilio/Rest/Wireless.php 0000604 00000007113 15174325127 0012024 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\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 \Twilio\Exceptions\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 \Twilio\Exceptions\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\CommandList */ protected function getCommands() { return $this->v1->commands; } /** * @param string $sid The sid * @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 * @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 * @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/Twilio/Rest/Proxy.php 0000604 00000005235 15174325127 0011353 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 \Twilio\Exceptions\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 \Twilio\Exceptions\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 A string that uniquely identifies this Service. * @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/Twilio/Rest/Accounts.php 0000604 00000004633 15174325127 0012012 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 \Twilio\Exceptions\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 \Twilio\Exceptions\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/Twilio/Rest/Monitor.php 0000604 00000006112 15174325127 0011654 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 \Twilio\Exceptions\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 \Twilio\Exceptions\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 * @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 * @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/Twilio/Rest/Trunking.php 0000604 00000005213 15174325127 0012027 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 \Twilio\Exceptions\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 \Twilio\Exceptions\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 sid * @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/Twilio/Rest/Video.php 0000604 00000007105 15174325127 0011276 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\RecordingList recordings * @property \Twilio\Rest\Video\V1\RoomList rooms * @method \Twilio\Rest\Video\V1\CompositionContext compositions(string $sid) * @method \Twilio\Rest\Video\V1\RecordingContext recordings(string $sid) * @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 \Twilio\Exceptions\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 \Twilio\Exceptions\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 * @return \Twilio\Rest\Video\V1\CompositionContext */ protected function contextCompositions($sid) { return $this->v1->compositions($sid); } /** * @return \Twilio\Rest\Video\V1\RecordingList */ protected function getRecordings() { return $this->v1->recordings; } /** * @param string $sid The sid * @return \Twilio\Rest\Video\V1\RecordingContext */ protected function contextRecordings($sid) { return $this->v1->recordings($sid); } /** * @return \Twilio\Rest\Video\V1\RoomList */ protected function getRooms() { return $this->v1->rooms; } /** * @param string $sid The sid * @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/Twilio/Rest/Chat.php 0000604 00000006612 15174325127 0011111 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 \Twilio\Exceptions\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 \Twilio\Exceptions\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 * @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 * @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/Twilio/Rest/Api.php 0000604 00000034442 15174325127 0010745 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\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 \Twilio\Exceptions\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 \Twilio\Exceptions\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 sid * @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 Fetch by unique Application Sid * @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 connect_app_sid * @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 country_code * @return \Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountryContext */ protected function contextAvailablePhoneNumbers($countryCode) { return $this->v2010->account->availablePhoneNumbers($countryCode); } /** * @return \Twilio\Rest\Api\V2010\Account\CallList */ protected function getCalls() { return $this->v2010->account->calls; } /** * @param string $sid Call Sid that uniquely identifies the Call 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 Fetch by unique conference Sid * @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 Fetch by unique connect-app Sid * @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 Fetch by unique incoming-phone-number Sid * @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 sid * @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 Fetch by unique message Sid * @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 Fetch by unique notification Sid * @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 Fetch by unique outgoing-caller-id Sid * @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 Fetch by unique queue Sid * @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 Fetch by unique recording Sid * @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 Fetch by unique short-code Sid * @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 Fetch by unique transcription Sid * @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/Twilio/Rest/Monitor/V1/AlertPage.php 0000604 00000001313 15174325127 0014004 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/Twilio/Rest/Monitor/V1/AlertInstance.php 0000604 00000010666 15174325127 0014707 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 */ 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 * @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'), 'resourceSid' => Values::array_get($payload, 'resource_sid'), 'sid' => Values::array_get($payload, 'sid'), 'url' => Values::array_get($payload, 'url'), 'requestVariables' => Values::array_get($payload, 'request_variables'), 'responseBody' => Values::array_get($payload, 'response_body'), 'responseHeaders' => Values::array_get($payload, 'response_headers'), ); $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 */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the AlertInstance * * @return boolean True if delete succeeds, false otherwise */ 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.Monitor.V1.AlertInstance ' . implode(' ', $context) . ']'; } } sdk/Twilio/Rest/Monitor/V1/AlertOptions.php 0000604 00000004333 15174325127 0014570 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 The log_level * @param \DateTime $startDate The start_date * @param \DateTime $endDate The end_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 The log_level * @param \DateTime $startDate The start_date * @param \DateTime $endDate The end_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; } /** * The log_level * * @param string $logLevel The log_level * @return $this Fluent Builder */ public function setLogLevel($logLevel) { $this->options['logLevel'] = $logLevel; return $this; } /** * The start_date * * @param \DateTime $startDate The start_date * @return $this Fluent Builder */ public function setStartDate($startDate) { $this->options['startDate'] = $startDate; return $this; } /** * The end_date * * @param \DateTime $endDate The end_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/Twilio/Rest/Monitor/V1/EventContext.php 0000604 00000002712 15174325127 0014572 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Monitor\V1; 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 * @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 */ 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/Twilio/Rest/Monitor/V1/EventOptions.php 0000604 00000007322 15174325127 0014603 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 The actor_sid * @param string $eventType The event_type * @param string $resourceSid The resource_sid * @param string $sourceIpAddress The source_ip_address * @param \DateTime $startDate The start_date * @param \DateTime $endDate The end_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 The actor_sid * @param string $eventType The event_type * @param string $resourceSid The resource_sid * @param string $sourceIpAddress The source_ip_address * @param \DateTime $startDate The start_date * @param \DateTime $endDate The end_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; } /** * The actor_sid * * @param string $actorSid The actor_sid * @return $this Fluent Builder */ public function setActorSid($actorSid) { $this->options['actorSid'] = $actorSid; return $this; } /** * The event_type * * @param string $eventType The event_type * @return $this Fluent Builder */ public function setEventType($eventType) { $this->options['eventType'] = $eventType; return $this; } /** * The resource_sid * * @param string $resourceSid The resource_sid * @return $this Fluent Builder */ public function setResourceSid($resourceSid) { $this->options['resourceSid'] = $resourceSid; return $this; } /** * The source_ip_address * * @param string $sourceIpAddress The source_ip_address * @return $this Fluent Builder */ public function setSourceIpAddress($sourceIpAddress) { $this->options['sourceIpAddress'] = $sourceIpAddress; return $this; } /** * The start_date * * @param \DateTime $startDate The start_date * @return $this Fluent Builder */ public function setStartDate($startDate) { $this->options['startDate'] = $startDate; return $this; } /** * The end_date * * @param \DateTime $endDate The end_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/Twilio/Rest/Monitor/V1/AlertContext.php 0000604 00000003246 15174325127 0014563 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Monitor\V1; 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 * @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 */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new AlertInstance($this->version, $payload, $this->solution['sid']); } /** * Deletes the AlertInstance * * @return boolean True if delete succeeds, false otherwise */ 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.Monitor.V1.AlertContext ' . implode(' ', $context) . ']'; } } sdk/Twilio/Rest/Monitor/V1/AlertList.php 0000604 00000012057 15174325127 0014052 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 * @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/Twilio/Rest/Monitor/V1/EventList.php 0000604 00000012325 15174325127 0014062 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::iso8601Date($options['startDate']), 'EndDate' => Serialize::iso8601Date($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 * @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/Twilio/Rest/Monitor/V1/EventInstance.php 0000604 00000007477 15174325127 0014727 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 * @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 */ 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/Twilio/Rest/Monitor/V1/EventPage.php 0000604 00000001313 15174325127 0014016 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/Twilio/Rest/Monitor/V1.php 0000604 00000005264 15174325127 0012151 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 \Twilio\Exceptions\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 \Twilio\Exceptions\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/Twilio/Rest/Studio.php 0000604 00000005145 15174325127 0011501 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 \Twilio\Exceptions\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 \Twilio\Exceptions\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 * @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/Twilio/Rest/Lookups.php 0000604 00000005342 15174325127 0011665 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 \Twilio\Exceptions\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 \Twilio\Exceptions\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 * @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/Twilio/Rest/Chat/V2/CredentialInstance.php 0000604 00000007514 15174325127 0015141 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 * @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 */ public function fetch() { return $this->proxy()->fetch(); } /** * Update the CredentialInstance * * @param array|Options $options Optional Arguments * @return CredentialInstance Updated CredentialInstance */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Deletes the CredentialInstance * * @return boolean True if delete succeeds, false otherwise */ 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/Twilio/Rest/Chat/V2/CredentialList.php 0000604 00000013071 15174325127 0014303 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V2; 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 * @param array|Options $options Optional Arguments * @return CredentialInstance Newly created CredentialInstance */ 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 * @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/Twilio/Rest/Chat/V2/CredentialPage.php 0000604 00000001324 15174325127 0014242 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/Twilio/Rest/Chat/V2/ServiceInstance.php 0000604 00000014724 15174325127 0014470 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 boolean readStatusEnabled * @property boolean reachabilityEnabled * @property integer typingIndicatorTimeout * @property integer consumptionReportInterval * @property array limits * @property string preWebhookUrl * @property string postWebhookUrl * @property string webhookMethod * @property string webhookFilters * @property integer preWebhookRetryCount * @property integer 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 * @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 */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the ServiceInstance * * @return boolean True if delete succeeds, false otherwise */ public function delete() { return $this->proxy()->delete(); } /** * Update the ServiceInstance * * @param array|Options $options Optional Arguments * @return ServiceInstance Updated ServiceInstance */ 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/Twilio/Rest/Chat/V2/ServicePage.php 0000604 00000001313 15174325127 0013566 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/Twilio/Rest/Chat/V2/ServiceList.php 0000604 00000012052 15174325127 0013627 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V2; 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 The friendly_name * @return ServiceInstance Newly created ServiceInstance */ 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 * @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/Twilio/Rest/Chat/V2/CredentialContext.php 0000604 00000005143 15174325127 0015015 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V2; 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 * @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 */ 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 */ 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 */ 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/Twilio/Rest/Chat/V2/ServiceOptions.php 0000604 00000063260 15174325127 0014356 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 The friendly_name * @param string $defaultServiceRoleSid The default_service_role_sid * @param string $defaultChannelRoleSid The default_channel_role_sid * @param string $defaultChannelCreatorRoleSid The * default_channel_creator_role_sid * @param boolean $readStatusEnabled The read_status_enabled * @param boolean $reachabilityEnabled The reachability_enabled * @param integer $typingIndicatorTimeout The typing_indicator_timeout * @param integer $consumptionReportInterval The consumption_report_interval * @param boolean $notificationsNewMessageEnabled The * notifications.new_message.enabled * @param string $notificationsNewMessageTemplate The * notifications.new_message.template * @param string $notificationsNewMessageSound The * notifications.new_message.sound * @param boolean $notificationsNewMessageBadgeCountEnabled The * notifications.new_message.badge_count_enabled * @param boolean $notificationsAddedToChannelEnabled The * notifications.added_to_channel.enabled * @param string $notificationsAddedToChannelTemplate The * notifications.added_to_channel.template * @param string $notificationsAddedToChannelSound The * notifications.added_to_channel.sound * @param boolean $notificationsRemovedFromChannelEnabled The * notifications.removed_from_channel.enabled * @param string $notificationsRemovedFromChannelTemplate The * notifications.removed_from_channel.template * @param string $notificationsRemovedFromChannelSound The * notifications.removed_from_channel.sound * @param boolean $notificationsInvitedToChannelEnabled The * notifications.invited_to_channel.enabled * @param string $notificationsInvitedToChannelTemplate The * notifications.invited_to_channel.template * @param string $notificationsInvitedToChannelSound The * notifications.invited_to_channel.sound * @param string $preWebhookUrl The pre_webhook_url * @param string $postWebhookUrl The post_webhook_url * @param string $webhookMethod The webhook_method * @param string $webhookFilters The webhook_filters * @param integer $limitsChannelMembers The limits.channel_members * @param integer $limitsUserChannels The limits.user_channels * @param string $mediaCompatibilityMessage The media.compatibility_message * @param integer $preWebhookRetryCount The pre_webhook_retry_count * @param integer $postWebhookRetryCount The post_webhook_retry_count * @param boolean $notificationsLogEnabled The notifications.log_enabled * @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 The friendly_name * @param string $defaultServiceRoleSid The default_service_role_sid * @param string $defaultChannelRoleSid The default_channel_role_sid * @param string $defaultChannelCreatorRoleSid The * default_channel_creator_role_sid * @param boolean $readStatusEnabled The read_status_enabled * @param boolean $reachabilityEnabled The reachability_enabled * @param integer $typingIndicatorTimeout The typing_indicator_timeout * @param integer $consumptionReportInterval The consumption_report_interval * @param boolean $notificationsNewMessageEnabled The * notifications.new_message.enabled * @param string $notificationsNewMessageTemplate The * notifications.new_message.template * @param string $notificationsNewMessageSound The * notifications.new_message.sound * @param boolean $notificationsNewMessageBadgeCountEnabled The * notifications.new_message.badge_count_enabled * @param boolean $notificationsAddedToChannelEnabled The * notifications.added_to_channel.enabled * @param string $notificationsAddedToChannelTemplate The * notifications.added_to_channel.template * @param string $notificationsAddedToChannelSound The * notifications.added_to_channel.sound * @param boolean $notificationsRemovedFromChannelEnabled The * notifications.removed_from_channel.enabled * @param string $notificationsRemovedFromChannelTemplate The * notifications.removed_from_channel.template * @param string $notificationsRemovedFromChannelSound The * notifications.removed_from_channel.sound * @param boolean $notificationsInvitedToChannelEnabled The * notifications.invited_to_channel.enabled * @param string $notificationsInvitedToChannelTemplate The * notifications.invited_to_channel.template * @param string $notificationsInvitedToChannelSound The * notifications.invited_to_channel.sound * @param string $preWebhookUrl The pre_webhook_url * @param string $postWebhookUrl The post_webhook_url * @param string $webhookMethod The webhook_method * @param string $webhookFilters The webhook_filters * @param integer $limitsChannelMembers The limits.channel_members * @param integer $limitsUserChannels The limits.user_channels * @param string $mediaCompatibilityMessage The media.compatibility_message * @param integer $preWebhookRetryCount The pre_webhook_retry_count * @param integer $postWebhookRetryCount The post_webhook_retry_count * @param boolean $notificationsLogEnabled The notifications.log_enabled */ 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; } /** * The friendly_name * * @param string $friendlyName The friendly_name * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The default_service_role_sid * * @param string $defaultServiceRoleSid The default_service_role_sid * @return $this Fluent Builder */ public function setDefaultServiceRoleSid($defaultServiceRoleSid) { $this->options['defaultServiceRoleSid'] = $defaultServiceRoleSid; return $this; } /** * The default_channel_role_sid * * @param string $defaultChannelRoleSid The default_channel_role_sid * @return $this Fluent Builder */ public function setDefaultChannelRoleSid($defaultChannelRoleSid) { $this->options['defaultChannelRoleSid'] = $defaultChannelRoleSid; return $this; } /** * The default_channel_creator_role_sid * * @param string $defaultChannelCreatorRoleSid The * default_channel_creator_role_sid * @return $this Fluent Builder */ public function setDefaultChannelCreatorRoleSid($defaultChannelCreatorRoleSid) { $this->options['defaultChannelCreatorRoleSid'] = $defaultChannelCreatorRoleSid; return $this; } /** * The read_status_enabled * * @param boolean $readStatusEnabled The read_status_enabled * @return $this Fluent Builder */ public function setReadStatusEnabled($readStatusEnabled) { $this->options['readStatusEnabled'] = $readStatusEnabled; return $this; } /** * The reachability_enabled * * @param boolean $reachabilityEnabled The reachability_enabled * @return $this Fluent Builder */ public function setReachabilityEnabled($reachabilityEnabled) { $this->options['reachabilityEnabled'] = $reachabilityEnabled; return $this; } /** * The typing_indicator_timeout * * @param integer $typingIndicatorTimeout The typing_indicator_timeout * @return $this Fluent Builder */ public function setTypingIndicatorTimeout($typingIndicatorTimeout) { $this->options['typingIndicatorTimeout'] = $typingIndicatorTimeout; return $this; } /** * The consumption_report_interval * * @param integer $consumptionReportInterval The consumption_report_interval * @return $this Fluent Builder */ public function setConsumptionReportInterval($consumptionReportInterval) { $this->options['consumptionReportInterval'] = $consumptionReportInterval; return $this; } /** * The notifications.new_message.enabled * * @param boolean $notificationsNewMessageEnabled The * notifications.new_message.enabled * @return $this Fluent Builder */ public function setNotificationsNewMessageEnabled($notificationsNewMessageEnabled) { $this->options['notificationsNewMessageEnabled'] = $notificationsNewMessageEnabled; return $this; } /** * The notifications.new_message.template * * @param string $notificationsNewMessageTemplate The * notifications.new_message.template * @return $this Fluent Builder */ public function setNotificationsNewMessageTemplate($notificationsNewMessageTemplate) { $this->options['notificationsNewMessageTemplate'] = $notificationsNewMessageTemplate; return $this; } /** * The notifications.new_message.sound * * @param string $notificationsNewMessageSound The * notifications.new_message.sound * @return $this Fluent Builder */ public function setNotificationsNewMessageSound($notificationsNewMessageSound) { $this->options['notificationsNewMessageSound'] = $notificationsNewMessageSound; return $this; } /** * The notifications.new_message.badge_count_enabled * * @param boolean $notificationsNewMessageBadgeCountEnabled The * notifications.new_message.badge_count_enabled * @return $this Fluent Builder */ public function setNotificationsNewMessageBadgeCountEnabled($notificationsNewMessageBadgeCountEnabled) { $this->options['notificationsNewMessageBadgeCountEnabled'] = $notificationsNewMessageBadgeCountEnabled; return $this; } /** * The notifications.added_to_channel.enabled * * @param boolean $notificationsAddedToChannelEnabled The * notifications.added_to_channel.enabled * @return $this Fluent Builder */ public function setNotificationsAddedToChannelEnabled($notificationsAddedToChannelEnabled) { $this->options['notificationsAddedToChannelEnabled'] = $notificationsAddedToChannelEnabled; return $this; } /** * The notifications.added_to_channel.template * * @param string $notificationsAddedToChannelTemplate The * notifications.added_to_channel.template * @return $this Fluent Builder */ public function setNotificationsAddedToChannelTemplate($notificationsAddedToChannelTemplate) { $this->options['notificationsAddedToChannelTemplate'] = $notificationsAddedToChannelTemplate; return $this; } /** * The notifications.added_to_channel.sound * * @param string $notificationsAddedToChannelSound The * notifications.added_to_channel.sound * @return $this Fluent Builder */ public function setNotificationsAddedToChannelSound($notificationsAddedToChannelSound) { $this->options['notificationsAddedToChannelSound'] = $notificationsAddedToChannelSound; return $this; } /** * The notifications.removed_from_channel.enabled * * @param boolean $notificationsRemovedFromChannelEnabled The * notifications.removed_from_channel.enabled * @return $this Fluent Builder */ public function setNotificationsRemovedFromChannelEnabled($notificationsRemovedFromChannelEnabled) { $this->options['notificationsRemovedFromChannelEnabled'] = $notificationsRemovedFromChannelEnabled; return $this; } /** * The notifications.removed_from_channel.template * * @param string $notificationsRemovedFromChannelTemplate The * notifications.removed_from_channel.template * @return $this Fluent Builder */ public function setNotificationsRemovedFromChannelTemplate($notificationsRemovedFromChannelTemplate) { $this->options['notificationsRemovedFromChannelTemplate'] = $notificationsRemovedFromChannelTemplate; return $this; } /** * The notifications.removed_from_channel.sound * * @param string $notificationsRemovedFromChannelSound The * notifications.removed_from_channel.sound * @return $this Fluent Builder */ public function setNotificationsRemovedFromChannelSound($notificationsRemovedFromChannelSound) { $this->options['notificationsRemovedFromChannelSound'] = $notificationsRemovedFromChannelSound; return $this; } /** * The notifications.invited_to_channel.enabled * * @param boolean $notificationsInvitedToChannelEnabled The * notifications.invited_to_channel.enabled * @return $this Fluent Builder */ public function setNotificationsInvitedToChannelEnabled($notificationsInvitedToChannelEnabled) { $this->options['notificationsInvitedToChannelEnabled'] = $notificationsInvitedToChannelEnabled; return $this; } /** * The notifications.invited_to_channel.template * * @param string $notificationsInvitedToChannelTemplate The * notifications.invited_to_channel.template * @return $this Fluent Builder */ public function setNotificationsInvitedToChannelTemplate($notificationsInvitedToChannelTemplate) { $this->options['notificationsInvitedToChannelTemplate'] = $notificationsInvitedToChannelTemplate; return $this; } /** * The notifications.invited_to_channel.sound * * @param string $notificationsInvitedToChannelSound The * notifications.invited_to_channel.sound * @return $this Fluent Builder */ public function setNotificationsInvitedToChannelSound($notificationsInvitedToChannelSound) { $this->options['notificationsInvitedToChannelSound'] = $notificationsInvitedToChannelSound; return $this; } /** * The pre_webhook_url * * @param string $preWebhookUrl The pre_webhook_url * @return $this Fluent Builder */ public function setPreWebhookUrl($preWebhookUrl) { $this->options['preWebhookUrl'] = $preWebhookUrl; return $this; } /** * The post_webhook_url * * @param string $postWebhookUrl The post_webhook_url * @return $this Fluent Builder */ public function setPostWebhookUrl($postWebhookUrl) { $this->options['postWebhookUrl'] = $postWebhookUrl; 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 webhook_filters * * @param string $webhookFilters The webhook_filters * @return $this Fluent Builder */ public function setWebhookFilters($webhookFilters) { $this->options['webhookFilters'] = $webhookFilters; return $this; } /** * The limits.channel_members * * @param integer $limitsChannelMembers The limits.channel_members * @return $this Fluent Builder */ public function setLimitsChannelMembers($limitsChannelMembers) { $this->options['limitsChannelMembers'] = $limitsChannelMembers; return $this; } /** * The limits.user_channels * * @param integer $limitsUserChannels The limits.user_channels * @return $this Fluent Builder */ public function setLimitsUserChannels($limitsUserChannels) { $this->options['limitsUserChannels'] = $limitsUserChannels; return $this; } /** * The media.compatibility_message * * @param string $mediaCompatibilityMessage The media.compatibility_message * @return $this Fluent Builder */ public function setMediaCompatibilityMessage($mediaCompatibilityMessage) { $this->options['mediaCompatibilityMessage'] = $mediaCompatibilityMessage; return $this; } /** * The pre_webhook_retry_count * * @param integer $preWebhookRetryCount The pre_webhook_retry_count * @return $this Fluent Builder */ public function setPreWebhookRetryCount($preWebhookRetryCount) { $this->options['preWebhookRetryCount'] = $preWebhookRetryCount; return $this; } /** * The post_webhook_retry_count * * @param integer $postWebhookRetryCount The post_webhook_retry_count * @return $this Fluent Builder */ public function setPostWebhookRetryCount($postWebhookRetryCount) { $this->options['postWebhookRetryCount'] = $postWebhookRetryCount; return $this; } /** * The notifications.log_enabled * * @param boolean $notificationsLogEnabled The notifications.log_enabled * @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/Twilio/Rest/Chat/V2/ServiceContext.php 0000604 00000020344 15174325127 0014343 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 * @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 */ 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 */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Update the ServiceInstance * * @param array|Options $options Optional Arguments * @return ServiceInstance Updated ServiceInstance */ 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 \Twilio\Exceptions\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 \Twilio\Exceptions\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/Twilio/Rest/Chat/V2/CredentialOptions.php 0000604 00000015740 15174325127 0015030 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 The friendly_name * @param string $certificate The certificate * @param string $privateKey The private_key * @param boolean $sandbox The sandbox * @param string $apiKey The api_key * @param string $secret The secret * @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 The friendly_name * @param string $certificate The certificate * @param string $privateKey The private_key * @param boolean $sandbox The sandbox * @param string $apiKey The api_key * @param string $secret The secret * @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 The friendly_name * @param string $certificate The certificate * @param string $privateKey The private_key * @param boolean $sandbox The sandbox * @param string $apiKey The api_key * @param string $secret The secret */ 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; } /** * The friendly_name * * @param string $friendlyName The friendly_name * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The certificate * * @param string $certificate The certificate * @return $this Fluent Builder */ public function setCertificate($certificate) { $this->options['certificate'] = $certificate; return $this; } /** * The private_key * * @param string $privateKey The private_key * @return $this Fluent Builder */ public function setPrivateKey($privateKey) { $this->options['privateKey'] = $privateKey; return $this; } /** * The sandbox * * @param boolean $sandbox The sandbox * @return $this Fluent Builder */ public function setSandbox($sandbox) { $this->options['sandbox'] = $sandbox; return $this; } /** * The api_key * * @param string $apiKey The api_key * @return $this Fluent Builder */ public function setApiKey($apiKey) { $this->options['apiKey'] = $apiKey; return $this; } /** * The secret * * @param string $secret The secret * @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 The friendly_name * @param string $certificate The certificate * @param string $privateKey The private_key * @param boolean $sandbox The sandbox * @param string $apiKey The api_key * @param string $secret The secret */ 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; } /** * The friendly_name * * @param string $friendlyName The friendly_name * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The certificate * * @param string $certificate The certificate * @return $this Fluent Builder */ public function setCertificate($certificate) { $this->options['certificate'] = $certificate; return $this; } /** * The private_key * * @param string $privateKey The private_key * @return $this Fluent Builder */ public function setPrivateKey($privateKey) { $this->options['privateKey'] = $privateKey; return $this; } /** * The sandbox * * @param boolean $sandbox The sandbox * @return $this Fluent Builder */ public function setSandbox($sandbox) { $this->options['sandbox'] = $sandbox; return $this; } /** * The api_key * * @param string $apiKey The api_key * @return $this Fluent Builder */ public function setApiKey($apiKey) { $this->options['apiKey'] = $apiKey; return $this; } /** * The secret * * @param string $secret The secret * @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/Twilio/Rest/Chat/V2/Service/BindingInstance.php 0000604 00000010167 15174325127 0016037 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 service_sid * @param string $sid The sid * @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 */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the BindingInstance * * @return boolean True if delete succeeds, false otherwise */ 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/Twilio/Rest/Chat/V2/Service/UserContext.php 0000604 00000012117 15174325127 0015260 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\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 service_sid * @param string $sid The sid * @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 */ 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 */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Update the UserInstance * * @param array|Options $options Optional Arguments * @return UserInstance Updated UserInstance */ 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 \Twilio\Exceptions\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 \Twilio\Exceptions\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/Twilio/Rest/Chat/V2/Service/UserList.php 0000604 00000012753 15174325127 0014555 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\Values; use Twilio\Version; class UserList extends ListResource { /** * Construct the UserList * * @param Version $version Version that contains the resource * @param string $serviceSid The service_sid * @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 * @param array|Options $options Optional Arguments * @return UserInstance Newly created UserInstance */ 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 * @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/Twilio/Rest/Chat/V2/Service/UserOptions.php 0000604 00000010526 15174325127 0015271 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 role_sid * @param string $attributes The attributes * @param string $friendlyName The friendly_name * @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 role_sid * @param string $attributes The attributes * @param string $friendlyName The friendly_name * @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 role_sid * @param string $attributes The attributes * @param string $friendlyName The friendly_name */ 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 role_sid * * @param string $roleSid The role_sid * @return $this Fluent Builder */ public function setRoleSid($roleSid) { $this->options['roleSid'] = $roleSid; return $this; } /** * The attributes * * @param string $attributes The attributes * @return $this Fluent Builder */ public function setAttributes($attributes) { $this->options['attributes'] = $attributes; 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.Chat.V2.CreateUserOptions ' . implode(' ', $options) . ']'; } } class UpdateUserOptions extends Options { /** * @param string $roleSid The role_sid * @param string $attributes The attributes * @param string $friendlyName The friendly_name */ 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 role_sid * * @param string $roleSid The role_sid * @return $this Fluent Builder */ public function setRoleSid($roleSid) { $this->options['roleSid'] = $roleSid; return $this; } /** * The attributes * * @param string $attributes The attributes * @return $this Fluent Builder */ public function setAttributes($attributes) { $this->options['attributes'] = $attributes; 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.Chat.V2.UpdateUserOptions ' . implode(' ', $options) . ']'; } } sdk/Twilio/Rest/Chat/V2/Service/RoleList.php 0000604 00000012715 15174325127 0014536 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V2\Service; 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 service_sid * @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 The friendly_name * @param string $type The type * @param string $permission The permission * @return RoleInstance Newly created RoleInstance */ 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 * @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/Twilio/Rest/Chat/V2/Service/ChannelContext.php 0000604 00000013761 15174325127 0015720 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\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 * @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) */ 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 service_sid * @param string $sid The sid * @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 */ 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 */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Update the ChannelInstance * * @param array|Options $options Optional Arguments * @return ChannelInstance Updated ChannelInstance */ 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; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws \Twilio\Exceptions\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 \Twilio\Exceptions\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/Twilio/Rest/Chat/V2/Service/User/UserChannelInstance.php 0000604 00000005120 15174325127 0017603 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\Values; use Twilio\Version; /** * @property string accountSid * @property string serviceSid * @property string channelSid * @property string memberSid * @property string status * @property integer lastConsumedMessageIndex * @property integer 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 service_sid * @param string $userSid The sid * @return \Twilio\Rest\Chat\V2\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.V2.UserChannelInstance]'; } } sdk/Twilio/Rest/Chat/V2/Service/User/UserBindingList.php 0000604 00000012673 15174325127 0016767 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 service_sid * @param string $userSid The user_sid * @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 * @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/Twilio/Rest/Chat/V2/Service/User/UserBindingOptions.php 0000604 00000002634 15174325127 0017503 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 binding_type * @return ReadUserBindingOptions Options builder */ public static function read($bindingType = Values::NONE) { return new ReadUserBindingOptions($bindingType); } } class ReadUserBindingOptions extends Options { /** * @param string $bindingType The binding_type */ public function __construct($bindingType = Values::NONE) { $this->options['bindingType'] = $bindingType; } /** * The binding_type * * @param string $bindingType The binding_type * @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/Twilio/Rest/Chat/V2/Service/User/UserChannelPage.php 0000604 00000001531 15174325127 0016715 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/Twilio/Rest/Chat/V2/Service/User/UserBindingInstance.php 0000604 00000010654 15174325127 0017615 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 service_sid * @param string $userSid The user_sid * @param string $sid The sid * @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 */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the UserBindingInstance * * @return boolean True if delete succeeds, false otherwise */ 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/Twilio/Rest/Chat/V2/Service/User/UserBindingContext.php 0000604 00000004147 15174325127 0017475 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V2\Service\User; 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 service_sid * @param string $userSid The user_sid * @param string $sid The sid * @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 */ 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 */ 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/Twilio/Rest/Chat/V2/Service/User/UserChannelList.php 0000604 00000011202 15174325127 0016750 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 service_sid * @param string $userSid The sid * @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); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Chat.V2.UserChannelList]'; } } sdk/Twilio/Rest/Chat/V2/Service/User/UserBindingPage.php 0000604 00000001531 15174325127 0016717 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/Twilio/Rest/Chat/V2/Service/ChannelOptions.php 0000604 00000021402 15174325127 0015716 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 The friendly_name * @param string $uniqueName The unique_name * @param string $attributes The attributes * @param string $type The type * @param \DateTime $dateCreated The date_created * @param \DateTime $dateUpdated The date_updated * @param string $createdBy The created_by * @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 type * @return ReadChannelOptions Options builder */ public static function read($type = Values::NONE) { return new ReadChannelOptions($type); } /** * @param string $friendlyName The friendly_name * @param string $uniqueName The unique_name * @param string $attributes The attributes * @param \DateTime $dateCreated The date_created * @param \DateTime $dateUpdated The date_updated * @param string $createdBy The created_by * @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 The friendly_name * @param string $uniqueName The unique_name * @param string $attributes The attributes * @param string $type The type * @param \DateTime $dateCreated The date_created * @param \DateTime $dateUpdated The date_updated * @param string $createdBy The created_by */ 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; } /** * The friendly_name * * @param string $friendlyName The friendly_name * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The unique_name * * @param string $uniqueName The unique_name * @return $this Fluent Builder */ public function setUniqueName($uniqueName) { $this->options['uniqueName'] = $uniqueName; return $this; } /** * The attributes * * @param string $attributes The attributes * @return $this Fluent Builder */ public function setAttributes($attributes) { $this->options['attributes'] = $attributes; return $this; } /** * The type * * @param string $type The type * @return $this Fluent Builder */ public function setType($type) { $this->options['type'] = $type; return $this; } /** * The date_created * * @param \DateTime $dateCreated The date_created * @return $this Fluent Builder */ public function setDateCreated($dateCreated) { $this->options['dateCreated'] = $dateCreated; return $this; } /** * The date_updated * * @param \DateTime $dateUpdated The date_updated * @return $this Fluent Builder */ public function setDateUpdated($dateUpdated) { $this->options['dateUpdated'] = $dateUpdated; return $this; } /** * The created_by * * @param string $createdBy The created_by * @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 type */ public function __construct($type = Values::NONE) { $this->options['type'] = $type; } /** * The type * * @param string $type The type * @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 The friendly_name * @param string $uniqueName The unique_name * @param string $attributes The attributes * @param \DateTime $dateCreated The date_created * @param \DateTime $dateUpdated The date_updated * @param string $createdBy The created_by */ 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; } /** * The friendly_name * * @param string $friendlyName The friendly_name * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The unique_name * * @param string $uniqueName The unique_name * @return $this Fluent Builder */ public function setUniqueName($uniqueName) { $this->options['uniqueName'] = $uniqueName; return $this; } /** * The attributes * * @param string $attributes The attributes * @return $this Fluent Builder */ public function setAttributes($attributes) { $this->options['attributes'] = $attributes; return $this; } /** * The date_created * * @param \DateTime $dateCreated The date_created * @return $this Fluent Builder */ public function setDateCreated($dateCreated) { $this->options['dateCreated'] = $dateCreated; return $this; } /** * The date_updated * * @param \DateTime $dateUpdated The date_updated * @return $this Fluent Builder */ public function setDateUpdated($dateUpdated) { $this->options['dateUpdated'] = $dateUpdated; return $this; } /** * The created_by * * @param string $createdBy The created_by * @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/Twilio/Rest/Chat/V2/Service/Channel/MessagePage.php 0000604 00000001523 15174325127 0016525 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/Twilio/Rest/Chat/V2/Service/Channel/InviteInstance.php 0000604 00000010156 15174325127 0017271 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 service_sid * @param string $channelSid The channel_sid * @param string $sid The sid * @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 */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the InviteInstance * * @return boolean True if delete succeeds, false otherwise */ 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/Twilio/Rest/Chat/V2/Service/Channel/InvitePage.php 0000604 00000001520 15174325127 0016374 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/Twilio/Rest/Chat/V2/Service/Channel/MemberList.php 0000604 00000014755 15174325127 0016422 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V2\Service\Channel; 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 service_sid * @param string $channelSid The channel_sid * @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 * @param array|Options $options Optional Arguments * @return MemberInstance Newly created MemberInstance */ 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']), )); $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 * @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/Twilio/Rest/Chat/V2/Service/Channel/MemberContext.php 0000604 00000006251 15174325127 0017123 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V2\Service\Channel; 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 service_sid * @param string $channelSid The channel_sid * @param string $sid The sid * @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 */ 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 */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Update the MemberInstance * * @param array|Options $options Optional Arguments * @return MemberInstance Updated MemberInstance */ 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']), )); $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/Twilio/Rest/Chat/V2/Service/Channel/InviteOptions.php 0000604 00000004666 15174325127 0017171 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_sid * @return CreateInviteOptions Options builder */ public static function create($roleSid = Values::NONE) { return new CreateInviteOptions($roleSid); } /** * @param string $identity The identity * @return ReadInviteOptions Options builder */ public static function read($identity = Values::NONE) { return new ReadInviteOptions($identity); } } class CreateInviteOptions extends Options { /** * @param string $roleSid The role_sid */ public function __construct($roleSid = Values::NONE) { $this->options['roleSid'] = $roleSid; } /** * The role_sid * * @param string $roleSid The role_sid * @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 */ public function __construct($identity = Values::NONE) { $this->options['identity'] = $identity; } /** * The identity * * @param string $identity The identity * @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/Twilio/Rest/Chat/V2/Service/Channel/InviteList.php 0000604 00000014154 15174325127 0016442 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V2\Service\Channel; 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 service_sid * @param string $channelSid The channel_sid * @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 * @param array|Options $options Optional Arguments * @return InviteInstance Newly created InviteInstance */ 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 * @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/Twilio/Rest/Chat/V2/Service/Channel/MessageList.php 0000604 00000014567 15174325127 0016600 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V2\Service\Channel; 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 service_sid * @param string $channelSid The channel_sid * @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 */ 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 * @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/Twilio/Rest/Chat/V2/Service/Channel/InviteContext.php 0000604 00000004127 15174325127 0017152 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V2\Service\Channel; 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 service_sid * @param string $channelSid The channel_sid * @param string $sid The sid * @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 */ 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 */ 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/Twilio/Rest/Chat/V2/Service/Channel/MemberOptions.php 0000604 00000020466 15174325127 0017136 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 role_sid * @param integer $lastConsumedMessageIndex The last_consumed_message_index * @param \DateTime $lastConsumptionTimestamp The last_consumption_timestamp * @param \DateTime $dateCreated The date_created * @param \DateTime $dateUpdated The date_updated * @return CreateMemberOptions Options builder */ public static function create($roleSid = Values::NONE, $lastConsumedMessageIndex = Values::NONE, $lastConsumptionTimestamp = Values::NONE, $dateCreated = Values::NONE, $dateUpdated = Values::NONE) { return new CreateMemberOptions($roleSid, $lastConsumedMessageIndex, $lastConsumptionTimestamp, $dateCreated, $dateUpdated); } /** * @param string $identity The identity * @return ReadMemberOptions Options builder */ public static function read($identity = Values::NONE) { return new ReadMemberOptions($identity); } /** * @param string $roleSid The role_sid * @param integer $lastConsumedMessageIndex The last_consumed_message_index * @param \DateTime $lastConsumptionTimestamp The last_consumption_timestamp * @param \DateTime $dateCreated The date_created * @param \DateTime $dateUpdated The date_updated * @return UpdateMemberOptions Options builder */ public static function update($roleSid = Values::NONE, $lastConsumedMessageIndex = Values::NONE, $lastConsumptionTimestamp = Values::NONE, $dateCreated = Values::NONE, $dateUpdated = Values::NONE) { return new UpdateMemberOptions($roleSid, $lastConsumedMessageIndex, $lastConsumptionTimestamp, $dateCreated, $dateUpdated); } } class CreateMemberOptions extends Options { /** * @param string $roleSid The role_sid * @param integer $lastConsumedMessageIndex The last_consumed_message_index * @param \DateTime $lastConsumptionTimestamp The last_consumption_timestamp * @param \DateTime $dateCreated The date_created * @param \DateTime $dateUpdated The date_updated */ public function __construct($roleSid = Values::NONE, $lastConsumedMessageIndex = Values::NONE, $lastConsumptionTimestamp = Values::NONE, $dateCreated = Values::NONE, $dateUpdated = Values::NONE) { $this->options['roleSid'] = $roleSid; $this->options['lastConsumedMessageIndex'] = $lastConsumedMessageIndex; $this->options['lastConsumptionTimestamp'] = $lastConsumptionTimestamp; $this->options['dateCreated'] = $dateCreated; $this->options['dateUpdated'] = $dateUpdated; } /** * The role_sid * * @param string $roleSid The role_sid * @return $this Fluent Builder */ public function setRoleSid($roleSid) { $this->options['roleSid'] = $roleSid; return $this; } /** * The last_consumed_message_index * * @param integer $lastConsumedMessageIndex The last_consumed_message_index * @return $this Fluent Builder */ public function setLastConsumedMessageIndex($lastConsumedMessageIndex) { $this->options['lastConsumedMessageIndex'] = $lastConsumedMessageIndex; return $this; } /** * The last_consumption_timestamp * * @param \DateTime $lastConsumptionTimestamp The last_consumption_timestamp * @return $this Fluent Builder */ public function setLastConsumptionTimestamp($lastConsumptionTimestamp) { $this->options['lastConsumptionTimestamp'] = $lastConsumptionTimestamp; return $this; } /** * The date_created * * @param \DateTime $dateCreated The date_created * @return $this Fluent Builder */ public function setDateCreated($dateCreated) { $this->options['dateCreated'] = $dateCreated; return $this; } /** * The date_updated * * @param \DateTime $dateUpdated The date_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.Chat.V2.CreateMemberOptions ' . implode(' ', $options) . ']'; } } class ReadMemberOptions extends Options { /** * @param string $identity The identity */ public function __construct($identity = Values::NONE) { $this->options['identity'] = $identity; } /** * The identity * * @param string $identity The identity * @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 role_sid * @param integer $lastConsumedMessageIndex The last_consumed_message_index * @param \DateTime $lastConsumptionTimestamp The last_consumption_timestamp * @param \DateTime $dateCreated The date_created * @param \DateTime $dateUpdated The date_updated */ public function __construct($roleSid = Values::NONE, $lastConsumedMessageIndex = Values::NONE, $lastConsumptionTimestamp = Values::NONE, $dateCreated = Values::NONE, $dateUpdated = Values::NONE) { $this->options['roleSid'] = $roleSid; $this->options['lastConsumedMessageIndex'] = $lastConsumedMessageIndex; $this->options['lastConsumptionTimestamp'] = $lastConsumptionTimestamp; $this->options['dateCreated'] = $dateCreated; $this->options['dateUpdated'] = $dateUpdated; } /** * The role_sid * * @param string $roleSid The role_sid * @return $this Fluent Builder */ public function setRoleSid($roleSid) { $this->options['roleSid'] = $roleSid; return $this; } /** * The last_consumed_message_index * * @param integer $lastConsumedMessageIndex The last_consumed_message_index * @return $this Fluent Builder */ public function setLastConsumedMessageIndex($lastConsumedMessageIndex) { $this->options['lastConsumedMessageIndex'] = $lastConsumedMessageIndex; return $this; } /** * The last_consumption_timestamp * * @param \DateTime $lastConsumptionTimestamp The last_consumption_timestamp * @return $this Fluent Builder */ public function setLastConsumptionTimestamp($lastConsumptionTimestamp) { $this->options['lastConsumptionTimestamp'] = $lastConsumptionTimestamp; return $this; } /** * The date_created * * @param \DateTime $dateCreated The date_created * @return $this Fluent Builder */ public function setDateCreated($dateCreated) { $this->options['dateCreated'] = $dateCreated; return $this; } /** * The date_updated * * @param \DateTime $dateUpdated The date_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.Chat.V2.UpdateMemberOptions ' . implode(' ', $options) . ']'; } } sdk/Twilio/Rest/Chat/V2/Service/Channel/MessageInstance.php 0000604 00000011662 15174325127 0017422 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 boolean wasEdited * @property string from * @property string body * @property integer 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 service_sid * @param string $channelSid The channel_sid * @param string $sid The sid * @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 */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the MessageInstance * * @return boolean True if delete succeeds, false otherwise */ public function delete() { return $this->proxy()->delete(); } /** * Update the MessageInstance * * @param array|Options $options Optional Arguments * @return MessageInstance Updated MessageInstance */ 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/Twilio/Rest/Chat/V2/Service/Channel/MemberPage.php 0000604 00000001520 15174325127 0016345 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/Twilio/Rest/Chat/V2/Service/Channel/MessageOptions.php 0000604 00000020231 15174325127 0017301 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 from * @param string $attributes The attributes * @param \DateTime $dateCreated The date_created * @param \DateTime $dateUpdated The date_updated * @param string $lastUpdatedBy The last_updated_by * @param string $body The body * @param string $mediaSid The media_sid * @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 order * @return ReadMessageOptions Options builder */ public static function read($order = Values::NONE) { return new ReadMessageOptions($order); } /** * @param string $body The body * @param string $attributes The attributes * @param \DateTime $dateCreated The date_created * @param \DateTime $dateUpdated The date_updated * @param string $lastUpdatedBy The last_updated_by * @return UpdateMessageOptions Options builder */ public static function update($body = Values::NONE, $attributes = Values::NONE, $dateCreated = Values::NONE, $dateUpdated = Values::NONE, $lastUpdatedBy = Values::NONE) { return new UpdateMessageOptions($body, $attributes, $dateCreated, $dateUpdated, $lastUpdatedBy); } } class CreateMessageOptions extends Options { /** * @param string $from The from * @param string $attributes The attributes * @param \DateTime $dateCreated The date_created * @param \DateTime $dateUpdated The date_updated * @param string $lastUpdatedBy The last_updated_by * @param string $body The body * @param string $mediaSid The media_sid */ 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 from * * @param string $from The from * @return $this Fluent Builder */ public function setFrom($from) { $this->options['from'] = $from; return $this; } /** * The attributes * * @param string $attributes The attributes * @return $this Fluent Builder */ public function setAttributes($attributes) { $this->options['attributes'] = $attributes; return $this; } /** * The date_created * * @param \DateTime $dateCreated The date_created * @return $this Fluent Builder */ public function setDateCreated($dateCreated) { $this->options['dateCreated'] = $dateCreated; return $this; } /** * The date_updated * * @param \DateTime $dateUpdated The date_updated * @return $this Fluent Builder */ public function setDateUpdated($dateUpdated) { $this->options['dateUpdated'] = $dateUpdated; return $this; } /** * The last_updated_by * * @param string $lastUpdatedBy The last_updated_by * @return $this Fluent Builder */ public function setLastUpdatedBy($lastUpdatedBy) { $this->options['lastUpdatedBy'] = $lastUpdatedBy; return $this; } /** * The body * * @param string $body The body * @return $this Fluent Builder */ public function setBody($body) { $this->options['body'] = $body; return $this; } /** * The media_sid * * @param string $mediaSid The media_sid * @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 order */ public function __construct($order = Values::NONE) { $this->options['order'] = $order; } /** * The order * * @param string $order The order * @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 body * @param string $attributes The attributes * @param \DateTime $dateCreated The date_created * @param \DateTime $dateUpdated The date_updated * @param string $lastUpdatedBy The last_updated_by */ public function __construct($body = Values::NONE, $attributes = Values::NONE, $dateCreated = Values::NONE, $dateUpdated = Values::NONE, $lastUpdatedBy = Values::NONE) { $this->options['body'] = $body; $this->options['attributes'] = $attributes; $this->options['dateCreated'] = $dateCreated; $this->options['dateUpdated'] = $dateUpdated; $this->options['lastUpdatedBy'] = $lastUpdatedBy; } /** * The body * * @param string $body The body * @return $this Fluent Builder */ public function setBody($body) { $this->options['body'] = $body; return $this; } /** * The attributes * * @param string $attributes The attributes * @return $this Fluent Builder */ public function setAttributes($attributes) { $this->options['attributes'] = $attributes; return $this; } /** * The date_created * * @param \DateTime $dateCreated The date_created * @return $this Fluent Builder */ public function setDateCreated($dateCreated) { $this->options['dateCreated'] = $dateCreated; return $this; } /** * The date_updated * * @param \DateTime $dateUpdated The date_updated * @return $this Fluent Builder */ public function setDateUpdated($dateUpdated) { $this->options['dateUpdated'] = $dateUpdated; return $this; } /** * The last_updated_by * * @param string $lastUpdatedBy The last_updated_by * @return $this Fluent Builder */ public function setLastUpdatedBy($lastUpdatedBy) { $this->options['lastUpdatedBy'] = $lastUpdatedBy; return $this; } /** * Provide a friendly representation * * @return 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/Twilio/Rest/Chat/V2/Service/Channel/MessageContext.php 0000604 00000006143 15174325127 0017300 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V2\Service\Channel; 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 service_sid * @param string $channelSid The channel_sid * @param string $sid The sid * @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 */ 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 */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Update the MessageInstance * * @param array|Options $options Optional Arguments * @return MessageInstance Updated MessageInstance */ 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'], )); $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/Twilio/Rest/Chat/V2/Service/Channel/MemberInstance.php 0000604 00000011155 15174325127 0017242 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 integer 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 service_sid * @param string $channelSid The channel_sid * @param string $sid The sid * @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'), ); $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 */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the MemberInstance * * @return boolean True if delete succeeds, false otherwise */ public function delete() { return $this->proxy()->delete(); } /** * Update the MemberInstance * * @param array|Options $options Optional Arguments * @return MemberInstance Updated MemberInstance */ 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/Twilio/Rest/Chat/V2/Service/UserPage.php 0000604 00000001351 15174325127 0014506 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/Twilio/Rest/Chat/V2/Service/RoleContext.php 0000604 00000005007 15174325127 0015243 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V2\Service; 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 service_sid * @param string $sid The sid * @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 */ 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 */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Update the RoleInstance * * @param string $permission The permission * @return RoleInstance Updated RoleInstance */ 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/Twilio/Rest/Chat/V2/Service/RolePage.php 0000604 00000001351 15174325127 0014471 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/Twilio/Rest/Chat/V2/Service/ChannelInstance.php 0000604 00000012442 15174325127 0016033 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 integer membersCount * @property integer 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 service_sid * @param string $sid The sid * @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 */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the ChannelInstance * * @return boolean True if delete succeeds, false otherwise */ public function delete() { return $this->proxy()->delete(); } /** * Update the ChannelInstance * * @param array|Options $options Optional Arguments * @return ChannelInstance Updated ChannelInstance */ 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; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (property_exists($this, '_' . $name)) { $method = 'get' . ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide 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/Twilio/Rest/Chat/V2/Service/ChannelPage.php 0000604 00000001362 15174325127 0015142 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/Twilio/Rest/Chat/V2/Service/BindingList.php 0000604 00000012402 15174325127 0015200 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 service_sid * @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 * @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/Twilio/Rest/Chat/V2/Service/BindingPage.php 0000604 00000001362 15174325127 0015144 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/Twilio/Rest/Chat/V2/Service/ChannelList.php 0000604 00000014136 15174325127 0015204 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 ChannelList extends ListResource { /** * Construct the ChannelList * * @param Version $version Version that contains the resource * @param string $serviceSid The service_sid * @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 */ 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 * @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/Twilio/Rest/Chat/V2/Service/UserInstance.php 0000604 00000012111 15174325127 0015372 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 boolean isOnline * @property boolean isNotifiable * @property \DateTime dateCreated * @property \DateTime dateUpdated * @property integer 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 service_sid * @param string $sid The sid * @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 */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the UserInstance * * @return boolean True if delete succeeds, false otherwise */ public function delete() { return $this->proxy()->delete(); } /** * Update the UserInstance * * @param array|Options $options Optional Arguments * @return UserInstance Updated UserInstance */ 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/Twilio/Rest/Chat/V2/Service/BindingOptions.php 0000604 00000003500 15174325127 0015717 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 binding_type * @param string $identity The identity * @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 binding_type * @param string $identity The identity */ public function __construct($bindingType = Values::NONE, $identity = Values::NONE) { $this->options['bindingType'] = $bindingType; $this->options['identity'] = $identity; } /** * The binding_type * * @param string $bindingType The binding_type * @return $this Fluent Builder */ public function setBindingType($bindingType) { $this->options['bindingType'] = $bindingType; return $this; } /** * The identity * * @param string $identity The identity * @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/Twilio/Rest/Chat/V2/Service/RoleInstance.php 0000604 00000010035 15174325127 0015360 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 service_sid * @param string $sid The sid * @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 */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the RoleInstance * * @return boolean True if delete succeeds, false otherwise */ public function delete() { return $this->proxy()->delete(); } /** * Update the RoleInstance * * @param string $permission The permission * @return RoleInstance Updated RoleInstance */ 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/Twilio/Rest/Chat/V2/Service/BindingContext.php 0000604 00000003640 15174325127 0015715 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V2\Service; 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 service_sid * @param string $sid The sid * @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 */ 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 */ 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/Twilio/Rest/Chat/V2.php 0000604 00000005341 15174325127 0011376 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 \Twilio\Exceptions\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 \Twilio\Exceptions\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/Twilio/Rest/Chat/V1/CredentialPage.php 0000604 00000001324 15174325130 0014233 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/Twilio/Rest/Chat/V1/Service/UserList.php 0000604 00000012753 15174325130 0014546 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V1\Service; 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 service_sid * @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 * @param array|Options $options Optional Arguments * @return UserInstance Newly created UserInstance */ 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 * @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/Twilio/Rest/Chat/V1/Service/User/UserChannelPage.php 0000604 00000001531 15174325130 0016706 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/Twilio/Rest/Chat/V1/Service/User/UserChannelList.php 0000604 00000011202 15174325130 0016741 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 service_sid * @param string $userSid The sid * @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/Twilio/Rest/Chat/V1/Service/User/UserChannelInstance.php 0000604 00000005120 15174325130 0017574 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 integer lastConsumedMessageIndex * @property integer 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 service_sid * @param string $userSid The sid * @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/Twilio/Rest/Chat/V1/Service/ChannelInstance.php 0000604 00000012442 15174325130 0016024 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 integer membersCount * @property integer 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 service_sid * @param string $sid The sid * @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 */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the ChannelInstance * * @return boolean True if delete succeeds, false otherwise */ public function delete() { return $this->proxy()->delete(); } /** * Update the ChannelInstance * * @param array|Options $options Optional Arguments * @return ChannelInstance Updated ChannelInstance */ 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/Twilio/Rest/Chat/V1/Service/RoleList.php 0000604 00000012715 15174325130 0014527 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V1\Service; 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 service_sid * @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 The friendly_name * @param string $type The type * @param string $permission The permission * @return RoleInstance Newly created RoleInstance */ 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 * @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/Twilio/Rest/Chat/V1/Service/ChannelPage.php 0000604 00000001362 15174325130 0015133 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/Twilio/Rest/Chat/V1/Service/ChannelContext.php 0000604 00000013405 15174325130 0015704 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 service_sid * @param string $sid The sid * @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 */ 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 */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Update the ChannelInstance * * @param array|Options $options Optional Arguments * @return ChannelInstance Updated ChannelInstance */ 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 \Twilio\Exceptions\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 \Twilio\Exceptions\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/Twilio/Rest/Chat/V1/Service/UserPage.php 0000604 00000001351 15174325130 0014477 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/Twilio/Rest/Chat/V1/Service/UserInstance.php 0000604 00000011514 15174325130 0015371 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 boolean isOnline * @property boolean isNotifiable * @property \DateTime dateCreated * @property \DateTime dateUpdated * @property integer 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 service_sid * @param string $sid The sid * @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 */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the UserInstance * * @return boolean True if delete succeeds, false otherwise */ public function delete() { return $this->proxy()->delete(); } /** * Update the UserInstance * * @param array|Options $options Optional Arguments * @return UserInstance Updated UserInstance */ 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/Twilio/Rest/Chat/V1/Service/RolePage.php 0000604 00000001351 15174325130 0014462 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/Twilio/Rest/Chat/V1/Service/ChannelList.php 0000604 00000013610 15174325130 0015171 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V1\Service; 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 service_sid * @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 */ 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 sid * @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/Twilio/Rest/Chat/V1/Service/RoleInstance.php 0000604 00000010035 15174325130 0015351 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 service_sid * @param string $sid The sid * @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 */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the RoleInstance * * @return boolean True if delete succeeds, false otherwise */ public function delete() { return $this->proxy()->delete(); } /** * Update the RoleInstance * * @param string $permission The permission * @return RoleInstance Updated RoleInstance */ 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/Twilio/Rest/Chat/V1/Service/ChannelOptions.php 0000604 00000013570 15174325130 0015716 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 The friendly_name * @param string $uniqueName The unique_name * @param string $attributes The attributes * @param string $type The type * @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 type * @return ReadChannelOptions Options builder */ public static function read($type = Values::NONE) { return new ReadChannelOptions($type); } /** * @param string $friendlyName The friendly_name * @param string $uniqueName The unique_name * @param string $attributes The attributes * @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 The friendly_name * @param string $uniqueName The unique_name * @param string $attributes The attributes * @param string $type The type */ 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; } /** * The friendly_name * * @param string $friendlyName The friendly_name * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The unique_name * * @param string $uniqueName The unique_name * @return $this Fluent Builder */ public function setUniqueName($uniqueName) { $this->options['uniqueName'] = $uniqueName; return $this; } /** * The attributes * * @param string $attributes The attributes * @return $this Fluent Builder */ public function setAttributes($attributes) { $this->options['attributes'] = $attributes; return $this; } /** * The type * * @param string $type The type * @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 type */ public function __construct($type = Values::NONE) { $this->options['type'] = $type; } /** * The type * * @param string $type The type * @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 The friendly_name * @param string $uniqueName The unique_name * @param string $attributes The attributes */ public function __construct($friendlyName = Values::NONE, $uniqueName = Values::NONE, $attributes = Values::NONE) { $this->options['friendlyName'] = $friendlyName; $this->options['uniqueName'] = $uniqueName; $this->options['attributes'] = $attributes; } /** * The friendly_name * * @param string $friendlyName The friendly_name * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The unique_name * * @param string $uniqueName The unique_name * @return $this Fluent Builder */ public function setUniqueName($uniqueName) { $this->options['uniqueName'] = $uniqueName; return $this; } /** * The attributes * * @param string $attributes The attributes * @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/Twilio/Rest/Chat/V1/Service/Channel/MessageInstance.php 0000604 00000011227 15174325130 0017410 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 boolean wasEdited * @property string from * @property string body * @property integer 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 service_sid * @param string $channelSid The channel_sid * @param string $sid The sid * @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 */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the MessageInstance * * @return boolean True if delete succeeds, false otherwise */ public function delete() { return $this->proxy()->delete(); } /** * Update the MessageInstance * * @param array|Options $options Optional Arguments * @return MessageInstance Updated MessageInstance */ 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/Twilio/Rest/Chat/V1/Service/Channel/MemberOptions.php 0000604 00000010346 15174325130 0017123 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 role_sid * @return CreateMemberOptions Options builder */ public static function create($roleSid = Values::NONE) { return new CreateMemberOptions($roleSid); } /** * @param string $identity The identity * @return ReadMemberOptions Options builder */ public static function read($identity = Values::NONE) { return new ReadMemberOptions($identity); } /** * @param string $roleSid The role_sid * @param integer $lastConsumedMessageIndex The last_consumed_message_index * @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 role_sid */ public function __construct($roleSid = Values::NONE) { $this->options['roleSid'] = $roleSid; } /** * The role_sid * * @param string $roleSid The role_sid * @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 */ public function __construct($identity = Values::NONE) { $this->options['identity'] = $identity; } /** * The identity * * @param string $identity The identity * @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 role_sid * @param integer $lastConsumedMessageIndex The last_consumed_message_index */ public function __construct($roleSid = Values::NONE, $lastConsumedMessageIndex = Values::NONE) { $this->options['roleSid'] = $roleSid; $this->options['lastConsumedMessageIndex'] = $lastConsumedMessageIndex; } /** * The role_sid * * @param string $roleSid The role_sid * @return $this Fluent Builder */ public function setRoleSid($roleSid) { $this->options['roleSid'] = $roleSid; return $this; } /** * The last_consumed_message_index * * @param integer $lastConsumedMessageIndex The last_consumed_message_index * @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/Twilio/Rest/Chat/V1/Service/Channel/InviteContext.php 0000604 00000004127 15174325130 0017143 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V1\Service\Channel; 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 service_sid * @param string $channelSid The channel_sid * @param string $sid The sid * @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 */ 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 */ 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/Twilio/Rest/Chat/V1/Service/Channel/InviteOptions.php 0000604 00000004666 15174325130 0017162 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_sid * @return CreateInviteOptions Options builder */ public static function create($roleSid = Values::NONE) { return new CreateInviteOptions($roleSid); } /** * @param string $identity The identity * @return ReadInviteOptions Options builder */ public static function read($identity = Values::NONE) { return new ReadInviteOptions($identity); } } class CreateInviteOptions extends Options { /** * @param string $roleSid The role_sid */ public function __construct($roleSid = Values::NONE) { $this->options['roleSid'] = $roleSid; } /** * The role_sid * * @param string $roleSid The role_sid * @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 */ public function __construct($identity = Values::NONE) { $this->options['identity'] = $identity; } /** * The identity * * @param string $identity The identity * @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/Twilio/Rest/Chat/V1/Service/Channel/MemberContext.php 0000604 00000005603 15174325130 0017114 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V1\Service\Channel; 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 service_sid * @param string $channelSid The channel_sid * @param string $sid The sid * @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 */ 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 */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Update the MemberInstance * * @param array|Options $options Optional Arguments * @return MemberInstance Updated MemberInstance */ 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/Twilio/Rest/Chat/V1/Service/Channel/InviteInstance.php 0000604 00000010156 15174325130 0017262 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 service_sid * @param string $channelSid The channel_sid * @param string $sid The sid * @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 */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the InviteInstance * * @return boolean True if delete succeeds, false otherwise */ 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/Twilio/Rest/Chat/V1/Service/Channel/MemberList.php 0000604 00000014154 15174325130 0016404 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V1\Service\Channel; 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 service_sid * @param string $channelSid The channel_sid * @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 * @param array|Options $options Optional Arguments * @return MemberInstance Newly created MemberInstance */ 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 sid * @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/Twilio/Rest/Chat/V1/Service/Channel/MessagePage.php 0000604 00000001523 15174325130 0016516 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/Twilio/Rest/Chat/V1/Service/Channel/InvitePage.php 0000604 00000001520 15174325130 0016365 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/Twilio/Rest/Chat/V1/Service/Channel/MessageOptions.php 0000604 00000010511 15174325130 0017272 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 from * @param string $attributes The attributes * @return CreateMessageOptions Options builder */ public static function create($from = Values::NONE, $attributes = Values::NONE) { return new CreateMessageOptions($from, $attributes); } /** * @param string $order The order * @return ReadMessageOptions Options builder */ public static function read($order = Values::NONE) { return new ReadMessageOptions($order); } /** * @param string $body The body * @param string $attributes The attributes * @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 from * @param string $attributes The attributes */ public function __construct($from = Values::NONE, $attributes = Values::NONE) { $this->options['from'] = $from; $this->options['attributes'] = $attributes; } /** * The from * * @param string $from The from * @return $this Fluent Builder */ public function setFrom($from) { $this->options['from'] = $from; return $this; } /** * The attributes * * @param string $attributes The attributes * @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 order */ public function __construct($order = Values::NONE) { $this->options['order'] = $order; } /** * The order * * @param string $order The order * @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 body * @param string $attributes The attributes */ public function __construct($body = Values::NONE, $attributes = Values::NONE) { $this->options['body'] = $body; $this->options['attributes'] = $attributes; } /** * The body * * @param string $body The body * @return $this Fluent Builder */ public function setBody($body) { $this->options['body'] = $body; return $this; } /** * The attributes * * @param string $attributes The attributes * @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/Twilio/Rest/Chat/V1/Service/Channel/MemberPage.php 0000604 00000001520 15174325130 0016336 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/Twilio/Rest/Chat/V1/Service/Channel/MessageList.php 0000604 00000014163 15174325130 0016561 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V1\Service\Channel; 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 service_sid * @param string $channelSid The channel_sid * @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 body * @param array|Options $options Optional Arguments * @return MessageInstance Newly created MessageInstance */ 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 sid * @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/Twilio/Rest/Chat/V1/Service/Channel/MessageContext.php 0000604 00000005516 15174325130 0017274 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V1\Service\Channel; 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 service_sid * @param string $channelSid The channel_sid * @param string $sid The sid * @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 */ 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 */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Update the MessageInstance * * @param array|Options $options Optional Arguments * @return MessageInstance Updated MessageInstance */ 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/Twilio/Rest/Chat/V1/Service/Channel/MemberInstance.php 0000604 00000011155 15174325130 0017233 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 integer 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 service_sid * @param string $channelSid The channel_sid * @param string $sid The sid * @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 */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the MemberInstance * * @return boolean True if delete succeeds, false otherwise */ public function delete() { return $this->proxy()->delete(); } /** * Update the MemberInstance * * @param array|Options $options Optional Arguments * @return MemberInstance Updated MemberInstance */ 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/Twilio/Rest/Chat/V1/Service/Channel/InviteList.php 0000604 00000014154 15174325130 0016433 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V1\Service\Channel; 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 service_sid * @param string $channelSid The channel_sid * @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 * @param array|Options $options Optional Arguments * @return InviteInstance Newly created InviteInstance */ 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 * @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/Twilio/Rest/Chat/V1/Service/UserOptions.php 0000604 00000010526 15174325130 0015262 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 role_sid * @param string $attributes The attributes * @param string $friendlyName The friendly_name * @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 role_sid * @param string $attributes The attributes * @param string $friendlyName The friendly_name * @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 role_sid * @param string $attributes The attributes * @param string $friendlyName The friendly_name */ 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 role_sid * * @param string $roleSid The role_sid * @return $this Fluent Builder */ public function setRoleSid($roleSid) { $this->options['roleSid'] = $roleSid; return $this; } /** * The attributes * * @param string $attributes The attributes * @return $this Fluent Builder */ public function setAttributes($attributes) { $this->options['attributes'] = $attributes; 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.Chat.V1.CreateUserOptions ' . implode(' ', $options) . ']'; } } class UpdateUserOptions extends Options { /** * @param string $roleSid The role_sid * @param string $attributes The attributes * @param string $friendlyName The friendly_name */ 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 role_sid * * @param string $roleSid The role_sid * @return $this Fluent Builder */ public function setRoleSid($roleSid) { $this->options['roleSid'] = $roleSid; return $this; } /** * The attributes * * @param string $attributes The attributes * @return $this Fluent Builder */ public function setAttributes($attributes) { $this->options['attributes'] = $attributes; 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.Chat.V1.UpdateUserOptions ' . implode(' ', $options) . ']'; } } sdk/Twilio/Rest/Chat/V1/Service/UserContext.php 0000604 00000010621 15174325130 0015247 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 service_sid * @param string $sid The sid * @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 */ 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 */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Update the UserInstance * * @param array|Options $options Optional Arguments * @return UserInstance Updated UserInstance */ 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 \Twilio\Exceptions\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 \Twilio\Exceptions\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/Twilio/Rest/Chat/V1/Service/RoleContext.php 0000604 00000005007 15174325130 0015234 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V1\Service; 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 service_sid * @param string $sid The sid * @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 */ 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 */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Update the RoleInstance * * @param string $permission The permission * @return RoleInstance Updated RoleInstance */ 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/Twilio/Rest/Chat/V1/ServiceList.php 0000604 00000012052 15174325130 0013620 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V1; 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 The friendly_name * @return ServiceInstance Newly created ServiceInstance */ 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 * @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/Twilio/Rest/Chat/V1/ServiceInstance.php 0000604 00000013746 15174325130 0014464 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 boolean readStatusEnabled * @property boolean reachabilityEnabled * @property integer typingIndicatorTimeout * @property integer 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 sid * @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 */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the ServiceInstance * * @return boolean True if delete succeeds, false otherwise */ public function delete() { return $this->proxy()->delete(); } /** * Update the ServiceInstance * * @param array|Options $options Optional Arguments * @return ServiceInstance Updated ServiceInstance */ 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/Twilio/Rest/Chat/V1/CredentialInstance.php 0000604 00000007514 15174325130 0015132 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 sid * @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 */ public function fetch() { return $this->proxy()->fetch(); } /** * Update the CredentialInstance * * @param array|Options $options Optional Arguments * @return CredentialInstance Updated CredentialInstance */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Deletes the CredentialInstance * * @return boolean True if delete succeeds, false otherwise */ 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/Twilio/Rest/Chat/V1/CredentialList.php 0000604 00000013071 15174325130 0014274 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V1; 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 * @param array|Options $options Optional Arguments * @return CredentialInstance Newly created CredentialInstance */ 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 * @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/Twilio/Rest/Chat/V1/CredentialOptions.php 0000604 00000015740 15174325130 0015021 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 The friendly_name * @param string $certificate The certificate * @param string $privateKey The private_key * @param boolean $sandbox The sandbox * @param string $apiKey The api_key * @param string $secret The secret * @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 The friendly_name * @param string $certificate The certificate * @param string $privateKey The private_key * @param boolean $sandbox The sandbox * @param string $apiKey The api_key * @param string $secret The secret * @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 The friendly_name * @param string $certificate The certificate * @param string $privateKey The private_key * @param boolean $sandbox The sandbox * @param string $apiKey The api_key * @param string $secret The secret */ 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; } /** * The friendly_name * * @param string $friendlyName The friendly_name * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The certificate * * @param string $certificate The certificate * @return $this Fluent Builder */ public function setCertificate($certificate) { $this->options['certificate'] = $certificate; return $this; } /** * The private_key * * @param string $privateKey The private_key * @return $this Fluent Builder */ public function setPrivateKey($privateKey) { $this->options['privateKey'] = $privateKey; return $this; } /** * The sandbox * * @param boolean $sandbox The sandbox * @return $this Fluent Builder */ public function setSandbox($sandbox) { $this->options['sandbox'] = $sandbox; return $this; } /** * The api_key * * @param string $apiKey The api_key * @return $this Fluent Builder */ public function setApiKey($apiKey) { $this->options['apiKey'] = $apiKey; return $this; } /** * The secret * * @param string $secret The secret * @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 The friendly_name * @param string $certificate The certificate * @param string $privateKey The private_key * @param boolean $sandbox The sandbox * @param string $apiKey The api_key * @param string $secret The secret */ 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; } /** * The friendly_name * * @param string $friendlyName The friendly_name * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The certificate * * @param string $certificate The certificate * @return $this Fluent Builder */ public function setCertificate($certificate) { $this->options['certificate'] = $certificate; return $this; } /** * The private_key * * @param string $privateKey The private_key * @return $this Fluent Builder */ public function setPrivateKey($privateKey) { $this->options['privateKey'] = $privateKey; return $this; } /** * The sandbox * * @param boolean $sandbox The sandbox * @return $this Fluent Builder */ public function setSandbox($sandbox) { $this->options['sandbox'] = $sandbox; return $this; } /** * The api_key * * @param string $apiKey The api_key * @return $this Fluent Builder */ public function setApiKey($apiKey) { $this->options['apiKey'] = $apiKey; return $this; } /** * The secret * * @param string $secret The secret * @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/Twilio/Rest/Chat/V1/CredentialContext.php 0000604 00000005143 15174325130 0015006 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Chat\V1; 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 * @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 */ 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 */ 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 */ 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/Twilio/Rest/Chat/V1/ServicePage.php 0000604 00000001313 15174325130 0013557 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/Twilio/Rest/Chat/V1/ServiceOptions.php 0000604 00000166153 15174325130 0014354 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 The friendly_name * @param string $defaultServiceRoleSid The default_service_role_sid * @param string $defaultChannelRoleSid The default_channel_role_sid * @param string $defaultChannelCreatorRoleSid The * default_channel_creator_role_sid * @param boolean $readStatusEnabled The read_status_enabled * @param boolean $reachabilityEnabled The reachability_enabled * @param integer $typingIndicatorTimeout The typing_indicator_timeout * @param integer $consumptionReportInterval The consumption_report_interval * @param boolean $notificationsNewMessageEnabled The * notifications.new_message.enabled * @param string $notificationsNewMessageTemplate The * notifications.new_message.template * @param boolean $notificationsAddedToChannelEnabled The * notifications.added_to_channel.enabled * @param string $notificationsAddedToChannelTemplate The * notifications.added_to_channel.template * @param boolean $notificationsRemovedFromChannelEnabled The * notifications.removed_from_channel.enabled * @param string $notificationsRemovedFromChannelTemplate The * notifications.removed_from_channel.template * @param boolean $notificationsInvitedToChannelEnabled The * notifications.invited_to_channel.enabled * @param string $notificationsInvitedToChannelTemplate The * notifications.invited_to_channel.template * @param string $preWebhookUrl The pre_webhook_url * @param string $postWebhookUrl The post_webhook_url * @param string $webhookMethod The webhook_method * @param string $webhookFilters The webhook_filters * @param string $webhooksOnMessageSendUrl The webhooks.on_message_send.url * @param string $webhooksOnMessageSendMethod The * webhooks.on_message_send.method * @param string $webhooksOnMessageSendFormat The * webhooks.on_message_send.format * @param string $webhooksOnMessageUpdateUrl The webhooks.on_message_update.url * @param string $webhooksOnMessageUpdateMethod The * webhooks.on_message_update.method * @param string $webhooksOnMessageUpdateFormat The * webhooks.on_message_update.format * @param string $webhooksOnMessageRemoveUrl The webhooks.on_message_remove.url * @param string $webhooksOnMessageRemoveMethod The * webhooks.on_message_remove.method * @param string $webhooksOnMessageRemoveFormat The * webhooks.on_message_remove.format * @param string $webhooksOnChannelAddUrl The webhooks.on_channel_add.url * @param string $webhooksOnChannelAddMethod The webhooks.on_channel_add.method * @param string $webhooksOnChannelAddFormat The webhooks.on_channel_add.format * @param string $webhooksOnChannelDestroyUrl The * webhooks.on_channel_destroy.url * @param string $webhooksOnChannelDestroyMethod The * webhooks.on_channel_destroy.method * @param string $webhooksOnChannelDestroyFormat The * webhooks.on_channel_destroy.format * @param string $webhooksOnChannelUpdateUrl The webhooks.on_channel_update.url * @param string $webhooksOnChannelUpdateMethod The * webhooks.on_channel_update.method * @param string $webhooksOnChannelUpdateFormat The * webhooks.on_channel_update.format * @param string $webhooksOnMemberAddUrl The webhooks.on_member_add.url * @param string $webhooksOnMemberAddMethod The webhooks.on_member_add.method * @param string $webhooksOnMemberAddFormat The webhooks.on_member_add.format * @param string $webhooksOnMemberRemoveUrl The webhooks.on_member_remove.url * @param string $webhooksOnMemberRemoveMethod The * webhooks.on_member_remove.method * @param string $webhooksOnMemberRemoveFormat The * webhooks.on_member_remove.format * @param string $webhooksOnMessageSentUrl The webhooks.on_message_sent.url * @param string $webhooksOnMessageSentMethod The * webhooks.on_message_sent.method * @param string $webhooksOnMessageSentFormat The * webhooks.on_message_sent.format * @param string $webhooksOnMessageUpdatedUrl The * webhooks.on_message_updated.url * @param string $webhooksOnMessageUpdatedMethod The * webhooks.on_message_updated.method * @param string $webhooksOnMessageUpdatedFormat The * webhooks.on_message_updated.format * @param string $webhooksOnMessageRemovedUrl The * webhooks.on_message_removed.url * @param string $webhooksOnMessageRemovedMethod The * webhooks.on_message_removed.method * @param string $webhooksOnMessageRemovedFormat The * webhooks.on_message_removed.format * @param string $webhooksOnChannelAddedUrl The webhooks.on_channel_added.url * @param string $webhooksOnChannelAddedMethod The * webhooks.on_channel_added.method * @param string $webhooksOnChannelAddedFormat The * webhooks.on_channel_added.format * @param string $webhooksOnChannelDestroyedUrl The * webhooks.on_channel_destroyed.url * @param string $webhooksOnChannelDestroyedMethod The * webhooks.on_channel_destroyed.method * @param string $webhooksOnChannelDestroyedFormat The * webhooks.on_channel_destroyed.format * @param string $webhooksOnChannelUpdatedUrl The * webhooks.on_channel_updated.url * @param string $webhooksOnChannelUpdatedMethod The * webhooks.on_channel_updated.method * @param string $webhooksOnChannelUpdatedFormat The * webhooks.on_channel_updated.format * @param string $webhooksOnMemberAddedUrl The webhooks.on_member_added.url * @param string $webhooksOnMemberAddedMethod The * webhooks.on_member_added.method * @param string $webhooksOnMemberAddedFormat The * webhooks.on_member_added.format * @param string $webhooksOnMemberRemovedUrl The webhooks.on_member_removed.url * @param string $webhooksOnMemberRemovedMethod The * webhooks.on_member_removed.method * @param string $webhooksOnMemberRemovedFormat The * webhooks.on_member_removed.format * @param integer $limitsChannelMembers The limits.channel_members * @param integer $limitsUserChannels The limits.user_channels * @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, $webhooksOnMessageSendFormat = Values::NONE, $webhooksOnMessageUpdateUrl = Values::NONE, $webhooksOnMessageUpdateMethod = Values::NONE, $webhooksOnMessageUpdateFormat = Values::NONE, $webhooksOnMessageRemoveUrl = Values::NONE, $webhooksOnMessageRemoveMethod = Values::NONE, $webhooksOnMessageRemoveFormat = Values::NONE, $webhooksOnChannelAddUrl = Values::NONE, $webhooksOnChannelAddMethod = Values::NONE, $webhooksOnChannelAddFormat = Values::NONE, $webhooksOnChannelDestroyUrl = Values::NONE, $webhooksOnChannelDestroyMethod = Values::NONE, $webhooksOnChannelDestroyFormat = Values::NONE, $webhooksOnChannelUpdateUrl = Values::NONE, $webhooksOnChannelUpdateMethod = Values::NONE, $webhooksOnChannelUpdateFormat = Values::NONE, $webhooksOnMemberAddUrl = Values::NONE, $webhooksOnMemberAddMethod = Values::NONE, $webhooksOnMemberAddFormat = Values::NONE, $webhooksOnMemberRemoveUrl = Values::NONE, $webhooksOnMemberRemoveMethod = Values::NONE, $webhooksOnMemberRemoveFormat = Values::NONE, $webhooksOnMessageSentUrl = Values::NONE, $webhooksOnMessageSentMethod = Values::NONE, $webhooksOnMessageSentFormat = Values::NONE, $webhooksOnMessageUpdatedUrl = Values::NONE, $webhooksOnMessageUpdatedMethod = Values::NONE, $webhooksOnMessageUpdatedFormat = Values::NONE, $webhooksOnMessageRemovedUrl = Values::NONE, $webhooksOnMessageRemovedMethod = Values::NONE, $webhooksOnMessageRemovedFormat = Values::NONE, $webhooksOnChannelAddedUrl = Values::NONE, $webhooksOnChannelAddedMethod = Values::NONE, $webhooksOnChannelAddedFormat = Values::NONE, $webhooksOnChannelDestroyedUrl = Values::NONE, $webhooksOnChannelDestroyedMethod = Values::NONE, $webhooksOnChannelDestroyedFormat = Values::NONE, $webhooksOnChannelUpdatedUrl = Values::NONE, $webhooksOnChannelUpdatedMethod = Values::NONE, $webhooksOnChannelUpdatedFormat = Values::NONE, $webhooksOnMemberAddedUrl = Values::NONE, $webhooksOnMemberAddedMethod = Values::NONE, $webhooksOnMemberAddedFormat = Values::NONE, $webhooksOnMemberRemovedUrl = Values::NONE, $webhooksOnMemberRemovedMethod = Values::NONE, $webhooksOnMemberRemovedFormat = 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, $webhooksOnMessageSendFormat, $webhooksOnMessageUpdateUrl, $webhooksOnMessageUpdateMethod, $webhooksOnMessageUpdateFormat, $webhooksOnMessageRemoveUrl, $webhooksOnMessageRemoveMethod, $webhooksOnMessageRemoveFormat, $webhooksOnChannelAddUrl, $webhooksOnChannelAddMethod, $webhooksOnChannelAddFormat, $webhooksOnChannelDestroyUrl, $webhooksOnChannelDestroyMethod, $webhooksOnChannelDestroyFormat, $webhooksOnChannelUpdateUrl, $webhooksOnChannelUpdateMethod, $webhooksOnChannelUpdateFormat, $webhooksOnMemberAddUrl, $webhooksOnMemberAddMethod, $webhooksOnMemberAddFormat, $webhooksOnMemberRemoveUrl, $webhooksOnMemberRemoveMethod, $webhooksOnMemberRemoveFormat, $webhooksOnMessageSentUrl, $webhooksOnMessageSentMethod, $webhooksOnMessageSentFormat, $webhooksOnMessageUpdatedUrl, $webhooksOnMessageUpdatedMethod, $webhooksOnMessageUpdatedFormat, $webhooksOnMessageRemovedUrl, $webhooksOnMessageRemovedMethod, $webhooksOnMessageRemovedFormat, $webhooksOnChannelAddedUrl, $webhooksOnChannelAddedMethod, $webhooksOnChannelAddedFormat, $webhooksOnChannelDestroyedUrl, $webhooksOnChannelDestroyedMethod, $webhooksOnChannelDestroyedFormat, $webhooksOnChannelUpdatedUrl, $webhooksOnChannelUpdatedMethod, $webhooksOnChannelUpdatedFormat, $webhooksOnMemberAddedUrl, $webhooksOnMemberAddedMethod, $webhooksOnMemberAddedFormat, $webhooksOnMemberRemovedUrl, $webhooksOnMemberRemovedMethod, $webhooksOnMemberRemovedFormat, $limitsChannelMembers, $limitsUserChannels); } } class UpdateServiceOptions extends Options { /** * @param string $friendlyName The friendly_name * @param string $defaultServiceRoleSid The default_service_role_sid * @param string $defaultChannelRoleSid The default_channel_role_sid * @param string $defaultChannelCreatorRoleSid The * default_channel_creator_role_sid * @param boolean $readStatusEnabled The read_status_enabled * @param boolean $reachabilityEnabled The reachability_enabled * @param integer $typingIndicatorTimeout The typing_indicator_timeout * @param integer $consumptionReportInterval The consumption_report_interval * @param boolean $notificationsNewMessageEnabled The * notifications.new_message.enabled * @param string $notificationsNewMessageTemplate The * notifications.new_message.template * @param boolean $notificationsAddedToChannelEnabled The * notifications.added_to_channel.enabled * @param string $notificationsAddedToChannelTemplate The * notifications.added_to_channel.template * @param boolean $notificationsRemovedFromChannelEnabled The * notifications.removed_from_channel.enabled * @param string $notificationsRemovedFromChannelTemplate The * notifications.removed_from_channel.template * @param boolean $notificationsInvitedToChannelEnabled The * notifications.invited_to_channel.enabled * @param string $notificationsInvitedToChannelTemplate The * notifications.invited_to_channel.template * @param string $preWebhookUrl The pre_webhook_url * @param string $postWebhookUrl The post_webhook_url * @param string $webhookMethod The webhook_method * @param string $webhookFilters The webhook_filters * @param string $webhooksOnMessageSendUrl The webhooks.on_message_send.url * @param string $webhooksOnMessageSendMethod The * webhooks.on_message_send.method * @param string $webhooksOnMessageSendFormat The * webhooks.on_message_send.format * @param string $webhooksOnMessageUpdateUrl The webhooks.on_message_update.url * @param string $webhooksOnMessageUpdateMethod The * webhooks.on_message_update.method * @param string $webhooksOnMessageUpdateFormat The * webhooks.on_message_update.format * @param string $webhooksOnMessageRemoveUrl The webhooks.on_message_remove.url * @param string $webhooksOnMessageRemoveMethod The * webhooks.on_message_remove.method * @param string $webhooksOnMessageRemoveFormat The * webhooks.on_message_remove.format * @param string $webhooksOnChannelAddUrl The webhooks.on_channel_add.url * @param string $webhooksOnChannelAddMethod The webhooks.on_channel_add.method * @param string $webhooksOnChannelAddFormat The webhooks.on_channel_add.format * @param string $webhooksOnChannelDestroyUrl The * webhooks.on_channel_destroy.url * @param string $webhooksOnChannelDestroyMethod The * webhooks.on_channel_destroy.method * @param string $webhooksOnChannelDestroyFormat The * webhooks.on_channel_destroy.format * @param string $webhooksOnChannelUpdateUrl The webhooks.on_channel_update.url * @param string $webhooksOnChannelUpdateMethod The * webhooks.on_channel_update.method * @param string $webhooksOnChannelUpdateFormat The * webhooks.on_channel_update.format * @param string $webhooksOnMemberAddUrl The webhooks.on_member_add.url * @param string $webhooksOnMemberAddMethod The webhooks.on_member_add.method * @param string $webhooksOnMemberAddFormat The webhooks.on_member_add.format * @param string $webhooksOnMemberRemoveUrl The webhooks.on_member_remove.url * @param string $webhooksOnMemberRemoveMethod The * webhooks.on_member_remove.method * @param string $webhooksOnMemberRemoveFormat The * webhooks.on_member_remove.format * @param string $webhooksOnMessageSentUrl The webhooks.on_message_sent.url * @param string $webhooksOnMessageSentMethod The * webhooks.on_message_sent.method * @param string $webhooksOnMessageSentFormat The * webhooks.on_message_sent.format * @param string $webhooksOnMessageUpdatedUrl The * webhooks.on_message_updated.url * @param string $webhooksOnMessageUpdatedMethod The * webhooks.on_message_updated.method * @param string $webhooksOnMessageUpdatedFormat The * webhooks.on_message_updated.format * @param string $webhooksOnMessageRemovedUrl The * webhooks.on_message_removed.url * @param string $webhooksOnMessageRemovedMethod The * webhooks.on_message_removed.method * @param string $webhooksOnMessageRemovedFormat The * webhooks.on_message_removed.format * @param string $webhooksOnChannelAddedUrl The webhooks.on_channel_added.url * @param string $webhooksOnChannelAddedMethod The * webhooks.on_channel_added.method * @param string $webhooksOnChannelAddedFormat The * webhooks.on_channel_added.format * @param string $webhooksOnChannelDestroyedUrl The * webhooks.on_channel_destroyed.url * @param string $webhooksOnChannelDestroyedMethod The * webhooks.on_channel_destroyed.method * @param string $webhooksOnChannelDestroyedFormat The * webhooks.on_channel_destroyed.format * @param string $webhooksOnChannelUpdatedUrl The * webhooks.on_channel_updated.url * @param string $webhooksOnChannelUpdatedMethod The * webhooks.on_channel_updated.method * @param string $webhooksOnChannelUpdatedFormat The * webhooks.on_channel_updated.format * @param string $webhooksOnMemberAddedUrl The webhooks.on_member_added.url * @param string $webhooksOnMemberAddedMethod The * webhooks.on_member_added.method * @param string $webhooksOnMemberAddedFormat The * webhooks.on_member_added.format * @param string $webhooksOnMemberRemovedUrl The webhooks.on_member_removed.url * @param string $webhooksOnMemberRemovedMethod The * webhooks.on_member_removed.method * @param string $webhooksOnMemberRemovedFormat The * webhooks.on_member_removed.format * @param integer $limitsChannelMembers The limits.channel_members * @param integer $limitsUserChannels The limits.user_channels */ 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, $webhooksOnMessageSendFormat = Values::NONE, $webhooksOnMessageUpdateUrl = Values::NONE, $webhooksOnMessageUpdateMethod = Values::NONE, $webhooksOnMessageUpdateFormat = Values::NONE, $webhooksOnMessageRemoveUrl = Values::NONE, $webhooksOnMessageRemoveMethod = Values::NONE, $webhooksOnMessageRemoveFormat = Values::NONE, $webhooksOnChannelAddUrl = Values::NONE, $webhooksOnChannelAddMethod = Values::NONE, $webhooksOnChannelAddFormat = Values::NONE, $webhooksOnChannelDestroyUrl = Values::NONE, $webhooksOnChannelDestroyMethod = Values::NONE, $webhooksOnChannelDestroyFormat = Values::NONE, $webhooksOnChannelUpdateUrl = Values::NONE, $webhooksOnChannelUpdateMethod = Values::NONE, $webhooksOnChannelUpdateFormat = Values::NONE, $webhooksOnMemberAddUrl = Values::NONE, $webhooksOnMemberAddMethod = Values::NONE, $webhooksOnMemberAddFormat = Values::NONE, $webhooksOnMemberRemoveUrl = Values::NONE, $webhooksOnMemberRemoveMethod = Values::NONE, $webhooksOnMemberRemoveFormat = Values::NONE, $webhooksOnMessageSentUrl = Values::NONE, $webhooksOnMessageSentMethod = Values::NONE, $webhooksOnMessageSentFormat = Values::NONE, $webhooksOnMessageUpdatedUrl = Values::NONE, $webhooksOnMessageUpdatedMethod = Values::NONE, $webhooksOnMessageUpdatedFormat = Values::NONE, $webhooksOnMessageRemovedUrl = Values::NONE, $webhooksOnMessageRemovedMethod = Values::NONE, $webhooksOnMessageRemovedFormat = Values::NONE, $webhooksOnChannelAddedUrl = Values::NONE, $webhooksOnChannelAddedMethod = Values::NONE, $webhooksOnChannelAddedFormat = Values::NONE, $webhooksOnChannelDestroyedUrl = Values::NONE, $webhooksOnChannelDestroyedMethod = Values::NONE, $webhooksOnChannelDestroyedFormat = Values::NONE, $webhooksOnChannelUpdatedUrl = Values::NONE, $webhooksOnChannelUpdatedMethod = Values::NONE, $webhooksOnChannelUpdatedFormat = Values::NONE, $webhooksOnMemberAddedUrl = Values::NONE, $webhooksOnMemberAddedMethod = Values::NONE, $webhooksOnMemberAddedFormat = Values::NONE, $webhooksOnMemberRemovedUrl = Values::NONE, $webhooksOnMemberRemovedMethod = Values::NONE, $webhooksOnMemberRemovedFormat = 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['webhooksOnMessageSendFormat'] = $webhooksOnMessageSendFormat; $this->options['webhooksOnMessageUpdateUrl'] = $webhooksOnMessageUpdateUrl; $this->options['webhooksOnMessageUpdateMethod'] = $webhooksOnMessageUpdateMethod; $this->options['webhooksOnMessageUpdateFormat'] = $webhooksOnMessageUpdateFormat; $this->options['webhooksOnMessageRemoveUrl'] = $webhooksOnMessageRemoveUrl; $this->options['webhooksOnMessageRemoveMethod'] = $webhooksOnMessageRemoveMethod; $this->options['webhooksOnMessageRemoveFormat'] = $webhooksOnMessageRemoveFormat; $this->options['webhooksOnChannelAddUrl'] = $webhooksOnChannelAddUrl; $this->options['webhooksOnChannelAddMethod'] = $webhooksOnChannelAddMethod; $this->options['webhooksOnChannelAddFormat'] = $webhooksOnChannelAddFormat; $this->options['webhooksOnChannelDestroyUrl'] = $webhooksOnChannelDestroyUrl; $this->options['webhooksOnChannelDestroyMethod'] = $webhooksOnChannelDestroyMethod; $this->options['webhooksOnChannelDestroyFormat'] = $webhooksOnChannelDestroyFormat; $this->options['webhooksOnChannelUpdateUrl'] = $webhooksOnChannelUpdateUrl; $this->options['webhooksOnChannelUpdateMethod'] = $webhooksOnChannelUpdateMethod; $this->options['webhooksOnChannelUpdateFormat'] = $webhooksOnChannelUpdateFormat; $this->options['webhooksOnMemberAddUrl'] = $webhooksOnMemberAddUrl; $this->options['webhooksOnMemberAddMethod'] = $webhooksOnMemberAddMethod; $this->options['webhooksOnMemberAddFormat'] = $webhooksOnMemberAddFormat; $this->options['webhooksOnMemberRemoveUrl'] = $webhooksOnMemberRemoveUrl; $this->options['webhooksOnMemberRemoveMethod'] = $webhooksOnMemberRemoveMethod; $this->options['webhooksOnMemberRemoveFormat'] = $webhooksOnMemberRemoveFormat; $this->options['webhooksOnMessageSentUrl'] = $webhooksOnMessageSentUrl; $this->options['webhooksOnMessageSentMethod'] = $webhooksOnMessageSentMethod; $this->options['webhooksOnMessageSentFormat'] = $webhooksOnMessageSentFormat; $this->options['webhooksOnMessageUpdatedUrl'] = $webhooksOnMessageUpdatedUrl; $this->options['webhooksOnMessageUpdatedMethod'] = $webhooksOnMessageUpdatedMethod; $this->options['webhooksOnMessageUpdatedFormat'] = $webhooksOnMessageUpdatedFormat; $this->options['webhooksOnMessageRemovedUrl'] = $webhooksOnMessageRemovedUrl; $this->options['webhooksOnMessageRemovedMethod'] = $webhooksOnMessageRemovedMethod; $this->options['webhooksOnMessageRemovedFormat'] = $webhooksOnMessageRemovedFormat; $this->options['webhooksOnChannelAddedUrl'] = $webhooksOnChannelAddedUrl; $this->options['webhooksOnChannelAddedMethod'] = $webhooksOnChannelAddedMethod; $this->options['webhooksOnChannelAddedFormat'] = $webhooksOnChannelAddedFormat; $this->options['webhooksOnChannelDestroyedUrl'] = $webhooksOnChannelDestroyedUrl; $this->options['webhooksOnChannelDestroyedMethod'] = $webhooksOnChannelDestroyedMethod; $this->options['webhooksOnChannelDestroyedFormat'] = $webhooksOnChannelDestroyedFormat; $this->options['webhooksOnChannelUpdatedUrl'] = $webhooksOnChannelUpdatedUrl; $this->options['webhooksOnChannelUpdatedMethod'] = $webhooksOnChannelUpdatedMethod; $this->options['webhooksOnChannelUpdatedFormat'] = $webhooksOnChannelUpdatedFormat; $this->options['webhooksOnMemberAddedUrl'] = $webhooksOnMemberAddedUrl; $this->options['webhooksOnMemberAddedMethod'] = $webhooksOnMemberAddedMethod; $this->options['webhooksOnMemberAddedFormat'] = $webhooksOnMemberAddedFormat; $this->options['webhooksOnMemberRemovedUrl'] = $webhooksOnMemberRemovedUrl; $this->options['webhooksOnMemberRemovedMethod'] = $webhooksOnMemberRemovedMethod; $this->options['webhooksOnMemberRemovedFormat'] = $webhooksOnMemberRemovedFormat; $this->options['limitsChannelMembers'] = $limitsChannelMembers; $this->options['limitsUserChannels'] = $limitsUserChannels; } /** * The friendly_name * * @param string $friendlyName The friendly_name * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The default_service_role_sid * * @param string $defaultServiceRoleSid The default_service_role_sid * @return $this Fluent Builder */ public function setDefaultServiceRoleSid($defaultServiceRoleSid) { $this->options['defaultServiceRoleSid'] = $defaultServiceRoleSid; return $this; } /** * The default_channel_role_sid * * @param string $defaultChannelRoleSid The default_channel_role_sid * @return $this Fluent Builder */ public function setDefaultChannelRoleSid($defaultChannelRoleSid) { $this->options['defaultChannelRoleSid'] = $defaultChannelRoleSid; return $this; } /** * The default_channel_creator_role_sid * * @param string $defaultChannelCreatorRoleSid The * default_channel_creator_role_sid * @return $this Fluent Builder */ public function setDefaultChannelCreatorRoleSid($defaultChannelCreatorRoleSid) { $this->options['defaultChannelCreatorRoleSid'] = $defaultChannelCreatorRoleSid; return $this; } /** * The read_status_enabled * * @param boolean $readStatusEnabled The read_status_enabled * @return $this Fluent Builder */ public function setReadStatusEnabled($readStatusEnabled) { $this->options['readStatusEnabled'] = $readStatusEnabled; return $this; } /** * The reachability_enabled * * @param boolean $reachabilityEnabled The reachability_enabled * @return $this Fluent Builder */ public function setReachabilityEnabled($reachabilityEnabled) { $this->options['reachabilityEnabled'] = $reachabilityEnabled; return $this; } /** * The typing_indicator_timeout * * @param integer $typingIndicatorTimeout The typing_indicator_timeout * @return $this Fluent Builder */ public function setTypingIndicatorTimeout($typingIndicatorTimeout) { $this->options['typingIndicatorTimeout'] = $typingIndicatorTimeout; return $this; } /** * The consumption_report_interval * * @param integer $consumptionReportInterval The consumption_report_interval * @return $this Fluent Builder */ public function setConsumptionReportInterval($consumptionReportInterval) { $this->options['consumptionReportInterval'] = $consumptionReportInterval; return $this; } /** * The notifications.new_message.enabled * * @param boolean $notificationsNewMessageEnabled The * notifications.new_message.enabled * @return $this Fluent Builder */ public function setNotificationsNewMessageEnabled($notificationsNewMessageEnabled) { $this->options['notificationsNewMessageEnabled'] = $notificationsNewMessageEnabled; return $this; } /** * The notifications.new_message.template * * @param string $notificationsNewMessageTemplate The * notifications.new_message.template * @return $this Fluent Builder */ public function setNotificationsNewMessageTemplate($notificationsNewMessageTemplate) { $this->options['notificationsNewMessageTemplate'] = $notificationsNewMessageTemplate; return $this; } /** * The notifications.added_to_channel.enabled * * @param boolean $notificationsAddedToChannelEnabled The * notifications.added_to_channel.enabled * @return $this Fluent Builder */ public function setNotificationsAddedToChannelEnabled($notificationsAddedToChannelEnabled) { $this->options['notificationsAddedToChannelEnabled'] = $notificationsAddedToChannelEnabled; return $this; } /** * The notifications.added_to_channel.template * * @param string $notificationsAddedToChannelTemplate The * notifications.added_to_channel.template * @return $this Fluent Builder */ public function setNotificationsAddedToChannelTemplate($notificationsAddedToChannelTemplate) { $this->options['notificationsAddedToChannelTemplate'] = $notificationsAddedToChannelTemplate; return $this; } /** * The notifications.removed_from_channel.enabled * * @param boolean $notificationsRemovedFromChannelEnabled The * notifications.removed_from_channel.enabled * @return $this Fluent Builder */ public function setNotificationsRemovedFromChannelEnabled($notificationsRemovedFromChannelEnabled) { $this->options['notificationsRemovedFromChannelEnabled'] = $notificationsRemovedFromChannelEnabled; return $this; } /** * The notifications.removed_from_channel.template * * @param string $notificationsRemovedFromChannelTemplate The * notifications.removed_from_channel.template * @return $this Fluent Builder */ public function setNotificationsRemovedFromChannelTemplate($notificationsRemovedFromChannelTemplate) { $this->options['notificationsRemovedFromChannelTemplate'] = $notificationsRemovedFromChannelTemplate; return $this; } /** * The notifications.invited_to_channel.enabled * * @param boolean $notificationsInvitedToChannelEnabled The * notifications.invited_to_channel.enabled * @return $this Fluent Builder */ public function setNotificationsInvitedToChannelEnabled($notificationsInvitedToChannelEnabled) { $this->options['notificationsInvitedToChannelEnabled'] = $notificationsInvitedToChannelEnabled; return $this; } /** * The notifications.invited_to_channel.template * * @param string $notificationsInvitedToChannelTemplate The * notifications.invited_to_channel.template * @return $this Fluent Builder */ public function setNotificationsInvitedToChannelTemplate($notificationsInvitedToChannelTemplate) { $this->options['notificationsInvitedToChannelTemplate'] = $notificationsInvitedToChannelTemplate; return $this; } /** * The pre_webhook_url * * @param string $preWebhookUrl The pre_webhook_url * @return $this Fluent Builder */ public function setPreWebhookUrl($preWebhookUrl) { $this->options['preWebhookUrl'] = $preWebhookUrl; return $this; } /** * The post_webhook_url * * @param string $postWebhookUrl The post_webhook_url * @return $this Fluent Builder */ public function setPostWebhookUrl($postWebhookUrl) { $this->options['postWebhookUrl'] = $postWebhookUrl; 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 webhook_filters * * @param string $webhookFilters The webhook_filters * @return $this Fluent Builder */ public function setWebhookFilters($webhookFilters) { $this->options['webhookFilters'] = $webhookFilters; return $this; } /** * The webhooks.on_message_send.url * * @param string $webhooksOnMessageSendUrl The webhooks.on_message_send.url * @return $this Fluent Builder */ public function setWebhooksOnMessageSendUrl($webhooksOnMessageSendUrl) { $this->options['webhooksOnMessageSendUrl'] = $webhooksOnMessageSendUrl; return $this; } /** * The webhooks.on_message_send.method * * @param string $webhooksOnMessageSendMethod The * webhooks.on_message_send.method * @return $this Fluent Builder */ public function setWebhooksOnMessageSendMethod($webhooksOnMessageSendMethod) { $this->options['webhooksOnMessageSendMethod'] = $webhooksOnMessageSendMethod; return $this; } /** * The webhooks.on_message_send.format * * @param string $webhooksOnMessageSendFormat The * webhooks.on_message_send.format * @return $this Fluent Builder */ public function setWebhooksOnMessageSendFormat($webhooksOnMessageSendFormat) { $this->options['webhooksOnMessageSendFormat'] = $webhooksOnMessageSendFormat; return $this; } /** * The webhooks.on_message_update.url * * @param string $webhooksOnMessageUpdateUrl The webhooks.on_message_update.url * @return $this Fluent Builder */ public function setWebhooksOnMessageUpdateUrl($webhooksOnMessageUpdateUrl) { $this->options['webhooksOnMessageUpdateUrl'] = $webhooksOnMessageUpdateUrl; return $this; } /** * The webhooks.on_message_update.method * * @param string $webhooksOnMessageUpdateMethod The * webhooks.on_message_update.method * @return $this Fluent Builder */ public function setWebhooksOnMessageUpdateMethod($webhooksOnMessageUpdateMethod) { $this->options['webhooksOnMessageUpdateMethod'] = $webhooksOnMessageUpdateMethod; return $this; } /** * The webhooks.on_message_update.format * * @param string $webhooksOnMessageUpdateFormat The * webhooks.on_message_update.format * @return $this Fluent Builder */ public function setWebhooksOnMessageUpdateFormat($webhooksOnMessageUpdateFormat) { $this->options['webhooksOnMessageUpdateFormat'] = $webhooksOnMessageUpdateFormat; return $this; } /** * The webhooks.on_message_remove.url * * @param string $webhooksOnMessageRemoveUrl The webhooks.on_message_remove.url * @return $this Fluent Builder */ public function setWebhooksOnMessageRemoveUrl($webhooksOnMessageRemoveUrl) { $this->options['webhooksOnMessageRemoveUrl'] = $webhooksOnMessageRemoveUrl; return $this; } /** * The webhooks.on_message_remove.method * * @param string $webhooksOnMessageRemoveMethod The * webhooks.on_message_remove.method * @return $this Fluent Builder */ public function setWebhooksOnMessageRemoveMethod($webhooksOnMessageRemoveMethod) { $this->options['webhooksOnMessageRemoveMethod'] = $webhooksOnMessageRemoveMethod; return $this; } /** * The webhooks.on_message_remove.format * * @param string $webhooksOnMessageRemoveFormat The * webhooks.on_message_remove.format * @return $this Fluent Builder */ public function setWebhooksOnMessageRemoveFormat($webhooksOnMessageRemoveFormat) { $this->options['webhooksOnMessageRemoveFormat'] = $webhooksOnMessageRemoveFormat; return $this; } /** * The webhooks.on_channel_add.url * * @param string $webhooksOnChannelAddUrl The webhooks.on_channel_add.url * @return $this Fluent Builder */ public function setWebhooksOnChannelAddUrl($webhooksOnChannelAddUrl) { $this->options['webhooksOnChannelAddUrl'] = $webhooksOnChannelAddUrl; return $this; } /** * The webhooks.on_channel_add.method * * @param string $webhooksOnChannelAddMethod The webhooks.on_channel_add.method * @return $this Fluent Builder */ public function setWebhooksOnChannelAddMethod($webhooksOnChannelAddMethod) { $this->options['webhooksOnChannelAddMethod'] = $webhooksOnChannelAddMethod; return $this; } /** * The webhooks.on_channel_add.format * * @param string $webhooksOnChannelAddFormat The webhooks.on_channel_add.format * @return $this Fluent Builder */ public function setWebhooksOnChannelAddFormat($webhooksOnChannelAddFormat) { $this->options['webhooksOnChannelAddFormat'] = $webhooksOnChannelAddFormat; return $this; } /** * The webhooks.on_channel_destroy.url * * @param string $webhooksOnChannelDestroyUrl The * webhooks.on_channel_destroy.url * @return $this Fluent Builder */ public function setWebhooksOnChannelDestroyUrl($webhooksOnChannelDestroyUrl) { $this->options['webhooksOnChannelDestroyUrl'] = $webhooksOnChannelDestroyUrl; return $this; } /** * The webhooks.on_channel_destroy.method * * @param string $webhooksOnChannelDestroyMethod The * webhooks.on_channel_destroy.method * @return $this Fluent Builder */ public function setWebhooksOnChannelDestroyMethod($webhooksOnChannelDestroyMethod) { $this->options['webhooksOnChannelDestroyMethod'] = $webhooksOnChannelDestroyMethod; return $this; } /** * The webhooks.on_channel_destroy.format * * @param string $webhooksOnChannelDestroyFormat The * webhooks.on_channel_destroy.format * @return $this Fluent Builder */ public function setWebhooksOnChannelDestroyFormat($webhooksOnChannelDestroyFormat) { $this->options['webhooksOnChannelDestroyFormat'] = $webhooksOnChannelDestroyFormat; return $this; } /** * The webhooks.on_channel_update.url * * @param string $webhooksOnChannelUpdateUrl The webhooks.on_channel_update.url * @return $this Fluent Builder */ public function setWebhooksOnChannelUpdateUrl($webhooksOnChannelUpdateUrl) { $this->options['webhooksOnChannelUpdateUrl'] = $webhooksOnChannelUpdateUrl; return $this; } /** * The webhooks.on_channel_update.method * * @param string $webhooksOnChannelUpdateMethod The * webhooks.on_channel_update.method * @return $this Fluent Builder */ public function setWebhooksOnChannelUpdateMethod($webhooksOnChannelUpdateMethod) { $this->options['webhooksOnChannelUpdateMethod'] = $webhooksOnChannelUpdateMethod; return $this; } /** * The webhooks.on_channel_update.format * * @param string $webhooksOnChannelUpdateFormat The * webhooks.on_channel_update.format * @return $this Fluent Builder */ public function setWebhooksOnChannelUpdateFormat($webhooksOnChannelUpdateFormat) { $this->options['webhooksOnChannelUpdateFormat'] = $webhooksOnChannelUpdateFormat; return $this; } /** * The webhooks.on_member_add.url * * @param string $webhooksOnMemberAddUrl The webhooks.on_member_add.url * @return $this Fluent Builder */ public function setWebhooksOnMemberAddUrl($webhooksOnMemberAddUrl) { $this->options['webhooksOnMemberAddUrl'] = $webhooksOnMemberAddUrl; return $this; } /** * The webhooks.on_member_add.method * * @param string $webhooksOnMemberAddMethod The webhooks.on_member_add.method * @return $this Fluent Builder */ public function setWebhooksOnMemberAddMethod($webhooksOnMemberAddMethod) { $this->options['webhooksOnMemberAddMethod'] = $webhooksOnMemberAddMethod; return $this; } /** * The webhooks.on_member_add.format * * @param string $webhooksOnMemberAddFormat The webhooks.on_member_add.format * @return $this Fluent Builder */ public function setWebhooksOnMemberAddFormat($webhooksOnMemberAddFormat) { $this->options['webhooksOnMemberAddFormat'] = $webhooksOnMemberAddFormat; return $this; } /** * The webhooks.on_member_remove.url * * @param string $webhooksOnMemberRemoveUrl The webhooks.on_member_remove.url * @return $this Fluent Builder */ public function setWebhooksOnMemberRemoveUrl($webhooksOnMemberRemoveUrl) { $this->options['webhooksOnMemberRemoveUrl'] = $webhooksOnMemberRemoveUrl; return $this; } /** * The webhooks.on_member_remove.method * * @param string $webhooksOnMemberRemoveMethod The * webhooks.on_member_remove.method * @return $this Fluent Builder */ public function setWebhooksOnMemberRemoveMethod($webhooksOnMemberRemoveMethod) { $this->options['webhooksOnMemberRemoveMethod'] = $webhooksOnMemberRemoveMethod; return $this; } /** * The webhooks.on_member_remove.format * * @param string $webhooksOnMemberRemoveFormat The * webhooks.on_member_remove.format * @return $this Fluent Builder */ public function setWebhooksOnMemberRemoveFormat($webhooksOnMemberRemoveFormat) { $this->options['webhooksOnMemberRemoveFormat'] = $webhooksOnMemberRemoveFormat; return $this; } /** * The webhooks.on_message_sent.url * * @param string $webhooksOnMessageSentUrl The webhooks.on_message_sent.url * @return $this Fluent Builder */ public function setWebhooksOnMessageSentUrl($webhooksOnMessageSentUrl) { $this->options['webhooksOnMessageSentUrl'] = $webhooksOnMessageSentUrl; return $this; } /** * The webhooks.on_message_sent.method * * @param string $webhooksOnMessageSentMethod The * webhooks.on_message_sent.method * @return $this Fluent Builder */ public function setWebhooksOnMessageSentMethod($webhooksOnMessageSentMethod) { $this->options['webhooksOnMessageSentMethod'] = $webhooksOnMessageSentMethod; return $this; } /** * The webhooks.on_message_sent.format * * @param string $webhooksOnMessageSentFormat The * webhooks.on_message_sent.format * @return $this Fluent Builder */ public function setWebhooksOnMessageSentFormat($webhooksOnMessageSentFormat) { $this->options['webhooksOnMessageSentFormat'] = $webhooksOnMessageSentFormat; return $this; } /** * The webhooks.on_message_updated.url * * @param string $webhooksOnMessageUpdatedUrl The * webhooks.on_message_updated.url * @return $this Fluent Builder */ public function setWebhooksOnMessageUpdatedUrl($webhooksOnMessageUpdatedUrl) { $this->options['webhooksOnMessageUpdatedUrl'] = $webhooksOnMessageUpdatedUrl; return $this; } /** * The webhooks.on_message_updated.method * * @param string $webhooksOnMessageUpdatedMethod The * webhooks.on_message_updated.method * @return $this Fluent Builder */ public function setWebhooksOnMessageUpdatedMethod($webhooksOnMessageUpdatedMethod) { $this->options['webhooksOnMessageUpdatedMethod'] = $webhooksOnMessageUpdatedMethod; return $this; } /** * The webhooks.on_message_updated.format * * @param string $webhooksOnMessageUpdatedFormat The * webhooks.on_message_updated.format * @return $this Fluent Builder */ public function setWebhooksOnMessageUpdatedFormat($webhooksOnMessageUpdatedFormat) { $this->options['webhooksOnMessageUpdatedFormat'] = $webhooksOnMessageUpdatedFormat; return $this; } /** * The webhooks.on_message_removed.url * * @param string $webhooksOnMessageRemovedUrl The * webhooks.on_message_removed.url * @return $this Fluent Builder */ public function setWebhooksOnMessageRemovedUrl($webhooksOnMessageRemovedUrl) { $this->options['webhooksOnMessageRemovedUrl'] = $webhooksOnMessageRemovedUrl; return $this; } /** * The webhooks.on_message_removed.method * * @param string $webhooksOnMessageRemovedMethod The * webhooks.on_message_removed.method * @return $this Fluent Builder */ public function setWebhooksOnMessageRemovedMethod($webhooksOnMessageRemovedMethod) { $this->options['webhooksOnMessageRemovedMethod'] = $webhooksOnMessageRemovedMethod; return $this; } /** * The webhooks.on_message_removed.format * * @param string $webhooksOnMessageRemovedFormat The * webhooks.on_message_removed.format * @return $this Fluent Builder */ public function setWebhooksOnMessageRemovedFormat($webhooksOnMessageRemovedFormat) { $this->options['webhooksOnMessageRemovedFormat'] = $webhooksOnMessageRemovedFormat; return $this; } /** * The webhooks.on_channel_added.url * * @param string $webhooksOnChannelAddedUrl The webhooks.on_channel_added.url * @return $this Fluent Builder */ public function setWebhooksOnChannelAddedUrl($webhooksOnChannelAddedUrl) { $this->options['webhooksOnChannelAddedUrl'] = $webhooksOnChannelAddedUrl; return $this; } /** * The webhooks.on_channel_added.method * * @param string $webhooksOnChannelAddedMethod The * webhooks.on_channel_added.method * @return $this Fluent Builder */ public function setWebhooksOnChannelAddedMethod($webhooksOnChannelAddedMethod) { $this->options['webhooksOnChannelAddedMethod'] = $webhooksOnChannelAddedMethod; return $this; } /** * The webhooks.on_channel_added.format * * @param string $webhooksOnChannelAddedFormat The * webhooks.on_channel_added.format * @return $this Fluent Builder */ public function setWebhooksOnChannelAddedFormat($webhooksOnChannelAddedFormat) { $this->options['webhooksOnChannelAddedFormat'] = $webhooksOnChannelAddedFormat; return $this; } /** * The webhooks.on_channel_destroyed.url * * @param string $webhooksOnChannelDestroyedUrl The * webhooks.on_channel_destroyed.url * @return $this Fluent Builder */ public function setWebhooksOnChannelDestroyedUrl($webhooksOnChannelDestroyedUrl) { $this->options['webhooksOnChannelDestroyedUrl'] = $webhooksOnChannelDestroyedUrl; return $this; } /** * The webhooks.on_channel_destroyed.method * * @param string $webhooksOnChannelDestroyedMethod The * webhooks.on_channel_destroyed.method * @return $this Fluent Builder */ public function setWebhooksOnChannelDestroyedMethod($webhooksOnChannelDestroyedMethod) { $this->options['webhooksOnChannelDestroyedMethod'] = $webhooksOnChannelDestroyedMethod; return $this; } /** * The webhooks.on_channel_destroyed.format * * @param string $webhooksOnChannelDestroyedFormat The * webhooks.on_channel_destroyed.format * @return $this Fluent Builder */ public function setWebhooksOnChannelDestroyedFormat($webhooksOnChannelDestroyedFormat) { $this->options['webhooksOnChannelDestroyedFormat'] = $webhooksOnChannelDestroyedFormat; return $this; } /** * The webhooks.on_channel_updated.url * * @param string $webhooksOnChannelUpdatedUrl The * webhooks.on_channel_updated.url * @return $this Fluent Builder */ public function setWebhooksOnChannelUpdatedUrl($webhooksOnChannelUpdatedUrl) { $this->options['webhooksOnChannelUpdatedUrl'] = $webhooksOnChannelUpdatedUrl; return $this; } /** * The webhooks.on_channel_updated.method * * @param string $webhooksOnChannelUpdatedMethod The * webhooks.on_channel_updated.method * @return $this Fluent Builder */ public function setWebhooksOnChannelUpdatedMethod($webhooksOnChannelUpdatedMethod) { $this->options['webhooksOnChannelUpdatedMethod'] = $webhooksOnChannelUpdatedMethod; return $this; } /** * The webhooks.on_channel_updated.format * * @param string $webhooksOnChannelUpdatedFormat The * webhooks.on_channel_updated.format * @return $this Fluent Builder */ public function setWebhooksOnChannelUpdatedFormat($webhooksOnChannelUpdatedFormat) { $this->options['webhooksOnChannelUpdatedFormat'] = $webhooksOnChannelUpdatedFormat; return $this; } /** * The webhooks.on_member_added.url * * @param string $webhooksOnMemberAddedUrl The webhooks.on_member_added.url * @return $this Fluent Builder */ public function setWebhooksOnMemberAddedUrl($webhooksOnMemberAddedUrl) { $this->options['webhooksOnMemberAddedUrl'] = $webhooksOnMemberAddedUrl; return $this; } /** * The webhooks.on_member_added.method * * @param string $webhooksOnMemberAddedMethod The * webhooks.on_member_added.method * @return $this Fluent Builder */ public function setWebhooksOnMemberAddedMethod($webhooksOnMemberAddedMethod) { $this->options['webhooksOnMemberAddedMethod'] = $webhooksOnMemberAddedMethod; return $this; } /** * The webhooks.on_member_added.format * * @param string $webhooksOnMemberAddedFormat The * webhooks.on_member_added.format * @return $this Fluent Builder */ public function setWebhooksOnMemberAddedFormat($webhooksOnMemberAddedFormat) { $this->options['webhooksOnMemberAddedFormat'] = $webhooksOnMemberAddedFormat; return $this; } /** * The webhooks.on_member_removed.url * * @param string $webhooksOnMemberRemovedUrl The webhooks.on_member_removed.url * @return $this Fluent Builder */ public function setWebhooksOnMemberRemovedUrl($webhooksOnMemberRemovedUrl) { $this->options['webhooksOnMemberRemovedUrl'] = $webhooksOnMemberRemovedUrl; return $this; } /** * The webhooks.on_member_removed.method * * @param string $webhooksOnMemberRemovedMethod The * webhooks.on_member_removed.method * @return $this Fluent Builder */ public function setWebhooksOnMemberRemovedMethod($webhooksOnMemberRemovedMethod) { $this->options['webhooksOnMemberRemovedMethod'] = $webhooksOnMemberRemovedMethod; return $this; } /** * The webhooks.on_member_removed.format * * @param string $webhooksOnMemberRemovedFormat The * webhooks.on_member_removed.format * @return $this Fluent Builder */ public function setWebhooksOnMemberRemovedFormat($webhooksOnMemberRemovedFormat) { $this->options['webhooksOnMemberRemovedFormat'] = $webhooksOnMemberRemovedFormat; return $this; } /** * The limits.channel_members * * @param integer $limitsChannelMembers The limits.channel_members * @return $this Fluent Builder */ public function setLimitsChannelMembers($limitsChannelMembers) { $this->options['limitsChannelMembers'] = $limitsChannelMembers; return $this; } /** * The limits.user_channels * * @param integer $limitsUserChannels The limits.user_channels * @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/Twilio/Rest/Chat/V1/ServiceContext.php 0000604 00000026021 15174325130 0014332 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 sid * @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 */ 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 */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Update the ServiceInstance * * @param array|Options $options Optional Arguments * @return ServiceInstance Updated ServiceInstance */ 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.OnMessageSend.Format' => $options['webhooksOnMessageSendFormat'], 'Webhooks.OnMessageUpdate.Url' => $options['webhooksOnMessageUpdateUrl'], 'Webhooks.OnMessageUpdate.Method' => $options['webhooksOnMessageUpdateMethod'], 'Webhooks.OnMessageUpdate.Format' => $options['webhooksOnMessageUpdateFormat'], 'Webhooks.OnMessageRemove.Url' => $options['webhooksOnMessageRemoveUrl'], 'Webhooks.OnMessageRemove.Method' => $options['webhooksOnMessageRemoveMethod'], 'Webhooks.OnMessageRemove.Format' => $options['webhooksOnMessageRemoveFormat'], 'Webhooks.OnChannelAdd.Url' => $options['webhooksOnChannelAddUrl'], 'Webhooks.OnChannelAdd.Method' => $options['webhooksOnChannelAddMethod'], 'Webhooks.OnChannelAdd.Format' => $options['webhooksOnChannelAddFormat'], 'Webhooks.OnChannelDestroy.Url' => $options['webhooksOnChannelDestroyUrl'], 'Webhooks.OnChannelDestroy.Method' => $options['webhooksOnChannelDestroyMethod'], 'Webhooks.OnChannelDestroy.Format' => $options['webhooksOnChannelDestroyFormat'], 'Webhooks.OnChannelUpdate.Url' => $options['webhooksOnChannelUpdateUrl'], 'Webhooks.OnChannelUpdate.Method' => $options['webhooksOnChannelUpdateMethod'], 'Webhooks.OnChannelUpdate.Format' => $options['webhooksOnChannelUpdateFormat'], 'Webhooks.OnMemberAdd.Url' => $options['webhooksOnMemberAddUrl'], 'Webhooks.OnMemberAdd.Method' => $options['webhooksOnMemberAddMethod'], 'Webhooks.OnMemberAdd.Format' => $options['webhooksOnMemberAddFormat'], 'Webhooks.OnMemberRemove.Url' => $options['webhooksOnMemberRemoveUrl'], 'Webhooks.OnMemberRemove.Method' => $options['webhooksOnMemberRemoveMethod'], 'Webhooks.OnMemberRemove.Format' => $options['webhooksOnMemberRemoveFormat'], 'Webhooks.OnMessageSent.Url' => $options['webhooksOnMessageSentUrl'], 'Webhooks.OnMessageSent.Method' => $options['webhooksOnMessageSentMethod'], 'Webhooks.OnMessageSent.Format' => $options['webhooksOnMessageSentFormat'], 'Webhooks.OnMessageUpdated.Url' => $options['webhooksOnMessageUpdatedUrl'], 'Webhooks.OnMessageUpdated.Method' => $options['webhooksOnMessageUpdatedMethod'], 'Webhooks.OnMessageUpdated.Format' => $options['webhooksOnMessageUpdatedFormat'], 'Webhooks.OnMessageRemoved.Url' => $options['webhooksOnMessageRemovedUrl'], 'Webhooks.OnMessageRemoved.Method' => $options['webhooksOnMessageRemovedMethod'], 'Webhooks.OnMessageRemoved.Format' => $options['webhooksOnMessageRemovedFormat'], 'Webhooks.OnChannelAdded.Url' => $options['webhooksOnChannelAddedUrl'], 'Webhooks.OnChannelAdded.Method' => $options['webhooksOnChannelAddedMethod'], 'Webhooks.OnChannelAdded.Format' => $options['webhooksOnChannelAddedFormat'], 'Webhooks.OnChannelDestroyed.Url' => $options['webhooksOnChannelDestroyedUrl'], 'Webhooks.OnChannelDestroyed.Method' => $options['webhooksOnChannelDestroyedMethod'], 'Webhooks.OnChannelDestroyed.Format' => $options['webhooksOnChannelDestroyedFormat'], 'Webhooks.OnChannelUpdated.Url' => $options['webhooksOnChannelUpdatedUrl'], 'Webhooks.OnChannelUpdated.Method' => $options['webhooksOnChannelUpdatedMethod'], 'Webhooks.OnChannelUpdated.Format' => $options['webhooksOnChannelUpdatedFormat'], 'Webhooks.OnMemberAdded.Url' => $options['webhooksOnMemberAddedUrl'], 'Webhooks.OnMemberAdded.Method' => $options['webhooksOnMemberAddedMethod'], 'Webhooks.OnMemberAdded.Format' => $options['webhooksOnMemberAddedFormat'], 'Webhooks.OnMemberRemoved.Url' => $options['webhooksOnMemberRemovedUrl'], 'Webhooks.OnMemberRemoved.Method' => $options['webhooksOnMemberRemovedMethod'], 'Webhooks.OnMemberRemoved.Format' => $options['webhooksOnMemberRemovedFormat'], '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 \Twilio\Exceptions\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 \Twilio\Exceptions\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/Twilio/Rest/Chat/V1.php 0000604 00000005341 15174325130 0011367 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 \Twilio\Exceptions\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 \Twilio\Exceptions\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/Twilio/Rest/Notify/V1/ServiceOptions.php 0000604 00000051024 15174325130 0014733 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 The friendly_name * @param string $apnCredentialSid The apn_credential_sid * @param string $gcmCredentialSid The gcm_credential_sid * @param string $messagingServiceSid The messaging_service_sid * @param string $facebookMessengerPageId The facebook_messenger_page_id * @param string $defaultApnNotificationProtocolVersion The * default_apn_notification_protocol_version * @param string $defaultGcmNotificationProtocolVersion The * default_gcm_notification_protocol_version * @param string $fcmCredentialSid The fcm_credential_sid * @param string $defaultFcmNotificationProtocolVersion The * default_fcm_notification_protocol_version * @param boolean $logEnabled The log_enabled * @param string $alexaSkillId The alexa_skill_id * @param string $defaultAlexaNotificationProtocolVersion The * default_alexa_notification_protocol_version * @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 friendly_name * @return ReadServiceOptions Options builder */ public static function read($friendlyName = Values::NONE) { return new ReadServiceOptions($friendlyName); } /** * @param string $friendlyName The friendly_name * @param string $apnCredentialSid The apn_credential_sid * @param string $gcmCredentialSid The gcm_credential_sid * @param string $messagingServiceSid The messaging_service_sid * @param string $facebookMessengerPageId The facebook_messenger_page_id * @param string $defaultApnNotificationProtocolVersion The * default_apn_notification_protocol_version * @param string $defaultGcmNotificationProtocolVersion The * default_gcm_notification_protocol_version * @param string $fcmCredentialSid The fcm_credential_sid * @param string $defaultFcmNotificationProtocolVersion The * default_fcm_notification_protocol_version * @param boolean $logEnabled The log_enabled * @param string $alexaSkillId The alexa_skill_id * @param string $defaultAlexaNotificationProtocolVersion The * default_alexa_notification_protocol_version * @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) { return new UpdateServiceOptions($friendlyName, $apnCredentialSid, $gcmCredentialSid, $messagingServiceSid, $facebookMessengerPageId, $defaultApnNotificationProtocolVersion, $defaultGcmNotificationProtocolVersion, $fcmCredentialSid, $defaultFcmNotificationProtocolVersion, $logEnabled, $alexaSkillId, $defaultAlexaNotificationProtocolVersion); } } class CreateServiceOptions extends Options { /** * @param string $friendlyName The friendly_name * @param string $apnCredentialSid The apn_credential_sid * @param string $gcmCredentialSid The gcm_credential_sid * @param string $messagingServiceSid The messaging_service_sid * @param string $facebookMessengerPageId The facebook_messenger_page_id * @param string $defaultApnNotificationProtocolVersion The * default_apn_notification_protocol_version * @param string $defaultGcmNotificationProtocolVersion The * default_gcm_notification_protocol_version * @param string $fcmCredentialSid The fcm_credential_sid * @param string $defaultFcmNotificationProtocolVersion The * default_fcm_notification_protocol_version * @param boolean $logEnabled The log_enabled * @param string $alexaSkillId The alexa_skill_id * @param string $defaultAlexaNotificationProtocolVersion The * default_alexa_notification_protocol_version */ 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; } /** * The friendly_name * * @param string $friendlyName The friendly_name * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The apn_credential_sid * * @param string $apnCredentialSid The apn_credential_sid * @return $this Fluent Builder */ public function setApnCredentialSid($apnCredentialSid) { $this->options['apnCredentialSid'] = $apnCredentialSid; return $this; } /** * The gcm_credential_sid * * @param string $gcmCredentialSid The gcm_credential_sid * @return $this Fluent Builder */ public function setGcmCredentialSid($gcmCredentialSid) { $this->options['gcmCredentialSid'] = $gcmCredentialSid; return $this; } /** * The messaging_service_sid * * @param string $messagingServiceSid The messaging_service_sid * @return $this Fluent Builder */ public function setMessagingServiceSid($messagingServiceSid) { $this->options['messagingServiceSid'] = $messagingServiceSid; return $this; } /** * The facebook_messenger_page_id * * @param string $facebookMessengerPageId The facebook_messenger_page_id * @return $this Fluent Builder */ public function setFacebookMessengerPageId($facebookMessengerPageId) { $this->options['facebookMessengerPageId'] = $facebookMessengerPageId; return $this; } /** * The default_apn_notification_protocol_version * * @param string $defaultApnNotificationProtocolVersion The * default_apn_notification_protocol_version * @return $this Fluent Builder */ public function setDefaultApnNotificationProtocolVersion($defaultApnNotificationProtocolVersion) { $this->options['defaultApnNotificationProtocolVersion'] = $defaultApnNotificationProtocolVersion; return $this; } /** * The default_gcm_notification_protocol_version * * @param string $defaultGcmNotificationProtocolVersion The * default_gcm_notification_protocol_version * @return $this Fluent Builder */ public function setDefaultGcmNotificationProtocolVersion($defaultGcmNotificationProtocolVersion) { $this->options['defaultGcmNotificationProtocolVersion'] = $defaultGcmNotificationProtocolVersion; return $this; } /** * The fcm_credential_sid * * @param string $fcmCredentialSid The fcm_credential_sid * @return $this Fluent Builder */ public function setFcmCredentialSid($fcmCredentialSid) { $this->options['fcmCredentialSid'] = $fcmCredentialSid; return $this; } /** * The default_fcm_notification_protocol_version * * @param string $defaultFcmNotificationProtocolVersion The * default_fcm_notification_protocol_version * @return $this Fluent Builder */ public function setDefaultFcmNotificationProtocolVersion($defaultFcmNotificationProtocolVersion) { $this->options['defaultFcmNotificationProtocolVersion'] = $defaultFcmNotificationProtocolVersion; return $this; } /** * The log_enabled * * @param boolean $logEnabled The log_enabled * @return $this Fluent Builder */ public function setLogEnabled($logEnabled) { $this->options['logEnabled'] = $logEnabled; return $this; } /** * The alexa_skill_id * * @param string $alexaSkillId The alexa_skill_id * @return $this Fluent Builder */ public function setAlexaSkillId($alexaSkillId) { $this->options['alexaSkillId'] = $alexaSkillId; return $this; } /** * The default_alexa_notification_protocol_version * * @param string $defaultAlexaNotificationProtocolVersion The * default_alexa_notification_protocol_version * @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 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.Notify.V1.ReadServiceOptions ' . implode(' ', $options) . ']'; } } class UpdateServiceOptions extends Options { /** * @param string $friendlyName The friendly_name * @param string $apnCredentialSid The apn_credential_sid * @param string $gcmCredentialSid The gcm_credential_sid * @param string $messagingServiceSid The messaging_service_sid * @param string $facebookMessengerPageId The facebook_messenger_page_id * @param string $defaultApnNotificationProtocolVersion The * default_apn_notification_protocol_version * @param string $defaultGcmNotificationProtocolVersion The * default_gcm_notification_protocol_version * @param string $fcmCredentialSid The fcm_credential_sid * @param string $defaultFcmNotificationProtocolVersion The * default_fcm_notification_protocol_version * @param boolean $logEnabled The log_enabled * @param string $alexaSkillId The alexa_skill_id * @param string $defaultAlexaNotificationProtocolVersion The * default_alexa_notification_protocol_version */ 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; } /** * The friendly_name * * @param string $friendlyName The friendly_name * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The apn_credential_sid * * @param string $apnCredentialSid The apn_credential_sid * @return $this Fluent Builder */ public function setApnCredentialSid($apnCredentialSid) { $this->options['apnCredentialSid'] = $apnCredentialSid; return $this; } /** * The gcm_credential_sid * * @param string $gcmCredentialSid The gcm_credential_sid * @return $this Fluent Builder */ public function setGcmCredentialSid($gcmCredentialSid) { $this->options['gcmCredentialSid'] = $gcmCredentialSid; return $this; } /** * The messaging_service_sid * * @param string $messagingServiceSid The messaging_service_sid * @return $this Fluent Builder */ public function setMessagingServiceSid($messagingServiceSid) { $this->options['messagingServiceSid'] = $messagingServiceSid; return $this; } /** * The facebook_messenger_page_id * * @param string $facebookMessengerPageId The facebook_messenger_page_id * @return $this Fluent Builder */ public function setFacebookMessengerPageId($facebookMessengerPageId) { $this->options['facebookMessengerPageId'] = $facebookMessengerPageId; return $this; } /** * The default_apn_notification_protocol_version * * @param string $defaultApnNotificationProtocolVersion The * default_apn_notification_protocol_version * @return $this Fluent Builder */ public function setDefaultApnNotificationProtocolVersion($defaultApnNotificationProtocolVersion) { $this->options['defaultApnNotificationProtocolVersion'] = $defaultApnNotificationProtocolVersion; return $this; } /** * The default_gcm_notification_protocol_version * * @param string $defaultGcmNotificationProtocolVersion The * default_gcm_notification_protocol_version * @return $this Fluent Builder */ public function setDefaultGcmNotificationProtocolVersion($defaultGcmNotificationProtocolVersion) { $this->options['defaultGcmNotificationProtocolVersion'] = $defaultGcmNotificationProtocolVersion; return $this; } /** * The fcm_credential_sid * * @param string $fcmCredentialSid The fcm_credential_sid * @return $this Fluent Builder */ public function setFcmCredentialSid($fcmCredentialSid) { $this->options['fcmCredentialSid'] = $fcmCredentialSid; return $this; } /** * The default_fcm_notification_protocol_version * * @param string $defaultFcmNotificationProtocolVersion The * default_fcm_notification_protocol_version * @return $this Fluent Builder */ public function setDefaultFcmNotificationProtocolVersion($defaultFcmNotificationProtocolVersion) { $this->options['defaultFcmNotificationProtocolVersion'] = $defaultFcmNotificationProtocolVersion; return $this; } /** * The log_enabled * * @param boolean $logEnabled The log_enabled * @return $this Fluent Builder */ public function setLogEnabled($logEnabled) { $this->options['logEnabled'] = $logEnabled; return $this; } /** * The alexa_skill_id * * @param string $alexaSkillId The alexa_skill_id * @return $this Fluent Builder */ public function setAlexaSkillId($alexaSkillId) { $this->options['alexaSkillId'] = $alexaSkillId; return $this; } /** * The default_alexa_notification_protocol_version * * @param string $defaultAlexaNotificationProtocolVersion The * default_alexa_notification_protocol_version * @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.UpdateServiceOptions ' . implode(' ', $options) . ']'; } } sdk/Twilio/Rest/Notify/V1/ServiceContext.php 0000604 00000014671 15174325130 0014733 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\Rest\Notify\V1\Service\SegmentList; use Twilio\Rest\Notify\V1\Service\UserList; 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 * @property \Twilio\Rest\Notify\V1\Service\UserList users * @property \Twilio\Rest\Notify\V1\Service\SegmentList segments * @method \Twilio\Rest\Notify\V1\Service\BindingContext bindings(string $sid) * @method \Twilio\Rest\Notify\V1\Service\UserContext users(string $identity) */ class ServiceContext extends InstanceContext { protected $_bindings = null; protected $_notifications = null; protected $_users = null; protected $_segments = null; /** * Initialize the ServiceContext * * @param \Twilio\Version $version Version that contains the resource * @param string $sid The sid * @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 */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Fetch a ServiceInstance * * @return ServiceInstance Fetched ServiceInstance */ 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 */ 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'], )); $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; } /** * Access the users * * @return \Twilio\Rest\Notify\V1\Service\UserList */ protected function getUsers() { if (!$this->_users) { $this->_users = new UserList($this->version, $this->solution['sid']); } return $this->_users; } /** * Access the segments * * @return \Twilio\Rest\Notify\V1\Service\SegmentList */ protected function getSegments() { if (!$this->_segments) { $this->_segments = new SegmentList($this->version, $this->solution['sid']); } return $this->_segments; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws \Twilio\Exceptions\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 \Twilio\Exceptions\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/Twilio/Rest/Notify/V1/CredentialInstance.php 0000604 00000007703 15174325130 0015523 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 sid * @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 */ public function fetch() { return $this->proxy()->fetch(); } /** * Update the CredentialInstance * * @param array|Options $options Optional Arguments * @return CredentialInstance Updated CredentialInstance */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Deletes the CredentialInstance * * @return boolean True if delete succeeds, false otherwise */ 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/Twilio/Rest/Notify/V1/ServicePage.php 0000604 00000001500 15174325130 0014146 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/Twilio/Rest/Notify/V1/CredentialOptions.php 0000604 00000016127 15174325130 0015412 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 The friendly_name * @param string $certificate The certificate * @param string $privateKey The private_key * @param boolean $sandbox The sandbox * @param string $apiKey The api_key * @param string $secret The secret * @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 The friendly_name * @param string $certificate The certificate * @param string $privateKey The private_key * @param boolean $sandbox The sandbox * @param string $apiKey The api_key * @param string $secret The secret * @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 The friendly_name * @param string $certificate The certificate * @param string $privateKey The private_key * @param boolean $sandbox The sandbox * @param string $apiKey The api_key * @param string $secret The secret */ 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; } /** * The friendly_name * * @param string $friendlyName The friendly_name * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The certificate * * @param string $certificate The certificate * @return $this Fluent Builder */ public function setCertificate($certificate) { $this->options['certificate'] = $certificate; return $this; } /** * The private_key * * @param string $privateKey The private_key * @return $this Fluent Builder */ public function setPrivateKey($privateKey) { $this->options['privateKey'] = $privateKey; return $this; } /** * The sandbox * * @param boolean $sandbox The sandbox * @return $this Fluent Builder */ public function setSandbox($sandbox) { $this->options['sandbox'] = $sandbox; return $this; } /** * The api_key * * @param string $apiKey The api_key * @return $this Fluent Builder */ public function setApiKey($apiKey) { $this->options['apiKey'] = $apiKey; return $this; } /** * The secret * * @param string $secret The secret * @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 The friendly_name * @param string $certificate The certificate * @param string $privateKey The private_key * @param boolean $sandbox The sandbox * @param string $apiKey The api_key * @param string $secret The secret */ 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; } /** * The friendly_name * * @param string $friendlyName The friendly_name * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The certificate * * @param string $certificate The certificate * @return $this Fluent Builder */ public function setCertificate($certificate) { $this->options['certificate'] = $certificate; return $this; } /** * The private_key * * @param string $privateKey The private_key * @return $this Fluent Builder */ public function setPrivateKey($privateKey) { $this->options['privateKey'] = $privateKey; return $this; } /** * The sandbox * * @param boolean $sandbox The sandbox * @return $this Fluent Builder */ public function setSandbox($sandbox) { $this->options['sandbox'] = $sandbox; return $this; } /** * The api_key * * @param string $apiKey The api_key * @return $this Fluent Builder */ public function setApiKey($apiKey) { $this->options['apiKey'] = $apiKey; return $this; } /** * The secret * * @param string $secret The secret * @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/Twilio/Rest/Notify/V1/CredentialPage.php 0000604 00000001511 15174325130 0014622 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/Twilio/Rest/Notify/V1/CredentialContext.php 0000604 00000005332 15174325130 0015377 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Notify\V1; 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 sid * @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 */ 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 */ 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 */ 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/Twilio/Rest/Notify/V1/ServiceInstance.php 0000604 00000014447 15174325130 0015054 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 boolean logEnabled * @property string url * @property array links * @property string alexaSkillId * @property string defaultAlexaNotificationProtocolVersion */ class ServiceInstance extends InstanceResource { protected $_bindings = null; protected $_notifications = null; protected $_users = null; protected $_segments = 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\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 */ public function delete() { return $this->proxy()->delete(); } /** * Fetch a ServiceInstance * * @return ServiceInstance Fetched ServiceInstance */ public function fetch() { return $this->proxy()->fetch(); } /** * Update the ServiceInstance * * @param array|Options $options Optional Arguments * @return ServiceInstance Updated ServiceInstance */ 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; } /** * Access the users * * @return \Twilio\Rest\Notify\V1\Service\UserList */ protected function getUsers() { return $this->proxy()->users; } /** * Access the segments * * @return \Twilio\Rest\Notify\V1\Service\SegmentList */ protected function getSegments() { return $this->proxy()->segments; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (property_exists($this, '_' . $name)) { $method = 'get' . ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide 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/Twilio/Rest/Notify/V1/Service/UserInstance.php 0000604 00000010724 15174325130 0015764 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 identity * @property \DateTime dateCreated * @property \DateTime dateUpdated * @property string segments * @property string url * @property array links */ class UserInstance extends InstanceResource { protected $_bindings = null; protected $_segmentMemberships = null; /** * Initialize the UserInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The service_sid * @param string $identity The identity * @return \Twilio\Rest\Notify\V1\Service\UserInstance */ public function __construct(Version $version, array $payload, $serviceSid, $identity = 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'), 'identity' => Values::array_get($payload, 'identity'), 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), 'segments' => Values::array_get($payload, 'segments'), '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\Notify\V1\Service\UserContext Context for this * UserInstance */ protected function proxy() { if (!$this->context) { $this->context = new UserContext( $this->version, $this->solution['serviceSid'], $this->solution['identity'] ); } return $this->context; } /** * Deletes the UserInstance * * @return boolean True if delete succeeds, false otherwise */ public function delete() { return $this->proxy()->delete(); } /** * Fetch a UserInstance * * @return UserInstance Fetched UserInstance */ public function fetch() { return $this->proxy()->fetch(); } /** * Access the bindings * * @return \Twilio\Rest\Notify\V1\Service\User\UserBindingList */ protected function getBindings() { return $this->proxy()->bindings; } /** * Access the segmentMemberships * * @return \Twilio\Rest\Notify\V1\Service\User\SegmentMembershipList */ protected function getSegmentMemberships() { return $this->proxy()->segmentMemberships; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (property_exists($this, '_' . $name)) { $method = 'get' . ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide 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.UserInstance ' . implode(' ', $context) . ']'; } } sdk/Twilio/Rest/Notify/V1/Service/UserPage.php 0000604 00000001536 15174325130 0015075 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 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.Notify.V1.UserPage]'; } } sdk/Twilio/Rest/Notify/V1/Service/NotificationList.php 0000604 00000005377 15174325130 0016653 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Notify\V1\Service; 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 service_sid * @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 */ 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; }), )); $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/Twilio/Rest/Notify/V1/Service/SegmentList.php 0000604 00000011117 15174325130 0015614 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Notify\V1\Service; 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 SegmentList extends ListResource { /** * Construct the SegmentList * * @param Version $version Version that contains the resource * @param string $serviceSid The service_sid * @return \Twilio\Rest\Notify\V1\Service\SegmentList */ public function __construct(Version $version, $serviceSid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, ); $this->uri = '/Services/' . rawurlencode($serviceSid) . '/Segments'; } /** * Streams SegmentInstance 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 SegmentInstance 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 SegmentInstance[] Array of results */ public function read($limit = null, $pageSize = null) { return iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of SegmentInstance 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 SegmentInstance */ 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 SegmentPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of SegmentInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of SegmentInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new SegmentPage($this->version, $response, $this->solution); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Notify.V1.SegmentList]'; } } sdk/Twilio/Rest/Notify/V1/Service/User/SegmentMembershipPage.php 0000604 00000001741 15174325130 0020511 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Notify\V1\Service\User; use Twilio\Page; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class SegmentMembershipPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new SegmentMembershipInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['identity'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Notify.V1.SegmentMembershipPage]'; } } sdk/Twilio/Rest/Notify/V1/Service/User/UserBindingList.php 0000604 00000015440 15174325130 0017344 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Notify\V1\Service\User; 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 UserBindingList extends ListResource { /** * Construct the UserBindingList * * @param Version $version Version that contains the resource * @param string $serviceSid The service_sid * @param string $identity The identity * @return \Twilio\Rest\Notify\V1\Service\User\UserBindingList */ public function __construct(Version $version, $serviceSid, $identity) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, 'identity' => $identity, ); $this->uri = '/Services/' . rawurlencode($serviceSid) . '/Users/' . rawurlencode($identity) . '/Bindings'; } /** * Create a new UserBindingInstance * * @param string $bindingType The binding_type * @param string $address The address * @param array|Options $options Optional Arguments * @return UserBindingInstance Newly created UserBindingInstance */ public function create($bindingType, $address, $options = array()) { $options = new Values($options); $data = Values::of(array( '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 UserBindingInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['identity'] ); } /** * 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( 'StartDate' => Serialize::iso8601Date($options['startDate']), 'EndDate' => Serialize::iso8601Date($options['endDate']), '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 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 * @return \Twilio\Rest\Notify\V1\Service\User\UserBindingContext */ public function getContext($sid) { return new UserBindingContext( $this->version, $this->solution['serviceSid'], $this->solution['identity'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Notify.V1.UserBindingList]'; } } sdk/Twilio/Rest/Notify/V1/Service/User/UserBindingInstance.php 0000604 00000011401 15174325130 0020166 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Notify\V1\Service\User; 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 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 service_sid * @param string $identity The identity * @param string $sid The sid * @return \Twilio\Rest\Notify\V1\Service\User\UserBindingInstance */ 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'), '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, '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\Notify\V1\Service\User\UserBindingContext Context for * this * UserBindingInstance */ protected function proxy() { if (!$this->context) { $this->context = new UserBindingContext( $this->version, $this->solution['serviceSid'], $this->solution['identity'], $this->solution['sid'] ); } return $this->context; } /** * Fetch a UserBindingInstance * * @return UserBindingInstance Fetched UserBindingInstance */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the UserBindingInstance * * @return boolean True if delete succeeds, false otherwise */ 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.UserBindingInstance ' . implode(' ', $context) . ']'; } } sdk/Twilio/Rest/Notify/V1/Service/User/SegmentMembershipList.php 0000604 00000004433 15174325130 0020551 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Notify\V1\Service\User; 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 SegmentMembershipList extends ListResource { /** * Construct the SegmentMembershipList * * @param Version $version Version that contains the resource * @param string $serviceSid The service_sid * @param string $identity The identity * @return \Twilio\Rest\Notify\V1\Service\User\SegmentMembershipList */ public function __construct(Version $version, $serviceSid, $identity) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, 'identity' => $identity, ); $this->uri = '/Services/' . rawurlencode($serviceSid) . '/Users/' . rawurlencode($identity) . '/SegmentMemberships'; } /** * Create a new SegmentMembershipInstance * * @param string $segment The segment * @return SegmentMembershipInstance Newly created SegmentMembershipInstance */ public function create($segment) { $data = Values::of(array('Segment' => $segment, )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new SegmentMembershipInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['identity'] ); } /** * Constructs a SegmentMembershipContext * * @param string $segment The segment * @return \Twilio\Rest\Notify\V1\Service\User\SegmentMembershipContext */ public function getContext($segment) { return new SegmentMembershipContext( $this->version, $this->solution['serviceSid'], $this->solution['identity'], $segment ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Notify.V1.SegmentMembershipList]'; } } sdk/Twilio/Rest/Notify/V1/Service/User/UserBindingPage.php 0000604 00000001717 15174325130 0017307 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Notify\V1\Service\User; use Twilio\Page; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ 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['identity'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Notify.V1.UserBindingPage]'; } } sdk/Twilio/Rest/Notify/V1/Service/User/SegmentMembershipContext.php 0000604 00000004500 15174325130 0021255 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Notify\V1\Service\User; 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 SegmentMembershipContext extends InstanceContext { /** * Initialize the SegmentMembershipContext * * @param \Twilio\Version $version Version that contains the resource * @param string $serviceSid The service_sid * @param string $identity The identity * @param string $segment The segment * @return \Twilio\Rest\Notify\V1\Service\User\SegmentMembershipContext */ public function __construct(Version $version, $serviceSid, $identity, $segment) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, 'identity' => $identity, 'segment' => $segment, ); $this->uri = '/Services/' . rawurlencode($serviceSid) . '/Users/' . rawurlencode($identity) . '/SegmentMemberships/' . rawurlencode($segment) . ''; } /** * Deletes the SegmentMembershipInstance * * @return boolean True if delete succeeds, false otherwise */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Fetch a SegmentMembershipInstance * * @return SegmentMembershipInstance Fetched SegmentMembershipInstance */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new SegmentMembershipInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['identity'], $this->solution['segment'] ); } /** * Provide 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.SegmentMembershipContext ' . implode(' ', $context) . ']'; } } sdk/Twilio/Rest/Notify/V1/Service/User/UserBindingOptions.php 0000604 00000012032 15174325130 0020056 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Notify\V1\Service\User; 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 UserBindingOptions { /** * @param string $tag The tag * @param string $notificationProtocolVersion The notification_protocol_version * @param string $credentialSid The credential_sid * @param string $endpoint The endpoint * @return CreateUserBindingOptions Options builder */ public static function create($tag = Values::NONE, $notificationProtocolVersion = Values::NONE, $credentialSid = Values::NONE, $endpoint = Values::NONE) { return new CreateUserBindingOptions($tag, $notificationProtocolVersion, $credentialSid, $endpoint); } /** * @param \DateTime $startDate The start_date * @param \DateTime $endDate The end_date * @param string $tag The tag * @return ReadUserBindingOptions Options builder */ public static function read($startDate = Values::NONE, $endDate = Values::NONE, $tag = Values::NONE) { return new ReadUserBindingOptions($startDate, $endDate, $tag); } } class CreateUserBindingOptions extends Options { /** * @param string $tag The tag * @param string $notificationProtocolVersion The notification_protocol_version * @param string $credentialSid The credential_sid * @param string $endpoint The endpoint */ 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; } /** * The tag * * @param string $tag The tag * @return $this Fluent Builder */ public function setTag($tag) { $this->options['tag'] = $tag; return $this; } /** * The notification_protocol_version * * @param string $notificationProtocolVersion The notification_protocol_version * @return $this Fluent Builder */ public function setNotificationProtocolVersion($notificationProtocolVersion) { $this->options['notificationProtocolVersion'] = $notificationProtocolVersion; return $this; } /** * The credential_sid * * @param string $credentialSid The credential_sid * @return $this Fluent Builder */ public function setCredentialSid($credentialSid) { $this->options['credentialSid'] = $credentialSid; return $this; } /** * The endpoint * * @param string $endpoint The endpoint * @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.CreateUserBindingOptions ' . implode(' ', $options) . ']'; } } class ReadUserBindingOptions extends Options { /** * @param \DateTime $startDate The start_date * @param \DateTime $endDate The end_date * @param string $tag The tag */ public function __construct($startDate = Values::NONE, $endDate = Values::NONE, $tag = Values::NONE) { $this->options['startDate'] = $startDate; $this->options['endDate'] = $endDate; $this->options['tag'] = $tag; } /** * The start_date * * @param \DateTime $startDate The start_date * @return $this Fluent Builder */ public function setStartDate($startDate) { $this->options['startDate'] = $startDate; return $this; } /** * The end_date * * @param \DateTime $endDate The end_date * @return $this Fluent Builder */ public function setEndDate($endDate) { $this->options['endDate'] = $endDate; return $this; } /** * The tag * * @param string $tag The tag * @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.ReadUserBindingOptions ' . implode(' ', $options) . ']'; } } sdk/Twilio/Rest/Notify/V1/Service/User/UserBindingContext.php 0000604 00000004344 15174325130 0020056 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Notify\V1\Service\User; 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 UserBindingContext extends InstanceContext { /** * Initialize the UserBindingContext * * @param \Twilio\Version $version Version that contains the resource * @param string $serviceSid The service_sid * @param string $identity The identity * @param string $sid The sid * @return \Twilio\Rest\Notify\V1\Service\User\UserBindingContext */ 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) . '/Users/' . rawurlencode($identity) . '/Bindings/' . rawurlencode($sid) . ''; } /** * Fetch a UserBindingInstance * * @return UserBindingInstance Fetched UserBindingInstance */ 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['identity'], $this->solution['sid'] ); } /** * Deletes the UserBindingInstance * * @return boolean True if delete succeeds, false otherwise */ 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.UserBindingContext ' . implode(' ', $context) . ']'; } } sdk/Twilio/Rest/Notify/V1/Service/User/SegmentMembershipInstance.php 0000604 00000007707 15174325130 0021411 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Notify\V1\Service\User; 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 identity * @property string segment * @property string url */ class SegmentMembershipInstance extends InstanceResource { /** * Initialize the SegmentMembershipInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The service_sid * @param string $identity The identity * @param string $segment The segment * @return \Twilio\Rest\Notify\V1\Service\User\SegmentMembershipInstance */ public function __construct(Version $version, array $payload, $serviceSid, $identity, $segment = null) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'accountSid' => Values::array_get($payload, 'account_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'identity' => Values::array_get($payload, 'identity'), 'segment' => Values::array_get($payload, 'segment'), 'url' => Values::array_get($payload, 'url'), ); $this->solution = array( 'serviceSid' => $serviceSid, 'identity' => $identity, 'segment' => $segment ?: $this->properties['segment'], ); } /** * Generate an 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\User\SegmentMembershipContext Context * for * this * SegmentMembershipInstance */ protected function proxy() { if (!$this->context) { $this->context = new SegmentMembershipContext( $this->version, $this->solution['serviceSid'], $this->solution['identity'], $this->solution['segment'] ); } return $this->context; } /** * Deletes the SegmentMembershipInstance * * @return boolean True if delete succeeds, false otherwise */ public function delete() { return $this->proxy()->delete(); } /** * Fetch a SegmentMembershipInstance * * @return SegmentMembershipInstance Fetched SegmentMembershipInstance */ 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.Notify.V1.SegmentMembershipInstance ' . implode(' ', $context) . ']'; } } sdk/Twilio/Rest/Notify/V1/Service/BindingOptions.php 0000604 00000012656 15174325130 0016315 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 The tag * @param string $notificationProtocolVersion The notification_protocol_version * @param string $credentialSid The credential_sid * @param string $endpoint The endpoint * @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 The start_date * @param \DateTime $endDate The end_date * @param string $identity The identity * @param string $tag The tag * @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 The tag * @param string $notificationProtocolVersion The notification_protocol_version * @param string $credentialSid The credential_sid * @param string $endpoint The endpoint */ 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; } /** * The tag * * @param string $tag The tag * @return $this Fluent Builder */ public function setTag($tag) { $this->options['tag'] = $tag; return $this; } /** * The notification_protocol_version * * @param string $notificationProtocolVersion The notification_protocol_version * @return $this Fluent Builder */ public function setNotificationProtocolVersion($notificationProtocolVersion) { $this->options['notificationProtocolVersion'] = $notificationProtocolVersion; return $this; } /** * The credential_sid * * @param string $credentialSid The credential_sid * @return $this Fluent Builder */ public function setCredentialSid($credentialSid) { $this->options['credentialSid'] = $credentialSid; return $this; } /** * The endpoint * * @param string $endpoint The endpoint * @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 The start_date * @param \DateTime $endDate The end_date * @param string $identity The identity * @param string $tag The tag */ 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; } /** * The start_date * * @param \DateTime $startDate The start_date * @return $this Fluent Builder */ public function setStartDate($startDate) { $this->options['startDate'] = $startDate; return $this; } /** * The end_date * * @param \DateTime $endDate The end_date * @return $this Fluent Builder */ public function setEndDate($endDate) { $this->options['endDate'] = $endDate; return $this; } /** * The identity * * @param string $identity The identity * @return $this Fluent Builder */ public function setIdentity($identity) { $this->options['identity'] = $identity; return $this; } /** * The tag * * @param string $tag The tag * @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/Twilio/Rest/Notify/V1/Service/NotificationInstance.php 0000604 00000007134 15174325130 0017475 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 integer 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 service_sid * @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/Twilio/Rest/Notify/V1/Service/UserList.php 0000604 00000013773 15174325130 0015142 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Notify\V1\Service; 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 UserList extends ListResource { /** * Construct the UserList * * @param Version $version Version that contains the resource * @param string $serviceSid The service_sid * @return \Twilio\Rest\Notify\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 * @param array|Options $options Optional Arguments * @return UserInstance Newly created UserInstance */ public function create($identity, $options = array()) { $options = new Values($options); $data = Values::of(array( 'Identity' => $identity, 'Segment' => Serialize::map($options['segment'], function($e) { return $e; }), )); $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 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 UserInstance 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 UserInstance[] 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 UserInstance 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 UserInstance */ 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; }), 'Segment' => $options['segment'], '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 $identity The identity * @return \Twilio\Rest\Notify\V1\Service\UserContext */ public function getContext($identity) { return new UserContext($this->version, $this->solution['serviceSid'], $identity); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Notify.V1.UserList]'; } } sdk/Twilio/Rest/Notify/V1/Service/NotificationPage.php 0000604 00000001566 15174325130 0016610 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/Twilio/Rest/Notify/V1/Service/BindingContext.php 0000604 00000004027 15174325130 0016277 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Notify\V1\Service; 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 service_sid * @param string $sid The sid * @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 */ 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 */ 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/Twilio/Rest/Notify/V1/Service/UserOptions.php 0000604 00000005674 15174325130 0015663 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 UserOptions { /** * @param string $segment The segment * @return CreateUserOptions Options builder */ public static function create($segment = Values::NONE) { return new CreateUserOptions($segment); } /** * @param string $identity The identity * @param string $segment The segment * @return ReadUserOptions Options builder */ public static function read($identity = Values::NONE, $segment = Values::NONE) { return new ReadUserOptions($identity, $segment); } } class CreateUserOptions extends Options { /** * @param string $segment The segment */ public function __construct($segment = Values::NONE) { $this->options['segment'] = $segment; } /** * The segment * * @param string $segment The segment * @return $this Fluent Builder */ public function setSegment($segment) { $this->options['segment'] = $segment; return $this; } /** * Provide a friendly representation * * @return 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.CreateUserOptions ' . implode(' ', $options) . ']'; } } class ReadUserOptions extends Options { /** * @param string $identity The identity * @param string $segment The segment */ public function __construct($identity = Values::NONE, $segment = Values::NONE) { $this->options['identity'] = $identity; $this->options['segment'] = $segment; } /** * The identity * * @param string $identity The identity * @return $this Fluent Builder */ public function setIdentity($identity) { $this->options['identity'] = $identity; return $this; } /** * The segment * * @param string $segment The segment * @return $this Fluent Builder */ public function setSegment($segment) { $this->options['segment'] = $segment; return $this; } /** * Provide a friendly representation * * @return 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.ReadUserOptions ' . implode(' ', $options) . ']'; } } sdk/Twilio/Rest/Notify/V1/Service/SegmentPage.php 0000604 00000001547 15174325130 0015563 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 SegmentPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new SegmentInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Notify.V1.SegmentPage]'; } } sdk/Twilio/Rest/Notify/V1/Service/SegmentInstance.php 0000604 00000004647 15174325130 0016457 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 uniqueName * @property \DateTime dateCreated * @property \DateTime dateUpdated */ class SegmentInstance extends InstanceResource { /** * Initialize the SegmentInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The service_sid * @return \Twilio\Rest\Notify\V1\Service\SegmentInstance */ 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'), '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')), ); $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.SegmentInstance]'; } } sdk/Twilio/Rest/Notify/V1/Service/UserContext.php 0000604 00000011166 15174325130 0015645 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\Rest\Notify\V1\Service\User\SegmentMembershipList; use Twilio\Rest\Notify\V1\Service\User\UserBindingList; 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\User\UserBindingList bindings * @property \Twilio\Rest\Notify\V1\Service\User\SegmentMembershipList segmentMemberships * @method \Twilio\Rest\Notify\V1\Service\User\UserBindingContext bindings(string $sid) * @method \Twilio\Rest\Notify\V1\Service\User\SegmentMembershipContext segmentMemberships(string $segment) */ class UserContext extends InstanceContext { protected $_bindings = null; protected $_segmentMemberships = null; /** * Initialize the UserContext * * @param \Twilio\Version $version Version that contains the resource * @param string $serviceSid The service_sid * @param string $identity The identity * @return \Twilio\Rest\Notify\V1\Service\UserContext */ public function __construct(Version $version, $serviceSid, $identity) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, 'identity' => $identity, ); $this->uri = '/Services/' . rawurlencode($serviceSid) . '/Users/' . rawurlencode($identity) . ''; } /** * Deletes the UserInstance * * @return boolean True if delete succeeds, false otherwise */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Fetch a UserInstance * * @return UserInstance Fetched UserInstance */ 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['identity'] ); } /** * Access the bindings * * @return \Twilio\Rest\Notify\V1\Service\User\UserBindingList */ protected function getBindings() { if (!$this->_bindings) { $this->_bindings = new UserBindingList( $this->version, $this->solution['serviceSid'], $this->solution['identity'] ); } return $this->_bindings; } /** * Access the segmentMemberships * * @return \Twilio\Rest\Notify\V1\Service\User\SegmentMembershipList */ protected function getSegmentMemberships() { if (!$this->_segmentMemberships) { $this->_segmentMemberships = new SegmentMembershipList( $this->version, $this->solution['serviceSid'], $this->solution['identity'] ); } return $this->_segmentMemberships; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws \Twilio\Exceptions\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 \Twilio\Exceptions\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.UserContext ' . implode(' ', $context) . ']'; } } sdk/Twilio/Rest/Notify/V1/Service/BindingInstance.php 0000604 00000010715 15174325130 0016420 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 service_sid * @param string $sid The sid * @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 */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the BindingInstance * * @return boolean True if delete succeeds, false otherwise */ 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/Twilio/Rest/Notify/V1/Service/BindingPage.php 0000604 00000001547 15174325130 0015533 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/Twilio/Rest/Notify/V1/Service/NotificationOptions.php 0000604 00000017455 15174325130 0017373 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 * @param string $tag The tag * @param string $body The body * @param string $priority The priority * @param integer $ttl The ttl * @param string $title The title * @param string $sound The sound * @param string $action The action * @param array $data The data * @param array $apn The apn * @param array $gcm The gcm * @param array $sms The sms * @param array $facebookMessenger The facebook_messenger * @param array $fcm The fcm * @param string $segment The segment * @param array $alexa The alexa * @param string $toBinding The to_binding * @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) { return new CreateNotificationOptions($identity, $tag, $body, $priority, $ttl, $title, $sound, $action, $data, $apn, $gcm, $sms, $facebookMessenger, $fcm, $segment, $alexa, $toBinding); } } class CreateNotificationOptions extends Options { /** * @param string $identity The identity * @param string $tag The tag * @param string $body The body * @param string $priority The priority * @param integer $ttl The ttl * @param string $title The title * @param string $sound The sound * @param string $action The action * @param array $data The data * @param array $apn The apn * @param array $gcm The gcm * @param array $sms The sms * @param array $facebookMessenger The facebook_messenger * @param array $fcm The fcm * @param string $segment The segment * @param array $alexa The alexa * @param string $toBinding The to_binding */ 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) { $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; } /** * The identity * * @param string $identity The identity * @return $this Fluent Builder */ public function setIdentity($identity) { $this->options['identity'] = $identity; return $this; } /** * The tag * * @param string $tag The tag * @return $this Fluent Builder */ public function setTag($tag) { $this->options['tag'] = $tag; return $this; } /** * The body * * @param string $body The body * @return $this Fluent Builder */ public function setBody($body) { $this->options['body'] = $body; return $this; } /** * The priority * * @param string $priority The priority * @return $this Fluent Builder */ public function setPriority($priority) { $this->options['priority'] = $priority; return $this; } /** * The ttl * * @param integer $ttl The ttl * @return $this Fluent Builder */ public function setTtl($ttl) { $this->options['ttl'] = $ttl; return $this; } /** * The title * * @param string $title The title * @return $this Fluent Builder */ public function setTitle($title) { $this->options['title'] = $title; return $this; } /** * The sound * * @param string $sound The sound * @return $this Fluent Builder */ public function setSound($sound) { $this->options['sound'] = $sound; return $this; } /** * The action * * @param string $action The action * @return $this Fluent Builder */ public function setAction($action) { $this->options['action'] = $action; return $this; } /** * The data * * @param array $data The data * @return $this Fluent Builder */ public function setData($data) { $this->options['data'] = $data; return $this; } /** * The apn * * @param array $apn The apn * @return $this Fluent Builder */ public function setApn($apn) { $this->options['apn'] = $apn; return $this; } /** * The gcm * * @param array $gcm The gcm * @return $this Fluent Builder */ public function setGcm($gcm) { $this->options['gcm'] = $gcm; return $this; } /** * The sms * * @param array $sms The sms * @return $this Fluent Builder */ public function setSms($sms) { $this->options['sms'] = $sms; return $this; } /** * The facebook_messenger * * @param array $facebookMessenger The facebook_messenger * @return $this Fluent Builder */ public function setFacebookMessenger($facebookMessenger) { $this->options['facebookMessenger'] = $facebookMessenger; return $this; } /** * The fcm * * @param array $fcm The fcm * @return $this Fluent Builder */ public function setFcm($fcm) { $this->options['fcm'] = $fcm; return $this; } /** * The segment * * @param string $segment The segment * @return $this Fluent Builder */ public function setSegment($segment) { $this->options['segment'] = $segment; return $this; } /** * The alexa * * @param array $alexa The alexa * @return $this Fluent Builder */ public function setAlexa($alexa) { $this->options['alexa'] = $alexa; return $this; } /** * The to_binding * * @param string $toBinding The to_binding * @return $this Fluent Builder */ public function setToBinding($toBinding) { $this->options['toBinding'] = $toBinding; return $this; } /** * Provide a friendly representation * * @return 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/Twilio/Rest/Notify/V1/Service/BindingList.php 0000604 00000015126 15174325130 0015570 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Notify\V1\Service; 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 service_sid * @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 * @param string $bindingType The binding_type * @param string $address The address * @param array|Options $options Optional Arguments * @return BindingInstance Newly created BindingInstance */ 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 sid * @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/Twilio/Rest/Notify/V1/ServiceList.php 0000604 00000015000 15174325130 0014205 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Notify\V1; 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 */ 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 sid * @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/Twilio/Rest/Notify/V1/CredentialList.php 0000604 00000013262 15174325130 0014667 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Notify\V1; 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 type * @param array|Options $options Optional Arguments * @return CredentialInstance Newly created CredentialInstance */ 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 * @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/Twilio/Rest/Notify/V1.php 0000604 00000005373 15174325130 0011765 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 \Twilio\Exceptions\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 \Twilio\Exceptions\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/Twilio/Rest/Preview/Marketplace/AvailableAddOnInstance.php 0000604 00000007537 15174325130 0020357 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 unique Available Add-on Sid * @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 */ 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/Twilio/Rest/Preview/Marketplace/AvailableAddOn/AvailableAddOnExtensionInstance.php 0000604 00000007572 15174325130 0025041 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 available_add_on_sid * @param string $sid The unique Extension Sid * @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 */ 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/Twilio/Rest/Preview/Marketplace/AvailableAddOn/AvailableAddOnExtensionPage.php 0000604 00000002101 15174325130 0024130 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/Twilio/Rest/Preview/Marketplace/AvailableAddOn/AvailableAddOnExtensionContext.php 0000604 00000004273 15174325130 0024714 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Marketplace\AvailableAddOn; 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 available_add_on_sid * @param string $sid The unique Extension Sid * @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 */ 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/Twilio/Rest/Preview/Marketplace/AvailableAddOn/AvailableAddOnExtensionList.php 0000604 00000012551 15174325130 0024201 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 available_add_on_sid * @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 unique Extension Sid * @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/Twilio/Rest/Preview/Marketplace/AvailableAddOnList.php 0000604 00000011704 15174325130 0017515 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 unique Available Add-on Sid * @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/Twilio/Rest/Preview/Marketplace/InstalledAddOnInstance.php 0000604 00000011334 15174325130 0020404 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 unique Installed Add-on Sid * @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 */ public function delete() { return $this->proxy()->delete(); } /** * Fetch a InstalledAddOnInstance * * @return InstalledAddOnInstance Fetched InstalledAddOnInstance */ public function fetch() { return $this->proxy()->fetch(); } /** * Update the InstalledAddOnInstance * * @param array|Options $options Optional Arguments * @return InstalledAddOnInstance Updated InstalledAddOnInstance */ 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/Twilio/Rest/Preview/Marketplace/InstalledAddOnPage.php 0000604 00000001703 15174325130 0017513 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/Twilio/Rest/Preview/Marketplace/AvailableAddOnPage.php 0000604 00000001703 15174325130 0017454 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/Twilio/Rest/Preview/Marketplace/InstalledAddOnContext.php 0000604 00000011072 15174325130 0020263 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 unique Installed Add-on Sid * @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 */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Fetch a InstalledAddOnInstance * * @return InstalledAddOnInstance Fetched InstalledAddOnInstance */ 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 */ 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 \Twilio\Exceptions\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 \Twilio\Exceptions\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/Twilio/Rest/Preview/Marketplace/InstalledAddOn/InstalledAddOnExtensionContext.php 0000604 00000005715 15174325130 0025014 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Marketplace\InstalledAddOn; 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 installed_add_on_sid * @param string $sid The unique Extension Sid * @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 */ 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 boolean $enabled A Boolean indicating if the Extension will be invoked * @return InstalledAddOnExtensionInstance Updated * InstalledAddOnExtensionInstance */ 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/Twilio/Rest/Preview/Marketplace/InstalledAddOn/InstalledAddOnExtensionList.php 0000604 00000012551 15174325130 0024277 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 installed_add_on_sid * @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 unique Extension Sid * @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/Twilio/Rest/Preview/Marketplace/InstalledAddOn/InstalledAddOnExtensionPage.php 0000604 00000002101 15174325130 0024226 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/Twilio/Rest/Preview/Marketplace/InstalledAddOn/InstalledAddOnExtensionInstance.php 0000604 00000010534 15174325130 0025127 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 boolean 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 installed_add_on_sid * @param string $sid The unique Extension Sid * @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 */ public function fetch() { return $this->proxy()->fetch(); } /** * Update the InstalledAddOnExtensionInstance * * @param boolean $enabled A Boolean indicating if the Extension will be invoked * @return InstalledAddOnExtensionInstance Updated * InstalledAddOnExtensionInstance */ 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/Twilio/Rest/Preview/Marketplace/InstalledAddOnOptions.php 0000604 00000011337 15174325130 0020276 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 The string that uniquely identifies this Add-on * installation * @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 The string that uniquely identifies this Add-on * installation * @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 The string that uniquely identifies this Add-on * installation */ public function __construct($configuration = Values::NONE, $uniqueName = Values::NONE) { $this->options['configuration'] = $configuration; $this->options['uniqueName'] = $uniqueName; } /** * The JSON object representing the configuration of the new Add-on installation. * * @param array $configuration The JSON object representing the configuration * @return $this Fluent Builder */ public function setConfiguration($configuration) { $this->options['configuration'] = $configuration; return $this; } /** * The human-readable string that uniquely identifies this Add-on installation for an Account. * * @param string $uniqueName The string that uniquely identifies this Add-on * installation * @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 The string that uniquely identifies this Add-on * installation */ public function __construct($configuration = Values::NONE, $uniqueName = Values::NONE) { $this->options['configuration'] = $configuration; $this->options['uniqueName'] = $uniqueName; } /** * The JSON object representing the configuration of the Add-on installation. * * @param array $configuration The JSON object representing the configuration * @return $this Fluent Builder */ public function setConfiguration($configuration) { $this->options['configuration'] = $configuration; return $this; } /** * The human-readable string that uniquely identifies this Add-on installation for an Account. * * @param string $uniqueName The string that uniquely identifies this Add-on * installation * @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/Twilio/Rest/Preview/Marketplace/AvailableAddOnContext.php 0000604 00000007160 15174325130 0020227 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 unique Available Add-on Sid * @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 */ 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 \Twilio\Exceptions\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 \Twilio\Exceptions\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/Twilio/Rest/Preview/Marketplace/InstalledAddOnList.php 0000604 00000014161 15174325130 0017554 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Marketplace; 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 A string that uniquely identifies the * Add-on to install * @param boolean $acceptTermsOfService A boolean reflecting your acceptance of * the Terms of Service * @param array|Options $options Optional Arguments * @return InstalledAddOnInstance Newly created InstalledAddOnInstance */ 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 unique Installed Add-on Sid * @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/Twilio/Rest/Preview/HostedNumbers/AuthorizationDocumentList.php 0000604 00000015071 15174325130 0021621 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\HostedNumbers; 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 array|Options $options Optional Arguments * @return AuthorizationDocumentInstance Newly created * AuthorizationDocumentInstance */ public function create($hostedNumberOrderSids, $addressSid, $email, $options = array()) { $options = new Values($options); $data = Values::of(array( 'HostedNumberOrderSids' => Serialize::map($hostedNumberOrderSids, function($e) { return $e; }), 'AddressSid' => $addressSid, 'Email' => $email, '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/Twilio/Rest/Preview/HostedNumbers/AuthorizationDocumentPage.php 0000604 00000001734 15174325130 0021563 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/Twilio/Rest/Preview/HostedNumbers/AuthorizationDocument/DependentHostedNumberOrderInstance.php 0000604 00000010726 15174325130 0027676 0 ustar 00 <?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 integer verificationAttempts * @property string email * @property string ccEmails * @property string verificationType * @property string verificationDocumentSid * @property string extension * @property integer 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]'; } } sdk/Twilio/Rest/Preview/HostedNumbers/AuthorizationDocument/DependentHostedNumberOrderPage.php 0000604 00000002126 15174325130 0027001 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]'; } } sdk/Twilio/Rest/Preview/HostedNumbers/AuthorizationDocument/DependentHostedNumberOrderList.php 0000604 00000013217 15174325130 0027043 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/Twilio/Rest/Preview/HostedNumbers/AuthorizationDocument/DependentHostedNumberOrderOptions.php 0000604 00000011233 15174325130 0027557 0 ustar 00 <?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; } /** * 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.ReadDependentHostedNumberOrderOptions ' . implode(' ', $options) . ']'; } } sdk/Twilio/Rest/Preview/HostedNumbers/HostedNumberOrderInstance.php 0000604 00000013763 15174325130 0021514 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 integer verificationAttempts * @property string email * @property string ccEmails * @property string url * @property string verificationType * @property string verificationDocumentSid * @property string extension * @property integer 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 */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the HostedNumberOrderInstance * * @return boolean True if delete succeeds, false otherwise */ public function delete() { return $this->proxy()->delete(); } /** * Update the HostedNumberOrderInstance * * @param array|Options $options Optional Arguments * @return HostedNumberOrderInstance Updated HostedNumberOrderInstance */ 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/Twilio/Rest/Preview/HostedNumbers/HostedNumberOrderList.php 0000604 00000016471 15174325130 0020662 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\HostedNumbers; 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 boolean $smsCapability Specify SMS capability to host. * @param array|Options $options Optional Arguments * @return HostedNumberOrderInstance Newly created HostedNumberOrderInstance */ 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/Twilio/Rest/Preview/HostedNumbers/HostedNumberOrderPage.php 0000604 00000001720 15174325130 0020612 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/Twilio/Rest/Preview/HostedNumbers/HostedNumberOrderContext.php 0000604 00000006326 15174325130 0021371 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\HostedNumbers; 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 */ 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 */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Update the HostedNumberOrderInstance * * @param array|Options $options Optional Arguments * @return HostedNumberOrderInstance Updated HostedNumberOrderInstance */ 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/Twilio/Rest/Preview/HostedNumbers/AuthorizationDocumentOptions.php 0000604 00000016221 15174325130 0022337 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. * @return UpdateAuthorizationDocumentOptions Options builder */ public static function update($hostedNumberOrderSids = Values::NONE, $addressSid = Values::NONE, $email = Values::NONE, $ccEmails = Values::NONE, $status = Values::NONE) { return new UpdateAuthorizationDocumentOptions($hostedNumberOrderSids, $addressSid, $email, $ccEmails, $status); } /** * @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. */ public function __construct($hostedNumberOrderSids = Values::NONE, $addressSid = Values::NONE, $email = Values::NONE, $ccEmails = Values::NONE, $status = Values::NONE) { $this->options['hostedNumberOrderSids'] = $hostedNumberOrderSids; $this->options['addressSid'] = $addressSid; $this->options['email'] = $email; $this->options['ccEmails'] = $ccEmails; $this->options['status'] = $status; } /** * 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; } /** * A list of emails that this AuthorizationDocument 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 Status of this AuthorizationDocument. User can only update this to `opened` when AuthorizationDocument is in `signing`, or `signing` when AuthorizationDocument is in `opened`. * * @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.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; } /** * The Status of this AuthorizationDocument. One of `opened`, `signing`, `signed`, `canceled`, or `failed`. * * @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; } /** * A list of emails that this AuthorizationDocument 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; } /** * Provide a friendly representation * * @return 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/Twilio/Rest/Preview/HostedNumbers/AuthorizationDocumentContext.php 0000604 00000011344 15174325130 0022331 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 */ 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 */ 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'], )); $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 \Twilio\Exceptions\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 \Twilio\Exceptions\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/Twilio/Rest/Preview/HostedNumbers/HostedNumberOrderOptions.php 0000604 00000052601 15174325130 0021375 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 The extension * @param integer $callDelay The call_delay * @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 The extension * @param integer $callDelay The call_delay */ 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 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; } /** * 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; } /** * The Status of this HostedNumberOrder. User can only update this to `pending-loa` or `pending-verification`. * * @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; } /** * The extension * * @param string $extension The extension * @return $this Fluent Builder */ public function setExtension($extension) { $this->options['extension'] = $extension; return $this; } /** * The call_delay * * @param integer $callDelay The call_delay * @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; } /** * Optional. The unique SID identifier of the Account or Sub-Account to create this HostedNumberOrder on. * * @param string $accountSid Account Sid. * @return $this Fluent Builder */ public function setAccountSid($accountSid) { $this->options['accountSid'] = $accountSid; return $this; } /** * Optional. 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; } /** * 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; } /** * Optional. The SMS URL attached to the IncomingPhoneNumber resource. * * @param string $smsUrl SMS URL. * @return $this Fluent Builder */ public function setSmsUrl($smsUrl) { $this->options['smsUrl'] = $smsUrl; return $this; } /** * Optional. The SMS Method attached to the IncomingPhoneNumber resource. * * @param string $smsMethod SMS Method. * @return $this Fluent Builder */ public function setSmsMethod($smsMethod) { $this->options['smsMethod'] = $smsMethod; return $this; } /** * Optional. The SMS Fallback URL attached to the IncomingPhoneNumber resource. * * @param string $smsFallbackUrl SMS Fallback URL. * @return $this Fluent Builder */ public function setSmsFallbackUrl($smsFallbackUrl) { $this->options['smsFallbackUrl'] = $smsFallbackUrl; return $this; } /** * Optional. The SMS Fallback Method attached to 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/Twilio/Rest/Preview/HostedNumbers/AuthorizationDocumentInstance.php 0000604 00000010624 15174325130 0022451 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 */ public function fetch() { return $this->proxy()->fetch(); } /** * Update the AuthorizationDocumentInstance * * @param array|Options $options Optional Arguments * @return AuthorizationDocumentInstance Updated AuthorizationDocumentInstance */ 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/Twilio/Rest/Preview/Sync/Service/DocumentPage.php 0000604 00000001712 15174325130 0016530 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/Twilio/Rest/Preview/Sync/Service/DocumentContext.php 0000604 00000011270 15174325130 0017300 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 */ 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 */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Update the DocumentInstance * * @param array $data The data * @return DocumentInstance Updated DocumentInstance */ 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 \Twilio\Exceptions\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 \Twilio\Exceptions\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/Twilio/Rest/Preview/Sync/Service/Document/DocumentPermissionPage.php 0000604 00000002113 15174325130 0022353 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/Twilio/Rest/Preview/Sync/Service/Document/DocumentPermissionInstance.php 0000604 00000011177 15174325130 0023255 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 boolean read * @property boolean write * @property boolean 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 */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the DocumentPermissionInstance * * @return boolean True if delete succeeds, false otherwise */ public function delete() { return $this->proxy()->delete(); } /** * Update the DocumentPermissionInstance * * @param boolean $read Read access. * @param boolean $write Write access. * @param boolean $manage Manage access. * @return DocumentPermissionInstance Updated DocumentPermissionInstance */ 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/Twilio/Rest/Preview/Sync/Service/Document/DocumentPermissionList.php 0000604 00000013010 15174325130 0022410 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/Twilio/Rest/Preview/Sync/Service/Document/DocumentPermissionContext.php 0000604 00000007033 15174325130 0023131 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Sync\Service\Document; 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 */ 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 */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Update the DocumentPermissionInstance * * @param boolean $read Read access. * @param boolean $write Write access. * @param boolean $manage Manage access. * @return DocumentPermissionInstance Updated DocumentPermissionInstance */ 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/Twilio/Rest/Preview/Sync/Service/SyncMapPage.php 0000604 00000001707 15174325130 0016330 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/Twilio/Rest/Preview/Sync/Service/DocumentOptions.php 0000604 00000003721 15174325130 0017311 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/Twilio/Rest/Preview/Sync/Service/DocumentList.php 0000604 00000013261 15174325130 0016571 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Sync\Service; 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 */ 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/Twilio/Rest/Preview/Sync/Service/SyncMapList.php 0000604 00000013056 15174325130 0016367 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Sync\Service; 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 */ 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/Twilio/Rest/Preview/Sync/Service/SyncList/SyncListItemContext.php 0000604 00000005770 15174325130 0021671 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Sync\Service\SyncList; 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 integer $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 */ 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 */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Update the SyncListItemInstance * * @param array $data The data * @return SyncListItemInstance Updated SyncListItemInstance */ 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/Twilio/Rest/Preview/Sync/Service/SyncList/SyncListItemOptions.php 0000604 00000004460 15174325130 0021673 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/Twilio/Rest/Preview/Sync/Service/SyncList/SyncListItemInstance.php 0000604 00000011070 15174325130 0021777 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 integer 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 integer $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 */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the SyncListItemInstance * * @return boolean True if delete succeeds, false otherwise */ public function delete() { return $this->proxy()->delete(); } /** * Update the SyncListItemInstance * * @param array $data The data * @return SyncListItemInstance Updated SyncListItemInstance */ 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/Twilio/Rest/Preview/Sync/Service/SyncList/SyncListPermissionPage.php 0000604 00000002107 15174325130 0022342 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/Twilio/Rest/Preview/Sync/Service/SyncList/SyncListPermissionList.php 0000604 00000012744 15174325130 0022411 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/Twilio/Rest/Preview/Sync/Service/SyncList/SyncListPermissionContext.php 0000604 00000006706 15174325130 0023123 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Sync\Service\SyncList; 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 */ 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 */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Update the SyncListPermissionInstance * * @param boolean $read Read access. * @param boolean $write Write access. * @param boolean $manage Manage access. * @return SyncListPermissionInstance Updated SyncListPermissionInstance */ 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/Twilio/Rest/Preview/Sync/Service/SyncList/SyncListItemList.php 0000604 00000014475 15174325130 0021162 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Sync\Service\SyncList; 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 */ 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 integer $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/Twilio/Rest/Preview/Sync/Service/SyncList/SyncListPermissionInstance.php 0000604 00000011127 15174325130 0023234 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 boolean read * @property boolean write * @property boolean 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 */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the SyncListPermissionInstance * * @return boolean True if delete succeeds, false otherwise */ public function delete() { return $this->proxy()->delete(); } /** * Update the SyncListPermissionInstance * * @param boolean $read Read access. * @param boolean $write Write access. * @param boolean $manage Manage access. * @return SyncListPermissionInstance Updated SyncListPermissionInstance */ 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/Twilio/Rest/Preview/Sync/Service/SyncList/SyncListItemPage.php 0000604 00000002065 15174325130 0021113 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/Twilio/Rest/Preview/Sync/Service/SyncListList.php 0000604 00000013103 15174325130 0016556 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Sync\Service; 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 */ 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/Twilio/Rest/Preview/Sync/Service/SyncMap/SyncMapItemPage.php 0000604 00000002060 15174325130 0020512 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/Twilio/Rest/Preview/Sync/Service/SyncMap/SyncMapPermissionInstance.php 0000604 00000011074 15174325130 0022641 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 boolean read * @property boolean write * @property boolean 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 */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the SyncMapPermissionInstance * * @return boolean True if delete succeeds, false otherwise */ public function delete() { return $this->proxy()->delete(); } /** * Update the SyncMapPermissionInstance * * @param boolean $read Read access. * @param boolean $write Write access. * @param boolean $manage Manage access. * @return SyncMapPermissionInstance Updated SyncMapPermissionInstance */ 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/Twilio/Rest/Preview/Sync/Service/SyncMap/SyncMapPermissionContext.php 0000604 00000006655 15174325130 0022532 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Sync\Service\SyncMap; 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 */ 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 */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Update the SyncMapPermissionInstance * * @param boolean $read Read access. * @param boolean $write Write access. * @param boolean $manage Manage access. * @return SyncMapPermissionInstance Updated SyncMapPermissionInstance */ 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/Twilio/Rest/Preview/Sync/Service/SyncMap/SyncMapItemList.php 0000604 00000014513 15174325130 0020557 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Sync\Service\SyncMap; 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 */ 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/Twilio/Rest/Preview/Sync/Service/SyncMap/SyncMapItemOptions.php 0000604 00000004452 15174325130 0021300 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/Twilio/Rest/Preview/Sync/Service/SyncMap/SyncMapPermissionPage.php 0000604 00000002102 15174325130 0021741 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/Twilio/Rest/Preview/Sync/Service/SyncMap/SyncMapItemContext.php 0000604 00000005717 15174325130 0021276 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Sync\Service\SyncMap; 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 */ 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 */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Update the SyncMapItemInstance * * @param array $data The data * @return SyncMapItemInstance Updated SyncMapItemInstance */ 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/Twilio/Rest/Preview/Sync/Service/SyncMap/SyncMapPermissionList.php 0000604 00000012701 15174325130 0022006 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/Twilio/Rest/Preview/Sync/Service/SyncMap/SyncMapItemInstance.php 0000604 00000011354 15174325130 0021410 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 */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the SyncMapItemInstance * * @return boolean True if delete succeeds, false otherwise */ public function delete() { return $this->proxy()->delete(); } /** * Update the SyncMapItemInstance * * @param array $data The data * @return SyncMapItemInstance Updated SyncMapItemInstance */ 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/Twilio/Rest/Preview/Sync/Service/SyncMapInstance.php 0000604 00000011244 15174325130 0017215 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 */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the SyncMapInstance * * @return boolean True if delete succeeds, false otherwise */ 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/Twilio/Rest/Preview/Sync/Service/SyncMapContext.php 0000604 00000011427 15174325130 0017100 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 */ 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 */ 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 \Twilio\Exceptions\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 \Twilio\Exceptions\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/Twilio/Rest/Preview/Sync/Service/DocumentInstance.php 0000604 00000011364 15174325130 0017424 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 */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the DocumentInstance * * @return boolean True if delete succeeds, false otherwise */ public function delete() { return $this->proxy()->delete(); } /** * Update the DocumentInstance * * @param array $data The data * @return DocumentInstance Updated DocumentInstance */ 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/Twilio/Rest/Preview/Sync/Service/SyncMapOptions.php 0000604 00000003122 15174325130 0017100 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/Twilio/Rest/Preview/Sync/Service/SyncListOptions.php 0000604 00000003127 15174325130 0017303 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/Twilio/Rest/Preview/Sync/Service/SyncListPage.php 0000604 00000001712 15174325130 0016522 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/Twilio/Rest/Preview/Sync/Service/SyncListInstance.php 0000604 00000011274 15174325130 0017416 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 */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the SyncListInstance * * @return boolean True if delete succeeds, false otherwise */ 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/Twilio/Rest/Preview/Sync/Service/SyncListContext.php 0000604 00000011506 15174325130 0017274 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(integer $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 */ 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 */ 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 \Twilio\Exceptions\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 \Twilio\Exceptions\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/Twilio/Rest/Preview/Sync/ServicePage.php 0000604 00000001640 15174325130 0014752 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/Twilio/Rest/Preview/Sync/ServiceContext.php 0000604 00000013060 15174325130 0015521 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 */ 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 */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Update the ServiceInstance * * @param array|Options $options Optional Arguments * @return ServiceInstance Updated ServiceInstance */ 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 \Twilio\Exceptions\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 \Twilio\Exceptions\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/Twilio/Rest/Preview/Sync/ServiceOptions.php 0000604 00000014241 15174325130 0015532 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 boolean $reachabilityWebhooksEnabled The reachability_webhooks_enabled * @param boolean $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 boolean $reachabilityWebhooksEnabled The reachability_webhooks_enabled * @param boolean $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 boolean $reachabilityWebhooksEnabled The reachability_webhooks_enabled * @param boolean $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 boolean $reachabilityWebhooksEnabled The reachability_webhooks_enabled * @return $this Fluent Builder */ public function setReachabilityWebhooksEnabled($reachabilityWebhooksEnabled) { $this->options['reachabilityWebhooksEnabled'] = $reachabilityWebhooksEnabled; return $this; } /** * The acl_enabled * * @param boolean $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 boolean $reachabilityWebhooksEnabled The reachability_webhooks_enabled * @param boolean $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 boolean $reachabilityWebhooksEnabled The reachability_webhooks_enabled * @return $this Fluent Builder */ public function setReachabilityWebhooksEnabled($reachabilityWebhooksEnabled) { $this->options['reachabilityWebhooksEnabled'] = $reachabilityWebhooksEnabled; return $this; } /** * The acl_enabled * * @param boolean $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/Twilio/Rest/Preview/Sync/ServiceList.php 0000604 00000013173 15174325130 0015015 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Sync; 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 */ 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/Twilio/Rest/Preview/Sync/ServiceInstance.php 0000604 00000011725 15174325130 0015647 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 boolean reachabilityWebhooksEnabled * @property boolean 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 */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the ServiceInstance * * @return boolean True if delete succeeds, false otherwise */ public function delete() { return $this->proxy()->delete(); } /** * Update the ServiceInstance * * @param array|Options $options Optional Arguments * @return ServiceInstance Updated ServiceInstance */ 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/Twilio/Rest/Preview/HostedNumbers.php 0000604 00000006236 15174325130 0014431 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 \Twilio\Exceptions\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 \Twilio\Exceptions\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/Twilio/Rest/Preview/Proxy/Service/SessionPage.php 0000604 00000001711 15174325130 0016601 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Proxy\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 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.Preview.Proxy.SessionPage]'; } } sdk/Twilio/Rest/Preview/Proxy/Service/ShortCodePage.php 0000604 00000001717 15174325130 0017056 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Proxy\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 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.Preview.Proxy.ShortCodePage]'; } } sdk/Twilio/Rest/Preview/Proxy/Service/PhoneNumberContext.php 0000604 00000004276 15174325130 0020161 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Proxy\Service; 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 PhoneNumberContext extends InstanceContext { /** * Initialize the PhoneNumberContext * * @param \Twilio\Version $version Version that contains the resource * @param string $serviceSid The service_sid * @param string $sid Fetch by unique phone-number Sid * @return \Twilio\Rest\Preview\Proxy\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 */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Fetch a PhoneNumberInstance * * @return PhoneNumberInstance Fetched PhoneNumberInstance */ 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.Preview.Proxy.PhoneNumberContext ' . implode(' ', $context) . ']'; } } sdk/Twilio/Rest/Preview/Proxy/Service/ShortCodeContext.php 0000604 00000004247 15174325130 0017627 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Proxy\Service; 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 ShortCodeContext extends InstanceContext { /** * Initialize the ShortCodeContext * * @param \Twilio\Version $version Version that contains the resource * @param string $serviceSid The service_sid * @param string $sid Fetch by unique shortcode Sid * @return \Twilio\Rest\Preview\Proxy\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 */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Fetch a ShortCodeInstance * * @return ShortCodeInstance Fetched ShortCodeInstance */ 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.Preview.Proxy.ShortCodeContext ' . implode(' ', $context) . ']'; } } sdk/Twilio/Rest/Preview/Proxy/Service/ShortCodeList.php 0000604 00000013017 15174325130 0017111 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Proxy\Service; 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 ShortCodeList extends ListResource { /** * Construct the ShortCodeList * * @param Version $version Version that contains the resource * @param string $serviceSid Service Sid. * @return \Twilio\Rest\Preview\Proxy\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 Delete by unique shortcode Sid * @return ShortCodeInstance Newly created ShortCodeInstance */ 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 Fetch by unique shortcode Sid * @return \Twilio\Rest\Preview\Proxy\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.Preview.Proxy.ShortCodeList]'; } } sdk/Twilio/Rest/Preview/Proxy/Service/ShortCodeInstance.php 0000604 00000010143 15174325130 0017737 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Proxy\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 \DateTime dateCreated * @property \DateTime dateUpdated * @property string shortCode * @property string countryCode * @property array 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 Service Sid. * @param string $sid Fetch by unique shortcode Sid * @return \Twilio\Rest\Preview\Proxy\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\Preview\Proxy\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 */ public function delete() { return $this->proxy()->delete(); } /** * Fetch a ShortCodeInstance * * @return ShortCodeInstance Fetched ShortCodeInstance */ 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.Proxy.ShortCodeInstance ' . implode(' ', $context) . ']'; } } sdk/Twilio/Rest/Preview/Proxy/Service/SessionList.php 0000604 00000014276 15174325130 0016652 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Proxy\Service; 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 * @param string $serviceSid Service Sid. * @return \Twilio\Rest\Preview\Proxy\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 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 SessionInstance 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 SessionInstance[] 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 SessionInstance 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 SessionInstance */ public function page($options = array(), $pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $options = new Values($options); $params = Values::of(array( 'UniqueName' => $options['uniqueName'], 'Status' => $options['status'], '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 */ public function create($options = array()) { $options = new Values($options); $data = Values::of(array( 'UniqueName' => $options['uniqueName'], 'Ttl' => $options['ttl'], 'Status' => $options['status'], 'Participants' => Serialize::map($options['participants'], function($e) { return $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 A string that uniquely identifies this Session. * @return \Twilio\Rest\Preview\Proxy\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.Preview.Proxy.SessionList]'; } } sdk/Twilio/Rest/Preview/Proxy/Service/SessionOptions.php 0000604 00000020265 15174325130 0017365 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Proxy\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 SessionOptions { /** * @param string $uniqueName A unique, developer assigned name of this Session. * @param string $status The Status of this Session * @return ReadSessionOptions Options builder */ public static function read($uniqueName = Values::NONE, $status = Values::NONE) { return new ReadSessionOptions($uniqueName, $status); } /** * @param string $uniqueName A unique, developer assigned name of this Session. * @param integer $ttl How long will this session stay open, in seconds. * @param string $status The Status of this Session * @param string $participants The participants * @return CreateSessionOptions Options builder */ public static function create($uniqueName = Values::NONE, $ttl = Values::NONE, $status = Values::NONE, $participants = Values::NONE) { return new CreateSessionOptions($uniqueName, $ttl, $status, $participants); } /** * @param string $uniqueName A unique, developer assigned name of this Session. * @param integer $ttl How long will this session stay open, in seconds. * @param string $status The Status of this Session * @param string $participants The participants * @return UpdateSessionOptions Options builder */ public static function update($uniqueName = Values::NONE, $ttl = Values::NONE, $status = Values::NONE, $participants = Values::NONE) { return new UpdateSessionOptions($uniqueName, $ttl, $status, $participants); } } class ReadSessionOptions extends Options { /** * @param string $uniqueName A unique, developer assigned name of this Session. * @param string $status The Status of this Session */ public function __construct($uniqueName = Values::NONE, $status = Values::NONE) { $this->options['uniqueName'] = $uniqueName; $this->options['status'] = $status; } /** * Provides a unique and addressable name to be assigned to this Session, assigned by the developer, to be optionally used in addition to SID. * * @param string $uniqueName A unique, developer assigned name of this Session. * @return $this Fluent Builder */ public function setUniqueName($uniqueName) { $this->options['uniqueName'] = $uniqueName; return $this; } /** * The Status of this Session. One of `in-progess` or `completed`. * * @param string $status The Status of this Session * @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.Proxy.ReadSessionOptions ' . implode(' ', $options) . ']'; } } class CreateSessionOptions extends Options { /** * @param string $uniqueName A unique, developer assigned name of this Session. * @param integer $ttl How long will this session stay open, in seconds. * @param string $status The Status of this Session * @param string $participants The participants */ public function __construct($uniqueName = Values::NONE, $ttl = Values::NONE, $status = Values::NONE, $participants = Values::NONE) { $this->options['uniqueName'] = $uniqueName; $this->options['ttl'] = $ttl; $this->options['status'] = $status; $this->options['participants'] = $participants; } /** * Provides a unique and addressable name to be assigned to this Session, assigned by the developer, to be optionally used in addition to SID. * * @param string $uniqueName A unique, developer assigned name of this Session. * @return $this Fluent Builder */ public function setUniqueName($uniqueName) { $this->options['uniqueName'] = $uniqueName; return $this; } /** * How long will this session stay open, in seconds. Each new interaction resets this timer. * * @param integer $ttl How long will this session stay open, in seconds. * @return $this Fluent Builder */ public function setTtl($ttl) { $this->options['ttl'] = $ttl; return $this; } /** * The Status of this Session. One of `in-progess` or `completed`. * * @param string $status The Status of this Session * @return $this Fluent Builder */ public function setStatus($status) { $this->options['status'] = $status; return $this; } /** * The participants * * @param string $participants The participants * @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.Preview.Proxy.CreateSessionOptions ' . implode(' ', $options) . ']'; } } class UpdateSessionOptions extends Options { /** * @param string $uniqueName A unique, developer assigned name of this Session. * @param integer $ttl How long will this session stay open, in seconds. * @param string $status The Status of this Session * @param string $participants The participants */ public function __construct($uniqueName = Values::NONE, $ttl = Values::NONE, $status = Values::NONE, $participants = Values::NONE) { $this->options['uniqueName'] = $uniqueName; $this->options['ttl'] = $ttl; $this->options['status'] = $status; $this->options['participants'] = $participants; } /** * Provides a unique and addressable name to be assigned to this Session, assigned by the developer, to be optionally used in addition to SID. * * @param string $uniqueName A unique, developer assigned name of this Session. * @return $this Fluent Builder */ public function setUniqueName($uniqueName) { $this->options['uniqueName'] = $uniqueName; return $this; } /** * How long will this session stay open, in seconds. Each new interaction resets this timer. * * @param integer $ttl How long will this session stay open, in seconds. * @return $this Fluent Builder */ public function setTtl($ttl) { $this->options['ttl'] = $ttl; return $this; } /** * The Status of this Session. One of `in-progess` or `completed`. * * @param string $status The Status of this Session * @return $this Fluent Builder */ public function setStatus($status) { $this->options['status'] = $status; return $this; } /** * The participants * * @param string $participants The participants * @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.Preview.Proxy.UpdateSessionOptions ' . implode(' ', $options) . ']'; } } sdk/Twilio/Rest/Preview/Proxy/Service/SessionContext.php 0000604 00000013200 15174325130 0017345 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Proxy\Service; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Rest\Preview\Proxy\Service\Session\InteractionList; use Twilio\Rest\Preview\Proxy\Service\Session\ParticipantList; 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\Proxy\Service\Session\InteractionList interactions * @property \Twilio\Rest\Preview\Proxy\Service\Session\ParticipantList participants * @method \Twilio\Rest\Preview\Proxy\Service\Session\InteractionContext interactions(string $sid) * @method \Twilio\Rest\Preview\Proxy\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 Service Sid. * @param string $sid A string that uniquely identifies this Session. * @return \Twilio\Rest\Preview\Proxy\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 */ 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 */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Update the SessionInstance * * @param array|Options $options Optional Arguments * @return SessionInstance Updated SessionInstance */ public function update($options = array()) { $options = new Values($options); $data = Values::of(array( 'UniqueName' => $options['uniqueName'], 'Ttl' => $options['ttl'], 'Status' => $options['status'], 'Participants' => Serialize::map($options['participants'], function($e) { return $e; }), )); $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\Preview\Proxy\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\Preview\Proxy\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 \Twilio\Exceptions\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 \Twilio\Exceptions\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.Proxy.SessionContext ' . implode(' ', $context) . ']'; } } sdk/Twilio/Rest/Preview/Proxy/Service/PhoneNumberList.php 0000604 00000013077 15174325130 0017447 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Proxy\Service; 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 PhoneNumberList extends ListResource { /** * Construct the PhoneNumberList * * @param Version $version Version that contains the resource * @param string $serviceSid Service Sid. * @return \Twilio\Rest\Preview\Proxy\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 $sid Delete by unique phone-number Sid * @return PhoneNumberInstance Newly created PhoneNumberInstance */ public function create($sid) { $data = Values::of(array('Sid' => $sid, )); $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 Fetch by unique phone-number Sid * @return \Twilio\Rest\Preview\Proxy\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.Preview.Proxy.PhoneNumberList]'; } } sdk/Twilio/Rest/Preview/Proxy/Service/PhoneNumberInstance.php 0000604 00000010312 15174325130 0020265 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Proxy\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 \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 Service Sid. * @param string $sid Fetch by unique phone-number Sid * @return \Twilio\Rest\Preview\Proxy\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\Preview\Proxy\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 */ public function delete() { return $this->proxy()->delete(); } /** * Fetch a PhoneNumberInstance * * @return PhoneNumberInstance Fetched PhoneNumberInstance */ 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.Proxy.PhoneNumberInstance ' . implode(' ', $context) . ']'; } } sdk/Twilio/Rest/Preview/Proxy/Service/Session/ParticipantOptions.php 0000604 00000016211 15174325130 0021637 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Proxy\Service\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 $identifier The Participant's contact identifier, normally a * phone number. * @param string $participantType The Type of this Participant * @return ReadParticipantOptions Options builder */ public static function read($identifier = Values::NONE, $participantType = Values::NONE) { return new ReadParticipantOptions($identifier, $participantType); } /** * @param string $friendlyName A human readable description of this resource * @param string $participantType The Type of this Participant * @return CreateParticipantOptions Options builder */ public static function create($friendlyName = Values::NONE, $participantType = Values::NONE) { return new CreateParticipantOptions($friendlyName, $participantType); } /** * @param string $participantType The Type of this Participant * @param string $identifier The Participant's contact identifier, normally a * phone number. * @param string $friendlyName A human readable description of this resource * @return UpdateParticipantOptions Options builder */ public static function update($participantType = Values::NONE, $identifier = Values::NONE, $friendlyName = Values::NONE) { return new UpdateParticipantOptions($participantType, $identifier, $friendlyName); } } class ReadParticipantOptions extends Options { /** * @param string $identifier The Participant's contact identifier, normally a * phone number. * @param string $participantType The Type of this Participant */ public function __construct($identifier = Values::NONE, $participantType = Values::NONE) { $this->options['identifier'] = $identifier; $this->options['participantType'] = $participantType; } /** * The Participant's contact identifier, normally a phone number. * * @param string $identifier The Participant's contact identifier, normally a * phone number. * @return $this Fluent Builder */ public function setIdentifier($identifier) { $this->options['identifier'] = $identifier; return $this; } /** * The Type of this Participant. One of `sms`, `voice` or `phone`. * * @param string $participantType The Type of this Participant * @return $this Fluent Builder */ public function setParticipantType($participantType) { $this->options['participantType'] = $participantType; return $this; } /** * Provide a friendly representation * * @return 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.Proxy.ReadParticipantOptions ' . implode(' ', $options) . ']'; } } class CreateParticipantOptions extends Options { /** * @param string $friendlyName A human readable description of this resource * @param string $participantType The Type of this Participant */ public function __construct($friendlyName = Values::NONE, $participantType = Values::NONE) { $this->options['friendlyName'] = $friendlyName; $this->options['participantType'] = $participantType; } /** * 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; } /** * The Type of this Participant. One of `sms`, `voice` or `phone`. * * @param string $participantType The Type of this Participant * @return $this Fluent Builder */ public function setParticipantType($participantType) { $this->options['participantType'] = $participantType; return $this; } /** * Provide a friendly representation * * @return 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.Proxy.CreateParticipantOptions ' . implode(' ', $options) . ']'; } } class UpdateParticipantOptions extends Options { /** * @param string $participantType The Type of this Participant * @param string $identifier The Participant's contact identifier, normally a * phone number. * @param string $friendlyName A human readable description of this resource */ public function __construct($participantType = Values::NONE, $identifier = Values::NONE, $friendlyName = Values::NONE) { $this->options['participantType'] = $participantType; $this->options['identifier'] = $identifier; $this->options['friendlyName'] = $friendlyName; } /** * The Type of this Participant. One of `sms`, `voice` or `phone`. * * @param string $participantType The Type of this Participant * @return $this Fluent Builder */ public function setParticipantType($participantType) { $this->options['participantType'] = $participantType; return $this; } /** * The Participant's contact identifier, normally a phone number. * * @param string $identifier The Participant's contact identifier, normally a * phone number. * @return $this Fluent Builder */ public function setIdentifier($identifier) { $this->options['identifier'] = $identifier; 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; } /** * Provide a friendly representation * * @return 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.Proxy.UpdateParticipantOptions ' . implode(' ', $options) . ']'; } } sdk/Twilio/Rest/Preview/Proxy/Service/Session/ParticipantContext.php 0000604 00000012446 15174325130 0021636 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Proxy\Service\Session; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Rest\Preview\Proxy\Service\Session\Participant\MessageInteractionList; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview 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\Proxy\Service\Session\Participant\MessageInteractionList messageInteractions * @method \Twilio\Rest\Preview\Proxy\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 Service Sid. * @param string $sessionSid Session Sid. * @param string $sid A string that uniquely identifies this Participant. * @return \Twilio\Rest\Preview\Proxy\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 */ 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 */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Update the ParticipantInstance * * @param array|Options $options Optional Arguments * @return ParticipantInstance Updated ParticipantInstance */ public function update($options = array()) { $options = new Values($options); $data = Values::of(array( 'ParticipantType' => $options['participantType'], 'Identifier' => $options['identifier'], 'FriendlyName' => $options['friendlyName'], )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new ParticipantInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sessionSid'], $this->solution['sid'] ); } /** * Access the messageInteractions * * @return \Twilio\Rest\Preview\Proxy\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 \Twilio\Exceptions\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 \Twilio\Exceptions\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.Proxy.ParticipantContext ' . implode(' ', $context) . ']'; } } sdk/Twilio/Rest/Preview/Proxy/Service/Session/ParticipantList.php 0000604 00000015241 15174325130 0021121 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Proxy\Service\Session; 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 ParticipantList extends ListResource { /** * Construct the ParticipantList * * @param Version $version Version that contains the resource * @param string $serviceSid Service Sid. * @param string $sessionSid Session Sid. * @return \Twilio\Rest\Preview\Proxy\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 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( 'Identifier' => $options['identifier'], 'ParticipantType' => $options['participantType'], '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 Participant's contact identifier, normally a * phone number. * @param array|Options $options Optional Arguments * @return ParticipantInstance Newly created ParticipantInstance */ public function create($identifier, $options = array()) { $options = new Values($options); $data = Values::of(array( 'Identifier' => $identifier, 'FriendlyName' => $options['friendlyName'], 'ParticipantType' => $options['participantType'], )); $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 A string that uniquely identifies this Participant. * @return \Twilio\Rest\Preview\Proxy\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.Preview.Proxy.ParticipantList]'; } } sdk/Twilio/Rest/Preview/Proxy/Service/Session/Participant/MessageInteractionList.php 0000604 00000015147 15174325130 0024712 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Proxy\Service\Session\Participant; 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 MessageInteractionList extends ListResource { /** * Construct the MessageInteractionList * * @param Version $version Version that contains the resource * @param string $serviceSid Service Sid. * @param string $sessionSid Session Sid. * @param string $participantSid The participant_sid * @return \Twilio\Rest\Preview\Proxy\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 */ 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 A string that uniquely identifies this Interaction. * @return \Twilio\Rest\Preview\Proxy\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.Preview.Proxy.MessageInteractionList]'; } } sdk/Twilio/Rest/Preview/Proxy/Service/Session/Participant/MessageInteractionInstance.php 0000604 00000013512 15174325130 0025535 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Proxy\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 preview 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 sessionSid * @property string serviceSid * @property string accountSid * @property string data * @property string status * @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 Service Sid. * @param string $sessionSid Session Sid. * @param string $participantSid The participant_sid * @param string $sid A string that uniquely identifies this Interaction. * @return \Twilio\Rest\Preview\Proxy\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'), 'status' => Values::array_get($payload, 'status'), '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\Preview\Proxy\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 */ 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.Proxy.MessageInteractionInstance ' . implode(' ', $context) . ']'; } } sdk/Twilio/Rest/Preview/Proxy/Service/Session/Participant/MessageInteractionOptions.php 0000604 00000004456 15174325130 0025433 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Proxy\Service\Session\Participant; 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 MessageInteractionOptions { /** * @param string $body The body of the message. Up to 1600 characters long. * @param string $mediaUrl The url of an image or video. * @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 The body of the message. Up to 1600 characters long. * @param string $mediaUrl The url of an image or video. */ public function __construct($body = Values::NONE, $mediaUrl = Values::NONE) { $this->options['body'] = $body; $this->options['mediaUrl'] = $mediaUrl; } /** * The text body of the message to send to the Participant. Up to 1600 characters long. * * @param string $body The body of the message. Up to 1600 characters long. * @return $this Fluent Builder */ public function setBody($body) { $this->options['body'] = $body; return $this; } /** * The public url of an image or video to send to the Participant. * * @param string $mediaUrl The url of an image or video. * @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.Preview.Proxy.CreateMessageInteractionOptions ' . implode(' ', $options) . ']'; } } sdk/Twilio/Rest/Preview/Proxy/Service/Session/Participant/MessageInteractionPage.php 0000604 00000002206 15174325130 0024643 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Proxy\Service\Session\Participant; 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 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.Preview.Proxy.MessageInteractionPage]'; } } sdk/Twilio/Rest/Preview/Proxy/Service/Session/Participant/MessageInteractionContext.php 0000604 00000005010 15174325130 0025407 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Proxy\Service\Session\Participant; 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 MessageInteractionContext extends InstanceContext { /** * Initialize the MessageInteractionContext * * @param \Twilio\Version $version Version that contains the resource * @param string $serviceSid Service Sid. * @param string $sessionSid Session Sid. * @param string $participantSid Participant Sid. * @param string $sid A string that uniquely identifies this Interaction. * @return \Twilio\Rest\Preview\Proxy\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 */ 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.Preview.Proxy.MessageInteractionContext ' . implode(' ', $context) . ']'; } } sdk/Twilio/Rest/Preview/Proxy/Service/Session/InteractionContext.php 0000604 00000004252 15174325130 0021633 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Proxy\Service\Session; 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 InteractionContext extends InstanceContext { /** * Initialize the InteractionContext * * @param \Twilio\Version $version Version that contains the resource * @param string $serviceSid Service Sid. * @param string $sessionSid Session Sid. * @param string $sid A string that uniquely identifies this Interaction. * @return \Twilio\Rest\Preview\Proxy\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 */ 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'] ); } /** * Provide 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.Proxy.InteractionContext ' . implode(' ', $context) . ']'; } } sdk/Twilio/Rest/Preview/Proxy/Service/Session/InteractionOptions.php 0000604 00000006074 15174325130 0021646 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Proxy\Service\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 InteractionOptions { /** * @param string $inboundParticipantStatus The Inbound Participant Status of * this Interaction * @param string $outboundParticipantStatus The Outbound Participant Status of * this Interaction * @return ReadInteractionOptions Options builder */ public static function read($inboundParticipantStatus = Values::NONE, $outboundParticipantStatus = Values::NONE) { return new ReadInteractionOptions($inboundParticipantStatus, $outboundParticipantStatus); } } class ReadInteractionOptions extends Options { /** * @param string $inboundParticipantStatus The Inbound Participant Status of * this Interaction * @param string $outboundParticipantStatus The Outbound Participant Status of * this Interaction */ public function __construct($inboundParticipantStatus = Values::NONE, $outboundParticipantStatus = Values::NONE) { $this->options['inboundParticipantStatus'] = $inboundParticipantStatus; $this->options['outboundParticipantStatus'] = $outboundParticipantStatus; } /** * The Inbound Participant Status of this Interaction. One of `completed`, `in-progress` or `failed`. * * @param string $inboundParticipantStatus The Inbound Participant Status of * this Interaction * @return $this Fluent Builder */ public function setInboundParticipantStatus($inboundParticipantStatus) { $this->options['inboundParticipantStatus'] = $inboundParticipantStatus; return $this; } /** * The Outbound Participant Status of this Interaction. One of `completed`, `in-progress` or `failed`. * * @param string $outboundParticipantStatus The Outbound Participant Status of * this Interaction * @return $this Fluent Builder */ public function setOutboundParticipantStatus($outboundParticipantStatus) { $this->options['outboundParticipantStatus'] = $outboundParticipantStatus; return $this; } /** * Provide a friendly representation * * @return 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.Proxy.ReadInteractionOptions ' . implode(' ', $options) . ']'; } } sdk/Twilio/Rest/Preview/Proxy/Service/Session/ParticipantPage.php 0000604 00000002066 15174325130 0021063 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Proxy\Service\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['serviceSid'], $this->solution['sessionSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Preview.Proxy.ParticipantPage]'; } } sdk/Twilio/Rest/Preview/Proxy/Service/Session/InteractionPage.php 0000604 00000002066 15174325130 0021064 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Proxy\Service\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 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.Preview.Proxy.InteractionPage]'; } } sdk/Twilio/Rest/Preview/Proxy/Service/Session/ParticipantInstance.php 0000604 00000012303 15174325130 0021746 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Proxy\Service\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 sessionSid * @property string serviceSid * @property string accountSid * @property string friendlyName * @property string participantType * @property string identifier * @property string proxyIdentifier * @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 Service Sid. * @param string $sessionSid Session Sid. * @param string $sid A string that uniquely identifies this Participant. * @return \Twilio\Rest\Preview\Proxy\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'), 'participantType' => Values::array_get($payload, 'participant_type'), 'identifier' => Values::array_get($payload, 'identifier'), 'proxyIdentifier' => Values::array_get($payload, 'proxy_identifier'), '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\Preview\Proxy\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 */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the ParticipantInstance * * @return boolean True if delete succeeds, false otherwise */ public function delete() { return $this->proxy()->delete(); } /** * Update the ParticipantInstance * * @param array|Options $options Optional Arguments * @return ParticipantInstance Updated ParticipantInstance */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Access the messageInteractions * * @return \Twilio\Rest\Preview\Proxy\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.Preview.Proxy.ParticipantInstance ' . implode(' ', $context) . ']'; } } sdk/Twilio/Rest/Preview/Proxy/Service/Session/InteractionInstance.php 0000604 00000012537 15174325130 0021760 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Proxy\Service\Session; 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 sessionSid * @property string serviceSid * @property string accountSid * @property string data * @property string status * @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 Service Sid. * @param string $sessionSid Session Sid. * @param string $sid A string that uniquely identifies this Interaction. * @return \Twilio\Rest\Preview\Proxy\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'), 'status' => Values::array_get($payload, 'status'), '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\Preview\Proxy\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 */ 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.Proxy.InteractionInstance ' . implode(' ', $context) . ']'; } } sdk/Twilio/Rest/Preview/Proxy/Service/Session/InteractionList.php 0000604 00000013422 15174325130 0021121 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Proxy\Service\Session; 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 InteractionList extends ListResource { /** * Construct the InteractionList * * @param Version $version Version that contains the resource * @param string $serviceSid Service Sid. * @param string $sessionSid Session Sid. * @return \Twilio\Rest\Preview\Proxy\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 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 InteractionInstance 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 InteractionInstance[] 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 InteractionInstance 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 InteractionInstance */ public function page($options = array(), $pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $options = new Values($options); $params = Values::of(array( 'InboundParticipantStatus' => $options['inboundParticipantStatus'], 'OutboundParticipantStatus' => $options['outboundParticipantStatus'], '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 A string that uniquely identifies this Interaction. * @return \Twilio\Rest\Preview\Proxy\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.Preview.Proxy.InteractionList]'; } } sdk/Twilio/Rest/Preview/Proxy/Service/SessionInstance.php 0000604 00000012266 15174325130 0017500 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Proxy\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 preview 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 uniqueName * @property integer ttl * @property string status * @property \DateTime startTime * @property \DateTime endTime * @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 Service Sid. * @param string $sid A string that uniquely identifies this Session. * @return \Twilio\Rest\Preview\Proxy\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'), 'uniqueName' => Values::array_get($payload, 'unique_name'), 'ttl' => Values::array_get($payload, 'ttl'), 'status' => Values::array_get($payload, 'status'), 'startTime' => Deserialize::dateTime(Values::array_get($payload, 'start_time')), 'endTime' => Deserialize::dateTime(Values::array_get($payload, 'end_time')), '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\Preview\Proxy\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 */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the SessionInstance * * @return boolean True if delete succeeds, false otherwise */ public function delete() { return $this->proxy()->delete(); } /** * Update the SessionInstance * * @param array|Options $options Optional Arguments * @return SessionInstance Updated SessionInstance */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Access the interactions * * @return \Twilio\Rest\Preview\Proxy\Service\Session\InteractionList */ protected function getInteractions() { return $this->proxy()->interactions; } /** * Access the participants * * @return \Twilio\Rest\Preview\Proxy\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.Preview.Proxy.SessionInstance ' . implode(' ', $context) . ']'; } } sdk/Twilio/Rest/Preview/Proxy/Service/PhoneNumberPage.php 0000604 00000001725 15174325130 0017405 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Proxy\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 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.Preview.Proxy.PhoneNumberPage]'; } } sdk/Twilio/Rest/Preview/Proxy/ServicePage.php 0000604 00000001642 15174325130 0015161 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Proxy; 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.Proxy.ServicePage]'; } } sdk/Twilio/Rest/Preview/Proxy/ServiceInstance.php 0000604 00000011600 15174325130 0016044 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Proxy; 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 boolean autoCreate * @property string callbackUrl * @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 A string that uniquely identifies this Service. * @return \Twilio\Rest\Preview\Proxy\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'), 'autoCreate' => Values::array_get($payload, 'auto_create'), 'callbackUrl' => Values::array_get($payload, '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\Preview\Proxy\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 */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the ServiceInstance * * @return boolean True if delete succeeds, false otherwise */ public function delete() { return $this->proxy()->delete(); } /** * Update the ServiceInstance * * @param array|Options $options Optional Arguments * @return ServiceInstance Updated ServiceInstance */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Access the sessions * * @return \Twilio\Rest\Preview\Proxy\Service\SessionList */ protected function getSessions() { return $this->proxy()->sessions; } /** * Access the phoneNumbers * * @return \Twilio\Rest\Preview\Proxy\Service\PhoneNumberList */ protected function getPhoneNumbers() { return $this->proxy()->phoneNumbers; } /** * Access the shortCodes * * @return \Twilio\Rest\Preview\Proxy\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.Preview.Proxy.ServiceInstance ' . implode(' ', $context) . ']'; } } sdk/Twilio/Rest/Preview/Proxy/ServiceList.php 0000604 00000013067 15174325130 0015224 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Proxy; 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\Proxy\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 array|Options $options Optional Arguments * @return ServiceInstance Newly created ServiceInstance */ public function create($options = array()) { $options = new Values($options); $data = Values::of(array( 'FriendlyName' => $options['friendlyName'], 'AutoCreate' => Serialize::booleanToString($options['autoCreate']), 'CallbackUrl' => $options['callbackUrl'], )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new ServiceInstance($this->version, $payload); } /** * Constructs a ServiceContext * * @param string $sid A string that uniquely identifies this Service. * @return \Twilio\Rest\Preview\Proxy\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.Proxy.ServiceList]'; } } sdk/Twilio/Rest/Preview/Proxy/ServiceOptions.php 0000604 00000013400 15174325130 0015733 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Proxy; 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 * @param boolean $autoCreate Boolean flag specifying whether to auto-create * threads. * @param string $callbackUrl URL Twilio will request for callbacks. * @return CreateServiceOptions Options builder */ public static function create($friendlyName = Values::NONE, $autoCreate = Values::NONE, $callbackUrl = Values::NONE) { return new CreateServiceOptions($friendlyName, $autoCreate, $callbackUrl); } /** * @param string $friendlyName A human readable description of this resource * @param boolean $autoCreate Boolean flag specifying whether to auto-create * threads. * @param string $callbackUrl URL Twilio will request for callbacks. * @return UpdateServiceOptions Options builder */ public static function update($friendlyName = Values::NONE, $autoCreate = Values::NONE, $callbackUrl = Values::NONE) { return new UpdateServiceOptions($friendlyName, $autoCreate, $callbackUrl); } } class CreateServiceOptions extends Options { /** * @param string $friendlyName A human readable description of this resource * @param boolean $autoCreate Boolean flag specifying whether to auto-create * threads. * @param string $callbackUrl URL Twilio will request for callbacks. */ public function __construct($friendlyName = Values::NONE, $autoCreate = Values::NONE, $callbackUrl = Values::NONE) { $this->options['friendlyName'] = $friendlyName; $this->options['autoCreate'] = $autoCreate; $this->options['callbackUrl'] = $callbackUrl; } /** * 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; } /** * Boolean flag specifying whether to create threads when a user communticates out of band. * * @param boolean $autoCreate Boolean flag specifying whether to auto-create * threads. * @return $this Fluent Builder */ public function setAutoCreate($autoCreate) { $this->options['autoCreate'] = $autoCreate; return $this; } /** * The URL Twilio will request for callback notifications. * * @param string $callbackUrl URL Twilio will request for callbacks. * @return $this Fluent Builder */ public function setCallbackUrl($callbackUrl) { $this->options['callbackUrl'] = $callbackUrl; return $this; } /** * Provide a friendly representation * * @return 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.Proxy.CreateServiceOptions ' . implode(' ', $options) . ']'; } } class UpdateServiceOptions extends Options { /** * @param string $friendlyName A human readable description of this resource * @param boolean $autoCreate Boolean flag specifying whether to auto-create * threads. * @param string $callbackUrl URL Twilio will request for callbacks. */ public function __construct($friendlyName = Values::NONE, $autoCreate = Values::NONE, $callbackUrl = Values::NONE) { $this->options['friendlyName'] = $friendlyName; $this->options['autoCreate'] = $autoCreate; $this->options['callbackUrl'] = $callbackUrl; } /** * 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; } /** * Boolean flag specifying whether to create threads when a user communticates out of band. * * @param boolean $autoCreate Boolean flag specifying whether to auto-create * threads. * @return $this Fluent Builder */ public function setAutoCreate($autoCreate) { $this->options['autoCreate'] = $autoCreate; return $this; } /** * The URL Twilio will request for callback notifications. * * @param string $callbackUrl URL Twilio will request for callbacks. * @return $this Fluent Builder */ public function setCallbackUrl($callbackUrl) { $this->options['callbackUrl'] = $callbackUrl; return $this; } /** * Provide a friendly representation * * @return 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.Proxy.UpdateServiceOptions ' . implode(' ', $options) . ']'; } } sdk/Twilio/Rest/Preview/Proxy/ServiceContext.php 0000604 00000013053 15174325130 0015730 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Proxy; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Rest\Preview\Proxy\Service\PhoneNumberList; use Twilio\Rest\Preview\Proxy\Service\SessionList; use Twilio\Rest\Preview\Proxy\Service\ShortCodeList; 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\Proxy\Service\SessionList sessions * @property \Twilio\Rest\Preview\Proxy\Service\PhoneNumberList phoneNumbers * @property \Twilio\Rest\Preview\Proxy\Service\ShortCodeList shortCodes * @method \Twilio\Rest\Preview\Proxy\Service\SessionContext sessions(string $sid) * @method \Twilio\Rest\Preview\Proxy\Service\PhoneNumberContext phoneNumbers(string $sid) * @method \Twilio\Rest\Preview\Proxy\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 A string that uniquely identifies this Service. * @return \Twilio\Rest\Preview\Proxy\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 */ 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 */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Update the ServiceInstance * * @param array|Options $options Optional Arguments * @return ServiceInstance Updated ServiceInstance */ public function update($options = array()) { $options = new Values($options); $data = Values::of(array( 'FriendlyName' => $options['friendlyName'], 'AutoCreate' => Serialize::booleanToString($options['autoCreate']), 'CallbackUrl' => $options['callbackUrl'], )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new ServiceInstance($this->version, $payload, $this->solution['sid']); } /** * Access the sessions * * @return \Twilio\Rest\Preview\Proxy\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\Preview\Proxy\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\Preview\Proxy\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 \Twilio\Exceptions\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 \Twilio\Exceptions\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.Proxy.ServiceContext ' . implode(' ', $context) . ']'; } } sdk/Twilio/Rest/Preview/Sync.php 0000604 00000004470 15174325130 0012561 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 \Twilio\Exceptions\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 \Twilio\Exceptions\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/Twilio/Rest/Preview/DeployedDevices/FleetPage.php 0000604 00000001660 15174325130 0016547 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/Twilio/Rest/Preview/DeployedDevices/FleetList.php 0000604 00000012601 15174325130 0016603 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\DeployedDevices; 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 */ 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/Twilio/Rest/Preview/DeployedDevices/FleetInstance.php 0000604 00000012242 15174325130 0017435 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 */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the FleetInstance * * @return boolean True if delete succeeds, false otherwise */ public function delete() { return $this->proxy()->delete(); } /** * Update the FleetInstance * * @param array|Options $options Optional Arguments * @return FleetInstance Updated FleetInstance */ 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/Twilio/Rest/Preview/DeployedDevices/Fleet/KeyContext.php 0000604 00000005355 15174325130 0020054 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\DeployedDevices\Fleet; 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 */ 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 */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Update the KeyInstance * * @param array|Options $options Optional Arguments * @return KeyInstance Updated KeyInstance */ 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/Twilio/Rest/Preview/DeployedDevices/Fleet/KeyList.php 0000604 00000013711 15174325130 0017336 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\DeployedDevices\Fleet; 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 */ 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/Twilio/Rest/Preview/DeployedDevices/Fleet/DeviceContext.php 0000604 00000006046 15174325130 0020521 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\DeployedDevices\Fleet; 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 */ 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 */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Update the DeviceInstance * * @param array|Options $options Optional Arguments * @return DeviceInstance Updated DeviceInstance */ 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/Twilio/Rest/Preview/DeployedDevices/Fleet/DeviceOptions.php 0000604 00000021322 15174325130 0020522 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 boolean $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 boolean $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 boolean $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 boolean $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 boolean $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 boolean $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/Twilio/Rest/Preview/DeployedDevices/Fleet/DeviceList.php 0000604 00000014337 15174325130 0020012 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\DeployedDevices\Fleet; 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 */ 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/Twilio/Rest/Preview/DeployedDevices/Fleet/KeyOptions.php 0000604 00000013320 15174325130 0020052 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/Twilio/Rest/Preview/DeployedDevices/Fleet/CertificateList.php 0000604 00000014401 15174325130 0021025 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\DeployedDevices\Fleet; 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 */ 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/Twilio/Rest/Preview/DeployedDevices/Fleet/DeploymentContext.php 0000604 00000005724 15174325130 0021444 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\DeployedDevices\Fleet; 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 */ 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 */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Update the DeploymentInstance * * @param array|Options $options Optional Arguments * @return DeploymentInstance Updated DeploymentInstance */ 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/Twilio/Rest/Preview/DeployedDevices/Fleet/DeploymentOptions.php 0000604 00000011571 15174325130 0021450 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/Twilio/Rest/Preview/DeployedDevices/Fleet/KeyPage.php 0000604 00000001715 15174325130 0017300 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/Twilio/Rest/Preview/DeployedDevices/Fleet/DevicePage.php 0000604 00000001726 15174325130 0017751 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/Twilio/Rest/Preview/DeployedDevices/Fleet/CertificatePage.php 0000604 00000001745 15174325130 0020775 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/Twilio/Rest/Preview/DeployedDevices/Fleet/CertificateOptions.php 0000604 00000014654 15174325130 0021557 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/Twilio/Rest/Preview/DeployedDevices/Fleet/CertificateContext.php 0000604 00000005731 15174325130 0021544 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\DeployedDevices\Fleet; 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 */ 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 */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Update the CertificateInstance * * @param array|Options $options Optional Arguments * @return CertificateInstance Updated CertificateInstance */ 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/Twilio/Rest/Preview/DeployedDevices/Fleet/CertificateInstance.php 0000604 00000010644 15174325130 0021663 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 */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the CertificateInstance * * @return boolean True if delete succeeds, false otherwise */ public function delete() { return $this->proxy()->delete(); } /** * Update the CertificateInstance * * @param array|Options $options Optional Arguments * @return CertificateInstance Updated CertificateInstance */ 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/Twilio/Rest/Preview/DeployedDevices/Fleet/DeploymentList.php 0000604 00000013432 15174325130 0020726 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\DeployedDevices\Fleet; 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 */ 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/Twilio/Rest/Preview/DeployedDevices/Fleet/DeploymentInstance.php 0000604 00000011043 15174325130 0021553 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 */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the DeploymentInstance * * @return boolean True if delete succeeds, false otherwise */ public function delete() { return $this->proxy()->delete(); } /** * Update the DeploymentInstance * * @param array|Options $options Optional Arguments * @return DeploymentInstance Updated DeploymentInstance */ 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/Twilio/Rest/Preview/DeployedDevices/Fleet/KeyInstance.php 0000604 00000010554 15174325130 0020171 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 */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the KeyInstance * * @return boolean True if delete succeeds, false otherwise */ public function delete() { return $this->proxy()->delete(); } /** * Update the KeyInstance * * @param array|Options $options Optional Arguments * @return KeyInstance Updated KeyInstance */ 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/Twilio/Rest/Preview/DeployedDevices/Fleet/DeviceInstance.php 0000604 00000011512 15174325130 0020633 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 boolean 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 */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the DeviceInstance * * @return boolean True if delete succeeds, false otherwise */ public function delete() { return $this->proxy()->delete(); } /** * Update the DeviceInstance * * @param array|Options $options Optional Arguments * @return DeviceInstance Updated DeviceInstance */ 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/Twilio/Rest/Preview/DeployedDevices/Fleet/DeploymentPage.php 0000604 00000001742 15174325130 0020670 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/Twilio/Rest/Preview/DeployedDevices/FleetContext.php 0000604 00000014123 15174325130 0017315 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 */ 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 */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Update the FleetInstance * * @param array|Options $options Optional Arguments * @return FleetInstance Updated FleetInstance */ 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 \Twilio\Exceptions\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 \Twilio\Exceptions\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/Twilio/Rest/Preview/DeployedDevices/FleetOptions.php 0000604 00000007456 15174325130 0017337 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/Twilio/Rest/Preview/AccSecurity/ServiceContext.php 0000604 00000011135 15174325130 0017024 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 */ 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 */ 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 \Twilio\Exceptions\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 \Twilio\Exceptions\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/Twilio/Rest/Preview/AccSecurity/ServiceOptions.php 0000604 00000007120 15174325130 0017032 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 integer $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 integer $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 integer $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 integer $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 integer $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 integer $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/Twilio/Rest/Preview/AccSecurity/Service/VerificationPage.php 0000604 00000001744 15174325130 0020703 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/Twilio/Rest/Preview/AccSecurity/Service/VerificationInstance.php 0000604 00000005446 15174325130 0021576 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 boolean 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/Twilio/Rest/Preview/AccSecurity/Service/VerificationList.php 0000604 00000004000 15174325130 0020726 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\AccSecurity\Service; 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 */ 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/Twilio/Rest/Preview/AccSecurity/Service/VerificationCheckList.php 0000604 00000003657 15174325130 0021705 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\AccSecurity\Service; 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 */ 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/Twilio/Rest/Preview/AccSecurity/Service/VerificationCheckInstance.php 0000604 00000005472 15174325130 0022533 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 boolean 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/Twilio/Rest/Preview/AccSecurity/Service/VerificationOptions.php 0000604 00000003427 15174325130 0021462 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/Twilio/Rest/Preview/AccSecurity/Service/VerificationCheckPage.php 0000604 00000001763 15174325130 0021642 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/Twilio/Rest/Preview/AccSecurity/Service/VerificationCheckOptions.php 0000604 00000003116 15174325130 0022413 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/Twilio/Rest/Preview/AccSecurity/ServiceList.php 0000604 00000012735 15174325130 0016322 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\AccSecurity; 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 */ 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/Twilio/Rest/Preview/AccSecurity/ServiceInstance.php 0000604 00000010623 15174325130 0017145 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 integer 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 */ public function fetch() { return $this->proxy()->fetch(); } /** * Update the ServiceInstance * * @param array|Options $options Optional Arguments * @return ServiceInstance Updated ServiceInstance */ 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/Twilio/Rest/Preview/AccSecurity/ServicePage.php 0000604 00000001656 15174325130 0016263 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/Twilio/Rest/Preview/AccSecurity.php 0000604 00000004577 15174325130 0014073 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 \Twilio\Exceptions\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 \Twilio\Exceptions\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/Twilio/Rest/Preview/Studio/FlowContext.php 0000604 00000007125 15174325130 0015370 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Studio; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Rest\Preview\Studio\Flow\EngagementList; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview 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\Studio\Flow\EngagementList engagements * @method \Twilio\Rest\Preview\Studio\Flow\EngagementContext engagements(string $sid) */ class FlowContext extends InstanceContext { protected $_engagements = null; /** * Initialize the FlowContext * * @param \Twilio\Version $version Version that contains the resource * @param string $sid The sid * @return \Twilio\Rest\Preview\Studio\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 */ 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 */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Access the engagements * * @return \Twilio\Rest\Preview\Studio\Flow\EngagementList */ protected function getEngagements() { if (!$this->_engagements) { $this->_engagements = new EngagementList($this->version, $this->solution['sid']); } return $this->_engagements; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws \Twilio\Exceptions\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 \Twilio\Exceptions\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.Studio.FlowContext ' . implode(' ', $context) . ']'; } } sdk/Twilio/Rest/Preview/Studio/FlowList.php 0000604 00000011356 15174325130 0014660 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Studio; 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 FlowList extends ListResource { /** * Construct the FlowList * * @param Version $version Version that contains the resource * @return \Twilio\Rest\Preview\Studio\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 * @return \Twilio\Rest\Preview\Studio\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.Preview.Studio.FlowList]'; } } sdk/Twilio/Rest/Preview/Studio/FlowPage.php 0000604 00000001633 15174325130 0014616 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Studio; 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 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.Preview.Studio.FlowPage]'; } } sdk/Twilio/Rest/Preview/Studio/FlowInstance.php 0000604 00000010065 15174325130 0015505 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Studio; 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 friendlyName * @property string status * @property boolean debug * @property integer version * @property \DateTime dateCreated * @property \DateTime dateUpdated * @property string url * @property array links */ class FlowInstance extends InstanceResource { protected $_engagements = null; /** * Initialize the FlowInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The sid * @return \Twilio\Rest\Preview\Studio\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'), 'debug' => Values::array_get($payload, 'debug'), '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\Preview\Studio\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 */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the FlowInstance * * @return boolean True if delete succeeds, false otherwise */ public function delete() { return $this->proxy()->delete(); } /** * Access the engagements * * @return \Twilio\Rest\Preview\Studio\Flow\EngagementList */ protected function getEngagements() { return $this->proxy()->engagements; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (property_exists($this, '_' . $name)) { $method = 'get' . ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide 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.Studio.FlowInstance ' . implode(' ', $context) . ']'; } } sdk/Twilio/Rest/Preview/Studio/Flow/Engagement/StepList.php 0000604 00000012234 15174325131 0017642 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Studio\Flow\Engagement; 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 StepList extends ListResource { /** * Construct the StepList * * @param Version $version Version that contains the resource * @param string $flowSid Flow Sid. * @param string $engagementSid Engagement Sid. * @return \Twilio\Rest\Preview\Studio\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 * @return \Twilio\Rest\Preview\Studio\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.Preview.Studio.StepList]'; } } sdk/Twilio/Rest/Preview/Studio/Flow/Engagement/StepContext.php 0000604 00000004110 15174325131 0020345 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Studio\Flow\Engagement; 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 StepContext extends InstanceContext { /** * Initialize the StepContext * * @param \Twilio\Version $version Version that contains the resource * @param string $flowSid The flow_sid * @param string $engagementSid The engagement_sid * @param string $sid The sid * @return \Twilio\Rest\Preview\Studio\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 */ 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'] ); } /** * Provide 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.Studio.StepContext ' . implode(' ', $context) . ']'; } } sdk/Twilio/Rest/Preview/Studio/Flow/Engagement/StepPage.php 0000604 00000002043 15174325131 0017600 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Studio\Flow\Engagement; 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 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.Preview.Studio.StepPage]'; } } sdk/Twilio/Rest/Preview/Studio/Flow/Engagement/StepInstance.php 0000604 00000010464 15174325131 0020476 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Studio\Flow\Engagement; 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 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 */ class StepInstance extends InstanceResource { /** * Initialize the StepInstance * * @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. * @param string $sid The sid * @return \Twilio\Rest\Preview\Studio\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'), ); $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\Preview\Studio\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 */ 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.Studio.StepInstance ' . implode(' ', $context) . ']'; } } sdk/Twilio/Rest/Preview/Studio/Flow/EngagementPage.php 0000604 00000001716 15174325131 0016673 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Studio\Flow; 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 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.Preview.Studio.EngagementPage]'; } } sdk/Twilio/Rest/Preview/Studio/Flow/EngagementContext.php 0000604 00000007173 15174325131 0017446 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Studio\Flow; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Rest\Preview\Studio\Flow\Engagement\StepList; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview 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\Studio\Flow\Engagement\StepList steps * @method \Twilio\Rest\Preview\Studio\Flow\Engagement\StepContext steps(string $sid) */ class EngagementContext extends InstanceContext { protected $_steps = null; /** * Initialize the EngagementContext * * @param \Twilio\Version $version Version that contains the resource * @param string $flowSid The flow_sid * @param string $sid The sid * @return \Twilio\Rest\Preview\Studio\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 */ 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'] ); } /** * Access the steps * * @return \Twilio\Rest\Preview\Studio\Flow\Engagement\StepList */ protected function getSteps() { if (!$this->_steps) { $this->_steps = new StepList($this->version, $this->solution['flowSid'], $this->solution['sid']); } return $this->_steps; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws \Twilio\Exceptions\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 \Twilio\Exceptions\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.Studio.EngagementContext ' . implode(' ', $context) . ']'; } } sdk/Twilio/Rest/Preview/Studio/Flow/EngagementInstance.php 0000604 00000010422 15174325131 0017555 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Studio\Flow; 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 flowSid * @property string contactSid * @property string contactChannelAddress * @property string status * @property array context * @property \DateTime dateCreated * @property \DateTime dateUpdated * @property string url * @property array links */ class EngagementInstance extends InstanceResource { protected $_steps = null; /** * Initialize the EngagementInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $flowSid Flow Sid. * @param string $sid The sid * @return \Twilio\Rest\Preview\Studio\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'), 'status' => Values::array_get($payload, 'status'), 'context' => Values::array_get($payload, 'context'), '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\Preview\Studio\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 */ public function fetch() { return $this->proxy()->fetch(); } /** * Access the steps * * @return \Twilio\Rest\Preview\Studio\Flow\Engagement\StepList */ protected function getSteps() { return $this->proxy()->steps; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (property_exists($this, '_' . $name)) { $method = 'get' . ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide 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.Studio.EngagementInstance ' . implode(' ', $context) . ']'; } } sdk/Twilio/Rest/Preview/Studio/Flow/EngagementOptions.php 0000604 00000003136 15174325131 0017450 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Studio\Flow; 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 EngagementOptions { /** * @param string $parameters The parameters * @return CreateEngagementOptions Options builder */ public static function create($parameters = Values::NONE) { return new CreateEngagementOptions($parameters); } } class CreateEngagementOptions extends Options { /** * @param string $parameters The parameters */ public function __construct($parameters = Values::NONE) { $this->options['parameters'] = $parameters; } /** * The parameters * * @param string $parameters The parameters * @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.Preview.Studio.CreateEngagementOptions ' . implode(' ', $options) . ']'; } } sdk/Twilio/Rest/Preview/Studio/Flow/EngagementList.php 0000604 00000013300 15174325131 0016722 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Studio\Flow; 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 EngagementList extends ListResource { /** * Construct the EngagementList * * @param Version $version Version that contains the resource * @param string $flowSid Flow Sid. * @return \Twilio\Rest\Preview\Studio\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 to * @param string $from The from * @param array|Options $options Optional Arguments * @return EngagementInstance Newly created EngagementInstance */ public function create($to, $from, $options = array()) { $options = new Values($options); $data = Values::of(array('To' => $to, 'From' => $from, 'Parameters' => $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 * @return \Twilio\Rest\Preview\Studio\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.Preview.Studio.EngagementList]'; } } sdk/Twilio/Rest/Preview/BulkExports.php 0000604 00000005761 15174325131 0014134 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 \Twilio\Exceptions\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 \Twilio\Exceptions\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/Twilio/Rest/Preview/Studio.php 0000604 00000004450 15174325131 0013113 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\Studio\FlowList; use Twilio\Version; /** * @property \Twilio\Rest\Preview\Studio\FlowList flows * @method \Twilio\Rest\Preview\Studio\FlowContext flows(string $sid) */ class Studio extends Version { protected $_flows = null; /** * Construct the Studio version of Preview * * @param \Twilio\Domain $domain Domain that contains the version * @return \Twilio\Rest\Preview\Studio Studio version of Preview */ public function __construct(Domain $domain) { parent::__construct($domain); $this->version = 'Studio'; } /** * @return \Twilio\Rest\Preview\Studio\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 \Twilio\Exceptions\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 \Twilio\Exceptions\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.Studio]'; } } sdk/Twilio/Rest/Preview/Wireless/SimList.php 0000604 00000012414 15174325131 0015024 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/Twilio/Rest/Preview/Wireless/SimPage.php 0000604 00000001634 15174325131 0014767 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/Twilio/Rest/Preview/Wireless/CommandOptions.php 0000604 00000014211 15174325131 0016367 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/Twilio/Rest/Preview/Wireless/RatePlanContext.php 0000604 00000005077 15174325131 0016522 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Wireless; 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 */ 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 */ 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 */ 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/Twilio/Rest/Preview/Wireless/RatePlanOptions.php 0000604 00000020154 15174325131 0016522 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 boolean $dataEnabled The data_enabled * @param integer $dataLimit The data_limit * @param string $dataMetering The data_metering * @param boolean $messagingEnabled The messaging_enabled * @param boolean $voiceEnabled The voice_enabled * @param boolean $commandsEnabled The commands_enabled * @param boolean $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 boolean $dataEnabled The data_enabled * @param integer $dataLimit The data_limit * @param string $dataMetering The data_metering * @param boolean $messagingEnabled The messaging_enabled * @param boolean $voiceEnabled The voice_enabled * @param boolean $commandsEnabled The commands_enabled * @param boolean $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 boolean $dataEnabled The data_enabled * @return $this Fluent Builder */ public function setDataEnabled($dataEnabled) { $this->options['dataEnabled'] = $dataEnabled; return $this; } /** * The data_limit * * @param integer $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 boolean $messagingEnabled The messaging_enabled * @return $this Fluent Builder */ public function setMessagingEnabled($messagingEnabled) { $this->options['messagingEnabled'] = $messagingEnabled; return $this; } /** * The voice_enabled * * @param boolean $voiceEnabled The voice_enabled * @return $this Fluent Builder */ public function setVoiceEnabled($voiceEnabled) { $this->options['voiceEnabled'] = $voiceEnabled; return $this; } /** * The commands_enabled * * @param boolean $commandsEnabled The commands_enabled * @return $this Fluent Builder */ public function setCommandsEnabled($commandsEnabled) { $this->options['commandsEnabled'] = $commandsEnabled; return $this; } /** * The national_roaming_enabled * * @param boolean $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/Twilio/Rest/Preview/Wireless/CommandContext.php 0000604 00000003271 15174325131 0016364 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Wireless; 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 */ 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/Twilio/Rest/Preview/Wireless/RatePlanPage.php 0000604 00000001653 15174325131 0015746 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/Twilio/Rest/Preview/Wireless/Sim/UsagePage.php 0000604 00000001701 15174325131 0016026 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/Twilio/Rest/Preview/Wireless/Sim/UsageOptions.php 0000604 00000003540 15174325131 0016610 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/Twilio/Rest/Preview/Wireless/Sim/UsageContext.php 0000604 00000003611 15174325131 0016600 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Wireless\Sim; 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 */ 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/Twilio/Rest/Preview/Wireless/Sim/UsageList.php 0000604 00000002442 15174325131 0016070 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/Twilio/Rest/Preview/Wireless/Sim/UsageInstance.php 0000604 00000007255 15174325131 0016730 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 */ 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/Twilio/Rest/Preview/Wireless/CommandInstance.php 0000604 00000007510 15174325131 0016504 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 */ 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/Twilio/Rest/Preview/Wireless/CommandList.php 0000604 00000014235 15174325131 0015655 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 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 */ 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/Twilio/Rest/Preview/Wireless/RatePlanList.php 0000604 00000014201 15174325131 0015776 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\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 */ 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/Twilio/Rest/Preview/Wireless/SimOptions.php 0000604 00000030230 15174325131 0015540 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/Twilio/Rest/Preview/Wireless/SimContext.php 0000604 00000011331 15174325131 0015532 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 */ 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 */ 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 \Twilio\Exceptions\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 \Twilio\Exceptions\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/Twilio/Rest/Preview/Wireless/SimInstance.php 0000604 00000012666 15174325131 0015666 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 */ public function fetch() { return $this->proxy()->fetch(); } /** * Update the SimInstance * * @param array|Options $options Optional Arguments * @return SimInstance Updated SimInstance */ 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/Twilio/Rest/Preview/Wireless/CommandPage.php 0000604 00000001650 15174325131 0015613 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/Twilio/Rest/Preview/Wireless/RatePlanInstance.php 0000604 00000011417 15174325131 0016635 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 boolean dataEnabled * @property string dataMetering * @property integer dataLimit * @property boolean messagingEnabled * @property boolean voiceEnabled * @property boolean 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 */ public function fetch() { return $this->proxy()->fetch(); } /** * Update the RatePlanInstance * * @param array|Options $options Optional Arguments * @return RatePlanInstance Updated RatePlanInstance */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Deletes the RatePlanInstance * * @return boolean True if delete succeeds, false otherwise */ 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/Twilio/Rest/Preview/Proxy.php 0000604 00000004502 15174325131 0012763 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\Proxy\ServiceList; use Twilio\Version; /** * @property \Twilio\Rest\Preview\Proxy\ServiceList services * @method \Twilio\Rest\Preview\Proxy\ServiceContext services(string $sid) */ class Proxy extends Version { protected $_services = null; /** * Construct the Proxy version of Preview * * @param \Twilio\Domain $domain Domain that contains the version * @return \Twilio\Rest\Preview\Proxy Proxy version of Preview */ public function __construct(Domain $domain) { parent::__construct($domain); $this->version = 'Proxy'; } /** * @return \Twilio\Rest\Preview\Proxy\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 \Twilio\Exceptions\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 \Twilio\Exceptions\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.Proxy]'; } } sdk/Twilio/Rest/Preview/DeployedDevices.php 0000604 00000004702 15174325131 0014714 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 \Twilio\Exceptions\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 \Twilio\Exceptions\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/Twilio/Rest/Preview/Understand.php 0000604 00000004564 15174325131 0013761 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\ServiceList; use Twilio\Version; /** * @property \Twilio\Rest\Preview\Understand\ServiceList services * @method \Twilio\Rest\Preview\Understand\ServiceContext services(string $sid) */ class Understand extends Version { protected $_services = 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\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 \Twilio\Exceptions\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 \Twilio\Exceptions\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/Twilio/Rest/Preview/Wireless.php 0000604 00000006354 15174325131 0013446 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 \Twilio\Exceptions\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 \Twilio\Exceptions\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/Twilio/Rest/Preview/Marketplace.php 0000604 00000006012 15174325131 0014070 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 \Twilio\Exceptions\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 \Twilio\Exceptions\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/Twilio/Rest/Preview/Understand/ServiceInstance.php 0000604 00000012462 15174325131 0017042 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 boolean logQueries * @property string sid * @property integer ttl * @property string uniqueName * @property string url */ class ServiceInstance extends InstanceResource { protected $_fieldTypes = null; protected $_intents = null; protected $_modelBuilds = null; protected $_queries = 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\Understand\ServiceInstance */ 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'), 'ttl' => Values::array_get($payload, 'ttl'), 'uniqueName' => Values::array_get($payload, 'unique_name'), '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\Understand\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 */ public function fetch() { return $this->proxy()->fetch(); } /** * Update the ServiceInstance * * @param array|Options $options Optional Arguments * @return ServiceInstance Updated ServiceInstance */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Deletes the ServiceInstance * * @return boolean True if delete succeeds, false otherwise */ public function delete() { return $this->proxy()->delete(); } /** * Access the fieldTypes * * @return \Twilio\Rest\Preview\Understand\Service\FieldTypeList */ protected function getFieldTypes() { return $this->proxy()->fieldTypes; } /** * Access the intents * * @return \Twilio\Rest\Preview\Understand\Service\IntentList */ protected function getIntents() { return $this->proxy()->intents; } /** * Access the modelBuilds * * @return \Twilio\Rest\Preview\Understand\Service\ModelBuildList */ protected function getModelBuilds() { return $this->proxy()->modelBuilds; } /** * Access the queries * * @return \Twilio\Rest\Preview\Understand\Service\QueryList */ protected function getQueries() { return $this->proxy()->queries; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (property_exists($this, '_' . $name)) { $method = 'get' . ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide 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.ServiceInstance ' . implode(' ', $context) . ']'; } } sdk/Twilio/Rest/Preview/Understand/ServiceList.php 0000604 00000013107 15174325131 0016206 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand; 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\Understand\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 array|Options $options Optional Arguments * @return ServiceInstance Newly created ServiceInstance */ public function create($options = array()) { $options = new Values($options); $data = Values::of(array( 'FriendlyName' => $options['friendlyName'], 'LogQueries' => Serialize::booleanToString($options['logQueries']), 'Ttl' => $options['ttl'], 'UniqueName' => $options['uniqueName'], )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new ServiceInstance($this->version, $payload); } /** * Constructs a ServiceContext * * @param string $sid The sid * @return \Twilio\Rest\Preview\Understand\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.Understand.ServiceList]'; } } sdk/Twilio/Rest/Preview/Understand/ServiceContext.php 0000604 00000014213 15174325131 0016716 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\Service\FieldTypeList; use Twilio\Rest\Preview\Understand\Service\IntentList; use Twilio\Rest\Preview\Understand\Service\ModelBuildList; use Twilio\Rest\Preview\Understand\Service\QueryList; 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\Service\FieldTypeList fieldTypes * @property \Twilio\Rest\Preview\Understand\Service\IntentList intents * @property \Twilio\Rest\Preview\Understand\Service\ModelBuildList modelBuilds * @property \Twilio\Rest\Preview\Understand\Service\QueryList queries * @method \Twilio\Rest\Preview\Understand\Service\FieldTypeContext fieldTypes(string $sid) * @method \Twilio\Rest\Preview\Understand\Service\IntentContext intents(string $sid) * @method \Twilio\Rest\Preview\Understand\Service\ModelBuildContext modelBuilds(string $sid) * @method \Twilio\Rest\Preview\Understand\Service\QueryContext queries(string $sid) */ class ServiceContext extends InstanceContext { protected $_fieldTypes = null; protected $_intents = null; protected $_modelBuilds = null; protected $_queries = null; /** * Initialize the ServiceContext * * @param \Twilio\Version $version Version that contains the resource * @param string $sid The sid * @return \Twilio\Rest\Preview\Understand\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 */ 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 */ public function update($options = array()) { $options = new Values($options); $data = Values::of(array( 'FriendlyName' => $options['friendlyName'], 'LogQueries' => Serialize::booleanToString($options['logQueries']), 'Ttl' => $options['ttl'], 'UniqueName' => $options['uniqueName'], )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new ServiceInstance($this->version, $payload, $this->solution['sid']); } /** * Deletes the ServiceInstance * * @return boolean True if delete succeeds, false otherwise */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Access the fieldTypes * * @return \Twilio\Rest\Preview\Understand\Service\FieldTypeList */ protected function getFieldTypes() { if (!$this->_fieldTypes) { $this->_fieldTypes = new FieldTypeList($this->version, $this->solution['sid']); } return $this->_fieldTypes; } /** * Access the intents * * @return \Twilio\Rest\Preview\Understand\Service\IntentList */ protected function getIntents() { if (!$this->_intents) { $this->_intents = new IntentList($this->version, $this->solution['sid']); } return $this->_intents; } /** * Access the modelBuilds * * @return \Twilio\Rest\Preview\Understand\Service\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\Service\QueryList */ protected function getQueries() { if (!$this->_queries) { $this->_queries = new QueryList($this->version, $this->solution['sid']); } return $this->_queries; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws \Twilio\Exceptions\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 \Twilio\Exceptions\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.ServiceContext ' . implode(' ', $context) . ']'; } } sdk/Twilio/Rest/Preview/Understand/ServiceOptions.php 0000604 00000012643 15174325131 0016732 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 ServiceOptions { /** * @param string $friendlyName The friendly_name * @param boolean $logQueries The log_queries * @param integer $ttl The ttl * @param string $uniqueName The unique_name * @return CreateServiceOptions Options builder */ public static function create($friendlyName = Values::NONE, $logQueries = Values::NONE, $ttl = Values::NONE, $uniqueName = Values::NONE) { return new CreateServiceOptions($friendlyName, $logQueries, $ttl, $uniqueName); } /** * @param string $friendlyName The friendly_name * @param boolean $logQueries The log_queries * @param integer $ttl The ttl * @param string $uniqueName The unique_name * @return UpdateServiceOptions Options builder */ public static function update($friendlyName = Values::NONE, $logQueries = Values::NONE, $ttl = Values::NONE, $uniqueName = Values::NONE) { return new UpdateServiceOptions($friendlyName, $logQueries, $ttl, $uniqueName); } } class CreateServiceOptions extends Options { /** * @param string $friendlyName The friendly_name * @param boolean $logQueries The log_queries * @param integer $ttl The ttl * @param string $uniqueName The unique_name */ public function __construct($friendlyName = Values::NONE, $logQueries = Values::NONE, $ttl = Values::NONE, $uniqueName = Values::NONE) { $this->options['friendlyName'] = $friendlyName; $this->options['logQueries'] = $logQueries; $this->options['ttl'] = $ttl; $this->options['uniqueName'] = $uniqueName; } /** * The friendly_name * * @param string $friendlyName The friendly_name * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The log_queries * * @param boolean $logQueries The log_queries * @return $this Fluent Builder */ public function setLogQueries($logQueries) { $this->options['logQueries'] = $logQueries; return $this; } /** * The ttl * * @param integer $ttl The ttl * @return $this Fluent Builder */ public function setTtl($ttl) { $this->options['ttl'] = $ttl; return $this; } /** * 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.Understand.CreateServiceOptions ' . implode(' ', $options) . ']'; } } class UpdateServiceOptions extends Options { /** * @param string $friendlyName The friendly_name * @param boolean $logQueries The log_queries * @param integer $ttl The ttl * @param string $uniqueName The unique_name */ public function __construct($friendlyName = Values::NONE, $logQueries = Values::NONE, $ttl = Values::NONE, $uniqueName = Values::NONE) { $this->options['friendlyName'] = $friendlyName; $this->options['logQueries'] = $logQueries; $this->options['ttl'] = $ttl; $this->options['uniqueName'] = $uniqueName; } /** * The friendly_name * * @param string $friendlyName The friendly_name * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The log_queries * * @param boolean $logQueries The log_queries * @return $this Fluent Builder */ public function setLogQueries($logQueries) { $this->options['logQueries'] = $logQueries; return $this; } /** * The ttl * * @param integer $ttl The ttl * @return $this Fluent Builder */ public function setTtl($ttl) { $this->options['ttl'] = $ttl; return $this; } /** * 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.Understand.UpdateServiceOptions ' . implode(' ', $options) . ']'; } } sdk/Twilio/Rest/Preview/Understand/ServicePage.php 0000604 00000001654 15174325131 0016153 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 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.Understand.ServicePage]'; } } sdk/Twilio/Rest/Preview/Understand/Service/QueryPage.php 0000604 00000001715 15174325131 0017256 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\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 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['serviceSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Preview.Understand.QueryPage]'; } } sdk/Twilio/Rest/Preview/Understand/Service/IntentPage.php 0000604 00000001720 15174325131 0017406 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\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 IntentPage extends Page { public function __construct($version, $response, $solution) { parent::__construct($version, $response); // Path Solution $this->solution = $solution; } public function buildInstance(array $payload) { return new IntentInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Preview.Understand.IntentPage]'; } } sdk/Twilio/Rest/Preview/Understand/Service/FieldTypeInstance.php 0000604 00000011327 15174325131 0020726 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\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 preview 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 serviceSid * @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 $serviceSid The service_sid * @param string $sid The sid * @return \Twilio\Rest\Preview\Understand\Service\FieldTypeInstance */ public function __construct(Version $version, array $payload, $serviceSid, $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'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'sid' => Values::array_get($payload, 'sid'), 'uniqueName' => Values::array_get($payload, 'unique_name'), '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\Preview\Understand\Service\FieldTypeContext Context for * this * FieldTypeInstance */ protected function proxy() { if (!$this->context) { $this->context = new FieldTypeContext( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch a FieldTypeInstance * * @return FieldTypeInstance Fetched FieldTypeInstance */ public function fetch() { return $this->proxy()->fetch(); } /** * Update the FieldTypeInstance * * @param array|Options $options Optional Arguments * @return FieldTypeInstance Updated FieldTypeInstance */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Deletes the FieldTypeInstance * * @return boolean True if delete succeeds, false otherwise */ public function delete() { return $this->proxy()->delete(); } /** * Access the fieldValues * * @return \Twilio\Rest\Preview\Understand\Service\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/Twilio/Rest/Preview/Understand/Service/ModelBuildList.php 0000604 00000013332 15174325131 0020226 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\Service; 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 $serviceSid The service_sid * @return \Twilio\Rest\Preview\Understand\Service\ModelBuildList */ public function __construct(Version $version, $serviceSid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, ); $this->uri = '/Services/' . rawurlencode($serviceSid) . '/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 */ 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['serviceSid']); } /** * Constructs a ModelBuildContext * * @param string $sid The sid * @return \Twilio\Rest\Preview\Understand\Service\ModelBuildContext */ public function getContext($sid) { return new ModelBuildContext($this->version, $this->solution['serviceSid'], $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Preview.Understand.ModelBuildList]'; } } sdk/Twilio/Rest/Preview/Understand/Service/IntentList.php 0000604 00000013224 15174325131 0017447 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\Service; 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 IntentList extends ListResource { /** * Construct the IntentList * * @param Version $version Version that contains the resource * @param string $serviceSid The service_sid * @return \Twilio\Rest\Preview\Understand\Service\IntentList */ public function __construct(Version $version, $serviceSid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, ); $this->uri = '/Services/' . rawurlencode($serviceSid) . '/Intents'; } /** * Streams IntentInstance 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 IntentInstance 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 IntentInstance[] Array of results */ public function read($limit = null, $pageSize = null) { return iterator_to_array($this->stream($limit, $pageSize), false); } /** * Retrieve a single page of IntentInstance 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 IntentInstance */ 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 IntentPage($this->version, $response, $this->solution); } /** * Retrieve a specific page of IntentInstance records from the API. * Request is executed immediately * * @param string $targetUrl API-generated URL for the requested results page * @return \Twilio\Page Page of IntentInstance */ public function getPage($targetUrl) { $response = $this->version->getDomain()->getClient()->request( 'GET', $targetUrl ); return new IntentPage($this->version, $response, $this->solution); } /** * Create a new IntentInstance * * @param string $uniqueName The unique_name * @param array|Options $options Optional Arguments * @return IntentInstance Newly created IntentInstance */ 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 IntentInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Constructs a IntentContext * * @param string $sid The sid * @return \Twilio\Rest\Preview\Understand\Service\IntentContext */ public function getContext($sid) { return new IntentContext($this->version, $this->solution['serviceSid'], $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Preview.Understand.IntentList]'; } } sdk/Twilio/Rest/Preview/Understand/Service/QueryList.php 0000604 00000014434 15174325131 0017317 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\Service; 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 $serviceSid The service_sid * @return \Twilio\Rest\Preview\Understand\Service\QueryList */ public function __construct(Version $version, $serviceSid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, ); $this->uri = '/Services/' . rawurlencode($serviceSid) . '/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 language * @param string $query The query * @param array|Options $options Optional Arguments * @return QueryInstance Newly created QueryInstance */ public function create($language, $query, $options = array()) { $options = new Values($options); $data = Values::of(array( 'Language' => $language, 'Query' => $query, 'Intent' => $options['intent'], 'ModelBuild' => $options['modelBuild'], 'Field' => $options['field'], 'NamedEntity' => $options['namedEntity'], )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new QueryInstance($this->version, $payload, $this->solution['serviceSid']); } /** * Constructs a QueryContext * * @param string $sid The sid * @return \Twilio\Rest\Preview\Understand\Service\QueryContext */ public function getContext($sid) { return new QueryContext($this->version, $this->solution['serviceSid'], $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Preview.Understand.QueryList]'; } } sdk/Twilio/Rest/Preview/Understand/Service/ModelBuildOptions.php 0000604 00000006475 15174325131 0020760 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\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 ModelBuildOptions { /** * @param string $statusCallback The status_callback * @param string $uniqueName The unique_name * @return CreateModelBuildOptions Options builder */ public static function create($statusCallback = Values::NONE, $uniqueName = Values::NONE) { return new CreateModelBuildOptions($statusCallback, $uniqueName); } /** * @param string $uniqueName The unique_name * @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 The unique_name */ 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; } /** * 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.Understand.CreateModelBuildOptions ' . implode(' ', $options) . ']'; } } class UpdateModelBuildOptions 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.Understand.UpdateModelBuildOptions ' . implode(' ', $options) . ']'; } } sdk/Twilio/Rest/Preview/Understand/Service/ModelBuildContext.php 0000604 00000005534 15174325131 0020744 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\Service; 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 $serviceSid The service_sid * @param string $sid The sid * @return \Twilio\Rest\Preview\Understand\Service\ModelBuildContext */ public function __construct(Version $version, $serviceSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, 'sid' => $sid, ); $this->uri = '/Services/' . rawurlencode($serviceSid) . '/ModelBuilds/' . rawurlencode($sid) . ''; } /** * Fetch a ModelBuildInstance * * @return ModelBuildInstance Fetched ModelBuildInstance */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new ModelBuildInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Update the ModelBuildInstance * * @param array|Options $options Optional Arguments * @return ModelBuildInstance Updated ModelBuildInstance */ 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['serviceSid'], $this->solution['sid'] ); } /** * Deletes the ModelBuildInstance * * @return boolean True if delete succeeds, false otherwise */ 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/Twilio/Rest/Preview/Understand/Service/ModelBuildPage.php 0000604 00000001734 15174325131 0020172 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\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 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['serviceSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Preview.Understand.ModelBuildPage]'; } } sdk/Twilio/Rest/Preview/Understand/Service/FieldTypeContext.php 0000604 00000011436 15174325131 0020607 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\Service; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Rest\Preview\Understand\Service\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\Service\FieldType\FieldValueList fieldValues * @method \Twilio\Rest\Preview\Understand\Service\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 $serviceSid The service_sid * @param string $sid The sid * @return \Twilio\Rest\Preview\Understand\Service\FieldTypeContext */ public function __construct(Version $version, $serviceSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, 'sid' => $sid, ); $this->uri = '/Services/' . rawurlencode($serviceSid) . '/FieldTypes/' . rawurlencode($sid) . ''; } /** * Fetch a FieldTypeInstance * * @return FieldTypeInstance Fetched FieldTypeInstance */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new FieldTypeInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Update the FieldTypeInstance * * @param array|Options $options Optional Arguments * @return FieldTypeInstance Updated FieldTypeInstance */ 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['serviceSid'], $this->solution['sid'] ); } /** * Deletes the FieldTypeInstance * * @return boolean True if delete succeeds, false otherwise */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Access the fieldValues * * @return \Twilio\Rest\Preview\Understand\Service\FieldType\FieldValueList */ protected function getFieldValues() { if (!$this->_fieldValues) { $this->_fieldValues = new FieldValueList( $this->version, $this->solution['serviceSid'], $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 \Twilio\Exceptions\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 \Twilio\Exceptions\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/Twilio/Rest/Preview/Understand/Service/IntentContext.php 0000604 00000012432 15174325131 0020160 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\Service; use Twilio\Exceptions\TwilioException; use Twilio\InstanceContext; use Twilio\Options; use Twilio\Rest\Preview\Understand\Service\Intent\FieldList; use Twilio\Rest\Preview\Understand\Service\Intent\SampleList; use Twilio\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview 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\Service\Intent\FieldList fields * @property \Twilio\Rest\Preview\Understand\Service\Intent\SampleList samples * @method \Twilio\Rest\Preview\Understand\Service\Intent\FieldContext fields(string $sid) * @method \Twilio\Rest\Preview\Understand\Service\Intent\SampleContext samples(string $sid) */ class IntentContext extends InstanceContext { protected $_fields = null; protected $_samples = null; /** * Initialize the IntentContext * * @param \Twilio\Version $version Version that contains the resource * @param string $serviceSid The service_sid * @param string $sid The sid * @return \Twilio\Rest\Preview\Understand\Service\IntentContext */ public function __construct(Version $version, $serviceSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, 'sid' => $sid, ); $this->uri = '/Services/' . rawurlencode($serviceSid) . '/Intents/' . rawurlencode($sid) . ''; } /** * Fetch a IntentInstance * * @return IntentInstance Fetched IntentInstance */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new IntentInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Update the IntentInstance * * @param array|Options $options Optional Arguments * @return IntentInstance Updated IntentInstance */ 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 IntentInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Deletes the IntentInstance * * @return boolean True if delete succeeds, false otherwise */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Access the fields * * @return \Twilio\Rest\Preview\Understand\Service\Intent\FieldList */ protected function getFields() { if (!$this->_fields) { $this->_fields = new FieldList($this->version, $this->solution['serviceSid'], $this->solution['sid']); } return $this->_fields; } /** * Access the samples * * @return \Twilio\Rest\Preview\Understand\Service\Intent\SampleList */ protected function getSamples() { if (!$this->_samples) { $this->_samples = new SampleList( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->_samples; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws \Twilio\Exceptions\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 \Twilio\Exceptions\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.IntentContext ' . implode(' ', $context) . ']'; } } sdk/Twilio/Rest/Preview/Understand/Service/IntentInstance.php 0000604 00000011574 15174325131 0020306 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\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 preview 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 serviceSid * @property string sid * @property string uniqueName * @property string url */ class IntentInstance extends InstanceResource { protected $_fields = null; protected $_samples = null; /** * Initialize the IntentInstance * * @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\Understand\Service\IntentInstance */ public function __construct(Version $version, array $payload, $serviceSid, $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'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'sid' => Values::array_get($payload, 'sid'), 'uniqueName' => Values::array_get($payload, 'unique_name'), '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\Preview\Understand\Service\IntentContext Context for * this * IntentInstance */ protected function proxy() { if (!$this->context) { $this->context = new IntentContext( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch a IntentInstance * * @return IntentInstance Fetched IntentInstance */ public function fetch() { return $this->proxy()->fetch(); } /** * Update the IntentInstance * * @param array|Options $options Optional Arguments * @return IntentInstance Updated IntentInstance */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Deletes the IntentInstance * * @return boolean True if delete succeeds, false otherwise */ public function delete() { return $this->proxy()->delete(); } /** * Access the fields * * @return \Twilio\Rest\Preview\Understand\Service\Intent\FieldList */ protected function getFields() { return $this->proxy()->fields; } /** * Access the samples * * @return \Twilio\Rest\Preview\Understand\Service\Intent\SampleList */ protected function getSamples() { return $this->proxy()->samples; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (property_exists($this, '_' . $name)) { $method = 'get' . ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide 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.IntentInstance ' . implode(' ', $context) . ']'; } } sdk/Twilio/Rest/Preview/Understand/Service/IntentOptions.php 0000604 00000006431 15174325131 0020171 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\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 IntentOptions { /** * @param string $friendlyName The friendly_name * @return CreateIntentOptions Options builder */ public static function create($friendlyName = Values::NONE) { return new CreateIntentOptions($friendlyName); } /** * @param string $friendlyName The friendly_name * @param string $uniqueName The unique_name * @return UpdateIntentOptions Options builder */ public static function update($friendlyName = Values::NONE, $uniqueName = Values::NONE) { return new UpdateIntentOptions($friendlyName, $uniqueName); } } class CreateIntentOptions 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.Preview.Understand.CreateIntentOptions ' . implode(' ', $options) . ']'; } } class UpdateIntentOptions extends Options { /** * @param string $friendlyName The friendly_name * @param string $uniqueName The unique_name */ public function __construct($friendlyName = Values::NONE, $uniqueName = Values::NONE) { $this->options['friendlyName'] = $friendlyName; $this->options['uniqueName'] = $uniqueName; } /** * The friendly_name * * @param string $friendlyName The friendly_name * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * 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.Understand.UpdateIntentOptions ' . implode(' ', $options) . ']'; } } sdk/Twilio/Rest/Preview/Understand/Service/FieldTypeOptions.php 0000604 00000006464 15174325131 0020623 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\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 FieldTypeOptions { /** * @param string $friendlyName The friendly_name * @return CreateFieldTypeOptions Options builder */ public static function create($friendlyName = Values::NONE) { return new CreateFieldTypeOptions($friendlyName); } /** * @param string $friendlyName The friendly_name * @param string $uniqueName The unique_name * @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 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.Preview.Understand.CreateFieldTypeOptions ' . implode(' ', $options) . ']'; } } class UpdateFieldTypeOptions extends Options { /** * @param string $friendlyName The friendly_name * @param string $uniqueName The unique_name */ public function __construct($friendlyName = Values::NONE, $uniqueName = Values::NONE) { $this->options['friendlyName'] = $friendlyName; $this->options['uniqueName'] = $uniqueName; } /** * The friendly_name * * @param string $friendlyName The friendly_name * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * 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.Understand.UpdateFieldTypeOptions ' . implode(' ', $options) . ']'; } } sdk/Twilio/Rest/Preview/Understand/Service/QueryOptions.php 0000604 00000014602 15174325131 0020034 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\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 QueryOptions { /** * @param string $language The language * @param string $modelBuild The model_build * @param string $status The status * @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 $intent The intent * @param string $modelBuild The model_build * @param string $field The field * @param string $namedEntity The named_entity * @return CreateQueryOptions Options builder */ public static function create($intent = Values::NONE, $modelBuild = Values::NONE, $field = Values::NONE, $namedEntity = Values::NONE) { return new CreateQueryOptions($intent, $modelBuild, $field, $namedEntity); } /** * @param string $sampleSid The sample_sid * @param string $status The status * @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 language * @param string $modelBuild The model_build * @param string $status The status */ 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 language * * @param string $language The language * @return $this Fluent Builder */ public function setLanguage($language) { $this->options['language'] = $language; return $this; } /** * The model_build * * @param string $modelBuild The model_build * @return $this Fluent Builder */ public function setModelBuild($modelBuild) { $this->options['modelBuild'] = $modelBuild; return $this; } /** * The status * * @param string $status The status * @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 $intent The intent * @param string $modelBuild The model_build * @param string $field The field * @param string $namedEntity The named_entity */ public function __construct($intent = Values::NONE, $modelBuild = Values::NONE, $field = Values::NONE, $namedEntity = Values::NONE) { $this->options['intent'] = $intent; $this->options['modelBuild'] = $modelBuild; $this->options['field'] = $field; $this->options['namedEntity'] = $namedEntity; } /** * The intent * * @param string $intent The intent * @return $this Fluent Builder */ public function setIntent($intent) { $this->options['intent'] = $intent; return $this; } /** * The model_build * * @param string $modelBuild The model_build * @return $this Fluent Builder */ public function setModelBuild($modelBuild) { $this->options['modelBuild'] = $modelBuild; return $this; } /** * The field * * @param string $field The field * @return $this Fluent Builder */ public function setField($field) { $this->options['field'] = $field; return $this; } /** * The named_entity * * @param string $namedEntity The named_entity * @return $this Fluent Builder */ public function setNamedEntity($namedEntity) { $this->options['namedEntity'] = $namedEntity; return $this; } /** * Provide a friendly representation * * @return 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 The sample_sid * @param string $status The status */ public function __construct($sampleSid = Values::NONE, $status = Values::NONE) { $this->options['sampleSid'] = $sampleSid; $this->options['status'] = $status; } /** * The sample_sid * * @param string $sampleSid The sample_sid * @return $this Fluent Builder */ public function setSampleSid($sampleSid) { $this->options['sampleSid'] = $sampleSid; return $this; } /** * The status * * @param string $status The status * @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/Twilio/Rest/Preview/Understand/Service/QueryInstance.php 0000604 00000011246 15174325131 0020146 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\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 preview 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 serviceSid * @property string sid * @property string status * @property string url */ class QueryInstance extends InstanceResource { /** * Initialize the QueryInstance * * @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\Understand\Service\QueryInstance */ public function __construct(Version $version, array $payload, $serviceSid, $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'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'sid' => Values::array_get($payload, 'sid'), 'status' => Values::array_get($payload, 'status'), '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\Preview\Understand\Service\QueryContext Context for * this * QueryInstance */ protected function proxy() { if (!$this->context) { $this->context = new QueryContext( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch a QueryInstance * * @return QueryInstance Fetched QueryInstance */ public function fetch() { return $this->proxy()->fetch(); } /** * Update the QueryInstance * * @param array|Options $options Optional Arguments * @return QueryInstance Updated QueryInstance */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Deletes the QueryInstance * * @return boolean True if delete succeeds, false otherwise */ 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/Twilio/Rest/Preview/Understand/Service/ModelBuildInstance.php 0000604 00000010565 15174325131 0021064 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\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 preview 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 serviceSid * @property string sid * @property string status * @property string uniqueName * @property string url */ class ModelBuildInstance extends InstanceResource { /** * Initialize the ModelBuildInstance * * @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\Understand\Service\ModelBuildInstance */ public function __construct(Version $version, array $payload, $serviceSid, $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')), 'serviceSid' => Values::array_get($payload, 'service_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'), ); $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\Understand\Service\ModelBuildContext Context * for this * ModelBuildInstance */ protected function proxy() { if (!$this->context) { $this->context = new ModelBuildContext( $this->version, $this->solution['serviceSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch a ModelBuildInstance * * @return ModelBuildInstance Fetched ModelBuildInstance */ public function fetch() { return $this->proxy()->fetch(); } /** * Update the ModelBuildInstance * * @param array|Options $options Optional Arguments * @return ModelBuildInstance Updated ModelBuildInstance */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Deletes the ModelBuildInstance * * @return boolean True if delete succeeds, false otherwise */ 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/Twilio/Rest/Preview/Understand/Service/QueryContext.php 0000604 00000005465 15174325131 0020034 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\Service; 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 $serviceSid The service_sid * @param string $sid The sid * @return \Twilio\Rest\Preview\Understand\Service\QueryContext */ public function __construct(Version $version, $serviceSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, 'sid' => $sid, ); $this->uri = '/Services/' . rawurlencode($serviceSid) . '/Queries/' . rawurlencode($sid) . ''; } /** * Fetch a QueryInstance * * @return QueryInstance Fetched QueryInstance */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new QueryInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['sid'] ); } /** * Update the QueryInstance * * @param array|Options $options Optional Arguments * @return QueryInstance Updated QueryInstance */ 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['serviceSid'], $this->solution['sid'] ); } /** * Deletes the QueryInstance * * @return boolean True if delete succeeds, false otherwise */ 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/Twilio/Rest/Preview/Understand/Service/FieldTypeList.php 0000604 00000013323 15174325131 0020073 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\Service; 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 $serviceSid The service_sid * @return \Twilio\Rest\Preview\Understand\Service\FieldTypeList */ public function __construct(Version $version, $serviceSid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, ); $this->uri = '/Services/' . rawurlencode($serviceSid) . '/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 The unique_name * @param array|Options $options Optional Arguments * @return FieldTypeInstance Newly created FieldTypeInstance */ 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['serviceSid']); } /** * Constructs a FieldTypeContext * * @param string $sid The sid * @return \Twilio\Rest\Preview\Understand\Service\FieldTypeContext */ public function getContext($sid) { return new FieldTypeContext($this->version, $this->solution['serviceSid'], $sid); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Preview.Understand.FieldTypeList]'; } } sdk/Twilio/Rest/Preview/Understand/Service/FieldType/FieldValueList.php 0000604 00000014466 15174325131 0022124 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\Service\FieldType; 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 $serviceSid The service_sid * @param string $fieldTypeSid The field_type_sid * @return \Twilio\Rest\Preview\Understand\Service\FieldType\FieldValueList */ public function __construct(Version $version, $serviceSid, $fieldTypeSid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, 'fieldTypeSid' => $fieldTypeSid, ); $this->uri = '/Services/' . rawurlencode($serviceSid) . '/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 language * @param string $value The value * @return FieldValueInstance Newly created FieldValueInstance */ public function create($language, $value) { $data = Values::of(array('Language' => $language, 'Value' => $value, )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new FieldValueInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['fieldTypeSid'] ); } /** * Constructs a FieldValueContext * * @param string $sid The sid * @return \Twilio\Rest\Preview\Understand\Service\FieldType\FieldValueContext */ public function getContext($sid) { return new FieldValueContext( $this->version, $this->solution['serviceSid'], $this->solution['fieldTypeSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Preview.Understand.FieldValueList]'; } } sdk/Twilio/Rest/Preview/Understand/Service/FieldType/FieldValueInstance.php 0000604 00000010372 15174325131 0022745 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\Service\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 serviceSid * @property string sid * @property string value * @property string url */ class FieldValueInstance extends InstanceResource { /** * Initialize the FieldValueInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The service_sid * @param string $fieldTypeSid The field_type_sid * @param string $sid The sid * @return \Twilio\Rest\Preview\Understand\Service\FieldType\FieldValueInstance */ public function __construct(Version $version, array $payload, $serviceSid, $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'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'sid' => Values::array_get($payload, 'sid'), 'value' => Values::array_get($payload, 'value'), 'url' => Values::array_get($payload, 'url'), ); $this->solution = array( 'serviceSid' => $serviceSid, '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\Service\FieldType\FieldValueContext Context for this FieldValueInstance */ protected function proxy() { if (!$this->context) { $this->context = new FieldValueContext( $this->version, $this->solution['serviceSid'], $this->solution['fieldTypeSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch a FieldValueInstance * * @return FieldValueInstance Fetched FieldValueInstance */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the FieldValueInstance * * @return boolean True if delete succeeds, false otherwise */ 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/Twilio/Rest/Preview/Understand/Service/FieldType/FieldValuePage.php 0000604 00000002101 15174325131 0022044 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\Service\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['serviceSid'], $this->solution['fieldTypeSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Preview.Understand.FieldValuePage]'; } } sdk/Twilio/Rest/Preview/Understand/Service/FieldType/FieldValueContext.php 0000604 00000004600 15174325131 0022622 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\Service\FieldType; 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 $serviceSid The service_sid * @param string $fieldTypeSid The field_type_sid * @param string $sid The sid * @return \Twilio\Rest\Preview\Understand\Service\FieldType\FieldValueContext */ public function __construct(Version $version, $serviceSid, $fieldTypeSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, 'fieldTypeSid' => $fieldTypeSid, 'sid' => $sid, ); $this->uri = '/Services/' . rawurlencode($serviceSid) . '/FieldTypes/' . rawurlencode($fieldTypeSid) . '/FieldValues/' . rawurlencode($sid) . ''; } /** * Fetch a FieldValueInstance * * @return FieldValueInstance Fetched FieldValueInstance */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new FieldValueInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['fieldTypeSid'], $this->solution['sid'] ); } /** * Deletes the FieldValueInstance * * @return boolean True if delete succeeds, false otherwise */ 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/Twilio/Rest/Preview/Understand/Service/FieldType/FieldValueOptions.php 0000604 00000003111 15174325131 0022625 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\Service\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 language * @return ReadFieldValueOptions Options builder */ public static function read($language = Values::NONE) { return new ReadFieldValueOptions($language); } } class ReadFieldValueOptions extends Options { /** * @param string $language The language */ public function __construct($language = Values::NONE) { $this->options['language'] = $language; } /** * The language * * @param string $language The language * @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) . ']'; } } sdk/Twilio/Rest/Preview/Understand/Service/FieldTypePage.php 0000604 00000001731 15174325131 0020034 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\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 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['serviceSid']); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Preview.Understand.FieldTypePage]'; } } sdk/Twilio/Rest/Preview/Understand/Service/Intent/SampleContext.php 0000604 00000006112 15174325131 0021377 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\Service\Intent; 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 $serviceSid The service_sid * @param string $intentSid The intent_sid * @param string $sid The sid * @return \Twilio\Rest\Preview\Understand\Service\Intent\SampleContext */ public function __construct(Version $version, $serviceSid, $intentSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, 'intentSid' => $intentSid, 'sid' => $sid, ); $this->uri = '/Services/' . rawurlencode($serviceSid) . '/Intents/' . rawurlencode($intentSid) . '/Samples/' . rawurlencode($sid) . ''; } /** * Fetch a SampleInstance * * @return SampleInstance Fetched SampleInstance */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new SampleInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['intentSid'], $this->solution['sid'] ); } /** * Update the SampleInstance * * @param array|Options $options Optional Arguments * @return SampleInstance Updated SampleInstance */ public function update($options = array()) { $options = new Values($options); $data = Values::of(array( 'Language' => $options['language'], 'TaggedText' => $options['taggedText'], )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new SampleInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['intentSid'], $this->solution['sid'] ); } /** * Deletes the SampleInstance * * @return boolean True if delete succeeds, false otherwise */ 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/Twilio/Rest/Preview/Understand/Service/Intent/SampleOptions.php 0000604 00000006216 15174325131 0021413 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\Service\Intent; 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 language * @return ReadSampleOptions Options builder */ public static function read($language = Values::NONE) { return new ReadSampleOptions($language); } /** * @param string $language The language * @param string $taggedText The tagged_text * @return UpdateSampleOptions Options builder */ public static function update($language = Values::NONE, $taggedText = Values::NONE) { return new UpdateSampleOptions($language, $taggedText); } } class ReadSampleOptions extends Options { /** * @param string $language The language */ public function __construct($language = Values::NONE) { $this->options['language'] = $language; } /** * The language * * @param string $language The language * @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 UpdateSampleOptions extends Options { /** * @param string $language The language * @param string $taggedText The tagged_text */ public function __construct($language = Values::NONE, $taggedText = Values::NONE) { $this->options['language'] = $language; $this->options['taggedText'] = $taggedText; } /** * The language * * @param string $language The language * @return $this Fluent Builder */ public function setLanguage($language) { $this->options['language'] = $language; return $this; } /** * The tagged_text * * @param string $taggedText The tagged_text * @return $this Fluent Builder */ public function setTaggedText($taggedText) { $this->options['taggedText'] = $taggedText; return $this; } /** * Provide a friendly representation * * @return 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/Twilio/Rest/Preview/Understand/Service/Intent/FieldContext.php 0000604 00000004457 15174325131 0021213 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\Service\Intent; 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 $serviceSid The service_sid * @param string $intentSid The intent_sid * @param string $sid The sid * @return \Twilio\Rest\Preview\Understand\Service\Intent\FieldContext */ public function __construct(Version $version, $serviceSid, $intentSid, $sid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, 'intentSid' => $intentSid, 'sid' => $sid, ); $this->uri = '/Services/' . rawurlencode($serviceSid) . '/Intents/' . rawurlencode($intentSid) . '/Fields/' . rawurlencode($sid) . ''; } /** * Fetch a FieldInstance * * @return FieldInstance Fetched FieldInstance */ public function fetch() { $params = Values::of(array()); $payload = $this->version->fetch( 'GET', $this->uri, $params ); return new FieldInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['intentSid'], $this->solution['sid'] ); } /** * Deletes the FieldInstance * * @return boolean True if delete succeeds, false otherwise */ 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/Twilio/Rest/Preview/Understand/Service/Intent/FieldInstance.php 0000604 00000010507 15174325131 0021324 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\Service\Intent; 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 intentSid * @property string serviceSid * @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 $serviceSid The service_sid * @param string $intentSid The intent_sid * @param string $sid The sid * @return \Twilio\Rest\Preview\Understand\Service\Intent\FieldInstance */ public function __construct(Version $version, array $payload, $serviceSid, $intentSid, $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'), 'intentSid' => Values::array_get($payload, 'intent_sid'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'sid' => Values::array_get($payload, 'sid'), 'uniqueName' => Values::array_get($payload, 'unique_name'), 'url' => Values::array_get($payload, 'url'), ); $this->solution = array( 'serviceSid' => $serviceSid, 'intentSid' => $intentSid, '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\Service\Intent\FieldContext Context * for this * FieldInstance */ protected function proxy() { if (!$this->context) { $this->context = new FieldContext( $this->version, $this->solution['serviceSid'], $this->solution['intentSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch a FieldInstance * * @return FieldInstance Fetched FieldInstance */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the FieldInstance * * @return boolean True if delete succeeds, false otherwise */ 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/Twilio/Rest/Preview/Understand/Service/Intent/FieldList.php 0000604 00000013543 15174325131 0020476 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\Service\Intent; 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 $serviceSid The service_sid * @param string $intentSid The intent_sid * @return \Twilio\Rest\Preview\Understand\Service\Intent\FieldList */ public function __construct(Version $version, $serviceSid, $intentSid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, 'intentSid' => $intentSid, ); $this->uri = '/Services/' . rawurlencode($serviceSid) . '/Intents/' . rawurlencode($intentSid) . '/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 * @param string $uniqueName The unique_name * @return FieldInstance Newly created FieldInstance */ 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['serviceSid'], $this->solution['intentSid'] ); } /** * Constructs a FieldContext * * @param string $sid The sid * @return \Twilio\Rest\Preview\Understand\Service\Intent\FieldContext */ public function getContext($sid) { return new FieldContext( $this->version, $this->solution['serviceSid'], $this->solution['intentSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Preview.Understand.FieldList]'; } } sdk/Twilio/Rest/Preview/Understand/Service/Intent/SampleInstance.php 0000604 00000011277 15174325131 0021527 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\Service\Intent; 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 intentSid * @property string language * @property string serviceSid * @property string sid * @property string taggedText * @property string url */ class SampleInstance extends InstanceResource { /** * Initialize the SampleInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $serviceSid The service_sid * @param string $intentSid The intent_sid * @param string $sid The sid * @return \Twilio\Rest\Preview\Understand\Service\Intent\SampleInstance */ public function __construct(Version $version, array $payload, $serviceSid, $intentSid, $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')), 'intentSid' => Values::array_get($payload, 'intent_sid'), 'language' => Values::array_get($payload, 'language'), 'serviceSid' => Values::array_get($payload, 'service_sid'), 'sid' => Values::array_get($payload, 'sid'), 'taggedText' => Values::array_get($payload, 'tagged_text'), 'url' => Values::array_get($payload, 'url'), ); $this->solution = array( 'serviceSid' => $serviceSid, 'intentSid' => $intentSid, '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\Service\Intent\SampleContext Context * for * this * SampleInstance */ protected function proxy() { if (!$this->context) { $this->context = new SampleContext( $this->version, $this->solution['serviceSid'], $this->solution['intentSid'], $this->solution['sid'] ); } return $this->context; } /** * Fetch a SampleInstance * * @return SampleInstance Fetched SampleInstance */ public function fetch() { return $this->proxy()->fetch(); } /** * Update the SampleInstance * * @param array|Options $options Optional Arguments * @return SampleInstance Updated SampleInstance */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Deletes the SampleInstance * * @return boolean True if delete succeeds, false otherwise */ 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/Twilio/Rest/Preview/Understand/Service/Intent/SampleList.php 0000604 00000014327 15174325131 0020675 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\Service\Intent; 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 $serviceSid The service_sid * @param string $intentSid The intent_sid * @return \Twilio\Rest\Preview\Understand\Service\Intent\SampleList */ public function __construct(Version $version, $serviceSid, $intentSid) { parent::__construct($version); // Path Solution $this->solution = array('serviceSid' => $serviceSid, 'intentSid' => $intentSid, ); $this->uri = '/Services/' . rawurlencode($serviceSid) . '/Intents/' . rawurlencode($intentSid) . '/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 language * @param string $taggedText The tagged_text * @return SampleInstance Newly created SampleInstance */ public function create($language, $taggedText) { $data = Values::of(array('Language' => $language, 'TaggedText' => $taggedText, )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new SampleInstance( $this->version, $payload, $this->solution['serviceSid'], $this->solution['intentSid'] ); } /** * Constructs a SampleContext * * @param string $sid The sid * @return \Twilio\Rest\Preview\Understand\Service\Intent\SampleContext */ public function getContext($sid) { return new SampleContext( $this->version, $this->solution['serviceSid'], $this->solution['intentSid'], $sid ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Preview.Understand.SampleList]'; } } sdk/Twilio/Rest/Preview/Understand/Service/Intent/FieldPage.php 0000604 00000002054 15174325131 0020432 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\Service\Intent; 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['serviceSid'], $this->solution['intentSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Preview.Understand.FieldPage]'; } } sdk/Twilio/Rest/Preview/Understand/Service/Intent/SamplePage.php 0000604 00000002057 15174325131 0020633 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\Understand\Service\Intent; 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['serviceSid'], $this->solution['intentSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Preview.Understand.SamplePage]'; } } sdk/Twilio/Rest/Preview/BulkExports/ExportPage.php 0000604 00000001653 15174325131 0016206 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/Twilio/Rest/Preview/BulkExports/ExportList.php 0000604 00000002430 15174325131 0016237 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 ExportList extends ListResource { /** * 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(); } /** * 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); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Preview.BulkExports.ExportList]'; } } sdk/Twilio/Rest/Preview/BulkExports/ExportConfigurationInstance.php 0000604 00000007467 15174325131 0021637 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 boolean 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 */ public function fetch() { return $this->proxy()->fetch(); } /** * Update the ExportConfigurationInstance * * @param array|Options $options Optional Arguments * @return ExportConfigurationInstance Updated ExportConfigurationInstance */ 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/Twilio/Rest/Preview/BulkExports/ExportConfigurationList.php 0000604 00000002563 15174325131 0020776 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/Twilio/Rest/Preview/BulkExports/Export/DayList.php 0000604 00000011230 15174325131 0016752 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/Twilio/Rest/Preview/BulkExports/Export/DayPage.php 0000604 00000001712 15174325131 0016717 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/Twilio/Rest/Preview/BulkExports/Export/DayInstance.php 0000604 00000004353 15174325131 0017613 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 integer 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/Twilio/Rest/Preview/BulkExports/ExportContext.php 0000604 00000006525 15174325131 0016761 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\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains preview 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 */ class ExportContext extends InstanceContext { protected $_days = 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 */ 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; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws \Twilio\Exceptions\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 \Twilio\Exceptions\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/Twilio/Rest/Preview/BulkExports/ExportConfigurationPage.php 0000604 00000001722 15174325131 0020733 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/Twilio/Rest/Preview/BulkExports/ExportConfigurationOptions.php 0000604 00000005125 15174325131 0021513 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 boolean $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 boolean $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 boolean $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/Twilio/Rest/Preview/BulkExports/ExportInstance.php 0000604 00000006420 15174325131 0017073 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; /** * 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 */ public function fetch() { return $this->proxy()->fetch(); } /** * Access the days * * @return \Twilio\Rest\Preview\BulkExports\Export\DayList */ protected function getDays() { return $this->proxy()->days; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (property_exists($this, '_' . $name)) { $method = 'get' . ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide 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/Twilio/Rest/Preview/BulkExports/ExportConfigurationContext.php 0000604 00000005244 15174325131 0021506 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Preview\BulkExports; 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 */ 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 */ 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/Twilio/Rest/Pricing/V1.php 0000604 00000005750 15174325131 0012110 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 \Twilio\Exceptions\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 \Twilio\Exceptions\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/Twilio/Rest/Pricing/V1/PhoneNumberPage.php 0000604 00000001335 15174325131 0015122 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/Twilio/Rest/Pricing/V1/MessagingPage.php 0000604 00000001327 15174325131 0014616 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/Twilio/Rest/Pricing/V1/Messaging/CountryContext.php 0000604 00000003055 15174325131 0017031 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Pricing\V1\Messaging; 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 * @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 */ 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/Twilio/Rest/Pricing/V1/Messaging/CountryList.php 0000604 00000011214 15174325131 0016314 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 * @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/Twilio/Rest/Pricing/V1/Messaging/CountryPage.php 0000604 00000001333 15174325131 0016256 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/Twilio/Rest/Pricing/V1/Messaging/CountryInstance.php 0000604 00000006301 15174325131 0017146 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 * @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'), 'url' => Values::array_get($payload, 'url'), 'outboundSmsPrices' => Values::array_get($payload, 'outbound_sms_prices'), 'inboundSmsPrices' => Values::array_get($payload, 'inbound_sms_prices'), 'priceUnit' => Values::array_get($payload, 'price_unit'), ); $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 */ 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/Twilio/Rest/Pricing/V1/VoicePage.php 0000604 00000001313 15174325131 0013741 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/Twilio/Rest/Pricing/V1/PhoneNumberList.php 0000604 00000004632 15174325131 0015164 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 \Twilio\Exceptions\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 \Twilio\Exceptions\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/Twilio/Rest/Pricing/V1/MessagingList.php 0000604 00000004614 15174325131 0014657 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 \Twilio\Exceptions\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 \Twilio\Exceptions\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/Twilio/Rest/Pricing/V1/PhoneNumber/CountryContext.php 0000604 00000003064 15174325131 0017336 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Pricing\V1\PhoneNumber; 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 * @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 */ 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/Twilio/Rest/Pricing/V1/PhoneNumber/CountryPage.php 0000604 00000001335 15174325131 0016565 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/Twilio/Rest/Pricing/V1/PhoneNumber/CountryList.php 0000604 00000011225 15174325131 0016623 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 * @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/Twilio/Rest/Pricing/V1/PhoneNumber/CountryInstance.php 0000604 00000006117 15174325131 0017460 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 * @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'), 'url' => Values::array_get($payload, 'url'), 'phoneNumberPrices' => Values::array_get($payload, 'phone_number_prices'), 'priceUnit' => Values::array_get($payload, 'price_unit'), ); $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 */ 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/Twilio/Rest/Pricing/V1/VoiceList.php 0000604 00000005452 15174325131 0014010 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 \Twilio\Exceptions\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 \Twilio\Exceptions\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/Twilio/Rest/Pricing/V1/PhoneNumberInstance.php 0000604 00000003467 15174325131 0016022 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/Twilio/Rest/Pricing/V1/MessagingInstance.php 0000604 00000003457 15174325131 0015514 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/Twilio/Rest/Pricing/V1/Voice/CountryInstance.php 0000604 00000006275 15174325131 0016310 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 * @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'), 'url' => Values::array_get($payload, 'url'), 'outboundPrefixPrices' => Values::array_get($payload, 'outbound_prefix_prices'), 'inboundCallPrices' => Values::array_get($payload, 'inbound_call_prices'), 'priceUnit' => Values::array_get($payload, 'price_unit'), ); $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 */ 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/Twilio/Rest/Pricing/V1/Voice/NumberInstance.php 0000604 00000006343 15174325131 0016071 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 number * @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 */ 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/Twilio/Rest/Pricing/V1/Voice/NumberContext.php 0000604 00000002772 15174325131 0015753 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Pricing\V1\Voice; 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 number * @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 */ 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/Twilio/Rest/Pricing/V1/Voice/CountryContext.php 0000604 00000003041 15174325131 0016154 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Pricing\V1\Voice; 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 * @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 */ 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/Twilio/Rest/Pricing/V1/Voice/NumberList.php 0000604 00000002042 15174325131 0015230 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 number * @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/Twilio/Rest/Pricing/V1/Voice/CountryList.php 0000604 00000011174 15174325131 0015451 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 * @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/Twilio/Rest/Pricing/V1/Voice/NumberPage.php 0000604 00000001324 15174325131 0015173 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/Twilio/Rest/Pricing/V1/Voice/CountryPage.php 0000604 00000001327 15174325131 0015411 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/Twilio/Rest/Pricing/V1/VoiceInstance.php 0000604 00000003437 15174325131 0014642 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/Twilio/Rest/Messaging.php 0000604 00000005255 15174325131 0012144 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 * @method \Twilio\Rest\Messaging\V1\ServiceContext services(string $sid) */ 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 \Twilio\Exceptions\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 \Twilio\Exceptions\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 * @return \Twilio\Rest\Messaging\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.Messaging]'; } } sdk/Twilio/Rest/Taskrouter.php 0000604 00000005317 15174325131 0012371 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 \Twilio\Exceptions\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 \Twilio\Exceptions\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 * @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/Twilio/Rest/Pricing.php 0000604 00000005456 15174325131 0011625 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; /** * @property \Twilio\Rest\Pricing\V1 v1 * @property \Twilio\Rest\Pricing\V1\MessagingList messaging * @property \Twilio\Rest\Pricing\V1\PhoneNumberList phoneNumbers * @property \Twilio\Rest\Pricing\V1\VoiceList voice */ class Pricing extends Domain { protected $_v1 = 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; } /** * Magic getter to lazy load version * * @param string $name Version to return * @return \Twilio\Version The requested version * @throws \Twilio\Exceptions\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 \Twilio\Exceptions\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\V1\VoiceList */ protected function getVoice() { return $this->v1->voice; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Pricing]'; } } sdk/Twilio/Rest/Fax/V1.php 0000604 00000004327 15174325131 0011232 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 \Twilio\Exceptions\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 \Twilio\Exceptions\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/Twilio/Rest/Fax/V1/FaxInstance.php 0000604 00000011661 15174325131 0013434 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 integer numPages * @property integer 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 A string that uniquely identifies this fax. * @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 */ public function fetch() { return $this->proxy()->fetch(); } /** * Update the FaxInstance * * @param array|Options $options Optional Arguments * @return FaxInstance Updated FaxInstance */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Deletes the FaxInstance * * @return boolean True if delete succeeds, false otherwise */ 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/Twilio/Rest/Fax/V1/FaxPage.php 0000604 00000001456 15174325131 0012545 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/Twilio/Rest/Fax/V1/FaxList.php 0000604 00000014471 15174325131 0012605 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Fax\V1; 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 or SIP address to send the fax to * @param string $mediaUrl URL that points to the fax media * @param array|Options $options Optional Arguments * @return FaxInstance Newly created FaxInstance */ 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 A string that uniquely identifies this fax. * @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/Twilio/Rest/Fax/V1/FaxOptions.php 0000604 00000023425 15174325131 0013324 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 Include only faxes sent from * @param string $to Include only faxes sent to * @param \DateTime $dateCreatedOnOrBefore Include only faxes created on or * before * @param \DateTime $dateCreatedAfter Include only faxes created after * @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 URL for fax status callbacks * @param string $from Twilio number from which to originate the fax * @param string $sipAuthUsername Username for SIP authentication * @param string $sipAuthPassword Password for SIP authentication * @param boolean $storeMedia Whether or not to store media * @param integer $ttl How many minutes to attempt a 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 updated status of this fax * @return UpdateFaxOptions Options builder */ public static function update($status = Values::NONE) { return new UpdateFaxOptions($status); } } class ReadFaxOptions extends Options { /** * @param string $from Include only faxes sent from * @param string $to Include only faxes sent to * @param \DateTime $dateCreatedOnOrBefore Include only faxes created on or * before * @param \DateTime $dateCreatedAfter Include only faxes created after */ 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; } /** * Filters the returned list to only include faxes sent from the supplied number, given in E.164 format. * * @param string $from Include only faxes sent from * @return $this Fluent Builder */ public function setFrom($from) { $this->options['from'] = $from; return $this; } /** * Filters the returned list to only include faxes sent to the supplied number, given in E.164 format. * * @param string $to Include only faxes sent to * @return $this Fluent Builder */ public function setTo($to) { $this->options['to'] = $to; return $this; } /** * Filters the returned list to only include faxes created on or before the supplied date, given in ISO 8601 format. * * @param \DateTime $dateCreatedOnOrBefore Include only faxes created on or * before * @return $this Fluent Builder */ public function setDateCreatedOnOrBefore($dateCreatedOnOrBefore) { $this->options['dateCreatedOnOrBefore'] = $dateCreatedOnOrBefore; return $this; } /** * Filters the returned list to only include faxes created after the supplied date, given in ISO 8601 format. * * @param \DateTime $dateCreatedAfter Include only faxes created after * @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 URL for fax status callbacks * @param string $from Twilio number from which to originate the fax * @param string $sipAuthUsername Username for SIP authentication * @param string $sipAuthPassword Password for SIP authentication * @param boolean $storeMedia Whether or not to store media * @param integer $ttl How many minutes to attempt a 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 quality setting to use for this fax. One of `standard`, `fine` or `superfine`. * * @param string $quality The quality of this fax * @return $this Fluent Builder */ public function setQuality($quality) { $this->options['quality'] = $quality; return $this; } /** * The URL that Twilio will request when the status of the fax changes. * * @param string $statusCallback URL for fax status callbacks * @return $this Fluent Builder */ public function setStatusCallback($statusCallback) { $this->options['statusCallback'] = $statusCallback; return $this; } /** * The phone number to use as the caller id, E.164-formatted. If using a phone number, it must be a Twilio number or a verified outgoing caller id for your account. If sending to a SIP address, this can be any alphanumeric string (plus the characters `+`, `_`, `.`, and `-`) to use in the From header of the SIP request. * * @param string $from Twilio number from which to originate the fax * @return $this Fluent Builder */ public function setFrom($from) { $this->options['from'] = $from; return $this; } /** * The username to use for authentication when sending to a SIP address. * * @param string $sipAuthUsername Username for SIP authentication * @return $this Fluent Builder */ public function setSipAuthUsername($sipAuthUsername) { $this->options['sipAuthUsername'] = $sipAuthUsername; return $this; } /** * The password to use for authentication when sending to a SIP address. * * @param string $sipAuthPassword Password for SIP authentication * @return $this Fluent Builder */ public function setSipAuthPassword($sipAuthPassword) { $this->options['sipAuthPassword'] = $sipAuthPassword; return $this; } /** * Whether or not to store a copy of the sent media on Twilio's servers for later retrieval (defaults to `true`) * * @param boolean $storeMedia Whether or not to store media * @return $this Fluent Builder */ public function setStoreMedia($storeMedia) { $this->options['storeMedia'] = $storeMedia; return $this; } /** * How many minutes from when a fax was initiated should Twilio attempt to send a fax. * * @param integer $ttl How many minutes to attempt a 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 updated status of this fax */ public function __construct($status = Values::NONE) { $this->options['status'] = $status; } /** * The updated status of this fax. The only valid option is `canceled`. This may fail if the status has already started transmission. * * @param string $status The updated status of this fax * @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/Twilio/Rest/Fax/V1/FaxContext.php 0000604 00000007725 15174325131 0013322 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 A string that uniquely identifies this fax. * @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 */ 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 */ 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 */ 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 \Twilio\Exceptions\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 \Twilio\Exceptions\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/Twilio/Rest/Fax/V1/Fax/FaxMediaInstance.php 0000604 00000007351 15174325131 0015113 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 Fax SID * @param string $sid A string that uniquely identifies this fax media * @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 */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the FaxMediaInstance * * @return boolean True if delete succeeds, false otherwise */ 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/Twilio/Rest/Fax/V1/Fax/FaxMediaContext.php 0000604 00000004022 15174325131 0014763 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Fax\V1\Fax; 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 Fax SID * @param string $sid A string that uniquely identifies this fax media * @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 */ 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 */ 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/Twilio/Rest/Fax/V1/Fax/FaxMediaPage.php 0000604 00000001534 15174325131 0014220 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/Twilio/Rest/Fax/V1/Fax/FaxMediaList.php 0000604 00000011553 15174325131 0014261 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 Fax SID * @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 A string that uniquely identifies this fax media * @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/Twilio/Rest/Wireless/V1.php 0000604 00000006221 15174325131 0012304 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\Version; /** * @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 $_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\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 \Twilio\Exceptions\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 \Twilio\Exceptions\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/Twilio/Rest/Wireless/V1/SimPage.php 0000604 00000001470 15174325131 0013632 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Wireless\V1; use Twilio\Page; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ 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/Twilio/Rest/Wireless/V1/SimInstance.php 0000604 00000013301 15174325131 0014516 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; /** * 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 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 * @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 * @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'), '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 */ public function fetch() { return $this->proxy()->fetch(); } /** * Update the SimInstance * * @param array|Options $options Optional Arguments * @return SimInstance Updated SimInstance */ public function update($options = array()) { return $this->proxy()->update($options); } /** * 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/Twilio/Rest/Wireless/V1/CommandPage.php 0000604 00000001504 15174325131 0014456 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Wireless\V1; use Twilio\Page; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ 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/Twilio/Rest/Wireless/V1/CommandContext.php 0000604 00000003120 15174325131 0015222 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Wireless\V1; 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 CommandContext extends InstanceContext { /** * Initialize the CommandContext * * @param \Twilio\Version $version Version that contains the resource * @param string $sid The sid * @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 */ 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.Wireless.V1.CommandContext ' . implode(' ', $context) . ']'; } } sdk/Twilio/Rest/Wireless/V1/SimList.php 0000604 00000012236 15174325131 0013673 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; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ 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 * @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/Twilio/Rest/Wireless/V1/CommandOptions.php 0000604 00000012346 15174325131 0015243 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Wireless\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 CommandOptions { /** * @param string $sim The sim * @param string $status The status * @param string $direction The direction * @return ReadCommandOptions Options builder */ public static function read($sim = Values::NONE, $status = Values::NONE, $direction = Values::NONE) { return new ReadCommandOptions($sim, $status, $direction); } /** * @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($sim = Values::NONE, $callbackMethod = Values::NONE, $callbackUrl = Values::NONE, $commandMode = Values::NONE, $includeSid = Values::NONE) { return new CreateCommandOptions($sim, $callbackMethod, $callbackUrl, $commandMode, $includeSid); } } class ReadCommandOptions extends Options { /** * @param string $sim The sim * @param string $status The status * @param string $direction The direction */ public function __construct($sim = Values::NONE, $status = Values::NONE, $direction = Values::NONE) { $this->options['sim'] = $sim; $this->options['status'] = $status; $this->options['direction'] = $direction; } /** * 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.Wireless.V1.ReadCommandOptions ' . implode(' ', $options) . ']'; } } class CreateCommandOptions extends Options { /** * @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($sim = Values::NONE, $callbackMethod = Values::NONE, $callbackUrl = Values::NONE, $commandMode = Values::NONE, $includeSid = Values::NONE) { $this->options['sim'] = $sim; $this->options['callbackMethod'] = $callbackMethod; $this->options['callbackUrl'] = $callbackUrl; $this->options['commandMode'] = $commandMode; $this->options['includeSid'] = $includeSid; } /** * 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.Wireless.V1.CreateCommandOptions ' . implode(' ', $options) . ']'; } } sdk/Twilio/Rest/Wireless/V1/Sim/DataSessionOptions.php 0000604 00000003447 15174325131 0016634 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Wireless\V1\Sim; 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 DataSessionOptions { /** * @param \DateTime $end The end * @param \DateTime $start The start * @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 end * @param \DateTime $start The start */ public function __construct($end = Values::NONE, $start = Values::NONE) { $this->options['end'] = $end; $this->options['start'] = $start; } /** * The end * * @param \DateTime $end The end * @return $this Fluent Builder */ public function setEnd($end) { $this->options['end'] = $end; return $this; } /** * The start * * @param \DateTime $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.Wireless.V1.ReadDataSessionOptions ' . implode(' ', $options) . ']'; } } sdk/Twilio/Rest/Wireless/V1/Sim/DataSessionList.php 0000604 00000012074 15174325131 0016110 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; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class DataSessionList extends ListResource { /** * Construct the DataSessionList * * @param Version $version Version that contains the resource * @param string $simSid The sim_sid * @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/Twilio/Rest/Wireless/V1/Sim/UsageRecordInstance.php 0000604 00000004310 15174325131 0016721 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; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * * @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 sim_sid * @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/Twilio/Rest/Wireless/V1/Sim/UsageRecordOptions.php 0000604 00000004424 15174325131 0016616 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Wireless\V1\Sim; 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 UsageRecordOptions { /** * @param \DateTime $end The end * @param \DateTime $start The start * @param string $granularity The granularity * @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 The end * @param \DateTime $start The start * @param string $granularity The granularity */ public function __construct($end = Values::NONE, $start = Values::NONE, $granularity = Values::NONE) { $this->options['end'] = $end; $this->options['start'] = $start; $this->options['granularity'] = $granularity; } /** * The end * * @param \DateTime $end The end * @return $this Fluent Builder */ public function setEnd($end) { $this->options['end'] = $end; return $this; } /** * The start * * @param \DateTime $start The start * @return $this Fluent Builder */ public function setStart($start) { $this->options['start'] = $start; return $this; } /** * The granularity * * @param string $granularity The granularity * @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/Twilio/Rest/Wireless/V1/Sim/DataSessionPage.php 0000604 00000001557 15174325131 0016055 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Wireless\V1\Sim; use Twilio\Page; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ 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/Twilio/Rest/Wireless/V1/Sim/DataSessionInstance.php 0000604 00000006565 15174325131 0016751 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; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * * @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 integer packetsUploaded * @property integer packetsDownloaded * @property \DateTime lastUpdated * @property \DateTime start * @property \DateTime end */ 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 sim_sid * @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')), ); $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/Twilio/Rest/Wireless/V1/Sim/UsageRecordPage.php 0000604 00000001557 15174325131 0016043 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Wireless\V1\Sim; use Twilio\Page; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ 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/Twilio/Rest/Wireless/V1/Sim/UsageRecordList.php 0000604 00000012162 15174325131 0016074 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; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class UsageRecordList extends ListResource { /** * Construct the UsageRecordList * * @param Version $version Version that contains the resource * @param string $simSid The sim_sid * @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/Twilio/Rest/Wireless/V1/CommandInstance.php 0000604 00000007161 15174325131 0015353 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; /** * 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 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\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'), '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 */ 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.Wireless.V1.CommandInstance ' . implode(' ', $context) . ']'; } } sdk/Twilio/Rest/Wireless/V1/CommandList.php 0000604 00000013727 15174325131 0014527 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; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ 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'], '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 */ 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'], )); $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\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/Twilio/Rest/Wireless/V1/RatePlanContext.php 0000604 00000004726 15174325131 0015367 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Wireless\V1; use Twilio\InstanceContext; 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 RatePlanContext extends InstanceContext { /** * Initialize the RatePlanContext * * @param \Twilio\Version $version Version that contains the resource * @param string $sid The sid * @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 */ 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 */ 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 */ 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/Twilio/Rest/Wireless/V1/RatePlanPage.php 0000604 00000001507 15174325131 0014611 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Wireless\V1; use Twilio\Page; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ 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/Twilio/Rest/Wireless/V1/RatePlanOptions.php 0000604 00000022126 15174325131 0015370 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Wireless\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 RatePlanOptions { /** * @param string $uniqueName The unique_name * @param string $friendlyName The friendly_name * @param boolean $dataEnabled The data_enabled * @param integer $dataLimit The data_limit * @param string $dataMetering The data_metering * @param boolean $messagingEnabled The messaging_enabled * @param boolean $voiceEnabled The voice_enabled * @param boolean $nationalRoamingEnabled The national_roaming_enabled * @param string $internationalRoaming The international_roaming * @param integer $nationalRoamingDataLimit The national_roaming_data_limit * @param integer $internationalRoamingDataLimit The * international_roaming_data_limit * @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 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 boolean $dataEnabled The data_enabled * @param integer $dataLimit The data_limit * @param string $dataMetering The data_metering * @param boolean $messagingEnabled The messaging_enabled * @param boolean $voiceEnabled The voice_enabled * @param boolean $nationalRoamingEnabled The national_roaming_enabled * @param string $internationalRoaming The international_roaming * @param integer $nationalRoamingDataLimit The national_roaming_data_limit * @param integer $internationalRoamingDataLimit The * international_roaming_data_limit */ 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; } /** * 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 boolean $dataEnabled The data_enabled * @return $this Fluent Builder */ public function setDataEnabled($dataEnabled) { $this->options['dataEnabled'] = $dataEnabled; return $this; } /** * The data_limit * * @param integer $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 boolean $messagingEnabled The messaging_enabled * @return $this Fluent Builder */ public function setMessagingEnabled($messagingEnabled) { $this->options['messagingEnabled'] = $messagingEnabled; return $this; } /** * The voice_enabled * * @param boolean $voiceEnabled The voice_enabled * @return $this Fluent Builder */ public function setVoiceEnabled($voiceEnabled) { $this->options['voiceEnabled'] = $voiceEnabled; return $this; } /** * The national_roaming_enabled * * @param boolean $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; } /** * The national_roaming_data_limit * * @param integer $nationalRoamingDataLimit The national_roaming_data_limit * @return $this Fluent Builder */ public function setNationalRoamingDataLimit($nationalRoamingDataLimit) { $this->options['nationalRoamingDataLimit'] = $nationalRoamingDataLimit; return $this; } /** * The international_roaming_data_limit * * @param integer $internationalRoamingDataLimit The * international_roaming_data_limit * @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 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.Wireless.V1.UpdateRatePlanOptions ' . implode(' ', $options) . ']'; } } sdk/Twilio/Rest/Wireless/V1/RatePlanInstance.php 0000604 00000011723 15174325131 0015502 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; /** * 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 boolean dataEnabled * @property string dataMetering * @property integer dataLimit * @property boolean messagingEnabled * @property boolean voiceEnabled * @property boolean nationalRoamingEnabled * @property integer nationalRoamingDataLimit * @property string internationalRoaming * @property integer 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 * @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 */ public function fetch() { return $this->proxy()->fetch(); } /** * Update the RatePlanInstance * * @param array|Options $options Optional Arguments * @return RatePlanInstance Updated RatePlanInstance */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Deletes the RatePlanInstance * * @return boolean True if delete succeeds, false otherwise */ 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/Twilio/Rest/Wireless/V1/SimOptions.php 0000604 00000030057 15174325131 0014414 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Wireless\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 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.Wireless.V1.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.Wireless.V1.UpdateSimOptions ' . implode(' ', $options) . ']'; } } sdk/Twilio/Rest/Wireless/V1/SimContext.php 0000604 00000012140 15174325131 0014376 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; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * * @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 * @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 */ 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 */ 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 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 \Twilio\Exceptions\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 \Twilio\Exceptions\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/Twilio/Rest/Wireless/V1/RatePlanList.php 0000604 00000014143 15174325131 0014650 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; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ 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 */ 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 * @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/Twilio/Rest/IpMessaging.php 0000604 00000007047 15174325131 0012436 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://ip-messaging.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 \Twilio\Exceptions\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 \Twilio\Exceptions\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 * @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 * @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/Twilio/Rest/Notify.php 0000604 00000006176 15174325131 0011502 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 \Twilio\Exceptions\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 \Twilio\Exceptions\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 sid * @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 sid * @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/Twilio/Rest/Api/V2010/Account/QueueInstance.php 0000604 00000010556 15174325131 0015615 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 integer averageWaitTime * @property integer currentSize * @property \DateTime dateCreated * @property \DateTime dateUpdated * @property string friendlyName * @property integer 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 account_sid * @param string $sid Fetch by unique queue Sid * @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 */ public function fetch() { return $this->proxy()->fetch(); } /** * Update the QueueInstance * * @param array|Options $options Optional Arguments * @return QueueInstance Updated QueueInstance */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Deletes the QueueInstance * * @return boolean True if delete succeeds, false otherwise */ 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/Twilio/Rest/Api/V2010/Account/MessageInstance.php 0000604 00000013220 15174325131 0016104 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 integer 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 unique sid that identifies this account * @param string $sid Fetch by unique message Sid * @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 */ public function delete() { return $this->proxy()->delete(); } /** * Fetch a MessageInstance * * @return MessageInstance Fetched MessageInstance */ public function fetch() { return $this->proxy()->fetch(); } /** * Update the MessageInstance * * @param string $body The body * @return MessageInstance Updated MessageInstance */ 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/Twilio/Rest/Api/V2010/Account/OutgoingCallerIdPage.php 0000604 00000001421 15174325131 0017023 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/Twilio/Rest/Api/V2010/Account/ConferenceList.php 0000604 00000013407 15174325131 0015745 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 unique sid that identifies this account * @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 Fetch by unique conference Sid * @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/Twilio/Rest/Api/V2010/Account/ConnectAppPage.php 0000604 00000001377 15174325131 0015674 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/Twilio/Rest/Api/V2010/Account/Conference/ParticipantInstance.php 0000604 00000011677 15174325131 0021063 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 conferenceSid * @property \DateTime dateCreated * @property \DateTime dateUpdated * @property boolean endConferenceOnExit * @property boolean muted * @property boolean hold * @property boolean 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 unique sid that identifies this account * @param string $conferenceSid A string that uniquely identifies this * conference * @param string $callSid The call_sid * @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'), '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 */ public function fetch() { return $this->proxy()->fetch(); } /** * Update the ParticipantInstance * * @param array|Options $options Optional Arguments * @return ParticipantInstance Updated ParticipantInstance */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Deletes the ParticipantInstance * * @return boolean True if delete succeeds, false otherwise */ 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/Twilio/Rest/Api/V2010/Account/Conference/ParticipantOptions.php 0000604 00000060045 15174325131 0020743 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 boolean $muted Indicates if the participant should be muted * @param boolean $hold The hold * @param string $holdUrl The hold_url * @param string $holdMethod The hold_method * @param string $announceUrl The announce_url * @param string $announceMethod The announce_method * @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) { return new UpdateParticipantOptions($muted, $hold, $holdUrl, $holdMethod, $announceUrl, $announceMethod); } /** * @param string $statusCallback The status_callback * @param string $statusCallbackMethod The status_callback_method * @param string $statusCallbackEvent The status_callback_event * @param integer $timeout The timeout * @param boolean $record The record * @param boolean $muted The muted * @param string $beep The beep * @param boolean $startConferenceOnEnter The start_conference_on_enter * @param boolean $endConferenceOnExit The end_conference_on_exit * @param string $waitUrl The wait_url * @param string $waitMethod The wait_method * @param boolean $earlyMedia The early_media * @param integer $maxParticipants The max_participants * @param string $conferenceRecord The conference_record * @param string $conferenceTrim The conference_trim * @param string $conferenceStatusCallback The conference_status_callback * @param string $conferenceStatusCallbackMethod The * conference_status_callback_method * @param string $conferenceStatusCallbackEvent The * conference_status_callback_event * @param string $recordingChannels The recording_channels * @param string $recordingStatusCallback The recording_status_callback * @param string $recordingStatusCallbackMethod The * recording_status_callback_method * @param string $sipAuthUsername The sip_auth_username * @param string $sipAuthPassword The sip_auth_password * @param string $region The region * @param string $conferenceRecordingStatusCallback The * conference_recording_status_callback * @param string $conferenceRecordingStatusCallbackMethod The * conference_recording_status_callback_method * @param string $recordingStatusCallbackEvent The * recording_status_callback_event * @param string $conferenceRecordingStatusCallbackEvent The * conference_recording_status_callback_event * @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) { 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); } /** * @param boolean $muted Filter by muted participants * @param boolean $hold The hold * @return ReadParticipantOptions Options builder */ public static function read($muted = Values::NONE, $hold = Values::NONE) { return new ReadParticipantOptions($muted, $hold); } } class UpdateParticipantOptions extends Options { /** * @param boolean $muted Indicates if the participant should be muted * @param boolean $hold The hold * @param string $holdUrl The hold_url * @param string $holdMethod The hold_method * @param string $announceUrl The announce_url * @param string $announceMethod The announce_method */ public function __construct($muted = Values::NONE, $hold = Values::NONE, $holdUrl = Values::NONE, $holdMethod = Values::NONE, $announceUrl = Values::NONE, $announceMethod = 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; } /** * Indicates if the participant should be muted * * @param boolean $muted Indicates if the participant should be muted * @return $this Fluent Builder */ public function setMuted($muted) { $this->options['muted'] = $muted; return $this; } /** * The hold * * @param boolean $hold The hold * @return $this Fluent Builder */ public function setHold($hold) { $this->options['hold'] = $hold; return $this; } /** * The hold_url * * @param string $holdUrl The hold_url * @return $this Fluent Builder */ public function setHoldUrl($holdUrl) { $this->options['holdUrl'] = $holdUrl; return $this; } /** * The hold_method * * @param string $holdMethod The hold_method * @return $this Fluent Builder */ public function setHoldMethod($holdMethod) { $this->options['holdMethod'] = $holdMethod; return $this; } /** * The announce_url * * @param string $announceUrl The announce_url * @return $this Fluent Builder */ public function setAnnounceUrl($announceUrl) { $this->options['announceUrl'] = $announceUrl; return $this; } /** * The announce_method * * @param string $announceMethod The announce_method * @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.UpdateParticipantOptions ' . implode(' ', $options) . ']'; } } class CreateParticipantOptions extends Options { /** * @param string $statusCallback The status_callback * @param string $statusCallbackMethod The status_callback_method * @param string $statusCallbackEvent The status_callback_event * @param integer $timeout The timeout * @param boolean $record The record * @param boolean $muted The muted * @param string $beep The beep * @param boolean $startConferenceOnEnter The start_conference_on_enter * @param boolean $endConferenceOnExit The end_conference_on_exit * @param string $waitUrl The wait_url * @param string $waitMethod The wait_method * @param boolean $earlyMedia The early_media * @param integer $maxParticipants The max_participants * @param string $conferenceRecord The conference_record * @param string $conferenceTrim The conference_trim * @param string $conferenceStatusCallback The conference_status_callback * @param string $conferenceStatusCallbackMethod The * conference_status_callback_method * @param string $conferenceStatusCallbackEvent The * conference_status_callback_event * @param string $recordingChannels The recording_channels * @param string $recordingStatusCallback The recording_status_callback * @param string $recordingStatusCallbackMethod The * recording_status_callback_method * @param string $sipAuthUsername The sip_auth_username * @param string $sipAuthPassword The sip_auth_password * @param string $region The region * @param string $conferenceRecordingStatusCallback The * conference_recording_status_callback * @param string $conferenceRecordingStatusCallbackMethod The * conference_recording_status_callback_method * @param string $recordingStatusCallbackEvent The * recording_status_callback_event * @param string $conferenceRecordingStatusCallbackEvent The * conference_recording_status_callback_event */ 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) { $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; } /** * The status_callback * * @param string $statusCallback The status_callback * @return $this Fluent Builder */ public function setStatusCallback($statusCallback) { $this->options['statusCallback'] = $statusCallback; return $this; } /** * The status_callback_method * * @param string $statusCallbackMethod The status_callback_method * @return $this Fluent Builder */ public function setStatusCallbackMethod($statusCallbackMethod) { $this->options['statusCallbackMethod'] = $statusCallbackMethod; return $this; } /** * The status_callback_event * * @param string $statusCallbackEvent The status_callback_event * @return $this Fluent Builder */ public function setStatusCallbackEvent($statusCallbackEvent) { $this->options['statusCallbackEvent'] = $statusCallbackEvent; return $this; } /** * The timeout * * @param integer $timeout The timeout * @return $this Fluent Builder */ public function setTimeout($timeout) { $this->options['timeout'] = $timeout; return $this; } /** * The record * * @param boolean $record The record * @return $this Fluent Builder */ public function setRecord($record) { $this->options['record'] = $record; return $this; } /** * The muted * * @param boolean $muted The muted * @return $this Fluent Builder */ public function setMuted($muted) { $this->options['muted'] = $muted; return $this; } /** * The beep * * @param string $beep The beep * @return $this Fluent Builder */ public function setBeep($beep) { $this->options['beep'] = $beep; return $this; } /** * The start_conference_on_enter * * @param boolean $startConferenceOnEnter The start_conference_on_enter * @return $this Fluent Builder */ public function setStartConferenceOnEnter($startConferenceOnEnter) { $this->options['startConferenceOnEnter'] = $startConferenceOnEnter; return $this; } /** * The end_conference_on_exit * * @param boolean $endConferenceOnExit The end_conference_on_exit * @return $this Fluent Builder */ public function setEndConferenceOnExit($endConferenceOnExit) { $this->options['endConferenceOnExit'] = $endConferenceOnExit; return $this; } /** * The wait_url * * @param string $waitUrl The wait_url * @return $this Fluent Builder */ public function setWaitUrl($waitUrl) { $this->options['waitUrl'] = $waitUrl; return $this; } /** * The wait_method * * @param string $waitMethod The wait_method * @return $this Fluent Builder */ public function setWaitMethod($waitMethod) { $this->options['waitMethod'] = $waitMethod; return $this; } /** * The early_media * * @param boolean $earlyMedia The early_media * @return $this Fluent Builder */ public function setEarlyMedia($earlyMedia) { $this->options['earlyMedia'] = $earlyMedia; return $this; } /** * The max_participants * * @param integer $maxParticipants The max_participants * @return $this Fluent Builder */ public function setMaxParticipants($maxParticipants) { $this->options['maxParticipants'] = $maxParticipants; return $this; } /** * The conference_record * * @param string $conferenceRecord The conference_record * @return $this Fluent Builder */ public function setConferenceRecord($conferenceRecord) { $this->options['conferenceRecord'] = $conferenceRecord; return $this; } /** * The conference_trim * * @param string $conferenceTrim The conference_trim * @return $this Fluent Builder */ public function setConferenceTrim($conferenceTrim) { $this->options['conferenceTrim'] = $conferenceTrim; return $this; } /** * The conference_status_callback * * @param string $conferenceStatusCallback The conference_status_callback * @return $this Fluent Builder */ public function setConferenceStatusCallback($conferenceStatusCallback) { $this->options['conferenceStatusCallback'] = $conferenceStatusCallback; return $this; } /** * The conference_status_callback_method * * @param string $conferenceStatusCallbackMethod The * conference_status_callback_method * @return $this Fluent Builder */ public function setConferenceStatusCallbackMethod($conferenceStatusCallbackMethod) { $this->options['conferenceStatusCallbackMethod'] = $conferenceStatusCallbackMethod; return $this; } /** * The conference_status_callback_event * * @param string $conferenceStatusCallbackEvent The * conference_status_callback_event * @return $this Fluent Builder */ public function setConferenceStatusCallbackEvent($conferenceStatusCallbackEvent) { $this->options['conferenceStatusCallbackEvent'] = $conferenceStatusCallbackEvent; return $this; } /** * The recording_channels * * @param string $recordingChannels The recording_channels * @return $this Fluent Builder */ public function setRecordingChannels($recordingChannels) { $this->options['recordingChannels'] = $recordingChannels; return $this; } /** * The recording_status_callback * * @param string $recordingStatusCallback The recording_status_callback * @return $this Fluent Builder */ public function setRecordingStatusCallback($recordingStatusCallback) { $this->options['recordingStatusCallback'] = $recordingStatusCallback; return $this; } /** * The recording_status_callback_method * * @param string $recordingStatusCallbackMethod The * recording_status_callback_method * @return $this Fluent Builder */ public function setRecordingStatusCallbackMethod($recordingStatusCallbackMethod) { $this->options['recordingStatusCallbackMethod'] = $recordingStatusCallbackMethod; return $this; } /** * The sip_auth_username * * @param string $sipAuthUsername The sip_auth_username * @return $this Fluent Builder */ public function setSipAuthUsername($sipAuthUsername) { $this->options['sipAuthUsername'] = $sipAuthUsername; return $this; } /** * The sip_auth_password * * @param string $sipAuthPassword The sip_auth_password * @return $this Fluent Builder */ public function setSipAuthPassword($sipAuthPassword) { $this->options['sipAuthPassword'] = $sipAuthPassword; return $this; } /** * The region * * @param string $region The region * @return $this Fluent Builder */ public function setRegion($region) { $this->options['region'] = $region; return $this; } /** * The conference_recording_status_callback * * @param string $conferenceRecordingStatusCallback The * conference_recording_status_callback * @return $this Fluent Builder */ public function setConferenceRecordingStatusCallback($conferenceRecordingStatusCallback) { $this->options['conferenceRecordingStatusCallback'] = $conferenceRecordingStatusCallback; return $this; } /** * The conference_recording_status_callback_method * * @param string $conferenceRecordingStatusCallbackMethod The * conference_recording_status_callback_method * @return $this Fluent Builder */ public function setConferenceRecordingStatusCallbackMethod($conferenceRecordingStatusCallbackMethod) { $this->options['conferenceRecordingStatusCallbackMethod'] = $conferenceRecordingStatusCallbackMethod; return $this; } /** * The recording_status_callback_event * * @param string $recordingStatusCallbackEvent The * recording_status_callback_event * @return $this Fluent Builder */ public function setRecordingStatusCallbackEvent($recordingStatusCallbackEvent) { $this->options['recordingStatusCallbackEvent'] = $recordingStatusCallbackEvent; return $this; } /** * The conference_recording_status_callback_event * * @param string $conferenceRecordingStatusCallbackEvent The * conference_recording_status_callback_event * @return $this Fluent Builder */ public function setConferenceRecordingStatusCallbackEvent($conferenceRecordingStatusCallbackEvent) { $this->options['conferenceRecordingStatusCallbackEvent'] = $conferenceRecordingStatusCallbackEvent; return $this; } /** * Provide a friendly representation * * @return 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 boolean $muted Filter by muted participants * @param boolean $hold The hold */ public function __construct($muted = Values::NONE, $hold = Values::NONE) { $this->options['muted'] = $muted; $this->options['hold'] = $hold; } /** * Only show participants that are muted or unmuted * * @param boolean $muted Filter by muted participants * @return $this Fluent Builder */ public function setMuted($muted) { $this->options['muted'] = $muted; return $this; } /** * The hold * * @param boolean $hold The hold * @return $this Fluent Builder */ public function setHold($hold) { $this->options['hold'] = $hold; return $this; } /** * Provide a friendly representation * * @return 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/Twilio/Rest/Api/V2010/Account/Conference/ParticipantContext.php 0000604 00000006576 15174325131 0020745 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Conference; 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 account_sid * @param string $conferenceSid The string that uniquely identifies this * conference * @param string $callSid The call_sid * @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 */ 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 */ 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'], )); $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 */ 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/Twilio/Rest/Api/V2010/Account/Conference/ParticipantList.php 0000604 00000021204 15174325131 0020215 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 ParticipantList extends ListResource { /** * Construct the ParticipantList * * @param Version $version Version that contains the resource * @param string $accountSid The unique sid that identifies this account * @param string $conferenceSid A string that uniquely identifies this * conference * @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 * @param string $to The to * @param array|Options $options Optional Arguments * @return ParticipantInstance Newly created ParticipantInstance */ 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; }), )); $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']), '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 * @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/Twilio/Rest/Api/V2010/Account/Conference/ParticipantPage.php 0000604 00000001551 15174325131 0020161 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/Twilio/Rest/Api/V2010/Account/Usage/TriggerInstance.php 0000604 00000012030 15174325131 0017165 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 Fetch by unique usage-trigger Sid * @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 */ public function fetch() { return $this->proxy()->fetch(); } /** * Update the TriggerInstance * * @param array|Options $options Optional Arguments * @return TriggerInstance Updated TriggerInstance */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Deletes the TriggerInstance * * @return boolean True if delete succeeds, false otherwise */ 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/Twilio/Rest/Api/V2010/Account/Usage/RecordOptions.php 0000604 00000005424 15174325131 0016700 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 Only include usage of a given category * @param \DateTime $startDate Filter by start date * @param \DateTime $endDate Filter by end date * @return ReadRecordOptions Options builder */ public static function read($category = Values::NONE, $startDate = Values::NONE, $endDate = Values::NONE) { return new ReadRecordOptions($category, $startDate, $endDate); } } class ReadRecordOptions extends Options { /** * @param string $category Only include usage of a given category * @param \DateTime $startDate Filter by start date * @param \DateTime $endDate Filter by end date */ public function __construct($category = Values::NONE, $startDate = Values::NONE, $endDate = Values::NONE) { $this->options['category'] = $category; $this->options['startDate'] = $startDate; $this->options['endDate'] = $endDate; } /** * Only include usage of a given category * * @param string $category Only include usage of a given category * @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. Format is YYYY-MM-DD in GTM. As a convenience, you can also specify offsets to today, for example, StartDate=-30days, which will make StartDate 30 days before today * * @param \DateTime $startDate Filter by start date * @return $this Fluent Builder */ public function setStartDate($startDate) { $this->options['startDate'] = $startDate; return $this; } /** * Only include usage that has occurred on or after this date. Format is YYYY-MM-DD in GTM. As a convenience, you can also specify offsets to today, for example, EndDate=+30days, which will make EndDate 30 days from today * * @param \DateTime $endDate Filter by end 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.Api.V2010.ReadRecordOptions ' . implode(' ', $options) . ']'; } } sdk/Twilio/Rest/Api/V2010/Account/Usage/RecordInstance.php 0000604 00000006207 15174325131 0017011 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 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'), '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/Twilio/Rest/Api/V2010/Account/Usage/TriggerList.php 0000604 00000014765 15174325131 0016355 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Usage; 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 URL Twilio will request when the trigger fires * @param string $triggerValue the value at which the trigger will fire * @param string $usageCategory The usage category the trigger watches * @param array|Options $options Optional Arguments * @return TriggerInstance Newly created TriggerInstance */ 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 Fetch by unique usage-trigger Sid * @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/Twilio/Rest/Api/V2010/Account/Usage/RecordPage.php 0000604 00000001371 15174325131 0016116 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/Twilio/Rest/Api/V2010/Account/Usage/TriggerOptions.php 0000604 00000021171 15174325131 0017062 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 HTTP method to use with callback_url * @param string $callbackUrl URL Twilio will request when the trigger fires * @param string $friendlyName A user-specified, human-readable name for the * trigger. * @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 HTTP method to use with callback_url * @param string $friendlyName A user-specified, human-readable name for the * trigger. * @param string $recurring How this trigger recurs * @param string $triggerBy The field in the UsageRecord 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 Filter by recurring * @param string $triggerBy Filter by trigger by * @param string $usageCategory Filter by Usage Category * @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 HTTP method to use with callback_url * @param string $callbackUrl URL Twilio will request when the trigger fires * @param string $friendlyName A user-specified, human-readable name for the * trigger. */ 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 Twilio will use when making a request to the CallbackUrl. GET or POST. * * @param string $callbackMethod HTTP method to use with callback_url * @return $this Fluent Builder */ public function setCallbackMethod($callbackMethod) { $this->options['callbackMethod'] = $callbackMethod; return $this; } /** * Twilio will make a request to this url when the trigger fires. * * @param string $callbackUrl URL Twilio will request when the trigger fires * @return $this Fluent Builder */ public function setCallbackUrl($callbackUrl) { $this->options['callbackUrl'] = $callbackUrl; return $this; } /** * A user-specified, human-readable name for the trigger. * * @param string $friendlyName A user-specified, human-readable name for the * trigger. * @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 HTTP method to use with callback_url * @param string $friendlyName A user-specified, human-readable name for the * trigger. * @param string $recurring How this trigger recurs * @param string $triggerBy The field in the UsageRecord 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 Twilio will use when making a request to the CallbackUrl. GET or POST. * * @param string $callbackMethod HTTP method to use with callback_url * @return $this Fluent Builder */ public function setCallbackMethod($callbackMethod) { $this->options['callbackMethod'] = $callbackMethod; return $this; } /** * A user-specified, human-readable name for the trigger. * * @param string $friendlyName A user-specified, human-readable name for the * trigger. * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * How this trigger recurs. Empty for non-recurring triggers. One of `daily`, `monthly`, or `yearly` for recurring triggers. A trigger will only fire once during each recurring period. Recurring periods are in GMT. * * @param string $recurring How this trigger recurs * @return $this Fluent Builder */ public function setRecurring($recurring) { $this->options['recurring'] = $recurring; return $this; } /** * The field in the UsageRecord that fires the trigger. One of `count`, `usage`, or `price` * * @param string $triggerBy The field in the UsageRecord 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 Filter by recurring * @param string $triggerBy Filter by trigger by * @param string $usageCategory Filter by Usage Category */ public function __construct($recurring = Values::NONE, $triggerBy = Values::NONE, $usageCategory = Values::NONE) { $this->options['recurring'] = $recurring; $this->options['triggerBy'] = $triggerBy; $this->options['usageCategory'] = $usageCategory; } /** * Only show UsageTriggers that count over this interval. One of daily, monthly, or yearly * * @param string $recurring Filter by recurring * @return $this Fluent Builder */ public function setRecurring($recurring) { $this->options['recurring'] = $recurring; return $this; } /** * Only show UsageTriggers that trigger by this field in the UsagRecord * * @param string $triggerBy Filter by trigger by * @return $this Fluent Builder */ public function setTriggerBy($triggerBy) { $this->options['triggerBy'] = $triggerBy; return $this; } /** * Only show UsageTriggers that watch this usage category * * @param string $usageCategory Filter by Usage Category * @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/Twilio/Rest/Api/V2010/Account/Usage/TriggerContext.php 0000604 00000005410 15174325131 0017051 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Usage; 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 account_sid * @param string $sid Fetch by unique usage-trigger Sid * @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 */ 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 */ 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 */ 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/Twilio/Rest/Api/V2010/Account/Usage/TriggerPage.php 0000604 00000001374 15174325131 0016306 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/Twilio/Rest/Api/V2010/Account/Usage/Record/YesterdayInstance.php 0000604 00000006241 15174325131 0020760 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 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'), '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/Twilio/Rest/Api/V2010/Account/Usage/Record/YearlyOptions.php 0000604 00000004357 15174325131 0020151 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 category * @param \DateTime $startDate The start_date * @param \DateTime $endDate The end_date * @return ReadYearlyOptions Options builder */ public static function read($category = Values::NONE, $startDate = Values::NONE, $endDate = Values::NONE) { return new ReadYearlyOptions($category, $startDate, $endDate); } } class ReadYearlyOptions extends Options { /** * @param string $category The category * @param \DateTime $startDate The start_date * @param \DateTime $endDate The end_date */ public function __construct($category = Values::NONE, $startDate = Values::NONE, $endDate = Values::NONE) { $this->options['category'] = $category; $this->options['startDate'] = $startDate; $this->options['endDate'] = $endDate; } /** * The category * * @param string $category The category * @return $this Fluent Builder */ public function setCategory($category) { $this->options['category'] = $category; return $this; } /** * The start_date * * @param \DateTime $startDate The start_date * @return $this Fluent Builder */ public function setStartDate($startDate) { $this->options['startDate'] = $startDate; return $this; } /** * The end_date * * @param \DateTime $endDate The end_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.Api.V2010.ReadYearlyOptions ' . implode(' ', $options) . ']'; } } sdk/Twilio/Rest/Api/V2010/Account/Usage/Record/DailyList.php 0000604 00000012110 15174325131 0017210 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']), '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/Twilio/Rest/Api/V2010/Account/Usage/Record/YearlyList.php 0000604 00000012126 15174325131 0017422 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']), '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/Twilio/Rest/Api/V2010/Account/Usage/Record/AllTimePage.php 0000604 00000001403 15174325131 0017441 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/Twilio/Rest/Api/V2010/Account/Usage/Record/TodayPage.php 0000604 00000001375 15174325131 0017202 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/Twilio/Rest/Api/V2010/Account/Usage/Record/LastMonthOptions.php 0000604 00000004376 15174325131 0020616 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 category * @param \DateTime $startDate The start_date * @param \DateTime $endDate The end_date * @return ReadLastMonthOptions Options builder */ public static function read($category = Values::NONE, $startDate = Values::NONE, $endDate = Values::NONE) { return new ReadLastMonthOptions($category, $startDate, $endDate); } } class ReadLastMonthOptions extends Options { /** * @param string $category The category * @param \DateTime $startDate The start_date * @param \DateTime $endDate The end_date */ public function __construct($category = Values::NONE, $startDate = Values::NONE, $endDate = Values::NONE) { $this->options['category'] = $category; $this->options['startDate'] = $startDate; $this->options['endDate'] = $endDate; } /** * The category * * @param string $category The category * @return $this Fluent Builder */ public function setCategory($category) { $this->options['category'] = $category; return $this; } /** * The start_date * * @param \DateTime $startDate The start_date * @return $this Fluent Builder */ public function setStartDate($startDate) { $this->options['startDate'] = $startDate; return $this; } /** * The end_date * * @param \DateTime $endDate The end_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.Api.V2010.ReadLastMonthOptions ' . implode(' ', $options) . ']'; } } sdk/Twilio/Rest/Api/V2010/Account/Usage/Record/AllTimeInstance.php 0000604 00000006231 15174325131 0020335 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 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'), '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/Twilio/Rest/Api/V2010/Account/Usage/Record/YearlyPage.php 0000604 00000001400 15174325131 0017354 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/Twilio/Rest/Api/V2010/Account/Usage/Record/DailyPage.php 0000604 00000001375 15174325131 0017164 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/Twilio/Rest/Api/V2010/Account/Usage/Record/AllTimeOptions.php 0000604 00000004364 15174325131 0020231 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 category * @param \DateTime $startDate The start_date * @param \DateTime $endDate The end_date * @return ReadAllTimeOptions Options builder */ public static function read($category = Values::NONE, $startDate = Values::NONE, $endDate = Values::NONE) { return new ReadAllTimeOptions($category, $startDate, $endDate); } } class ReadAllTimeOptions extends Options { /** * @param string $category The category * @param \DateTime $startDate The start_date * @param \DateTime $endDate The end_date */ public function __construct($category = Values::NONE, $startDate = Values::NONE, $endDate = Values::NONE) { $this->options['category'] = $category; $this->options['startDate'] = $startDate; $this->options['endDate'] = $endDate; } /** * The category * * @param string $category The category * @return $this Fluent Builder */ public function setCategory($category) { $this->options['category'] = $category; return $this; } /** * The start_date * * @param \DateTime $startDate The start_date * @return $this Fluent Builder */ public function setStartDate($startDate) { $this->options['startDate'] = $startDate; return $this; } /** * The end_date * * @param \DateTime $endDate The end_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.Api.V2010.ReadAllTimeOptions ' . implode(' ', $options) . ']'; } } sdk/Twilio/Rest/Api/V2010/Account/Usage/Record/TodayOptions.php 0000604 00000004352 15174325131 0017757 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 category * @param \DateTime $startDate The start_date * @param \DateTime $endDate The end_date * @return ReadTodayOptions Options builder */ public static function read($category = Values::NONE, $startDate = Values::NONE, $endDate = Values::NONE) { return new ReadTodayOptions($category, $startDate, $endDate); } } class ReadTodayOptions extends Options { /** * @param string $category The category * @param \DateTime $startDate The start_date * @param \DateTime $endDate The end_date */ public function __construct($category = Values::NONE, $startDate = Values::NONE, $endDate = Values::NONE) { $this->options['category'] = $category; $this->options['startDate'] = $startDate; $this->options['endDate'] = $endDate; } /** * The category * * @param string $category The category * @return $this Fluent Builder */ public function setCategory($category) { $this->options['category'] = $category; return $this; } /** * The start_date * * @param \DateTime $startDate The start_date * @return $this Fluent Builder */ public function setStartDate($startDate) { $this->options['startDate'] = $startDate; return $this; } /** * The end_date * * @param \DateTime $endDate The end_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.Api.V2010.ReadTodayOptions ' . implode(' ', $options) . ']'; } } sdk/Twilio/Rest/Api/V2010/Account/Usage/Record/ThisMonthOptions.php 0000604 00000004376 15174325131 0020622 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 category * @param \DateTime $startDate The start_date * @param \DateTime $endDate The end_date * @return ReadThisMonthOptions Options builder */ public static function read($category = Values::NONE, $startDate = Values::NONE, $endDate = Values::NONE) { return new ReadThisMonthOptions($category, $startDate, $endDate); } } class ReadThisMonthOptions extends Options { /** * @param string $category The category * @param \DateTime $startDate The start_date * @param \DateTime $endDate The end_date */ public function __construct($category = Values::NONE, $startDate = Values::NONE, $endDate = Values::NONE) { $this->options['category'] = $category; $this->options['startDate'] = $startDate; $this->options['endDate'] = $endDate; } /** * The category * * @param string $category The category * @return $this Fluent Builder */ public function setCategory($category) { $this->options['category'] = $category; return $this; } /** * The start_date * * @param \DateTime $startDate The start_date * @return $this Fluent Builder */ public function setStartDate($startDate) { $this->options['startDate'] = $startDate; return $this; } /** * The end_date * * @param \DateTime $endDate The end_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.Api.V2010.ReadThisMonthOptions ' . implode(' ', $options) . ']'; } } sdk/Twilio/Rest/Api/V2010/Account/Usage/Record/MonthlyOptions.php 0000604 00000004364 15174325131 0020334 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 category * @param \DateTime $startDate The start_date * @param \DateTime $endDate The end_date * @return ReadMonthlyOptions Options builder */ public static function read($category = Values::NONE, $startDate = Values::NONE, $endDate = Values::NONE) { return new ReadMonthlyOptions($category, $startDate, $endDate); } } class ReadMonthlyOptions extends Options { /** * @param string $category The category * @param \DateTime $startDate The start_date * @param \DateTime $endDate The end_date */ public function __construct($category = Values::NONE, $startDate = Values::NONE, $endDate = Values::NONE) { $this->options['category'] = $category; $this->options['startDate'] = $startDate; $this->options['endDate'] = $endDate; } /** * The category * * @param string $category The category * @return $this Fluent Builder */ public function setCategory($category) { $this->options['category'] = $category; return $this; } /** * The start_date * * @param \DateTime $startDate The start_date * @return $this Fluent Builder */ public function setStartDate($startDate) { $this->options['startDate'] = $startDate; return $this; } /** * The end_date * * @param \DateTime $endDate The end_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.Api.V2010.ReadMonthlyOptions ' . implode(' ', $options) . ']'; } } sdk/Twilio/Rest/Api/V2010/Account/Usage/Record/AllTimeList.php 0000604 00000012144 15174325131 0017504 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']), '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/Twilio/Rest/Api/V2010/Account/Usage/Record/TodayList.php 0000604 00000012110 15174325131 0017226 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']), '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/Twilio/Rest/Api/V2010/Account/Usage/Record/YesterdayOptions.php 0000604 00000004376 15174325131 0020656 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 category * @param \DateTime $startDate The start_date * @param \DateTime $endDate The end_date * @return ReadYesterdayOptions Options builder */ public static function read($category = Values::NONE, $startDate = Values::NONE, $endDate = Values::NONE) { return new ReadYesterdayOptions($category, $startDate, $endDate); } } class ReadYesterdayOptions extends Options { /** * @param string $category The category * @param \DateTime $startDate The start_date * @param \DateTime $endDate The end_date */ public function __construct($category = Values::NONE, $startDate = Values::NONE, $endDate = Values::NONE) { $this->options['category'] = $category; $this->options['startDate'] = $startDate; $this->options['endDate'] = $endDate; } /** * The category * * @param string $category The category * @return $this Fluent Builder */ public function setCategory($category) { $this->options['category'] = $category; return $this; } /** * The start_date * * @param \DateTime $startDate The start_date * @return $this Fluent Builder */ public function setStartDate($startDate) { $this->options['startDate'] = $startDate; return $this; } /** * The end_date * * @param \DateTime $endDate The end_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.Api.V2010.ReadYesterdayOptions ' . implode(' ', $options) . ']'; } } sdk/Twilio/Rest/Api/V2010/Account/Usage/Record/YesterdayList.php 0000604 00000012200 15174325131 0020117 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']), '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/Twilio/Rest/Api/V2010/Account/Usage/Record/ThisMonthList.php 0000604 00000012200 15174325131 0020063 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']), '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/Twilio/Rest/Api/V2010/Account/Usage/Record/TodayInstance.php 0000604 00000006221 15174325131 0020065 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 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'), '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/Twilio/Rest/Api/V2010/Account/Usage/Record/YearlyInstance.php 0000604 00000006225 15174325131 0020256 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 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'), '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/Twilio/Rest/Api/V2010/Account/Usage/Record/LastMonthList.php 0000604 00000012200 15174325131 0020057 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']), '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/Twilio/Rest/Api/V2010/Account/Usage/Record/MonthlyPage.php 0000604 00000001403 15174325131 0017544 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/Twilio/Rest/Api/V2010/Account/Usage/Record/ThisMonthPage.php 0000604 00000001411 15174325131 0020026 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/Twilio/Rest/Api/V2010/Account/Usage/Record/YesterdayPage.php 0000604 00000001411 15174325131 0020062 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/Twilio/Rest/Api/V2010/Account/Usage/Record/DailyInstance.php 0000604 00000006221 15174325131 0020047 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 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'), '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/Twilio/Rest/Api/V2010/Account/Usage/Record/MonthlyInstance.php 0000604 00000006231 15174325131 0020440 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 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'), '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/Twilio/Rest/Api/V2010/Account/Usage/Record/LastMonthPage.php 0000604 00000001411 15174325131 0020022 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/Twilio/Rest/Api/V2010/Account/Usage/Record/ThisMonthInstance.php 0000604 00000006241 15174325131 0020724 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 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'), '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/Twilio/Rest/Api/V2010/Account/Usage/Record/LastMonthInstance.php 0000604 00000006241 15174325131 0020720 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 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'), '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/Twilio/Rest/Api/V2010/Account/Usage/Record/MonthlyList.php 0000604 00000012144 15174325131 0017607 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']), '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/Twilio/Rest/Api/V2010/Account/Usage/Record/DailyOptions.php 0000604 00000004352 15174325131 0017741 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 category * @param \DateTime $startDate The start_date * @param \DateTime $endDate The end_date * @return ReadDailyOptions Options builder */ public static function read($category = Values::NONE, $startDate = Values::NONE, $endDate = Values::NONE) { return new ReadDailyOptions($category, $startDate, $endDate); } } class ReadDailyOptions extends Options { /** * @param string $category The category * @param \DateTime $startDate The start_date * @param \DateTime $endDate The end_date */ public function __construct($category = Values::NONE, $startDate = Values::NONE, $endDate = Values::NONE) { $this->options['category'] = $category; $this->options['startDate'] = $startDate; $this->options['endDate'] = $endDate; } /** * The category * * @param string $category The category * @return $this Fluent Builder */ public function setCategory($category) { $this->options['category'] = $category; return $this; } /** * The start_date * * @param \DateTime $startDate The start_date * @return $this Fluent Builder */ public function setStartDate($startDate) { $this->options['startDate'] = $startDate; return $this; } /** * The end_date * * @param \DateTime $endDate The end_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.Api.V2010.ReadDailyOptions ' . implode(' ', $options) . ']'; } } sdk/Twilio/Rest/Api/V2010/Account/Usage/RecordList.php 0000604 00000023051 15174325131 0016154 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']), '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 \Twilio\Exceptions\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 \Twilio\Exceptions\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/Twilio/Rest/Api/V2010/Account/NotificationList.php 0000604 00000012766 15174325131 0016333 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 unique sid that identifies this account * @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 Fetch by unique notification Sid * @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/Twilio/Rest/Api/V2010/Account/SipInstance.php 0000604 00000003151 15174325132 0015256 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\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/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumberList.php 0000604 00000023544 15174325132 0017610 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 unique sid that identifies this account * @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 */ 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'], )); $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 Fetch by unique incoming-phone-number Sid * @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 \Twilio\Exceptions\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 \Twilio\Exceptions\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/Twilio/Rest/Api/V2010/Account/QueueList.php 0000604 00000012753 15174325132 0014766 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 QueueList extends ListResource { /** * Construct the QueueList * * @param Version $version Version that contains the resource * @param string $accountSid The account_sid * @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 user-provided string that identifies this * queue. * @param array|Options $options Optional Arguments * @return QueueInstance Newly created QueueInstance */ 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 Fetch by unique queue Sid * @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/Twilio/Rest/Api/V2010/Account/ValidationRequestList.php 0000604 00000004000 15174325132 0017327 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 ValidationRequestList extends ListResource { /** * Construct the ValidationRequestList * * @param Version $version Version that contains the resource * @param string $accountSid The account_sid * @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 * @param array|Options $options Optional Arguments * @return ValidationRequestInstance Newly created ValidationRequestInstance */ 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/Twilio/Rest/Api/V2010/Account/RecordingPage.php 0000604 00000001374 15174325132 0015554 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/Twilio/Rest/Api/V2010/Account/NewSigningKeyOptions.php 0000604 00000002677 15174325132 0017147 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 The friendly_name * @return CreateNewSigningKeyOptions Options builder */ public static function create($friendlyName = Values::NONE) { return new CreateNewSigningKeyOptions($friendlyName); } } class CreateNewSigningKeyOptions 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.CreateNewSigningKeyOptions ' . implode(' ', $options) . ']'; } } sdk/Twilio/Rest/Api/V2010/Account/RecordingInstance.php 0000604 00000012324 15174325132 0016441 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 string duration * @property string sid * @property string price * @property string priceUnit * @property string status * @property integer channels * @property string source * @property integer 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 unique sid that identifies this account * @param string $sid Fetch by unique recording Sid * @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')), '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 */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the RecordingInstance * * @return boolean True if delete succeeds, false otherwise */ 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/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/AssignedAddOnContext.php 0000604 00000010577 15174325132 0022766 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 account_sid * @param string $resourceSid The resource_sid * @param string $sid The unique Installed Add-on Sid * @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 */ 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 */ 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 \Twilio\Exceptions\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 \Twilio\Exceptions\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/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/TollFreeInstance.php 0000604 00000011410 15174325132 0022142 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 boolean 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 boolean voiceCallerIdLookup * @property string voiceFallbackMethod * @property string voiceFallbackUrl * @property string voiceMethod * @property string voiceUrl */ 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 unique sid that identifies this account * @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'), ); $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/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/AssignedAddOnList.php 0000604 00000014106 15174325132 0022245 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\IncomingPhoneNumber; 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 Account id that has installed this Add-on * @param string $resourceSid The Phone Number id that has 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 A string that uniquely identifies the * Add-on installation * @return AssignedAddOnInstance Newly created AssignedAddOnInstance */ 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 Installed Add-on Sid * @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/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/LocalList.php 0000604 00000015341 15174325132 0020636 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\IncomingPhoneNumber; 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 unique sid that identifies this account * @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 * @param array|Options $options Optional Arguments * @return LocalInstance Newly created LocalInstance */ 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'], )); $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/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/AssignedAddOn/AssignedAddOnExtensionPage.php 0000604 00000002101 15174325132 0026536 0 ustar 00 <?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 0000604 00000004755 15174325132 0027250 0 ustar 00 sdk <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\IncomingPhoneNumber\AssignedAddOn; 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 account_sid * @param string $resourceSid The resource_sid * @param string $assignedAddOnSid The assigned_add_on_sid * @param string $sid The unique Extension Sid * @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 */ 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/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/AssignedAddOn/AssignedAddOnExtensionList.php 0000604 00000013607 15174325132 0026612 0 ustar 00 <?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 Account id that has installed this Add-on * @param string $resourceSid The Phone Number id that has installed this Add-on * @param string $assignedAddOnSid A string 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 Extension Sid * @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 0000604 00000011012 15174325132 0027350 0 ustar 00 sdk <?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 boolean 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 Account id that has installed this Add-on * @param string $resourceSid The Phone Number id that has installed this Add-on * @param string $assignedAddOnSid A string that uniquely identifies the * assigned Add-on installation * @param string $sid The unique Extension Sid * @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 */ 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) . ']'; } } sdk/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/MobileOptions.php 0000604 00000030541 15174325132 0021532 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 boolean $beta The beta * @param string $friendlyName The friendly_name * @param string $phoneNumber The phone_number * @param string $origin The origin * @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 * @param string $friendlyName The friendly_name * @param string $smsApplicationSid The sms_application_sid * @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 $statusCallback The status_callback * @param string $statusCallbackMethod The status_callback_method * @param string $voiceApplicationSid The voice_application_sid * @param boolean $voiceCallerIdLookup The voice_caller_id_lookup * @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 * @param string $identitySid The identity_sid * @param string $addressSid The address_sid * @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) { return new CreateMobileOptions($apiVersion, $friendlyName, $smsApplicationSid, $smsFallbackMethod, $smsFallbackUrl, $smsMethod, $smsUrl, $statusCallback, $statusCallbackMethod, $voiceApplicationSid, $voiceCallerIdLookup, $voiceFallbackMethod, $voiceFallbackUrl, $voiceMethod, $voiceUrl, $identitySid, $addressSid); } } class ReadMobileOptions extends Options { /** * @param boolean $beta The beta * @param string $friendlyName The friendly_name * @param string $phoneNumber The phone_number * @param string $origin The origin */ 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; } /** * The beta * * @param boolean $beta The beta * @return $this Fluent Builder */ public function setBeta($beta) { $this->options['beta'] = $beta; 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 phone_number * * @param string $phoneNumber The phone_number * @return $this Fluent Builder */ public function setPhoneNumber($phoneNumber) { $this->options['phoneNumber'] = $phoneNumber; return $this; } /** * The origin * * @param string $origin The origin * @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 * @param string $friendlyName The friendly_name * @param string $smsApplicationSid The sms_application_sid * @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 $statusCallback The status_callback * @param string $statusCallbackMethod The status_callback_method * @param string $voiceApplicationSid The voice_application_sid * @param boolean $voiceCallerIdLookup The voice_caller_id_lookup * @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 * @param string $identitySid The identity_sid * @param string $addressSid The address_sid */ 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) { $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; } /** * The api_version * * @param string $apiVersion The api_version * @return $this Fluent Builder */ public function setApiVersion($apiVersion) { $this->options['apiVersion'] = $apiVersion; 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 sms_application_sid * * @param string $smsApplicationSid The sms_application_sid * @return $this Fluent Builder */ public function setSmsApplicationSid($smsApplicationSid) { $this->options['smsApplicationSid'] = $smsApplicationSid; 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 status_callback * * @param string $statusCallback The status_callback * @return $this Fluent Builder */ public function setStatusCallback($statusCallback) { $this->options['statusCallback'] = $statusCallback; return $this; } /** * The status_callback_method * * @param string $statusCallbackMethod The status_callback_method * @return $this Fluent Builder */ public function setStatusCallbackMethod($statusCallbackMethod) { $this->options['statusCallbackMethod'] = $statusCallbackMethod; return $this; } /** * The voice_application_sid * * @param string $voiceApplicationSid The voice_application_sid * @return $this Fluent Builder */ public function setVoiceApplicationSid($voiceApplicationSid) { $this->options['voiceApplicationSid'] = $voiceApplicationSid; return $this; } /** * The voice_caller_id_lookup * * @param boolean $voiceCallerIdLookup The voice_caller_id_lookup * @return $this Fluent Builder */ public function setVoiceCallerIdLookup($voiceCallerIdLookup) { $this->options['voiceCallerIdLookup'] = $voiceCallerIdLookup; 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; } /** * The identity_sid * * @param string $identitySid The identity_sid * @return $this Fluent Builder */ public function setIdentitySid($identitySid) { $this->options['identitySid'] = $identitySid; return $this; } /** * The address_sid * * @param string $addressSid The address_sid * @return $this Fluent Builder */ public function setAddressSid($addressSid) { $this->options['addressSid'] = $addressSid; return $this; } /** * Provide a friendly representation * * @return 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/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/TollFreeOptions.php 0000604 00000030563 15174325132 0022043 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 boolean $beta The beta * @param string $friendlyName The friendly_name * @param string $phoneNumber The phone_number * @param string $origin The origin * @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 * @param string $friendlyName The friendly_name * @param string $smsApplicationSid The sms_application_sid * @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 $statusCallback The status_callback * @param string $statusCallbackMethod The status_callback_method * @param string $voiceApplicationSid The voice_application_sid * @param boolean $voiceCallerIdLookup The voice_caller_id_lookup * @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 * @param string $identitySid The identity_sid * @param string $addressSid The address_sid * @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) { return new CreateTollFreeOptions($apiVersion, $friendlyName, $smsApplicationSid, $smsFallbackMethod, $smsFallbackUrl, $smsMethod, $smsUrl, $statusCallback, $statusCallbackMethod, $voiceApplicationSid, $voiceCallerIdLookup, $voiceFallbackMethod, $voiceFallbackUrl, $voiceMethod, $voiceUrl, $identitySid, $addressSid); } } class ReadTollFreeOptions extends Options { /** * @param boolean $beta The beta * @param string $friendlyName The friendly_name * @param string $phoneNumber The phone_number * @param string $origin The origin */ 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; } /** * The beta * * @param boolean $beta The beta * @return $this Fluent Builder */ public function setBeta($beta) { $this->options['beta'] = $beta; 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 phone_number * * @param string $phoneNumber The phone_number * @return $this Fluent Builder */ public function setPhoneNumber($phoneNumber) { $this->options['phoneNumber'] = $phoneNumber; return $this; } /** * The origin * * @param string $origin The origin * @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 * @param string $friendlyName The friendly_name * @param string $smsApplicationSid The sms_application_sid * @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 $statusCallback The status_callback * @param string $statusCallbackMethod The status_callback_method * @param string $voiceApplicationSid The voice_application_sid * @param boolean $voiceCallerIdLookup The voice_caller_id_lookup * @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 * @param string $identitySid The identity_sid * @param string $addressSid The address_sid */ 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) { $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; } /** * The api_version * * @param string $apiVersion The api_version * @return $this Fluent Builder */ public function setApiVersion($apiVersion) { $this->options['apiVersion'] = $apiVersion; 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 sms_application_sid * * @param string $smsApplicationSid The sms_application_sid * @return $this Fluent Builder */ public function setSmsApplicationSid($smsApplicationSid) { $this->options['smsApplicationSid'] = $smsApplicationSid; 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 status_callback * * @param string $statusCallback The status_callback * @return $this Fluent Builder */ public function setStatusCallback($statusCallback) { $this->options['statusCallback'] = $statusCallback; return $this; } /** * The status_callback_method * * @param string $statusCallbackMethod The status_callback_method * @return $this Fluent Builder */ public function setStatusCallbackMethod($statusCallbackMethod) { $this->options['statusCallbackMethod'] = $statusCallbackMethod; return $this; } /** * The voice_application_sid * * @param string $voiceApplicationSid The voice_application_sid * @return $this Fluent Builder */ public function setVoiceApplicationSid($voiceApplicationSid) { $this->options['voiceApplicationSid'] = $voiceApplicationSid; return $this; } /** * The voice_caller_id_lookup * * @param boolean $voiceCallerIdLookup The voice_caller_id_lookup * @return $this Fluent Builder */ public function setVoiceCallerIdLookup($voiceCallerIdLookup) { $this->options['voiceCallerIdLookup'] = $voiceCallerIdLookup; 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; } /** * The identity_sid * * @param string $identitySid The identity_sid * @return $this Fluent Builder */ public function setIdentitySid($identitySid) { $this->options['identitySid'] = $identitySid; return $this; } /** * The address_sid * * @param string $addressSid The address_sid * @return $this Fluent Builder */ public function setAddressSid($addressSid) { $this->options['addressSid'] = $addressSid; return $this; } /** * Provide a friendly representation * * @return 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/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/AssignedAddOnPage.php 0000604 00000001747 15174325132 0022215 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/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/LocalPage.php 0000604 00000001404 15174325132 0020572 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/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/MobileList.php 0000604 00000015363 15174325132 0021017 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\IncomingPhoneNumber; 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 unique sid that identifies this account * @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 * @param array|Options $options Optional Arguments * @return MobileInstance Newly created MobileInstance */ 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'], )); $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/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/TollFreeList.php 0000604 00000015427 15174325132 0021325 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\IncomingPhoneNumber; 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 unique sid that identifies this account * @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 * @param array|Options $options Optional Arguments * @return TollFreeInstance Newly created TollFreeInstance */ 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'], )); $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]'; } } sdk/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/AssignedAddOnInstance.php 0000604 00000011601 15174325132 0023073 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 Account id that has installed this Add-on * @param string $resourceSid The Phone Number id that has installed this Add-on * @param string $sid The unique Installed Add-on Sid * @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 */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the AssignedAddOnInstance * * @return boolean True if delete succeeds, false otherwise */ 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/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/MobileInstance.php 0000604 00000011400 15174325132 0021634 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 boolean 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 boolean voiceCallerIdLookup * @property string voiceFallbackMethod * @property string voiceFallbackUrl * @property string voiceMethod * @property string voiceUrl */ 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 unique sid that identifies this account * @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'), ); $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/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/LocalInstance.php 0000604 00000011374 15174325132 0021471 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 boolean 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 boolean voiceCallerIdLookup * @property string voiceFallbackMethod * @property string voiceFallbackUrl * @property string voiceMethod * @property string voiceUrl */ 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 unique sid that identifies this account * @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'), ); $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/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/TollFreePage.php 0000604 00000001415 15174325132 0021256 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/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/LocalOptions.php 0000604 00000030530 15174325132 0021353 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 boolean $beta The beta * @param string $friendlyName The friendly_name * @param string $phoneNumber The phone_number * @param string $origin The origin * @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 * @param string $friendlyName The friendly_name * @param string $smsApplicationSid The sms_application_sid * @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 $statusCallback The status_callback * @param string $statusCallbackMethod The status_callback_method * @param string $voiceApplicationSid The voice_application_sid * @param boolean $voiceCallerIdLookup The voice_caller_id_lookup * @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 * @param string $identitySid The identity_sid * @param string $addressSid The address_sid * @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) { return new CreateLocalOptions($apiVersion, $friendlyName, $smsApplicationSid, $smsFallbackMethod, $smsFallbackUrl, $smsMethod, $smsUrl, $statusCallback, $statusCallbackMethod, $voiceApplicationSid, $voiceCallerIdLookup, $voiceFallbackMethod, $voiceFallbackUrl, $voiceMethod, $voiceUrl, $identitySid, $addressSid); } } class ReadLocalOptions extends Options { /** * @param boolean $beta The beta * @param string $friendlyName The friendly_name * @param string $phoneNumber The phone_number * @param string $origin The origin */ 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; } /** * The beta * * @param boolean $beta The beta * @return $this Fluent Builder */ public function setBeta($beta) { $this->options['beta'] = $beta; 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 phone_number * * @param string $phoneNumber The phone_number * @return $this Fluent Builder */ public function setPhoneNumber($phoneNumber) { $this->options['phoneNumber'] = $phoneNumber; return $this; } /** * The origin * * @param string $origin The origin * @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 * @param string $friendlyName The friendly_name * @param string $smsApplicationSid The sms_application_sid * @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 $statusCallback The status_callback * @param string $statusCallbackMethod The status_callback_method * @param string $voiceApplicationSid The voice_application_sid * @param boolean $voiceCallerIdLookup The voice_caller_id_lookup * @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 * @param string $identitySid The identity_sid * @param string $addressSid The address_sid */ 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) { $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; } /** * The api_version * * @param string $apiVersion The api_version * @return $this Fluent Builder */ public function setApiVersion($apiVersion) { $this->options['apiVersion'] = $apiVersion; 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 sms_application_sid * * @param string $smsApplicationSid The sms_application_sid * @return $this Fluent Builder */ public function setSmsApplicationSid($smsApplicationSid) { $this->options['smsApplicationSid'] = $smsApplicationSid; 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 status_callback * * @param string $statusCallback The status_callback * @return $this Fluent Builder */ public function setStatusCallback($statusCallback) { $this->options['statusCallback'] = $statusCallback; return $this; } /** * The status_callback_method * * @param string $statusCallbackMethod The status_callback_method * @return $this Fluent Builder */ public function setStatusCallbackMethod($statusCallbackMethod) { $this->options['statusCallbackMethod'] = $statusCallbackMethod; return $this; } /** * The voice_application_sid * * @param string $voiceApplicationSid The voice_application_sid * @return $this Fluent Builder */ public function setVoiceApplicationSid($voiceApplicationSid) { $this->options['voiceApplicationSid'] = $voiceApplicationSid; return $this; } /** * The voice_caller_id_lookup * * @param boolean $voiceCallerIdLookup The voice_caller_id_lookup * @return $this Fluent Builder */ public function setVoiceCallerIdLookup($voiceCallerIdLookup) { $this->options['voiceCallerIdLookup'] = $voiceCallerIdLookup; 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; } /** * The identity_sid * * @param string $identitySid The identity_sid * @return $this Fluent Builder */ public function setIdentitySid($identitySid) { $this->options['identitySid'] = $identitySid; return $this; } /** * The address_sid * * @param string $addressSid The address_sid * @return $this Fluent Builder */ public function setAddressSid($addressSid) { $this->options['addressSid'] = $addressSid; return $this; } /** * Provide a friendly representation * * @return 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/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/MobilePage.php 0000604 00000001407 15174325132 0020752 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/Twilio/Rest/Api/V2010/Account/KeyPage.php 0000604 00000001352 15174325132 0014364 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/Twilio/Rest/Api/V2010/Account/TranscriptionInstance.php 0000604 00000010524 15174325132 0017364 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 unique sid that identifies this account * @param string $sid Fetch by unique transcription Sid * @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 */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the TranscriptionInstance * * @return boolean True if delete succeeds, false otherwise */ 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/Twilio/Rest/Api/V2010/Account/UsagePage.php 0000604 00000001360 15174325132 0014677 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/Twilio/Rest/Api/V2010/Account/TokenOptions.php 0000604 00000002702 15174325132 0015473 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 integer $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 integer $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 * * @param integer $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/Twilio/Rest/Api/V2010/Account/Sip/CredentialListInstance.php 0000604 00000010736 15174325132 0020173 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 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 */ public function fetch() { return $this->proxy()->fetch(); } /** * Update the CredentialListInstance * * @param string $friendlyName The friendly_name * @return CredentialListInstance Updated CredentialListInstance */ public function update($friendlyName) { return $this->proxy()->update($friendlyName); } /** * Deletes the CredentialListInstance * * @return boolean True if delete succeeds, false otherwise */ 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/Twilio/Rest/Api/V2010/Account/Sip/DomainPage.php 0000604 00000001367 15174325132 0015604 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/Twilio/Rest/Api/V2010/Account/Sip/IpAccessControlListInstance.php 0000604 00000010700 15174325132 0021143 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 Fetch by unique ip-access-control-list Sid * @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 */ public function fetch() { return $this->proxy()->fetch(); } /** * Update the IpAccessControlListInstance * * @param string $friendlyName A human readable description of this resource * @return IpAccessControlListInstance Updated IpAccessControlListInstance */ public function update($friendlyName) { return $this->proxy()->update($friendlyName); } /** * Deletes the IpAccessControlListInstance * * @return boolean True if delete succeeds, false otherwise */ 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/Twilio/Rest/Api/V2010/Account/Sip/CredentialListList.php 0000604 00000013034 15174325132 0017334 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Sip; 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 The friendly_name * @return CredentialListInstance Newly created CredentialListInstance */ 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 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/Twilio/Rest/Api/V2010/Account/Sip/IpAccessControlList/IpAddressPage.php 0000604 00000001571 15174325132 0022137 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/Twilio/Rest/Api/V2010/Account/Sip/IpAccessControlList/IpAddressList.php 0000604 00000013650 15174325132 0022177 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Sip\IpAccessControlList; use Twilio\ListResource; 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 account_sid * @param string $ipAccessControlListSid The ip_access_control_list_sid * @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 The friendly_name * @param string $ipAddress The ip_address * @return IpAddressInstance Newly created IpAddressInstance */ public function create($friendlyName, $ipAddress) { $data = Values::of(array('FriendlyName' => $friendlyName, 'IpAddress' => $ipAddress, )); $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 The sid * @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/Twilio/Rest/Api/V2010/Account/Sip/IpAccessControlList/IpAddressInstance.php 0000604 00000010702 15174325132 0023023 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 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 account_sid * @param string $ipAccessControlListSid The ip_access_control_list_sid * @param string $sid The sid * @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'), '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 */ public function fetch() { return $this->proxy()->fetch(); } /** * Update the IpAddressInstance * * @param array|Options $options Optional Arguments * @return IpAddressInstance Updated IpAddressInstance */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Deletes the IpAddressInstance * * @return boolean True if delete succeeds, false otherwise */ 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/Twilio/Rest/Api/V2010/Account/Sip/IpAccessControlList/IpAddressOptions.php 0000604 00000003624 15174325132 0022717 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 string $ipAddress The ip_address * @param string $friendlyName The friendly_name * @return UpdateIpAddressOptions Options builder */ public static function update($ipAddress = Values::NONE, $friendlyName = Values::NONE) { return new UpdateIpAddressOptions($ipAddress, $friendlyName); } } class UpdateIpAddressOptions extends Options { /** * @param string $ipAddress The ip_address * @param string $friendlyName The friendly_name */ public function __construct($ipAddress = Values::NONE, $friendlyName = Values::NONE) { $this->options['ipAddress'] = $ipAddress; $this->options['friendlyName'] = $friendlyName; } /** * The ip_address * * @param string $ipAddress The ip_address * @return $this Fluent Builder */ public function setIpAddress($ipAddress) { $this->options['ipAddress'] = $ipAddress; 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.Api.V2010.UpdateIpAddressOptions ' . implode(' ', $options) . ']'; } } sdk/Twilio/Rest/Api/V2010/Account/Sip/IpAccessControlList/IpAddressContext.php 0000604 00000006145 15174325132 0022711 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Sip\IpAccessControlList; 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 account_sid * @param string $ipAccessControlListSid The ip_access_control_list_sid * @param string $sid The sid * @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 */ 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 */ public function update($options = array()) { $options = new Values($options); $data = Values::of(array( 'IpAddress' => $options['ipAddress'], 'FriendlyName' => $options['friendlyName'], )); $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 */ 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/Twilio/Rest/Api/V2010/Account/Sip/CredentialListContext.php 0000604 00000011020 15174325132 0020036 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 account_sid * @param string $sid Fetch by unique credential 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 */ 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 The friendly_name * @return CredentialListInstance Updated CredentialListInstance */ 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 */ 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 \Twilio\Exceptions\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 \Twilio\Exceptions\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/Twilio/Rest/Api/V2010/Account/Sip/CredentialListPage.php 0000604 00000001417 15174325132 0017277 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/Twilio/Rest/Api/V2010/Account/Sip/IpAccessControlListContext.php 0000604 00000011215 15174325132 0021025 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 account_sid * @param string $sid Fetch by unique ip-access-control-list Sid * @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 */ 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 */ 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 */ 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 \Twilio\Exceptions\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 \Twilio\Exceptions\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/Twilio/Rest/Api/V2010/Account/Sip/DomainList.php 0000604 00000014211 15174325132 0015633 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Sip; 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 */ public function create($domainName, $options = array()) { $options = new Values($options); $data = Values::of(array( 'DomainName' => $domainName, 'FriendlyName' => $options['friendlyName'], 'AuthType' => $options['authType'], '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 Fetch by unique Domain Sid * @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/Twilio/Rest/Api/V2010/Account/Sip/CredentialList/CredentialPage.php 0000604 00000001562 15174325132 0021352 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/Twilio/Rest/Api/V2010/Account/Sip/CredentialList/CredentialList.php 0000604 00000013502 15174325132 0021406 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Sip\CredentialList; 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 account_sid * @param string $credentialListSid The credential_list_sid * @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 * @param string $password The password * @return CredentialInstance Newly created CredentialInstance */ 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 sid * @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/Twilio/Rest/Api/V2010/Account/Sip/CredentialList/CredentialContext.php 0000604 00000005752 15174325132 0022127 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Sip\CredentialList; 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 account_sid * @param string $credentialListSid The credential_list_sid * @param string $sid The sid * @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 */ 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 */ 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 */ 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/Twilio/Rest/Api/V2010/Account/Sip/CredentialList/CredentialInstance.php 0000604 00000010310 15174325132 0022231 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 account_sid * @param string $credentialListSid The credential_list_sid * @param string $sid The sid * @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 */ public function fetch() { return $this->proxy()->fetch(); } /** * Update the CredentialInstance * * @param array|Options $options Optional Arguments * @return CredentialInstance Updated CredentialInstance */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Deletes the CredentialInstance * * @return boolean True if delete succeeds, false otherwise */ 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/Twilio/Rest/Api/V2010/Account/Sip/CredentialList/CredentialOptions.php 0000604 00000002577 15174325132 0022140 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 * @return UpdateCredentialOptions Options builder */ public static function update($password = Values::NONE) { return new UpdateCredentialOptions($password); } } class UpdateCredentialOptions extends Options { /** * @param string $password The password */ public function __construct($password = Values::NONE) { $this->options['password'] = $password; } /** * The password * * @param string $password The password * @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/Twilio/Rest/Api/V2010/Account/Sip/IpAccessControlListPage.php 0000604 00000001436 15174325132 0020261 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/Twilio/Rest/Api/V2010/Account/Sip/DomainInstance.php 0000604 00000013501 15174325132 0016465 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 boolean sipRegistration */ class DomainInstance extends InstanceResource { protected $_ipAccessControlListMappings = null; protected $_credentialListMappings = 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 Fetch by unique Domain Sid * @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 */ public function fetch() { return $this->proxy()->fetch(); } /** * Update the DomainInstance * * @param array|Options $options Optional Arguments * @return DomainInstance Updated DomainInstance */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Deletes the DomainInstance * * @return boolean True if delete succeeds, false otherwise */ 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; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (property_exists($this, '_' . $name)) { $method = 'get' . ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide 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/Twilio/Rest/Api/V2010/Account/Sip/IpAccessControlListList.php 0000604 00000013264 15174325132 0020322 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Sip; 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 */ 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 Fetch by unique ip-access-control-list Sid * @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/Twilio/Rest/Api/V2010/Account/Sip/DomainContext.php 0000604 00000014074 15174325132 0016353 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\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 * @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; /** * Initialize the DomainContext * * @param \Twilio\Version $version Version that contains the resource * @param string $accountSid The account_sid * @param string $sid Fetch by unique Domain Sid * @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 */ 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 */ public function update($options = array()) { $options = new Values($options); $data = Values::of(array( 'AuthType' => $options['authType'], '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']), )); $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 */ 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; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws \Twilio\Exceptions\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 \Twilio\Exceptions\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/Twilio/Rest/Api/V2010/Account/Sip/DomainOptions.php 0000604 00000032103 15174325132 0016353 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 user-specified, human-readable name for the * trigger. * @param string $authType The types of authentication mapped to the domain * @param string $voiceUrl URL Twilio will request when receiving a call * @param string $voiceMethod HTTP method to use with voice_url * @param string $voiceFallbackUrl URL Twilio will request if an error occurs * in executing TwiML * @param string $voiceFallbackMethod HTTP method used with voice_fallback_url * @param string $voiceStatusCallbackUrl URL that Twilio will request with * status updates * @param string $voiceStatusCallbackMethod The voice_status_callback_method * @param boolean $sipRegistration The sip_registration * @return CreateDomainOptions Options builder */ public static function create($friendlyName = Values::NONE, $authType = 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, $authType, $voiceUrl, $voiceMethod, $voiceFallbackUrl, $voiceFallbackMethod, $voiceStatusCallbackUrl, $voiceStatusCallbackMethod, $sipRegistration); } /** * @param string $authType The auth_type * @param string $friendlyName A user-specified, human-readable name for the * trigger. * @param string $voiceFallbackMethod The voice_fallback_method * @param string $voiceFallbackUrl The voice_fallback_url * @param string $voiceMethod HTTP method to use with voice_url * @param string $voiceStatusCallbackMethod The voice_status_callback_method * @param string $voiceStatusCallbackUrl The voice_status_callback_url * @param string $voiceUrl The voice_url * @param boolean $sipRegistration The sip_registration * @return UpdateDomainOptions Options builder */ public static function update($authType = Values::NONE, $friendlyName = Values::NONE, $voiceFallbackMethod = Values::NONE, $voiceFallbackUrl = Values::NONE, $voiceMethod = Values::NONE, $voiceStatusCallbackMethod = Values::NONE, $voiceStatusCallbackUrl = Values::NONE, $voiceUrl = Values::NONE, $sipRegistration = Values::NONE) { return new UpdateDomainOptions($authType, $friendlyName, $voiceFallbackMethod, $voiceFallbackUrl, $voiceMethod, $voiceStatusCallbackMethod, $voiceStatusCallbackUrl, $voiceUrl, $sipRegistration); } } class CreateDomainOptions extends Options { /** * @param string $friendlyName A user-specified, human-readable name for the * trigger. * @param string $authType The types of authentication mapped to the domain * @param string $voiceUrl URL Twilio will request when receiving a call * @param string $voiceMethod HTTP method to use with voice_url * @param string $voiceFallbackUrl URL Twilio will request if an error occurs * in executing TwiML * @param string $voiceFallbackMethod HTTP method used with voice_fallback_url * @param string $voiceStatusCallbackUrl URL that Twilio will request with * status updates * @param string $voiceStatusCallbackMethod The voice_status_callback_method * @param boolean $sipRegistration The sip_registration */ public function __construct($friendlyName = Values::NONE, $authType = 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['authType'] = $authType; $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 user-specified, human-readable name for the trigger. * * @param string $friendlyName A user-specified, human-readable name for the * trigger. * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The types of authentication you have mapped to your domain * * @param string $authType The types of authentication mapped to the domain * @return $this Fluent Builder */ public function setAuthType($authType) { $this->options['authType'] = $authType; return $this; } /** * The URL Twilio will request when this domain receives a call * * @param string $voiceUrl URL Twilio will request when receiving a call * @return $this Fluent Builder */ public function setVoiceUrl($voiceUrl) { $this->options['voiceUrl'] = $voiceUrl; return $this; } /** * The HTTP method to use with the voice_url * * @param string $voiceMethod HTTP method to use with voice_url * @return $this Fluent Builder */ public function setVoiceMethod($voiceMethod) { $this->options['voiceMethod'] = $voiceMethod; return $this; } /** * The URL that Twilio will use if an error occurs retrieving or executing the TwiML requested by VoiceUrl * * @param string $voiceFallbackUrl URL Twilio will request if an error occurs * in executing TwiML * @return $this Fluent Builder */ public function setVoiceFallbackUrl($voiceFallbackUrl) { $this->options['voiceFallbackUrl'] = $voiceFallbackUrl; return $this; } /** * The HTTP method Twilio will use when requesting the VoiceFallbackUrl * * @param string $voiceFallbackMethod HTTP method used with voice_fallback_url * @return $this Fluent Builder */ public function setVoiceFallbackMethod($voiceFallbackMethod) { $this->options['voiceFallbackMethod'] = $voiceFallbackMethod; return $this; } /** * The URL that Twilio will request to pass status parameters * * @param string $voiceStatusCallbackUrl URL that Twilio will request with * status updates * @return $this Fluent Builder */ public function setVoiceStatusCallbackUrl($voiceStatusCallbackUrl) { $this->options['voiceStatusCallbackUrl'] = $voiceStatusCallbackUrl; return $this; } /** * The voice_status_callback_method * * @param string $voiceStatusCallbackMethod The voice_status_callback_method * @return $this Fluent Builder */ public function setVoiceStatusCallbackMethod($voiceStatusCallbackMethod) { $this->options['voiceStatusCallbackMethod'] = $voiceStatusCallbackMethod; return $this; } /** * The sip_registration * * @param boolean $sipRegistration The sip_registration * @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 $authType The auth_type * @param string $friendlyName A user-specified, human-readable name for the * trigger. * @param string $voiceFallbackMethod The voice_fallback_method * @param string $voiceFallbackUrl The voice_fallback_url * @param string $voiceMethod HTTP method to use with voice_url * @param string $voiceStatusCallbackMethod The voice_status_callback_method * @param string $voiceStatusCallbackUrl The voice_status_callback_url * @param string $voiceUrl The voice_url * @param boolean $sipRegistration The sip_registration */ public function __construct($authType = Values::NONE, $friendlyName = Values::NONE, $voiceFallbackMethod = Values::NONE, $voiceFallbackUrl = Values::NONE, $voiceMethod = Values::NONE, $voiceStatusCallbackMethod = Values::NONE, $voiceStatusCallbackUrl = Values::NONE, $voiceUrl = Values::NONE, $sipRegistration = Values::NONE) { $this->options['authType'] = $authType; $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; } /** * The auth_type * * @param string $authType The auth_type * @return $this Fluent Builder */ public function setAuthType($authType) { $this->options['authType'] = $authType; return $this; } /** * A user-specified, human-readable name for the trigger. * * @param string $friendlyName A user-specified, human-readable name for the * trigger. * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; 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 HTTP method to use with the voice_url * * @param string $voiceMethod HTTP method to use with voice_url * @return $this Fluent Builder */ public function setVoiceMethod($voiceMethod) { $this->options['voiceMethod'] = $voiceMethod; return $this; } /** * The voice_status_callback_method * * @param string $voiceStatusCallbackMethod The voice_status_callback_method * @return $this Fluent Builder */ public function setVoiceStatusCallbackMethod($voiceStatusCallbackMethod) { $this->options['voiceStatusCallbackMethod'] = $voiceStatusCallbackMethod; return $this; } /** * The voice_status_callback_url * * @param string $voiceStatusCallbackUrl The voice_status_callback_url * @return $this Fluent Builder */ public function setVoiceStatusCallbackUrl($voiceStatusCallbackUrl) { $this->options['voiceStatusCallbackUrl'] = $voiceStatusCallbackUrl; 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; } /** * The sip_registration * * @param boolean $sipRegistration The sip_registration * @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.UpdateDomainOptions ' . implode(' ', $options) . ']'; } } sdk/Twilio/Rest/Api/V2010/Account/Sip/Domain/IpAccessControlListMappingList.php 0000604 00000014224 15174325132 0023042 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Sip\Domain; 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 account_sid * @param string $domainSid A string that uniquely identifies the SIP Domain * @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 ip_access_control_list_sid * @return IpAccessControlListMappingInstance Newly created * IpAccessControlListMappingInstance */ 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 The sid * @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/Twilio/Rest/Api/V2010/Account/Sip/Domain/CredentialListMappingContext.php 0000604 00000004372 15174325132 0022575 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Sip\Domain; 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 account_sid * @param string $domainSid The domain_sid * @param string $sid The sid * @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 */ 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 */ 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/Twilio/Rest/Api/V2010/Account/Sip/Domain/CredentialListMappingInstance.php 0000604 00000010106 15174325132 0022705 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 account_sid * @param string $domainSid A string that uniquely identifies the SIP Domain * @param string $sid The sid * @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 */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the CredentialListMappingInstance * * @return boolean True if delete succeeds, false otherwise */ 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/Twilio/Rest/Api/V2010/Account/Sip/Domain/IpAccessControlListMappingPage.php 0000604 00000001622 15174325132 0023001 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/Twilio/Rest/Api/V2010/Account/Sip/Domain/IpAccessControlListMappingContext.php 0000604 00000004536 15174325132 0023560 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Sip\Domain; 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 account_sid * @param string $domainSid The domain_sid * @param string $sid The sid * @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 */ 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 */ 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/Twilio/Rest/Api/V2010/Account/Sip/Domain/CredentialListMappingList.php 0000604 00000014004 15174325132 0022055 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Sip\Domain; 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 account_sid * @param string $domainSid A string that uniquely identifies the SIP Domain * @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 The credential_list_sid * @return CredentialListMappingInstance Newly created * CredentialListMappingInstance */ 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 The sid * @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/Twilio/Rest/Api/V2010/Account/Sip/Domain/CredentialListMappingPage.php 0000604 00000001603 15174325132 0022017 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/Twilio/Rest/Api/V2010/Account/Sip/Domain/IpAccessControlListMappingInstance.php 0000604 00000010264 15174325132 0023673 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 account_sid * @param string $domainSid A string that uniquely identifies the SIP Domain * @param string $sid The sid * @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 */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the IpAccessControlListMappingInstance * * @return boolean True if delete succeeds, false otherwise */ 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/Twilio/Rest/Api/V2010/Account/TokenList.php 0000604 00000003066 15174325132 0014757 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 TokenList extends ListResource { /** * Construct the TokenList * * @param Version $version Version that contains the resource * @param string $accountSid The unique sid that identifies this account * @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 */ 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/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountryInstance.php 0000604 00000012456 15174325132 0022142 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 boolean 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 country_code * @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 */ 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/Twilio/Rest/Api/V2010/Account/AuthorizedConnectAppPage.php 0000604 00000001435 15174325132 0017727 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/Twilio/Rest/Api/V2010/Account/SipList.php 0000604 00000007446 15174325132 0014440 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 \Twilio\Exceptions\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 \Twilio\Exceptions\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/Twilio/Rest/Api/V2010/Account/TranscriptionList.php 0000604 00000011640 15174325132 0016533 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 unique sid that identifies this account * @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 Fetch by unique transcription Sid * @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/Twilio/Rest/Api/V2010/Account/ConferencePage.php 0000604 00000001377 15174325132 0015712 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/Twilio/Rest/Api/V2010/Account/ConnectAppOptions.php 0000604 00000015633 15174325132 0016454 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 URIL Twilio sends requests when users * authorize * @param string $companyName The company name set for this Connect App. * @param string $deauthorizeCallbackMethod HTTP method Twilio WIll use making * requests to the url * @param string $deauthorizeCallbackUrl URL Twilio will send a request when a * user de-authorizes this app * @param string $description A more detailed human readable description * @param string $friendlyName A human readable name for the Connect App. * @param string $homepageUrl The URL users can obtain more information * @param string $permissions The set of permissions that your ConnectApp * requests. * @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 URIL Twilio sends requests when users * authorize * @param string $companyName The company name set for this Connect App. * @param string $deauthorizeCallbackMethod HTTP method Twilio WIll use making * requests to the url * @param string $deauthorizeCallbackUrl URL Twilio will send a request when a * user de-authorizes this app * @param string $description A more detailed human readable description * @param string $friendlyName A human readable name for the Connect App. * @param string $homepageUrl The URL users can obtain more information * @param string $permissions The set of permissions that your ConnectApp * requests. */ 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 the user's browser will redirect to after Twilio authenticates the user and obtains authorization for this Connect App. * * @param string $authorizeRedirectUrl URIL Twilio sends requests when users * authorize * @return $this Fluent Builder */ public function setAuthorizeRedirectUrl($authorizeRedirectUrl) { $this->options['authorizeRedirectUrl'] = $authorizeRedirectUrl; return $this; } /** * The company name set for this Connect App. * * @param string $companyName The company name set for this Connect App. * @return $this Fluent Builder */ public function setCompanyName($companyName) { $this->options['companyName'] = $companyName; return $this; } /** * The HTTP method to be used when making a request to the `DeauthorizeCallbackUrl`. * * @param string $deauthorizeCallbackMethod HTTP method Twilio WIll use making * requests to the url * @return $this Fluent Builder */ public function setDeauthorizeCallbackMethod($deauthorizeCallbackMethod) { $this->options['deauthorizeCallbackMethod'] = $deauthorizeCallbackMethod; return $this; } /** * The URL to which Twilio will send a request when a user de-authorizes this Connect App. * * @param string $deauthorizeCallbackUrl URL Twilio will send a request when a * user de-authorizes this app * @return $this Fluent Builder */ public function setDeauthorizeCallbackUrl($deauthorizeCallbackUrl) { $this->options['deauthorizeCallbackUrl'] = $deauthorizeCallbackUrl; return $this; } /** * A more detailed human readable description of the Connect App. * * @param string $description A more detailed human readable description * @return $this Fluent Builder */ public function setDescription($description) { $this->options['description'] = $description; return $this; } /** * A human readable name for the Connect App. * * @param string $friendlyName A human readable name for the Connect App. * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The public URL where users can obtain more information about this Connect App. * * @param string $homepageUrl The URL users can obtain more information * @return $this Fluent Builder */ public function setHomepageUrl($homepageUrl) { $this->options['homepageUrl'] = $homepageUrl; return $this; } /** * The set of permissions that your ConnectApp requests. * * @param string $permissions The set of permissions that your ConnectApp * requests. * @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/Twilio/Rest/Api/V2010/Account/ShortCodeInstance.php 0000604 00000010520 15174325132 0016413 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 unique sid that identifies this account * @param string $sid Fetch by unique short-code Sid * @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 */ public function fetch() { return $this->proxy()->fetch(); } /** * Update the ShortCodeInstance * * @param array|Options $options Optional Arguments * @return ShortCodeInstance Updated ShortCodeInstance */ 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/Twilio/Rest/Api/V2010/Account/ConnectAppList.php 0000604 00000011553 15174325132 0015731 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 unique sid that identifies this account * @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 Fetch by unique connect-app Sid * @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/Twilio/Rest/Api/V2010/Account/OutgoingCallerIdList.php 0000604 00000012573 15174325132 0017075 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 unique sid that identifies this account * @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 Fetch by unique outgoing-caller-id Sid * @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/Twilio/Rest/Api/V2010/Account/SigningKeyContext.php 0000604 00000005177 15174325132 0016464 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; 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 */ 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 */ 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 */ 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/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/VoipInstance.php 0000604 00000006261 15174325132 0023054 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 boolean 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 34 character string that uniquely identifies * your account. * @param string $countryCode The ISO Country code to lookup phone numbers for. * @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/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/VoipOptions.php 0000604 00000024543 15174325132 0022746 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 integer $areaCode The area_code * @param string $contains The contains * @param boolean $smsEnabled The sms_enabled * @param boolean $mmsEnabled The mms_enabled * @param boolean $voiceEnabled The voice_enabled * @param boolean $excludeAllAddressRequired The exclude_all_address_required * @param boolean $excludeLocalAddressRequired The * exclude_local_address_required * @param boolean $excludeForeignAddressRequired The * exclude_foreign_address_required * @param boolean $beta The beta * @param string $nearNumber The near_number * @param string $nearLatLong The near_lat_long * @param integer $distance The distance * @param string $inPostalCode The in_postal_code * @param string $inRegion The in_region * @param string $inRateCenter The in_rate_center * @param string $inLata The in_lata * @param string $inLocality The in_locality * @param boolean $faxEnabled The fax_enabled * @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 integer $areaCode The area_code * @param string $contains The contains * @param boolean $smsEnabled The sms_enabled * @param boolean $mmsEnabled The mms_enabled * @param boolean $voiceEnabled The voice_enabled * @param boolean $excludeAllAddressRequired The exclude_all_address_required * @param boolean $excludeLocalAddressRequired The * exclude_local_address_required * @param boolean $excludeForeignAddressRequired The * exclude_foreign_address_required * @param boolean $beta The beta * @param string $nearNumber The near_number * @param string $nearLatLong The near_lat_long * @param integer $distance The distance * @param string $inPostalCode The in_postal_code * @param string $inRegion The in_region * @param string $inRateCenter The in_rate_center * @param string $inLata The in_lata * @param string $inLocality The in_locality * @param boolean $faxEnabled The fax_enabled */ 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 * * @param integer $areaCode The area_code * @return $this Fluent Builder */ public function setAreaCode($areaCode) { $this->options['areaCode'] = $areaCode; return $this; } /** * The contains * * @param string $contains The contains * @return $this Fluent Builder */ public function setContains($contains) { $this->options['contains'] = $contains; return $this; } /** * The sms_enabled * * @param boolean $smsEnabled The sms_enabled * @return $this Fluent Builder */ public function setSmsEnabled($smsEnabled) { $this->options['smsEnabled'] = $smsEnabled; return $this; } /** * The mms_enabled * * @param boolean $mmsEnabled The mms_enabled * @return $this Fluent Builder */ public function setMmsEnabled($mmsEnabled) { $this->options['mmsEnabled'] = $mmsEnabled; return $this; } /** * The voice_enabled * * @param boolean $voiceEnabled The voice_enabled * @return $this Fluent Builder */ public function setVoiceEnabled($voiceEnabled) { $this->options['voiceEnabled'] = $voiceEnabled; return $this; } /** * The exclude_all_address_required * * @param boolean $excludeAllAddressRequired The exclude_all_address_required * @return $this Fluent Builder */ public function setExcludeAllAddressRequired($excludeAllAddressRequired) { $this->options['excludeAllAddressRequired'] = $excludeAllAddressRequired; return $this; } /** * The exclude_local_address_required * * @param boolean $excludeLocalAddressRequired The * exclude_local_address_required * @return $this Fluent Builder */ public function setExcludeLocalAddressRequired($excludeLocalAddressRequired) { $this->options['excludeLocalAddressRequired'] = $excludeLocalAddressRequired; return $this; } /** * The exclude_foreign_address_required * * @param boolean $excludeForeignAddressRequired The * exclude_foreign_address_required * @return $this Fluent Builder */ public function setExcludeForeignAddressRequired($excludeForeignAddressRequired) { $this->options['excludeForeignAddressRequired'] = $excludeForeignAddressRequired; return $this; } /** * The beta * * @param boolean $beta The beta * @return $this Fluent Builder */ public function setBeta($beta) { $this->options['beta'] = $beta; return $this; } /** * The near_number * * @param string $nearNumber The near_number * @return $this Fluent Builder */ public function setNearNumber($nearNumber) { $this->options['nearNumber'] = $nearNumber; return $this; } /** * The near_lat_long * * @param string $nearLatLong The near_lat_long * @return $this Fluent Builder */ public function setNearLatLong($nearLatLong) { $this->options['nearLatLong'] = $nearLatLong; return $this; } /** * The distance * * @param integer $distance The distance * @return $this Fluent Builder */ public function setDistance($distance) { $this->options['distance'] = $distance; return $this; } /** * The in_postal_code * * @param string $inPostalCode The in_postal_code * @return $this Fluent Builder */ public function setInPostalCode($inPostalCode) { $this->options['inPostalCode'] = $inPostalCode; return $this; } /** * The in_region * * @param string $inRegion The in_region * @return $this Fluent Builder */ public function setInRegion($inRegion) { $this->options['inRegion'] = $inRegion; return $this; } /** * The in_rate_center * * @param string $inRateCenter The in_rate_center * @return $this Fluent Builder */ public function setInRateCenter($inRateCenter) { $this->options['inRateCenter'] = $inRateCenter; return $this; } /** * The in_lata * * @param string $inLata The in_lata * @return $this Fluent Builder */ public function setInLata($inLata) { $this->options['inLata'] = $inLata; return $this; } /** * The in_locality * * @param string $inLocality The in_locality * @return $this Fluent Builder */ public function setInLocality($inLocality) { $this->options['inLocality'] = $inLocality; return $this; } /** * The fax_enabled * * @param boolean $faxEnabled The fax_enabled * @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/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/MachineToMachineInstance.php 0000604 00000006341 15174325132 0025272 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 boolean 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 34 character string that uniquely identifies * your account. * @param string $countryCode The ISO Country code to lookup phone numbers for. * @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/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/VoipList.php 0000604 00000014435 15174325132 0022225 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 34 character string that uniquely identifies * your account. * @param string $countryCode The ISO Country code to lookup phone numbers for. * @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/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/MachineToMachinePage.php 0000604 00000001607 15174325132 0024402 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/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/SharedCostOptions.php 0000604 00000024601 15174325132 0024063 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 integer $areaCode The area_code * @param string $contains The contains * @param boolean $smsEnabled The sms_enabled * @param boolean $mmsEnabled The mms_enabled * @param boolean $voiceEnabled The voice_enabled * @param boolean $excludeAllAddressRequired The exclude_all_address_required * @param boolean $excludeLocalAddressRequired The * exclude_local_address_required * @param boolean $excludeForeignAddressRequired The * exclude_foreign_address_required * @param boolean $beta The beta * @param string $nearNumber The near_number * @param string $nearLatLong The near_lat_long * @param integer $distance The distance * @param string $inPostalCode The in_postal_code * @param string $inRegion The in_region * @param string $inRateCenter The in_rate_center * @param string $inLata The in_lata * @param string $inLocality The in_locality * @param boolean $faxEnabled The fax_enabled * @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 integer $areaCode The area_code * @param string $contains The contains * @param boolean $smsEnabled The sms_enabled * @param boolean $mmsEnabled The mms_enabled * @param boolean $voiceEnabled The voice_enabled * @param boolean $excludeAllAddressRequired The exclude_all_address_required * @param boolean $excludeLocalAddressRequired The * exclude_local_address_required * @param boolean $excludeForeignAddressRequired The * exclude_foreign_address_required * @param boolean $beta The beta * @param string $nearNumber The near_number * @param string $nearLatLong The near_lat_long * @param integer $distance The distance * @param string $inPostalCode The in_postal_code * @param string $inRegion The in_region * @param string $inRateCenter The in_rate_center * @param string $inLata The in_lata * @param string $inLocality The in_locality * @param boolean $faxEnabled The fax_enabled */ 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 * * @param integer $areaCode The area_code * @return $this Fluent Builder */ public function setAreaCode($areaCode) { $this->options['areaCode'] = $areaCode; return $this; } /** * The contains * * @param string $contains The contains * @return $this Fluent Builder */ public function setContains($contains) { $this->options['contains'] = $contains; return $this; } /** * The sms_enabled * * @param boolean $smsEnabled The sms_enabled * @return $this Fluent Builder */ public function setSmsEnabled($smsEnabled) { $this->options['smsEnabled'] = $smsEnabled; return $this; } /** * The mms_enabled * * @param boolean $mmsEnabled The mms_enabled * @return $this Fluent Builder */ public function setMmsEnabled($mmsEnabled) { $this->options['mmsEnabled'] = $mmsEnabled; return $this; } /** * The voice_enabled * * @param boolean $voiceEnabled The voice_enabled * @return $this Fluent Builder */ public function setVoiceEnabled($voiceEnabled) { $this->options['voiceEnabled'] = $voiceEnabled; return $this; } /** * The exclude_all_address_required * * @param boolean $excludeAllAddressRequired The exclude_all_address_required * @return $this Fluent Builder */ public function setExcludeAllAddressRequired($excludeAllAddressRequired) { $this->options['excludeAllAddressRequired'] = $excludeAllAddressRequired; return $this; } /** * The exclude_local_address_required * * @param boolean $excludeLocalAddressRequired The * exclude_local_address_required * @return $this Fluent Builder */ public function setExcludeLocalAddressRequired($excludeLocalAddressRequired) { $this->options['excludeLocalAddressRequired'] = $excludeLocalAddressRequired; return $this; } /** * The exclude_foreign_address_required * * @param boolean $excludeForeignAddressRequired The * exclude_foreign_address_required * @return $this Fluent Builder */ public function setExcludeForeignAddressRequired($excludeForeignAddressRequired) { $this->options['excludeForeignAddressRequired'] = $excludeForeignAddressRequired; return $this; } /** * The beta * * @param boolean $beta The beta * @return $this Fluent Builder */ public function setBeta($beta) { $this->options['beta'] = $beta; return $this; } /** * The near_number * * @param string $nearNumber The near_number * @return $this Fluent Builder */ public function setNearNumber($nearNumber) { $this->options['nearNumber'] = $nearNumber; return $this; } /** * The near_lat_long * * @param string $nearLatLong The near_lat_long * @return $this Fluent Builder */ public function setNearLatLong($nearLatLong) { $this->options['nearLatLong'] = $nearLatLong; return $this; } /** * The distance * * @param integer $distance The distance * @return $this Fluent Builder */ public function setDistance($distance) { $this->options['distance'] = $distance; return $this; } /** * The in_postal_code * * @param string $inPostalCode The in_postal_code * @return $this Fluent Builder */ public function setInPostalCode($inPostalCode) { $this->options['inPostalCode'] = $inPostalCode; return $this; } /** * The in_region * * @param string $inRegion The in_region * @return $this Fluent Builder */ public function setInRegion($inRegion) { $this->options['inRegion'] = $inRegion; return $this; } /** * The in_rate_center * * @param string $inRateCenter The in_rate_center * @return $this Fluent Builder */ public function setInRateCenter($inRateCenter) { $this->options['inRateCenter'] = $inRateCenter; return $this; } /** * The in_lata * * @param string $inLata The in_lata * @return $this Fluent Builder */ public function setInLata($inLata) { $this->options['inLata'] = $inLata; return $this; } /** * The in_locality * * @param string $inLocality The in_locality * @return $this Fluent Builder */ public function setInLocality($inLocality) { $this->options['inLocality'] = $inLocality; return $this; } /** * The fax_enabled * * @param boolean $faxEnabled The fax_enabled * @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/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/MachineToMachineOptions.php 0000604 00000024637 15174325132 0025171 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 integer $areaCode The area_code * @param string $contains The contains * @param boolean $smsEnabled The sms_enabled * @param boolean $mmsEnabled The mms_enabled * @param boolean $voiceEnabled The voice_enabled * @param boolean $excludeAllAddressRequired The exclude_all_address_required * @param boolean $excludeLocalAddressRequired The * exclude_local_address_required * @param boolean $excludeForeignAddressRequired The * exclude_foreign_address_required * @param boolean $beta The beta * @param string $nearNumber The near_number * @param string $nearLatLong The near_lat_long * @param integer $distance The distance * @param string $inPostalCode The in_postal_code * @param string $inRegion The in_region * @param string $inRateCenter The in_rate_center * @param string $inLata The in_lata * @param string $inLocality The in_locality * @param boolean $faxEnabled The fax_enabled * @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 integer $areaCode The area_code * @param string $contains The contains * @param boolean $smsEnabled The sms_enabled * @param boolean $mmsEnabled The mms_enabled * @param boolean $voiceEnabled The voice_enabled * @param boolean $excludeAllAddressRequired The exclude_all_address_required * @param boolean $excludeLocalAddressRequired The * exclude_local_address_required * @param boolean $excludeForeignAddressRequired The * exclude_foreign_address_required * @param boolean $beta The beta * @param string $nearNumber The near_number * @param string $nearLatLong The near_lat_long * @param integer $distance The distance * @param string $inPostalCode The in_postal_code * @param string $inRegion The in_region * @param string $inRateCenter The in_rate_center * @param string $inLata The in_lata * @param string $inLocality The in_locality * @param boolean $faxEnabled The fax_enabled */ 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 * * @param integer $areaCode The area_code * @return $this Fluent Builder */ public function setAreaCode($areaCode) { $this->options['areaCode'] = $areaCode; return $this; } /** * The contains * * @param string $contains The contains * @return $this Fluent Builder */ public function setContains($contains) { $this->options['contains'] = $contains; return $this; } /** * The sms_enabled * * @param boolean $smsEnabled The sms_enabled * @return $this Fluent Builder */ public function setSmsEnabled($smsEnabled) { $this->options['smsEnabled'] = $smsEnabled; return $this; } /** * The mms_enabled * * @param boolean $mmsEnabled The mms_enabled * @return $this Fluent Builder */ public function setMmsEnabled($mmsEnabled) { $this->options['mmsEnabled'] = $mmsEnabled; return $this; } /** * The voice_enabled * * @param boolean $voiceEnabled The voice_enabled * @return $this Fluent Builder */ public function setVoiceEnabled($voiceEnabled) { $this->options['voiceEnabled'] = $voiceEnabled; return $this; } /** * The exclude_all_address_required * * @param boolean $excludeAllAddressRequired The exclude_all_address_required * @return $this Fluent Builder */ public function setExcludeAllAddressRequired($excludeAllAddressRequired) { $this->options['excludeAllAddressRequired'] = $excludeAllAddressRequired; return $this; } /** * The exclude_local_address_required * * @param boolean $excludeLocalAddressRequired The * exclude_local_address_required * @return $this Fluent Builder */ public function setExcludeLocalAddressRequired($excludeLocalAddressRequired) { $this->options['excludeLocalAddressRequired'] = $excludeLocalAddressRequired; return $this; } /** * The exclude_foreign_address_required * * @param boolean $excludeForeignAddressRequired The * exclude_foreign_address_required * @return $this Fluent Builder */ public function setExcludeForeignAddressRequired($excludeForeignAddressRequired) { $this->options['excludeForeignAddressRequired'] = $excludeForeignAddressRequired; return $this; } /** * The beta * * @param boolean $beta The beta * @return $this Fluent Builder */ public function setBeta($beta) { $this->options['beta'] = $beta; return $this; } /** * The near_number * * @param string $nearNumber The near_number * @return $this Fluent Builder */ public function setNearNumber($nearNumber) { $this->options['nearNumber'] = $nearNumber; return $this; } /** * The near_lat_long * * @param string $nearLatLong The near_lat_long * @return $this Fluent Builder */ public function setNearLatLong($nearLatLong) { $this->options['nearLatLong'] = $nearLatLong; return $this; } /** * The distance * * @param integer $distance The distance * @return $this Fluent Builder */ public function setDistance($distance) { $this->options['distance'] = $distance; return $this; } /** * The in_postal_code * * @param string $inPostalCode The in_postal_code * @return $this Fluent Builder */ public function setInPostalCode($inPostalCode) { $this->options['inPostalCode'] = $inPostalCode; return $this; } /** * The in_region * * @param string $inRegion The in_region * @return $this Fluent Builder */ public function setInRegion($inRegion) { $this->options['inRegion'] = $inRegion; return $this; } /** * The in_rate_center * * @param string $inRateCenter The in_rate_center * @return $this Fluent Builder */ public function setInRateCenter($inRateCenter) { $this->options['inRateCenter'] = $inRateCenter; return $this; } /** * The in_lata * * @param string $inLata The in_lata * @return $this Fluent Builder */ public function setInLata($inLata) { $this->options['inLata'] = $inLata; return $this; } /** * The in_locality * * @param string $inLocality The in_locality * @return $this Fluent Builder */ public function setInLocality($inLocality) { $this->options['inLocality'] = $inLocality; return $this; } /** * The fax_enabled * * @param boolean $faxEnabled The fax_enabled * @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/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/MobileOptions.php 0000604 00000024555 15174325132 0023243 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 integer $areaCode The area_code * @param string $contains The contains * @param boolean $smsEnabled The sms_enabled * @param boolean $mmsEnabled The mms_enabled * @param boolean $voiceEnabled The voice_enabled * @param boolean $excludeAllAddressRequired The exclude_all_address_required * @param boolean $excludeLocalAddressRequired The * exclude_local_address_required * @param boolean $excludeForeignAddressRequired The * exclude_foreign_address_required * @param boolean $beta The beta * @param string $nearNumber The near_number * @param string $nearLatLong The near_lat_long * @param integer $distance The distance * @param string $inPostalCode The in_postal_code * @param string $inRegion The in_region * @param string $inRateCenter The in_rate_center * @param string $inLata The in_lata * @param string $inLocality The in_locality * @param boolean $faxEnabled The fax_enabled * @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 integer $areaCode The area_code * @param string $contains The contains * @param boolean $smsEnabled The sms_enabled * @param boolean $mmsEnabled The mms_enabled * @param boolean $voiceEnabled The voice_enabled * @param boolean $excludeAllAddressRequired The exclude_all_address_required * @param boolean $excludeLocalAddressRequired The * exclude_local_address_required * @param boolean $excludeForeignAddressRequired The * exclude_foreign_address_required * @param boolean $beta The beta * @param string $nearNumber The near_number * @param string $nearLatLong The near_lat_long * @param integer $distance The distance * @param string $inPostalCode The in_postal_code * @param string $inRegion The in_region * @param string $inRateCenter The in_rate_center * @param string $inLata The in_lata * @param string $inLocality The in_locality * @param boolean $faxEnabled The fax_enabled */ 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 * * @param integer $areaCode The area_code * @return $this Fluent Builder */ public function setAreaCode($areaCode) { $this->options['areaCode'] = $areaCode; return $this; } /** * The contains * * @param string $contains The contains * @return $this Fluent Builder */ public function setContains($contains) { $this->options['contains'] = $contains; return $this; } /** * The sms_enabled * * @param boolean $smsEnabled The sms_enabled * @return $this Fluent Builder */ public function setSmsEnabled($smsEnabled) { $this->options['smsEnabled'] = $smsEnabled; return $this; } /** * The mms_enabled * * @param boolean $mmsEnabled The mms_enabled * @return $this Fluent Builder */ public function setMmsEnabled($mmsEnabled) { $this->options['mmsEnabled'] = $mmsEnabled; return $this; } /** * The voice_enabled * * @param boolean $voiceEnabled The voice_enabled * @return $this Fluent Builder */ public function setVoiceEnabled($voiceEnabled) { $this->options['voiceEnabled'] = $voiceEnabled; return $this; } /** * The exclude_all_address_required * * @param boolean $excludeAllAddressRequired The exclude_all_address_required * @return $this Fluent Builder */ public function setExcludeAllAddressRequired($excludeAllAddressRequired) { $this->options['excludeAllAddressRequired'] = $excludeAllAddressRequired; return $this; } /** * The exclude_local_address_required * * @param boolean $excludeLocalAddressRequired The * exclude_local_address_required * @return $this Fluent Builder */ public function setExcludeLocalAddressRequired($excludeLocalAddressRequired) { $this->options['excludeLocalAddressRequired'] = $excludeLocalAddressRequired; return $this; } /** * The exclude_foreign_address_required * * @param boolean $excludeForeignAddressRequired The * exclude_foreign_address_required * @return $this Fluent Builder */ public function setExcludeForeignAddressRequired($excludeForeignAddressRequired) { $this->options['excludeForeignAddressRequired'] = $excludeForeignAddressRequired; return $this; } /** * The beta * * @param boolean $beta The beta * @return $this Fluent Builder */ public function setBeta($beta) { $this->options['beta'] = $beta; return $this; } /** * The near_number * * @param string $nearNumber The near_number * @return $this Fluent Builder */ public function setNearNumber($nearNumber) { $this->options['nearNumber'] = $nearNumber; return $this; } /** * The near_lat_long * * @param string $nearLatLong The near_lat_long * @return $this Fluent Builder */ public function setNearLatLong($nearLatLong) { $this->options['nearLatLong'] = $nearLatLong; return $this; } /** * The distance * * @param integer $distance The distance * @return $this Fluent Builder */ public function setDistance($distance) { $this->options['distance'] = $distance; return $this; } /** * The in_postal_code * * @param string $inPostalCode The in_postal_code * @return $this Fluent Builder */ public function setInPostalCode($inPostalCode) { $this->options['inPostalCode'] = $inPostalCode; return $this; } /** * The in_region * * @param string $inRegion The in_region * @return $this Fluent Builder */ public function setInRegion($inRegion) { $this->options['inRegion'] = $inRegion; return $this; } /** * The in_rate_center * * @param string $inRateCenter The in_rate_center * @return $this Fluent Builder */ public function setInRateCenter($inRateCenter) { $this->options['inRateCenter'] = $inRateCenter; return $this; } /** * The in_lata * * @param string $inLata The in_lata * @return $this Fluent Builder */ public function setInLata($inLata) { $this->options['inLata'] = $inLata; return $this; } /** * The in_locality * * @param string $inLocality The in_locality * @return $this Fluent Builder */ public function setInLocality($inLocality) { $this->options['inLocality'] = $inLocality; return $this; } /** * The fax_enabled * * @param boolean $faxEnabled The fax_enabled * @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/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/NationalOptions.php 0000604 00000024567 15174325132 0023604 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 integer $areaCode The area_code * @param string $contains The contains * @param boolean $smsEnabled The sms_enabled * @param boolean $mmsEnabled The mms_enabled * @param boolean $voiceEnabled The voice_enabled * @param boolean $excludeAllAddressRequired The exclude_all_address_required * @param boolean $excludeLocalAddressRequired The * exclude_local_address_required * @param boolean $excludeForeignAddressRequired The * exclude_foreign_address_required * @param boolean $beta The beta * @param string $nearNumber The near_number * @param string $nearLatLong The near_lat_long * @param integer $distance The distance * @param string $inPostalCode The in_postal_code * @param string $inRegion The in_region * @param string $inRateCenter The in_rate_center * @param string $inLata The in_lata * @param string $inLocality The in_locality * @param boolean $faxEnabled The fax_enabled * @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 integer $areaCode The area_code * @param string $contains The contains * @param boolean $smsEnabled The sms_enabled * @param boolean $mmsEnabled The mms_enabled * @param boolean $voiceEnabled The voice_enabled * @param boolean $excludeAllAddressRequired The exclude_all_address_required * @param boolean $excludeLocalAddressRequired The * exclude_local_address_required * @param boolean $excludeForeignAddressRequired The * exclude_foreign_address_required * @param boolean $beta The beta * @param string $nearNumber The near_number * @param string $nearLatLong The near_lat_long * @param integer $distance The distance * @param string $inPostalCode The in_postal_code * @param string $inRegion The in_region * @param string $inRateCenter The in_rate_center * @param string $inLata The in_lata * @param string $inLocality The in_locality * @param boolean $faxEnabled The fax_enabled */ 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 * * @param integer $areaCode The area_code * @return $this Fluent Builder */ public function setAreaCode($areaCode) { $this->options['areaCode'] = $areaCode; return $this; } /** * The contains * * @param string $contains The contains * @return $this Fluent Builder */ public function setContains($contains) { $this->options['contains'] = $contains; return $this; } /** * The sms_enabled * * @param boolean $smsEnabled The sms_enabled * @return $this Fluent Builder */ public function setSmsEnabled($smsEnabled) { $this->options['smsEnabled'] = $smsEnabled; return $this; } /** * The mms_enabled * * @param boolean $mmsEnabled The mms_enabled * @return $this Fluent Builder */ public function setMmsEnabled($mmsEnabled) { $this->options['mmsEnabled'] = $mmsEnabled; return $this; } /** * The voice_enabled * * @param boolean $voiceEnabled The voice_enabled * @return $this Fluent Builder */ public function setVoiceEnabled($voiceEnabled) { $this->options['voiceEnabled'] = $voiceEnabled; return $this; } /** * The exclude_all_address_required * * @param boolean $excludeAllAddressRequired The exclude_all_address_required * @return $this Fluent Builder */ public function setExcludeAllAddressRequired($excludeAllAddressRequired) { $this->options['excludeAllAddressRequired'] = $excludeAllAddressRequired; return $this; } /** * The exclude_local_address_required * * @param boolean $excludeLocalAddressRequired The * exclude_local_address_required * @return $this Fluent Builder */ public function setExcludeLocalAddressRequired($excludeLocalAddressRequired) { $this->options['excludeLocalAddressRequired'] = $excludeLocalAddressRequired; return $this; } /** * The exclude_foreign_address_required * * @param boolean $excludeForeignAddressRequired The * exclude_foreign_address_required * @return $this Fluent Builder */ public function setExcludeForeignAddressRequired($excludeForeignAddressRequired) { $this->options['excludeForeignAddressRequired'] = $excludeForeignAddressRequired; return $this; } /** * The beta * * @param boolean $beta The beta * @return $this Fluent Builder */ public function setBeta($beta) { $this->options['beta'] = $beta; return $this; } /** * The near_number * * @param string $nearNumber The near_number * @return $this Fluent Builder */ public function setNearNumber($nearNumber) { $this->options['nearNumber'] = $nearNumber; return $this; } /** * The near_lat_long * * @param string $nearLatLong The near_lat_long * @return $this Fluent Builder */ public function setNearLatLong($nearLatLong) { $this->options['nearLatLong'] = $nearLatLong; return $this; } /** * The distance * * @param integer $distance The distance * @return $this Fluent Builder */ public function setDistance($distance) { $this->options['distance'] = $distance; return $this; } /** * The in_postal_code * * @param string $inPostalCode The in_postal_code * @return $this Fluent Builder */ public function setInPostalCode($inPostalCode) { $this->options['inPostalCode'] = $inPostalCode; return $this; } /** * The in_region * * @param string $inRegion The in_region * @return $this Fluent Builder */ public function setInRegion($inRegion) { $this->options['inRegion'] = $inRegion; return $this; } /** * The in_rate_center * * @param string $inRateCenter The in_rate_center * @return $this Fluent Builder */ public function setInRateCenter($inRateCenter) { $this->options['inRateCenter'] = $inRateCenter; return $this; } /** * The in_lata * * @param string $inLata The in_lata * @return $this Fluent Builder */ public function setInLata($inLata) { $this->options['inLata'] = $inLata; return $this; } /** * The in_locality * * @param string $inLocality The in_locality * @return $this Fluent Builder */ public function setInLocality($inLocality) { $this->options['inLocality'] = $inLocality; return $this; } /** * The fax_enabled * * @param boolean $faxEnabled The fax_enabled * @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/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/MobileInstance.php 0000604 00000006271 15174325132 0023347 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 boolean 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 34 character string that uniquely identifies * your account. * @param string $countryCode The ISO Country code to lookup phone numbers for. * @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/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/VoipPage.php 0000604 00000001543 15174325132 0022162 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/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/MachineToMachineList.php 0000604 00000014705 15174325132 0024444 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 34 character string that uniquely identifies * your account. * @param string $countryCode The ISO Country code to lookup phone numbers for. * @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/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/LocalList.php 0000604 00000014453 15174325132 0022342 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 34 character string that uniquely identifies * your account. * @param string $countryCode The ISO Country code to lookup phone numbers for. * @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/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/TollFreeInstance.php 0000604 00000006301 15174325132 0023646 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 boolean 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 34 character string that uniquely identifies * your account. * @param string $countryCode The ISO Country code to lookup phone numbers for. * @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/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/MobilePage.php 0000604 00000001551 15174325132 0022453 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/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/NationalPage.php 0000604 00000001557 15174325132 0023017 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/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/SharedCostList.php 0000604 00000014561 15174325132 0023347 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 34 character string that uniquely identifies * your account. * @param string $countryCode The ISO Country code to lookup phone numbers for. * @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/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/TollFreePage.php 0000604 00000001557 15174325132 0022766 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/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/LocalOptions.php 0000604 00000024550 15174325132 0023061 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 integer $areaCode The area_code * @param string $contains The contains * @param boolean $smsEnabled The sms_enabled * @param boolean $mmsEnabled The mms_enabled * @param boolean $voiceEnabled The voice_enabled * @param boolean $excludeAllAddressRequired The exclude_all_address_required * @param boolean $excludeLocalAddressRequired The * exclude_local_address_required * @param boolean $excludeForeignAddressRequired The * exclude_foreign_address_required * @param boolean $beta The beta * @param string $nearNumber The near_number * @param string $nearLatLong The near_lat_long * @param integer $distance The distance * @param string $inPostalCode The in_postal_code * @param string $inRegion The in_region * @param string $inRateCenter The in_rate_center * @param string $inLata The in_lata * @param string $inLocality The in_locality * @param boolean $faxEnabled The fax_enabled * @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 integer $areaCode The area_code * @param string $contains The contains * @param boolean $smsEnabled The sms_enabled * @param boolean $mmsEnabled The mms_enabled * @param boolean $voiceEnabled The voice_enabled * @param boolean $excludeAllAddressRequired The exclude_all_address_required * @param boolean $excludeLocalAddressRequired The * exclude_local_address_required * @param boolean $excludeForeignAddressRequired The * exclude_foreign_address_required * @param boolean $beta The beta * @param string $nearNumber The near_number * @param string $nearLatLong The near_lat_long * @param integer $distance The distance * @param string $inPostalCode The in_postal_code * @param string $inRegion The in_region * @param string $inRateCenter The in_rate_center * @param string $inLata The in_lata * @param string $inLocality The in_locality * @param boolean $faxEnabled The fax_enabled */ 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 * * @param integer $areaCode The area_code * @return $this Fluent Builder */ public function setAreaCode($areaCode) { $this->options['areaCode'] = $areaCode; return $this; } /** * The contains * * @param string $contains The contains * @return $this Fluent Builder */ public function setContains($contains) { $this->options['contains'] = $contains; return $this; } /** * The sms_enabled * * @param boolean $smsEnabled The sms_enabled * @return $this Fluent Builder */ public function setSmsEnabled($smsEnabled) { $this->options['smsEnabled'] = $smsEnabled; return $this; } /** * The mms_enabled * * @param boolean $mmsEnabled The mms_enabled * @return $this Fluent Builder */ public function setMmsEnabled($mmsEnabled) { $this->options['mmsEnabled'] = $mmsEnabled; return $this; } /** * The voice_enabled * * @param boolean $voiceEnabled The voice_enabled * @return $this Fluent Builder */ public function setVoiceEnabled($voiceEnabled) { $this->options['voiceEnabled'] = $voiceEnabled; return $this; } /** * The exclude_all_address_required * * @param boolean $excludeAllAddressRequired The exclude_all_address_required * @return $this Fluent Builder */ public function setExcludeAllAddressRequired($excludeAllAddressRequired) { $this->options['excludeAllAddressRequired'] = $excludeAllAddressRequired; return $this; } /** * The exclude_local_address_required * * @param boolean $excludeLocalAddressRequired The * exclude_local_address_required * @return $this Fluent Builder */ public function setExcludeLocalAddressRequired($excludeLocalAddressRequired) { $this->options['excludeLocalAddressRequired'] = $excludeLocalAddressRequired; return $this; } /** * The exclude_foreign_address_required * * @param boolean $excludeForeignAddressRequired The * exclude_foreign_address_required * @return $this Fluent Builder */ public function setExcludeForeignAddressRequired($excludeForeignAddressRequired) { $this->options['excludeForeignAddressRequired'] = $excludeForeignAddressRequired; return $this; } /** * The beta * * @param boolean $beta The beta * @return $this Fluent Builder */ public function setBeta($beta) { $this->options['beta'] = $beta; return $this; } /** * The near_number * * @param string $nearNumber The near_number * @return $this Fluent Builder */ public function setNearNumber($nearNumber) { $this->options['nearNumber'] = $nearNumber; return $this; } /** * The near_lat_long * * @param string $nearLatLong The near_lat_long * @return $this Fluent Builder */ public function setNearLatLong($nearLatLong) { $this->options['nearLatLong'] = $nearLatLong; return $this; } /** * The distance * * @param integer $distance The distance * @return $this Fluent Builder */ public function setDistance($distance) { $this->options['distance'] = $distance; return $this; } /** * The in_postal_code * * @param string $inPostalCode The in_postal_code * @return $this Fluent Builder */ public function setInPostalCode($inPostalCode) { $this->options['inPostalCode'] = $inPostalCode; return $this; } /** * The in_region * * @param string $inRegion The in_region * @return $this Fluent Builder */ public function setInRegion($inRegion) { $this->options['inRegion'] = $inRegion; return $this; } /** * The in_rate_center * * @param string $inRateCenter The in_rate_center * @return $this Fluent Builder */ public function setInRateCenter($inRateCenter) { $this->options['inRateCenter'] = $inRateCenter; return $this; } /** * The in_lata * * @param string $inLata The in_lata * @return $this Fluent Builder */ public function setInLata($inLata) { $this->options['inLata'] = $inLata; return $this; } /** * The in_locality * * @param string $inLocality The in_locality * @return $this Fluent Builder */ public function setInLocality($inLocality) { $this->options['inLocality'] = $inLocality; return $this; } /** * The fax_enabled * * @param boolean $faxEnabled The fax_enabled * @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/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/MobileList.php 0000604 00000014471 15174325132 0022517 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 34 character string that uniquely identifies * your account. * @param string $countryCode The ISO Country code to lookup phone numbers for. * @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/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/LocalPage.php 0000604 00000001546 15174325132 0022302 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/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/NationalInstance.php 0000604 00000006301 15174325132 0023677 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 boolean 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 34 character string that uniquely identifies * your account. * @param string $countryCode The ISO Country code to lookup phone numbers for. * @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/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/LocalInstance.php 0000604 00000006265 15174325132 0023175 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 boolean 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 34 character string that uniquely identifies * your account. * @param string $countryCode The ISO Country code to lookup phone numbers for. * @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/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/NationalList.php 0000604 00000014525 15174325132 0023055 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 34 character string that uniquely identifies * your account. * @param string $countryCode The ISO Country code to lookup phone numbers for. * @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/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/TollFreeOptions.php 0000604 00000024567 15174325132 0023553 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 integer $areaCode The area_code * @param string $contains The contains * @param boolean $smsEnabled The sms_enabled * @param boolean $mmsEnabled The mms_enabled * @param boolean $voiceEnabled The voice_enabled * @param boolean $excludeAllAddressRequired The exclude_all_address_required * @param boolean $excludeLocalAddressRequired The * exclude_local_address_required * @param boolean $excludeForeignAddressRequired The * exclude_foreign_address_required * @param boolean $beta The beta * @param string $nearNumber The near_number * @param string $nearLatLong The near_lat_long * @param integer $distance The distance * @param string $inPostalCode The in_postal_code * @param string $inRegion The in_region * @param string $inRateCenter The in_rate_center * @param string $inLata The in_lata * @param string $inLocality The in_locality * @param boolean $faxEnabled The fax_enabled * @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 integer $areaCode The area_code * @param string $contains The contains * @param boolean $smsEnabled The sms_enabled * @param boolean $mmsEnabled The mms_enabled * @param boolean $voiceEnabled The voice_enabled * @param boolean $excludeAllAddressRequired The exclude_all_address_required * @param boolean $excludeLocalAddressRequired The * exclude_local_address_required * @param boolean $excludeForeignAddressRequired The * exclude_foreign_address_required * @param boolean $beta The beta * @param string $nearNumber The near_number * @param string $nearLatLong The near_lat_long * @param integer $distance The distance * @param string $inPostalCode The in_postal_code * @param string $inRegion The in_region * @param string $inRateCenter The in_rate_center * @param string $inLata The in_lata * @param string $inLocality The in_locality * @param boolean $faxEnabled The fax_enabled */ 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 * * @param integer $areaCode The area_code * @return $this Fluent Builder */ public function setAreaCode($areaCode) { $this->options['areaCode'] = $areaCode; return $this; } /** * The contains * * @param string $contains The contains * @return $this Fluent Builder */ public function setContains($contains) { $this->options['contains'] = $contains; return $this; } /** * The sms_enabled * * @param boolean $smsEnabled The sms_enabled * @return $this Fluent Builder */ public function setSmsEnabled($smsEnabled) { $this->options['smsEnabled'] = $smsEnabled; return $this; } /** * The mms_enabled * * @param boolean $mmsEnabled The mms_enabled * @return $this Fluent Builder */ public function setMmsEnabled($mmsEnabled) { $this->options['mmsEnabled'] = $mmsEnabled; return $this; } /** * The voice_enabled * * @param boolean $voiceEnabled The voice_enabled * @return $this Fluent Builder */ public function setVoiceEnabled($voiceEnabled) { $this->options['voiceEnabled'] = $voiceEnabled; return $this; } /** * The exclude_all_address_required * * @param boolean $excludeAllAddressRequired The exclude_all_address_required * @return $this Fluent Builder */ public function setExcludeAllAddressRequired($excludeAllAddressRequired) { $this->options['excludeAllAddressRequired'] = $excludeAllAddressRequired; return $this; } /** * The exclude_local_address_required * * @param boolean $excludeLocalAddressRequired The * exclude_local_address_required * @return $this Fluent Builder */ public function setExcludeLocalAddressRequired($excludeLocalAddressRequired) { $this->options['excludeLocalAddressRequired'] = $excludeLocalAddressRequired; return $this; } /** * The exclude_foreign_address_required * * @param boolean $excludeForeignAddressRequired The * exclude_foreign_address_required * @return $this Fluent Builder */ public function setExcludeForeignAddressRequired($excludeForeignAddressRequired) { $this->options['excludeForeignAddressRequired'] = $excludeForeignAddressRequired; return $this; } /** * The beta * * @param boolean $beta The beta * @return $this Fluent Builder */ public function setBeta($beta) { $this->options['beta'] = $beta; return $this; } /** * The near_number * * @param string $nearNumber The near_number * @return $this Fluent Builder */ public function setNearNumber($nearNumber) { $this->options['nearNumber'] = $nearNumber; return $this; } /** * The near_lat_long * * @param string $nearLatLong The near_lat_long * @return $this Fluent Builder */ public function setNearLatLong($nearLatLong) { $this->options['nearLatLong'] = $nearLatLong; return $this; } /** * The distance * * @param integer $distance The distance * @return $this Fluent Builder */ public function setDistance($distance) { $this->options['distance'] = $distance; return $this; } /** * The in_postal_code * * @param string $inPostalCode The in_postal_code * @return $this Fluent Builder */ public function setInPostalCode($inPostalCode) { $this->options['inPostalCode'] = $inPostalCode; return $this; } /** * The in_region * * @param string $inRegion The in_region * @return $this Fluent Builder */ public function setInRegion($inRegion) { $this->options['inRegion'] = $inRegion; return $this; } /** * The in_rate_center * * @param string $inRateCenter The in_rate_center * @return $this Fluent Builder */ public function setInRateCenter($inRateCenter) { $this->options['inRateCenter'] = $inRateCenter; return $this; } /** * The in_lata * * @param string $inLata The in_lata * @return $this Fluent Builder */ public function setInLata($inLata) { $this->options['inLata'] = $inLata; return $this; } /** * The in_locality * * @param string $inLocality The in_locality * @return $this Fluent Builder */ public function setInLocality($inLocality) { $this->options['inLocality'] = $inLocality; return $this; } /** * The fax_enabled * * @param boolean $faxEnabled The fax_enabled * @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/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/SharedCostPage.php 0000604 00000001565 15174325132 0023310 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/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/TollFreeList.php 0000604 00000014525 15174325132 0023024 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 34 character string that uniquely identifies * your account. * @param string $countryCode The ISO Country code to lookup phone numbers for. * @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/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/SharedCostInstance.php 0000604 00000006311 15174325132 0024172 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 boolean 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 34 character string that uniquely identifies * your account. * @param string $countryCode The ISO Country code to lookup phone numbers for. * @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/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumberPage.php 0000604 00000001432 15174325132 0017541 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/Twilio/Rest/Api/V2010/Account/NotificationPage.php 0000604 00000001405 15174325132 0016261 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/Twilio/Rest/Api/V2010/Account/SigningKeyOptions.php 0000604 00000002660 15174325132 0016465 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/Twilio/Rest/Api/V2010/Account/ConnectAppContext.php 0000604 00000005714 15174325132 0016444 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; 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 account_sid * @param string $sid Fetch by unique connect-app Sid * @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 */ 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 */ 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'] ); } /** * Provide 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/Twilio/Rest/Api/V2010/Account/NewSigningKeyInstance.php 0000604 00000004463 15174325132 0017253 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/Twilio/Rest/Api/V2010/Account/RecordingList.php 0000604 00000013016 15174325132 0015607 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 unique sid that identifies this account * @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 Fetch by unique recording Sid * @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/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountryContext.php 0000604 00000017160 15174325132 0022017 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 account_sid * @param string $countryCode The country_code * @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 */ 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 \Twilio\Exceptions\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 \Twilio\Exceptions\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/Twilio/Rest/Api/V2010/Account/TranscriptionContext.php 0000604 00000004001 15174325132 0017235 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; 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 account_sid * @param string $sid Fetch by unique transcription Sid * @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 */ 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 */ 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/Twilio/Rest/Api/V2010/Account/UsageInstance.php 0000604 00000003161 15174325132 0015570 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\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/Twilio/Rest/Api/V2010/Account/AddressOptions.php 0000604 00000022336 15174325132 0016005 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 The friendly_name * @param boolean $emergencyEnabled The emergency_enabled * @param boolean $autoCorrectAddress The auto_correct_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 The friendly_name * @param string $customerName The customer_name * @param string $street The street * @param string $city The city * @param string $region The region * @param string $postalCode The postal_code * @param boolean $emergencyEnabled The emergency_enabled * @param boolean $autoCorrectAddress The auto_correct_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 * @param string $friendlyName The friendly_name * @param string $isoCountry The iso_country * @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 The friendly_name * @param boolean $emergencyEnabled The emergency_enabled * @param boolean $autoCorrectAddress The auto_correct_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; } /** * The friendly_name * * @param string $friendlyName The friendly_name * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The emergency_enabled * * @param boolean $emergencyEnabled The emergency_enabled * @return $this Fluent Builder */ public function setEmergencyEnabled($emergencyEnabled) { $this->options['emergencyEnabled'] = $emergencyEnabled; return $this; } /** * The auto_correct_address * * @param boolean $autoCorrectAddress The auto_correct_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 The friendly_name * @param string $customerName The customer_name * @param string $street The street * @param string $city The city * @param string $region The region * @param string $postalCode The postal_code * @param boolean $emergencyEnabled The emergency_enabled * @param boolean $autoCorrectAddress The auto_correct_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; } /** * The friendly_name * * @param string $friendlyName The friendly_name * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The customer_name * * @param string $customerName The customer_name * @return $this Fluent Builder */ public function setCustomerName($customerName) { $this->options['customerName'] = $customerName; return $this; } /** * The street * * @param string $street The street * @return $this Fluent Builder */ public function setStreet($street) { $this->options['street'] = $street; return $this; } /** * The city * * @param string $city The city * @return $this Fluent Builder */ public function setCity($city) { $this->options['city'] = $city; return $this; } /** * The region * * @param string $region The region * @return $this Fluent Builder */ public function setRegion($region) { $this->options['region'] = $region; return $this; } /** * The postal_code * * @param string $postalCode The postal_code * @return $this Fluent Builder */ public function setPostalCode($postalCode) { $this->options['postalCode'] = $postalCode; return $this; } /** * The emergency_enabled * * @param boolean $emergencyEnabled The emergency_enabled * @return $this Fluent Builder */ public function setEmergencyEnabled($emergencyEnabled) { $this->options['emergencyEnabled'] = $emergencyEnabled; return $this; } /** * The auto_correct_address * * @param boolean $autoCorrectAddress The auto_correct_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 * @param string $friendlyName The friendly_name * @param string $isoCountry The iso_country */ 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 * * @param string $customerName The customer_name * @return $this Fluent Builder */ public function setCustomerName($customerName) { $this->options['customerName'] = $customerName; 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 iso_country * * @param string $isoCountry The iso_country * @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/Twilio/Rest/Api/V2010/Account/ValidationRequestPage.php 0000604 00000001424 15174325132 0017277 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/Twilio/Rest/Api/V2010/Account/QueuePage.php 0000604 00000001360 15174325132 0014717 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/Twilio/Rest/Api/V2010/Account/ShortCodeOptions.php 0000604 00000015621 15174325132 0016311 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 human readable description of this resource * @param string $apiVersion The API version to use * @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 Filter by friendly name * @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 human readable description of this resource * @param string $apiVersion The API version to use * @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 human readable descriptive text for this resource, up to 64 characters long. By default, the `FriendlyName` is just the short code. * * @param string $friendlyName A human readable description of this resource * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * SMSs to this short code will start a new TwiML session with this API version. * * @param string $apiVersion The API version to use * @return $this Fluent Builder */ public function setApiVersion($apiVersion) { $this->options['apiVersion'] = $apiVersion; return $this; } /** * The URL Twilio will request 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 Twilio will use when making requests to the `SmsUrl`. Either `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 Twilio will request if an error occurs retrieving or executing the TwiML from `SmsUrl`. * * @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 Twilio will use when requesting the above URL. Either `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 Filter by friendly name * @param string $shortCode Filter by ShortCode */ public function __construct($friendlyName = Values::NONE, $shortCode = Values::NONE) { $this->options['friendlyName'] = $friendlyName; $this->options['shortCode'] = $shortCode; } /** * Only show the ShortCode resources with friendly names that exactly match this name * * @param string $friendlyName Filter by friendly name * @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/Twilio/Rest/Api/V2010/Account/QueueOptions.php 0000604 00000006533 15174325132 0015505 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 human readable description of the queue * @param integer $maxSize The max number of members allowed in the queue * @return UpdateQueueOptions Options builder */ public static function update($friendlyName = Values::NONE, $maxSize = Values::NONE) { return new UpdateQueueOptions($friendlyName, $maxSize); } /** * @param integer $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 human readable description of the queue * @param integer $maxSize The max number of members allowed in the queue */ public function __construct($friendlyName = Values::NONE, $maxSize = Values::NONE) { $this->options['friendlyName'] = $friendlyName; $this->options['maxSize'] = $maxSize; } /** * A human readable description of the queue * * @param string $friendlyName A human readable description of the queue * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The maximum number of members that can be in the queue at a time * * @param integer $maxSize The max number of members 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 integer $maxSize The max number of calls allowed in the queue */ public function __construct($maxSize = Values::NONE) { $this->options['maxSize'] = $maxSize; } /** * The upper limit of calls allowed to be in the queue. The default is 100. The maximum is 1000. * * @param integer $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/Twilio/Rest/Api/V2010/Account/QueueContext.php 0000604 00000010661 15174325132 0015473 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 account_sid * @param string $sid Fetch by unique queue Sid * @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 */ 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 */ 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 */ 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 \Twilio\Exceptions\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 \Twilio\Exceptions\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/Twilio/Rest/Api/V2010/Account/AuthorizedConnectAppList.php 0000604 00000012065 15174325132 0017767 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 unique sid that identifies this account * @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 connect_app_sid * @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/Twilio/Rest/Api/V2010/Account/SipPage.php 0000604 00000001352 15174325132 0014367 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/Twilio/Rest/Api/V2010/Account/TranscriptionPage.php 0000604 00000001410 15174325132 0016466 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/Twilio/Rest/Api/V2010/Account/TokenInstance.php 0000604 00000004647 15174325132 0015616 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 unique sid that identifies this account * @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/Twilio/Rest/Api/V2010/Account/TokenPage.php 0000604 00000001360 15174325132 0014713 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/Twilio/Rest/Api/V2010/Account/ShortCodeContext.php 0000604 00000005321 15174325132 0016276 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; 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 account_sid * @param string $sid Fetch by unique short-code Sid * @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 */ 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 */ 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/Twilio/Rest/Api/V2010/Account/NewKeyInstance.php 0000604 00000004427 15174325132 0015734 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/Twilio/Rest/Api/V2010/Account/AddressContext.php 0000604 00000011625 15174325132 0015775 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 account_sid * @param string $sid The sid * @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 */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Fetch a AddressInstance * * @return AddressInstance Fetched AddressInstance */ 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 */ 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 \Twilio\Exceptions\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 \Twilio\Exceptions\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/Twilio/Rest/Api/V2010/Account/UsageList.php 0000604 00000005744 15174325132 0014750 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 \Twilio\Exceptions\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 \Twilio\Exceptions\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/Twilio/Rest/Api/V2010/Account/KeyList.php 0000604 00000011417 15174325132 0014426 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 sid * @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/Twilio/Rest/Api/V2010/Account/NewKeyList.php 0000604 00000003201 15174325132 0015070 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 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 */ 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/Twilio/Rest/Api/V2010/Account/OutgoingCallerIdContext.php 0000604 00000005362 15174325132 0017604 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; 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 account_sid * @param string $sid Fetch by unique outgoing-caller-id Sid * @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 */ 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 */ 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 */ 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/Twilio/Rest/Api/V2010/Account/SigningKeyList.php 0000604 00000011606 15174325132 0015745 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/Twilio/Rest/Api/V2010/Account/ValidationRequestOptions.php 0000604 00000007032 15174325132 0020057 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 The friendly_name * @param integer $callDelay The call_delay * @param string $extension The extension * @param string $statusCallback The status_callback * @param string $statusCallbackMethod The status_callback_method * @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 The friendly_name * @param integer $callDelay The call_delay * @param string $extension The extension * @param string $statusCallback The status_callback * @param string $statusCallbackMethod The status_callback_method */ 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; } /** * The friendly_name * * @param string $friendlyName The friendly_name * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The call_delay * * @param integer $callDelay The call_delay * @return $this Fluent Builder */ public function setCallDelay($callDelay) { $this->options['callDelay'] = $callDelay; return $this; } /** * The extension * * @param string $extension The extension * @return $this Fluent Builder */ public function setExtension($extension) { $this->options['extension'] = $extension; return $this; } /** * The status_callback * * @param string $statusCallback The status_callback * @return $this Fluent Builder */ public function setStatusCallback($statusCallback) { $this->options['statusCallback'] = $statusCallback; return $this; } /** * The status_callback_method * * @param string $statusCallbackMethod The status_callback_method * @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/Twilio/Rest/Api/V2010/Account/ShortCodeList.php 0000604 00000012374 15174325132 0015573 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 unique sid that identifies this account * @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 Fetch by unique short-code Sid * @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/Twilio/Rest/Api/V2010/Account/CallOptions.php 0000604 00000064346 15174325132 0015302 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 Url from which to fetch TwiML * @param string $applicationSid ApplicationSid that configures from where to * fetch TwiML * @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 FallbackUrl * @param string $statusCallback Status Callback URL * @param string $statusCallbackEvent The status_callback_event * @param string $statusCallbackMethod HTTP Method to use with StatusCallback * @param string $sendDigits Digits to send * @param string $ifMachine Action to take if a machine has answered the call * @param integer $timeout Number of seconds to wait for an answer * @param boolean $record Whether or not to record the Call * @param string $recordingChannels The recording_channels * @param string $recordingStatusCallback The recording_status_callback * @param string $recordingStatusCallbackMethod The * recording_status_callback_method * @param string $sipAuthUsername The sip_auth_username * @param string $sipAuthPassword The sip_auth_password * @param string $machineDetection Enable machine detection or end of greeting * detection * @param integer $machineDetectionTimeout Number of miliseconds to wait for * machine detection * @param string $recordingStatusCallbackEvent The * recording_status_callback_event * @return CreateCallOptions Options builder */ public static function create($url = 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, $ifMachine = 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) { return new CreateCallOptions($url, $applicationSid, $method, $fallbackUrl, $fallbackMethod, $statusCallback, $statusCallbackEvent, $statusCallbackMethod, $sendDigits, $ifMachine, $timeout, $record, $recordingChannels, $recordingStatusCallback, $recordingStatusCallbackMethod, $sipAuthUsername, $sipAuthPassword, $machineDetection, $machineDetectionTimeout, $recordingStatusCallbackEvent); } /** * @param string $to Phone number or Client identifier to filter `to` on * @param string $from Phone number or Client identifier to filter `from` on * @param string $parentCallSid Parent Call Sid to filter on * @param string $status Status to filter on * @param string $startTimeBefore StartTime to filter on * @param string $startTime StartTime to filter on * @param string $startTimeAfter StartTime to filter on * @param string $endTimeBefore EndTime to filter on * @param string $endTime EndTime to filter on * @param string $endTimeAfter EndTime to filter on * @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 URL that returns TwiML * @param string $method HTTP method to use to fetch TwiML * @param string $status Status to update the Call with * @param string $fallbackUrl Fallback URL in case of error * @param string $fallbackMethod HTTP Method to use with FallbackUrl * @param string $statusCallback Status Callback URL * @param string $statusCallbackMethod HTTP Method to use with StatusCallback * @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) { return new UpdateCallOptions($url, $method, $status, $fallbackUrl, $fallbackMethod, $statusCallback, $statusCallbackMethod); } } class CreateCallOptions extends Options { /** * @param string $url Url from which to fetch TwiML * @param string $applicationSid ApplicationSid that configures from where to * fetch TwiML * @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 FallbackUrl * @param string $statusCallback Status Callback URL * @param string $statusCallbackEvent The status_callback_event * @param string $statusCallbackMethod HTTP Method to use with StatusCallback * @param string $sendDigits Digits to send * @param string $ifMachine Action to take if a machine has answered the call * @param integer $timeout Number of seconds to wait for an answer * @param boolean $record Whether or not to record the Call * @param string $recordingChannels The recording_channels * @param string $recordingStatusCallback The recording_status_callback * @param string $recordingStatusCallbackMethod The * recording_status_callback_method * @param string $sipAuthUsername The sip_auth_username * @param string $sipAuthPassword The sip_auth_password * @param string $machineDetection Enable machine detection or end of greeting * detection * @param integer $machineDetectionTimeout Number of miliseconds to wait for * machine detection * @param string $recordingStatusCallbackEvent The * recording_status_callback_event */ public function __construct($url = 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, $ifMachine = 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) { $this->options['url'] = $url; $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['ifMachine'] = $ifMachine; $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; } /** * The fully qualified URL that should be consulted when the call connects. Just like when you set a URL on a phone number for handling inbound calls. * * @param string $url Url from which to fetch TwiML * @return $this Fluent Builder */ public function setUrl($url) { $this->options['url'] = $url; return $this; } /** * The 34 character sid of the application Twilio should use to handle this phone call. If this parameter is present, Twilio will ignore all of the voice URLs passed and use the URLs set on the application. * * @param string $applicationSid ApplicationSid that configures from where to * fetch TwiML * @return $this Fluent Builder */ public function setApplicationSid($applicationSid) { $this->options['applicationSid'] = $applicationSid; return $this; } /** * The HTTP method Twilio should use when requesting the URL. Defaults to `POST`. If an `ApplicationSid` was provided, 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; } /** * A URL that Twilio will request if an error occurs requesting or executing the TwiML at `Url`. If an `ApplicationSid` was provided, 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 Twilio should use to request the `FallbackUrl`. Must be either `GET` or `POST`. Defaults to `POST`. If an `ApplicationSid` was provided, this parameter is ignored. * * @param string $fallbackMethod HTTP Method to use with FallbackUrl * @return $this Fluent Builder */ public function setFallbackMethod($fallbackMethod) { $this->options['fallbackMethod'] = $fallbackMethod; return $this; } /** * A URL that Twilio will request when the call ends to notify your app. If an `ApplicationSid` was provided, this parameter is ignored. * * @param string $statusCallback Status Callback URL * @return $this Fluent Builder */ public function setStatusCallback($statusCallback) { $this->options['statusCallback'] = $statusCallback; return $this; } /** * The status_callback_event * * @param string $statusCallbackEvent The status_callback_event * @return $this Fluent Builder */ public function setStatusCallbackEvent($statusCallbackEvent) { $this->options['statusCallbackEvent'] = $statusCallbackEvent; return $this; } /** * The HTTP method that Twilio should use to request the `StatusCallback`. Defaults to `POST`. If an `ApplicationSid` was provided, this parameter is ignored. * * @param string $statusCallbackMethod HTTP Method to use with StatusCallback * @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. 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, dial extension 1234 and then the pound key, use `ww1234#`. * * @param string $sendDigits Digits to send * @return $this Fluent Builder */ public function setSendDigits($sendDigits) { $this->options['sendDigits'] = $sendDigits; return $this; } /** * Tell Twilio to try and determine if a machine (like voicemail) or a human has answered the call. Possible value are `Continue` and `Hangup`. * * @param string $ifMachine Action to take if a machine has answered the call * @return $this Fluent Builder */ public function setIfMachine($ifMachine) { $this->options['ifMachine'] = $ifMachine; return $this; } /** * The integer number of seconds that Twilio should allow the phone to ring before assuming there is no answer. Default is `60` seconds, the maximum is `999` seconds. Note, you could set this to a low value, such as `15`, to hangup before reaching an answering machine or voicemail. * * @param integer $timeout Number of seconds to wait for an answer * @return $this Fluent Builder */ public function setTimeout($timeout) { $this->options['timeout'] = $timeout; return $this; } /** * Set this parameter to true to record the entirety of a phone call. The RecordingUrl will be sent to the StatusCallback URL. Defaults to false. * * @param boolean $record Whether or not to record the Call * @return $this Fluent Builder */ public function setRecord($record) { $this->options['record'] = $record; return $this; } /** * The recording_channels * * @param string $recordingChannels The recording_channels * @return $this Fluent Builder */ public function setRecordingChannels($recordingChannels) { $this->options['recordingChannels'] = $recordingChannels; return $this; } /** * The recording_status_callback * * @param string $recordingStatusCallback The recording_status_callback * @return $this Fluent Builder */ public function setRecordingStatusCallback($recordingStatusCallback) { $this->options['recordingStatusCallback'] = $recordingStatusCallback; return $this; } /** * The recording_status_callback_method * * @param string $recordingStatusCallbackMethod The * recording_status_callback_method * @return $this Fluent Builder */ public function setRecordingStatusCallbackMethod($recordingStatusCallbackMethod) { $this->options['recordingStatusCallbackMethod'] = $recordingStatusCallbackMethod; return $this; } /** * The sip_auth_username * * @param string $sipAuthUsername The sip_auth_username * @return $this Fluent Builder */ public function setSipAuthUsername($sipAuthUsername) { $this->options['sipAuthUsername'] = $sipAuthUsername; return $this; } /** * The sip_auth_password * * @param string $sipAuthPassword The sip_auth_password * @return $this Fluent Builder */ public function setSipAuthPassword($sipAuthPassword) { $this->options['sipAuthPassword'] = $sipAuthPassword; return $this; } /** * Twilio will try to detect if a human, fax machine or answering machine has answered the call. Possible value are `Enable` and `DetectMessageEnd`. * * @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 integer number of miliseconds that Twilio should wait while machine_detection is performned before timing out. * * @param integer $machineDetectionTimeout Number of miliseconds to wait for * machine detection * @return $this Fluent Builder */ public function setMachineDetectionTimeout($machineDetectionTimeout) { $this->options['machineDetectionTimeout'] = $machineDetectionTimeout; return $this; } /** * The recording_status_callback_event * * @param string $recordingStatusCallbackEvent The * recording_status_callback_event * @return $this Fluent Builder */ public function setRecordingStatusCallbackEvent($recordingStatusCallbackEvent) { $this->options['recordingStatusCallbackEvent'] = $recordingStatusCallbackEvent; return $this; } /** * Provide a friendly representation * * @return 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 to filter `to` on * @param string $from Phone number or Client identifier to filter `from` on * @param string $parentCallSid Parent Call Sid to filter on * @param string $status Status to filter on * @param string $startTimeBefore StartTime to filter on * @param string $startTime StartTime to filter on * @param string $startTimeAfter StartTime to filter on * @param string $endTimeBefore EndTime to filter on * @param string $endTime EndTime to filter on * @param string $endTimeAfter EndTime to filter on */ 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 to this phone number or Client identifier * * @param string $to Phone number or Client identifier to filter `to` on * @return $this Fluent Builder */ public function setTo($to) { $this->options['to'] = $to; return $this; } /** * Only show calls from this phone number or Client identifier * * @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 show calls spawned by the call 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; } /** * Only show calls currently in this status * * @param string $status Status to filter on * @return $this Fluent Builder */ public function setStatus($status) { $this->options['status'] = $status; return $this; } /** * Only show calls that started on this date * * @param string $startTimeBefore StartTime to filter on * @return $this Fluent Builder */ public function setStartTimeBefore($startTimeBefore) { $this->options['startTimeBefore'] = $startTimeBefore; return $this; } /** * Only show calls that started on this date * * @param string $startTime StartTime to filter on * @return $this Fluent Builder */ public function setStartTime($startTime) { $this->options['startTime'] = $startTime; return $this; } /** * Only show calls that started on this date * * @param string $startTimeAfter StartTime to filter on * @return $this Fluent Builder */ public function setStartTimeAfter($startTimeAfter) { $this->options['startTimeAfter'] = $startTimeAfter; return $this; } /** * Only show call that ended on this date * * @param string $endTimeBefore EndTime to filter on * @return $this Fluent Builder */ public function setEndTimeBefore($endTimeBefore) { $this->options['endTimeBefore'] = $endTimeBefore; return $this; } /** * Only show call that ended on this date * * @param string $endTime EndTime to filter on * @return $this Fluent Builder */ public function setEndTime($endTime) { $this->options['endTime'] = $endTime; return $this; } /** * Only show call that ended on this date * * @param string $endTimeAfter EndTime to filter on * @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 URL that returns TwiML * @param string $method HTTP method to use to fetch TwiML * @param string $status Status to update the Call with * @param string $fallbackUrl Fallback URL in case of error * @param string $fallbackMethod HTTP Method to use with FallbackUrl * @param string $statusCallback Status Callback URL * @param string $statusCallbackMethod HTTP Method to use with StatusCallback */ public function __construct($url = Values::NONE, $method = Values::NONE, $status = Values::NONE, $fallbackUrl = Values::NONE, $fallbackMethod = Values::NONE, $statusCallback = Values::NONE, $statusCallbackMethod = 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; } /** * A valid URL that returns TwiML. Twilio will immediately redirect the call to the new TwiML upon execution. * * @param string $url URL that returns TwiML * @return $this Fluent Builder */ public function setUrl($url) { $this->options['url'] = $url; return $this; } /** * The HTTP method Twilio should use when requesting the URL. Defaults to `POST`. * * @param string $method HTTP method to use to fetch TwiML * @return $this Fluent Builder */ public function setMethod($method) { $this->options['method'] = $method; return $this; } /** * Either `canceled` or `completed`. Specifying `canceled` will attempt to hangup calls that are queued or ringing but 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 Status to update the Call with * @return $this Fluent Builder */ public function setStatus($status) { $this->options['status'] = $status; return $this; } /** * A URL that Twilio will request if an error occurs requesting or executing the TwiML at `Url`. * * @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 Twilio should use to request the `FallbackUrl`. Must be either `GET` or `POST`. Defaults to `POST`. * * @param string $fallbackMethod HTTP Method to use with FallbackUrl * @return $this Fluent Builder */ public function setFallbackMethod($fallbackMethod) { $this->options['fallbackMethod'] = $fallbackMethod; return $this; } /** * A URL that Twilio will request when the call ends to notify your app. * * @param string $statusCallback Status Callback URL * @return $this Fluent Builder */ public function setStatusCallback($statusCallback) { $this->options['statusCallback'] = $statusCallback; return $this; } /** * The HTTP method that Twilio should use to request the `StatusCallback`. Defaults to `POST`. * * @param string $statusCallbackMethod HTTP Method to use with StatusCallback * @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.UpdateCallOptions ' . implode(' ', $options) . ']'; } } sdk/Twilio/Rest/Api/V2010/Account/AddressInstance.php 0000604 00000011641 15174325132 0016113 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 boolean emergencyEnabled * @property boolean validated */ 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 account_sid * @param string $sid The sid * @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'), ); $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 */ public function delete() { return $this->proxy()->delete(); } /** * Fetch a AddressInstance * * @return AddressInstance Fetched AddressInstance */ public function fetch() { return $this->proxy()->fetch(); } /** * Update the AddressInstance * * @param array|Options $options Optional Arguments * @return AddressInstance Updated AddressInstance */ 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/Twilio/Rest/Api/V2010/Account/AddressPage.php 0000604 00000001366 15174325132 0015226 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/Twilio/Rest/Api/V2010/Account/MessageList.php 0000604 00000016003 15174325132 0015256 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 MessageList extends ListResource { /** * Construct the MessageList * * @param Version $version Version that contains the resource * @param string $accountSid The unique sid that identifies this account * @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 phone number to receive the message * @param array|Options $options Optional Arguments * @return MessageInstance Newly created MessageInstance */ 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'], 'MaxRate' => $options['maxRate'], 'ForceDelivery' => Serialize::booleanToString($options['forceDelivery']), 'ProviderSid' => $options['providerSid'], 'ContentRetention' => $options['contentRetention'], 'AddressRetention' => $options['addressRetention'], 'SmartEncoded' => Serialize::booleanToString($options['smartEncoded']), )); $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 Fetch by unique message Sid * @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/Twilio/Rest/Api/V2010/Account/CallContext.php 0000604 00000014111 15174325132 0015254 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 account_sid * @param string $sid Call Sid that uniquely identifies the Call 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 */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Fetch a CallInstance * * @return CallInstance Fetched CallInstance */ 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 */ 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'], )); $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 \Twilio\Exceptions\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 \Twilio\Exceptions\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/Twilio/Rest/Api/V2010/Account/OutgoingCallerIdOptions.php 0000604 00000006614 15174325132 0017614 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 human readable description of the caller ID * @return UpdateOutgoingCallerIdOptions Options builder */ public static function update($friendlyName = Values::NONE) { return new UpdateOutgoingCallerIdOptions($friendlyName); } /** * @param string $phoneNumber Filter by phone number * @param string $friendlyName Filter by friendly name * @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 human readable description of the caller ID */ public function __construct($friendlyName = Values::NONE) { $this->options['friendlyName'] = $friendlyName; } /** * A human readable description of the caller ID * * @param string $friendlyName A human readable description of the caller ID * @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 Filter by phone number * @param string $friendlyName Filter by friendly name */ public function __construct($phoneNumber = Values::NONE, $friendlyName = Values::NONE) { $this->options['phoneNumber'] = $phoneNumber; $this->options['friendlyName'] = $friendlyName; } /** * Only show the caller id resource that exactly matches this phone number * * @param string $phoneNumber Filter by phone number * @return $this Fluent Builder */ public function setPhoneNumber($phoneNumber) { $this->options['phoneNumber'] = $phoneNumber; return $this; } /** * Only show the caller id resource that exactly matches this name * * @param string $friendlyName Filter by 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.ReadOutgoingCallerIdOptions ' . implode(' ', $options) . ']'; } } sdk/Twilio/Rest/Api/V2010/Account/ConferenceContext.php 0000604 00000010441 15174325132 0016452 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\Values; use Twilio\Version; /** * @property \Twilio\Rest\Api\V2010\Account\Conference\ParticipantList participants * @method \Twilio\Rest\Api\V2010\Account\Conference\ParticipantContext participants(string $callSid) */ class ConferenceContext extends InstanceContext { protected $_participants = null; /** * Initialize the ConferenceContext * * @param \Twilio\Version $version Version that contains the resource * @param string $accountSid The account_sid * @param string $sid Fetch by unique conference Sid * @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 */ 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 */ 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 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; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws \Twilio\Exceptions\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 \Twilio\Exceptions\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/Twilio/Rest/Api/V2010/Account/NewSigningKeyList.php 0000604 00000003300 15174325132 0016407 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 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 */ 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/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountryList.php 0000604 00000012404 15174325132 0021302 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 country_code * @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/Twilio/Rest/Api/V2010/Account/OutgoingCallerIdInstance.php 0000604 00000010302 15174325132 0017712 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 unique sid that identifies this account * @param string $sid Fetch by unique outgoing-caller-id Sid * @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 */ public function fetch() { return $this->proxy()->fetch(); } /** * Update the OutgoingCallerIdInstance * * @param array|Options $options Optional Arguments * @return OutgoingCallerIdInstance Updated OutgoingCallerIdInstance */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Deletes the OutgoingCallerIdInstance * * @return boolean True if delete succeeds, false otherwise */ 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/Twilio/Rest/Api/V2010/Account/CallList.php 0000604 00000023144 15174325132 0014551 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 unique id of the Account responsible for * creating this Call * @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 */ public function create($to, $from, $options = array()) { $options = new Values($options); $data = Values::of(array( 'To' => $to, 'From' => $from, 'Url' => $options['url'], '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'], 'IfMachine' => $options['ifMachine'], '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; }), )); $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 Call Sid that uniquely identifies the Call 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 \Twilio\Exceptions\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 \Twilio\Exceptions\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/Twilio/Rest/Api/V2010/Account/ApplicationInstance.php 0000604 00000013047 15174325132 0016773 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 boolean 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 A string that uniquely identifies this resource * @param string $sid Fetch by unique Application Sid * @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 */ public function delete() { return $this->proxy()->delete(); } /** * Fetch a ApplicationInstance * * @return ApplicationInstance Fetched ApplicationInstance */ public function fetch() { return $this->proxy()->fetch(); } /** * Update the ApplicationInstance * * @param array|Options $options Optional Arguments * @return ApplicationInstance Updated ApplicationInstance */ 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/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumberInstance.php 0000604 00000016063 15174325132 0020437 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 boolean 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 boolean voiceCallerIdLookup * @property string voiceFallbackMethod * @property string voiceFallbackUrl * @property string voiceMethod * @property string voiceUrl * @property string emergencyStatus * @property string emergencyAddressSid */ 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 unique sid that identifies this account * @param string $sid Fetch by unique incoming-phone-number Sid * @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'), ); $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 */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Fetch a IncomingPhoneNumberInstance * * @return IncomingPhoneNumberInstance Fetched IncomingPhoneNumberInstance */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the IncomingPhoneNumberInstance * * @return boolean True if delete succeeds, false otherwise */ 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/Twilio/Rest/Api/V2010/Account/CallInstance.php 0000604 00000015051 15174325132 0015400 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 unique id of the Account responsible for * creating this Call * @param string $sid Call Sid that uniquely identifies the Call 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 */ public function delete() { return $this->proxy()->delete(); } /** * Fetch a CallInstance * * @return CallInstance Fetched CallInstance */ public function fetch() { return $this->proxy()->fetch(); } /** * Update the CallInstance * * @param array|Options $options Optional Arguments * @return CallInstance Updated CallInstance */ 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/Twilio/Rest/Api/V2010/Account/ConferenceOptions.php 0000604 00000016173 15174325132 0016471 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 Filter by date created * @param string $dateCreated Filter by date created * @param string $dateCreatedAfter Filter by date created * @param string $dateUpdatedBefore Filter by date updated * @param string $dateUpdated Filter by date updated * @param string $dateUpdatedAfter Filter by date updated * @param string $friendlyName Filter by friendly name * @param string $status The status of the conference * @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 status * @return UpdateConferenceOptions Options builder */ public static function update($status = Values::NONE) { return new UpdateConferenceOptions($status); } } class ReadConferenceOptions extends Options { /** * @param string $dateCreatedBefore Filter by date created * @param string $dateCreated Filter by date created * @param string $dateCreatedAfter Filter by date created * @param string $dateUpdatedBefore Filter by date updated * @param string $dateUpdated Filter by date updated * @param string $dateUpdatedAfter Filter by date updated * @param string $friendlyName Filter by friendly name * @param string $status The status of the conference */ 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; } /** * Only show conferences that started on this date, given as YYYY-MM-DD. You can also specify inequality such as DateCreated<=YYYY-MM-DD * * @param string $dateCreatedBefore Filter by date created * @return $this Fluent Builder */ public function setDateCreatedBefore($dateCreatedBefore) { $this->options['dateCreatedBefore'] = $dateCreatedBefore; return $this; } /** * Only show conferences that started on this date, given as YYYY-MM-DD. You can also specify inequality such as DateCreated<=YYYY-MM-DD * * @param string $dateCreated Filter by date created * @return $this Fluent Builder */ public function setDateCreated($dateCreated) { $this->options['dateCreated'] = $dateCreated; return $this; } /** * Only show conferences that started on this date, given as YYYY-MM-DD. You can also specify inequality such as DateCreated<=YYYY-MM-DD * * @param string $dateCreatedAfter Filter by date created * @return $this Fluent Builder */ public function setDateCreatedAfter($dateCreatedAfter) { $this->options['dateCreatedAfter'] = $dateCreatedAfter; return $this; } /** * Only show conferences that were last updated on this date, given as YYYY-MM-DD. You can also specify inequality such as DateUpdated>=YYYY-MM-DD * * @param string $dateUpdatedBefore Filter by date updated * @return $this Fluent Builder */ public function setDateUpdatedBefore($dateUpdatedBefore) { $this->options['dateUpdatedBefore'] = $dateUpdatedBefore; return $this; } /** * Only show conferences that were last updated on this date, given as YYYY-MM-DD. You can also specify inequality such as DateUpdated>=YYYY-MM-DD * * @param string $dateUpdated Filter by date updated * @return $this Fluent Builder */ public function setDateUpdated($dateUpdated) { $this->options['dateUpdated'] = $dateUpdated; return $this; } /** * Only show conferences that were last updated on this date, given as YYYY-MM-DD. You can also specify inequality such as DateUpdated>=YYYY-MM-DD * * @param string $dateUpdatedAfter Filter by date updated * @return $this Fluent Builder */ public function setDateUpdatedAfter($dateUpdatedAfter) { $this->options['dateUpdatedAfter'] = $dateUpdatedAfter; return $this; } /** * Only show results who's friendly name exactly matches the string * * @param string $friendlyName Filter by friendly name * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * A string representing the status of the conference. May be `init`, `in-progress`, or `completed`. * * @param string $status The status of the conference * @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 status */ public function __construct($status = Values::NONE) { $this->options['status'] = $status; } /** * The status * * @param string $status The status * @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.UpdateConferenceOptions ' . implode(' ', $options) . ']'; } } sdk/Twilio/Rest/Api/V2010/Account/ApplicationPage.php 0000604 00000001402 15174325132 0016073 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/Twilio/Rest/Api/V2010/Account/SigningKeyInstance.php 0000604 00000007424 15174325132 0016601 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 */ public function fetch() { return $this->proxy()->fetch(); } /** * Update the SigningKeyInstance * * @param array|Options $options Optional Arguments * @return SigningKeyInstance Updated SigningKeyInstance */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Deletes the SigningKeyInstance * * @return boolean True if delete succeeds, false otherwise */ 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/Twilio/Rest/Api/V2010/Account/RecordingOptions.php 0000604 00000007515 15174325132 0016336 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 Filter by date created * @param string $dateCreated Filter by date created * @param string $dateCreatedAfter Filter by date created * @param string $callSid Filter by call_sid * @param string $conferenceSid The conference_sid * @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 Filter by date created * @param string $dateCreated Filter by date created * @param string $dateCreatedAfter Filter by date created * @param string $callSid Filter by call_sid * @param string $conferenceSid The conference_sid */ 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 show recordings on the given date. Should be formatted as YYYY-MM-DD. You can also specify inequalities * * @param string $dateCreatedBefore Filter by date created * @return $this Fluent Builder */ public function setDateCreatedBefore($dateCreatedBefore) { $this->options['dateCreatedBefore'] = $dateCreatedBefore; return $this; } /** * Only show recordings on the given date. Should be formatted as YYYY-MM-DD. You can also specify inequalities * * @param string $dateCreated Filter by date created * @return $this Fluent Builder */ public function setDateCreated($dateCreated) { $this->options['dateCreated'] = $dateCreated; return $this; } /** * Only show recordings on the given date. Should be formatted as YYYY-MM-DD. You can also specify inequalities * * @param string $dateCreatedAfter Filter by date created * @return $this Fluent Builder */ public function setDateCreatedAfter($dateCreatedAfter) { $this->options['dateCreatedAfter'] = $dateCreatedAfter; return $this; } /** * Only show recordings made during the call given by the indicated sid * * @param string $callSid Filter by call_sid * @return $this Fluent Builder */ public function setCallSid($callSid) { $this->options['callSid'] = $callSid; return $this; } /** * The conference_sid * * @param string $conferenceSid The conference_sid * @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/Twilio/Rest/Api/V2010/Account/SigningKeyPage.php 0000604 00000001377 15174325132 0015712 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/Twilio/Rest/Api/V2010/Account/ShortCodePage.php 0000604 00000001374 15174325132 0015532 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/Twilio/Rest/Api/V2010/Account/KeyContext.php 0000604 00000005035 15174325132 0015136 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; 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 account_sid * @param string $sid The sid * @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 */ 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 */ 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 */ 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/Twilio/Rest/Api/V2010/Account/NotificationInstance.php 0000604 00000011452 15174325132 0017154 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 unique sid that identifies this account * @param string $sid Fetch by unique notification Sid * @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'), 'sid' => Values::array_get($payload, 'sid'), 'uri' => Values::array_get($payload, 'uri'), 'requestVariables' => Values::array_get($payload, 'request_variables'), 'responseBody' => Values::array_get($payload, 'response_body'), 'responseHeaders' => Values::array_get($payload, 'response_headers'), ); $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 */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the NotificationInstance * * @return boolean True if delete succeeds, false otherwise */ 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/Twilio/Rest/Api/V2010/Account/Queue/MemberInstance.php 0000604 00000007360 15174325132 0017024 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\Values; use Twilio\Version; /** * @property string callSid * @property \DateTime dateEnqueued * @property integer position * @property string uri * @property integer waitTime */ 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 account_sid * @param string $queueSid A string that uniquely identifies this queue * @param string $callSid The call_sid * @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'), ); $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 */ public function fetch() { return $this->proxy()->fetch(); } /** * Update the MemberInstance * * @param string $url The url * @param string $method The method * @return MemberInstance Updated MemberInstance */ public function update($url, $method) { return $this->proxy()->update($url, $method); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (property_exists($this, '_' . $name)) { $method = 'get' . ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide 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/Twilio/Rest/Api/V2010/Account/Queue/MemberContext.php 0000604 00000005101 15174325132 0016673 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Queue; use Twilio\InstanceContext; 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 account_sid * @param string $queueSid The Queue in which to find the members * @param string $callSid The call_sid * @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 */ 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 url * @param string $method The method * @return MemberInstance Updated MemberInstance */ public function update($url, $method) { $data = Values::of(array('Url' => $url, 'Method' => $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/Twilio/Rest/Api/V2010/Account/Queue/MemberList.php 0000604 00000012004 15174325132 0016162 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 account_sid * @param string $queueSid A string that uniquely identifies this queue * @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 * @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/Twilio/Rest/Api/V2010/Account/Queue/MemberPage.php 0000604 00000001520 15174325132 0016124 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/Twilio/Rest/Api/V2010/Account/NewKeyPage.php 0000604 00000001363 15174325132 0015040 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/Twilio/Rest/Api/V2010/Account/Recording/TranscriptionInstance.php 0000604 00000010674 15174325132 0021306 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 account_sid * @param string $recordingSid The recording_sid * @param string $sid The sid * @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 */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the TranscriptionInstance * * @return boolean True if delete succeeds, false otherwise */ 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/Twilio/Rest/Api/V2010/Account/Recording/AddOnResultContext.php 0000604 00000010130 15174325132 0020476 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 account_sid * @param string $referenceSid The reference_sid * @param string $sid Fetch by unique result Sid * @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 */ 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 */ 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 \Twilio\Exceptions\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 \Twilio\Exceptions\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/Twilio/Rest/Api/V2010/Account/Recording/AddOnResultInstance.php 0000604 00000011317 15174325132 0020626 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 unique sid that identifies this account * @param string $referenceSid A string that uniquely identifies the recording. * @param string $sid Fetch by unique result Sid * @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 */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the AddOnResultInstance * * @return boolean True if delete succeeds, false otherwise */ 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/Twilio/Rest/Api/V2010/Account/Recording/AddOnResult/PayloadList.php 0000604 00000012633 15174325132 0021370 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 unique sid that identifies this account * @param string $referenceSid A string that uniquely identifies the recording. * @param string $addOnResultSid A string that uniquely identifies the result * @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 Fetch by unique payload Sid * @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/Twilio/Rest/Api/V2010/Account/Recording/AddOnResult/PayloadPage.php 0000604 00000001626 15174325132 0021331 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/Twilio/Rest/Api/V2010/Account/Recording/AddOnResult/PayloadContext.php 0000604 00000004670 15174325132 0022103 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Recording\AddOnResult; 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 account_sid * @param string $referenceSid The reference_sid * @param string $addOnResultSid The add_on_result_sid * @param string $sid Fetch by unique payload Sid * @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 */ 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 */ 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/Twilio/Rest/Api/V2010/Account/Recording/AddOnResult/PayloadInstance.php 0000604 00000011116 15174325132 0022214 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 unique sid that identifies this account * @param string $referenceSid A string that uniquely identifies the recording. * @param string $addOnResultSid A string that uniquely identifies the result * @param string $sid Fetch by unique payload Sid * @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 */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the PayloadInstance * * @return boolean True if delete succeeds, false otherwise */ 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/Twilio/Rest/Api/V2010/Account/Recording/TranscriptionContext.php 0000604 00000004274 15174325132 0021165 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Recording; 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 account_sid * @param string $recordingSid The recording_sid * @param string $sid The sid * @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 */ 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 */ 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/Twilio/Rest/Api/V2010/Account/Recording/TranscriptionList.php 0000604 00000012167 15174325132 0020454 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 account_sid * @param string $recordingSid The recording_sid * @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 sid * @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/Twilio/Rest/Api/V2010/Account/Recording/AddOnResultPage.php 0000604 00000001547 15174325132 0017742 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/Twilio/Rest/Api/V2010/Account/Recording/TranscriptionPage.php 0000604 00000001555 15174325132 0020414 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/Twilio/Rest/Api/V2010/Account/Recording/AddOnResultList.php 0000604 00000012243 15174325132 0017774 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 unique sid that identifies this account * @param string $referenceSid A string that uniquely identifies the recording. * @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 Fetch by unique result Sid * @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/Twilio/Rest/Api/V2010/Account/Address/DependentPhoneNumberPage.php 0000604 00000001576 15174325132 0021302 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/Twilio/Rest/Api/V2010/Account/Address/DependentPhoneNumberInstance.php 0000604 00000011317 15174325132 0022164 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 boolean 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 account_sid * @param string $addressSid The sid * @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/Twilio/Rest/Api/V2010/Account/Address/DependentPhoneNumberList.php 0000604 00000011466 15174325132 0021340 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 account_sid * @param string $addressSid The sid * @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/Twilio/Rest/Api/V2010/Account/KeyInstance.php 0000604 00000007253 15174325132 0015262 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 sid * @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 */ public function fetch() { return $this->proxy()->fetch(); } /** * Update the KeyInstance * * @param array|Options $options Optional Arguments * @return KeyInstance Updated KeyInstance */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Deletes the KeyInstance * * @return boolean True if delete succeeds, false otherwise */ 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/Twilio/Rest/Api/V2010/Account/MessagePage.php 0000604 00000001366 15174325132 0015225 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/Twilio/Rest/Api/V2010/Account/KeyOptions.php 0000604 00000002615 15174325132 0015146 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 The friendly_name * @return UpdateKeyOptions Options builder */ public static function update($friendlyName = Values::NONE) { return new UpdateKeyOptions($friendlyName); } } class UpdateKeyOptions 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.UpdateKeyOptions ' . implode(' ', $options) . ']'; } } sdk/Twilio/Rest/Api/V2010/Account/AuthorizedConnectAppContext.php 0000604 00000003612 15174325132 0020476 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; 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 account_sid * @param string $connectAppSid The connect_app_sid * @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 */ 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/Twilio/Rest/Api/V2010/Account/RecordingContext.php 0000604 00000011071 15174325132 0016317 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 account_sid * @param string $sid Fetch by unique recording Sid * @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 */ 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 */ 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 \Twilio\Exceptions\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 \Twilio\Exceptions\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/Twilio/Rest/Api/V2010/Account/AddressList.php 0000604 00000015074 15174325132 0015266 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 AddressList extends ListResource { /** * Construct the AddressList * * @param Version $version Version that contains the resource * @param string $accountSid The account_sid * @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 customer_name * @param string $street The street * @param string $city The city * @param string $region The region * @param string $postalCode The postal_code * @param string $isoCountry The iso_country * @param array|Options $options Optional Arguments * @return AddressInstance Newly created AddressInstance */ 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 sid * @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/Twilio/Rest/Api/V2010/Account/Message/MediaList.php 0000604 00000013163 15174325132 0016301 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 unique sid that identifies this account * @param string $messageSid A string that uniquely identifies this message * @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 Fetch by unique media Sid * @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/Twilio/Rest/Api/V2010/Account/Message/FeedbackPage.php 0000604 00000001532 15174325132 0016704 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/Twilio/Rest/Api/V2010/Account/Message/FeedbackInstance.php 0000604 00000004637 15174325132 0017605 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 account_sid * @param string $messageSid The message_sid * @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/Twilio/Rest/Api/V2010/Account/Message/MediaPage.php 0000604 00000001521 15174325132 0016235 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/Twilio/Rest/Api/V2010/Account/Message/MediaInstance.php 0000604 00000007627 15174325132 0017142 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 unique sid that identifies this account * @param string $messageSid A string that uniquely identifies this message * @param string $sid Fetch by unique media Sid * @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 */ public function delete() { return $this->proxy()->delete(); } /** * Fetch a MediaInstance * * @return MediaInstance Fetched MediaInstance */ 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/Twilio/Rest/Api/V2010/Account/Message/FeedbackList.php 0000604 00000003453 15174325132 0016747 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\Values; use Twilio\Version; class FeedbackList extends ListResource { /** * Construct the FeedbackList * * @param Version $version Version that contains the resource * @param string $accountSid The account_sid * @param string $messageSid The message_sid * @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 */ 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/Twilio/Rest/Api/V2010/Account/Message/FeedbackOptions.php 0000604 00000002532 15174325132 0017464 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 The outcome * @return CreateFeedbackOptions Options builder */ public static function create($outcome = Values::NONE) { return new CreateFeedbackOptions($outcome); } } class CreateFeedbackOptions extends Options { /** * @param string $outcome The outcome */ public function __construct($outcome = Values::NONE) { $this->options['outcome'] = $outcome; } /** * The outcome * * @param string $outcome The outcome * @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/Twilio/Rest/Api/V2010/Account/Message/MediaContext.php 0000604 00000004151 15174325132 0017007 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Message; 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 account_sid * @param string $messageSid The message_sid * @param string $sid Fetch by unique media Sid * @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 */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Fetch a MediaInstance * * @return MediaInstance Fetched MediaInstance */ 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/Twilio/Rest/Api/V2010/Account/Message/MediaOptions.php 0000604 00000005352 15174325132 0017022 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 Filter by date created * @param string $dateCreated Filter by date created * @param string $dateCreatedAfter Filter by date created * @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 Filter by date created * @param string $dateCreated Filter by date created * @param string $dateCreatedAfter Filter by date created */ 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 show media created on the given date, or before/after using date inequalities. * * @param string $dateCreatedBefore Filter by date created * @return $this Fluent Builder */ public function setDateCreatedBefore($dateCreatedBefore) { $this->options['dateCreatedBefore'] = $dateCreatedBefore; return $this; } /** * Only show media created on the given date, or before/after using date inequalities. * * @param string $dateCreated Filter by date created * @return $this Fluent Builder */ public function setDateCreated($dateCreated) { $this->options['dateCreated'] = $dateCreated; return $this; } /** * Only show media created on the given date, or before/after using date inequalities. * * @param string $dateCreatedAfter Filter by date created * @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/Twilio/Rest/Api/V2010/Account/NewSigningKeyPage.php 0000604 00000001410 15174325132 0016350 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/Twilio/Rest/Api/V2010/Account/ConferenceInstance.php 0000604 00000010571 15174325132 0016576 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; /** * Initialize the ConferenceInstance * * @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 $sid Fetch by unique conference Sid * @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 */ public function fetch() { return $this->proxy()->fetch(); } /** * Update the ConferenceInstance * * @param array|Options $options Optional Arguments * @return ConferenceInstance Updated ConferenceInstance */ 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; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (property_exists($this, '_' . $name)) { $method = 'get' . ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide 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/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountryPage.php 0000604 00000001540 15174325132 0021242 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/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumberContext.php 0000604 00000013770 15174325132 0020321 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 account_sid * @param string $sid Fetch by unique incoming-phone-number Sid * @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 */ 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'], )); $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 */ 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 */ 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 \Twilio\Exceptions\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 \Twilio\Exceptions\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/Twilio/Rest/Api/V2010/Account/MessageContext.php 0000604 00000011416 15174325132 0015772 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 account_sid * @param string $sid Fetch by unique message Sid * @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 */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Fetch a MessageInstance * * @return MessageInstance Fetched MessageInstance */ 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 body * @return MessageInstance Updated MessageInstance */ 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 \Twilio\Exceptions\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 \Twilio\Exceptions\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/Twilio/Rest/Api/V2010/Account/NotificationOptions.php 0000604 00000006277 15174325132 0017054 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 integer $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 integer $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 show notifications for this log level * * @param integer $log Filter by log level * @return $this Fluent Builder */ public function setLog($log) { $this->options['log'] = $log; return $this; } /** * Only show notifications for this date. Should be formatted as YYYY-MM-DD. You can also specify inequalities. * * @param string $messageDateBefore Filter by date * @return $this Fluent Builder */ public function setMessageDateBefore($messageDateBefore) { $this->options['messageDateBefore'] = $messageDateBefore; return $this; } /** * Only show notifications for this date. Should be formatted as YYYY-MM-DD. You can also specify inequalities. * * @param string $messageDate Filter by date * @return $this Fluent Builder */ public function setMessageDate($messageDate) { $this->options['messageDate'] = $messageDate; return $this; } /** * Only show notifications for this date. Should be formatted as YYYY-MM-DD. You can also specify inequalities. * * @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/Twilio/Rest/Api/V2010/Account/ConnectAppInstance.php 0000604 00000010421 15174325132 0016553 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 unique sid that identifies this account * @param string $sid Fetch by unique connect-app Sid * @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 */ public function fetch() { return $this->proxy()->fetch(); } /** * Update the ConnectAppInstance * * @param array|Options $options Optional Arguments * @return ConnectAppInstance Updated ConnectAppInstance */ 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.ConnectAppInstance ' . implode(' ', $context) . ']'; } } sdk/Twilio/Rest/Api/V2010/Account/ApplicationOptions.php 0000604 00000056271 15174325132 0016670 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 * @param string $voiceUrl URL Twilio will make requests to when relieving a * call * @param string $voiceMethod HTTP method to use with the URL * @param string $voiceFallbackUrl Fallback URL * @param string $voiceFallbackMethod HTTP method to use with the fallback url * @param string $statusCallback URL to hit with status updates * @param string $statusCallbackMethod HTTP method to use with the status * callback * @param boolean $voiceCallerIdLookup True or False * @param string $smsUrl URL Twilio will request when receiving an SMS * @param string $smsMethod HTTP method to use with sms_url * @param string $smsFallbackUrl Fallback URL if there's an error parsing TwiML * @param string $smsFallbackMethod HTTP method to use with sms_fallback_method * @param string $smsStatusCallback URL Twilio with request with status updates * @param string $messageStatusCallback URL to make requests to with status * updates * @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) { return new CreateApplicationOptions($apiVersion, $voiceUrl, $voiceMethod, $voiceFallbackUrl, $voiceFallbackMethod, $statusCallback, $statusCallbackMethod, $voiceCallerIdLookup, $smsUrl, $smsMethod, $smsFallbackUrl, $smsFallbackMethod, $smsStatusCallback, $messageStatusCallback); } /** * @param string $friendlyName Filter by friendly name * @return ReadApplicationOptions Options builder */ public static function read($friendlyName = Values::NONE) { return new ReadApplicationOptions($friendlyName); } /** * @param string $friendlyName Human readable description of this resource * @param string $apiVersion The API version to use * @param string $voiceUrl URL Twilio will make requests to when relieving a * call * @param string $voiceMethod HTTP method to use with the URL * @param string $voiceFallbackUrl Fallback URL * @param string $voiceFallbackMethod HTTP method to use with the fallback url * @param string $statusCallback URL to hit with status updates * @param string $statusCallbackMethod HTTP method to use with the status * callback * @param boolean $voiceCallerIdLookup True or False * @param string $smsUrl URL Twilio will request when receiving an SMS * @param string $smsMethod HTTP method to use with sms_url * @param string $smsFallbackUrl Fallback URL if there's an error parsing TwiML * @param string $smsFallbackMethod HTTP method to use with sms_fallback_method * @param string $smsStatusCallback URL Twilio with request with status updates * @param string $messageStatusCallback URL to make requests to with status * updates * @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 * @param string $voiceUrl URL Twilio will make requests to when relieving a * call * @param string $voiceMethod HTTP method to use with the URL * @param string $voiceFallbackUrl Fallback URL * @param string $voiceFallbackMethod HTTP method to use with the fallback url * @param string $statusCallback URL to hit with status updates * @param string $statusCallbackMethod HTTP method to use with the status * callback * @param boolean $voiceCallerIdLookup True or False * @param string $smsUrl URL Twilio will request when receiving an SMS * @param string $smsMethod HTTP method to use with sms_url * @param string $smsFallbackUrl Fallback URL if there's an error parsing TwiML * @param string $smsFallbackMethod HTTP method to use with sms_fallback_method * @param string $smsStatusCallback URL Twilio with request with status updates * @param string $messageStatusCallback URL to make requests to with status * updates */ 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) { $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; } /** * Requests to this application will start a new TwiML session with this API version. * * @param string $apiVersion The API version to use * @return $this Fluent Builder */ public function setApiVersion($apiVersion) { $this->options['apiVersion'] = $apiVersion; return $this; } /** * The URL Twilio will request when a phone number assigned to this application receives a call. * * @param string $voiceUrl URL Twilio will make requests to when relieving a * call * @return $this Fluent Builder */ public function setVoiceUrl($voiceUrl) { $this->options['voiceUrl'] = $voiceUrl; return $this; } /** * The HTTP method Twilio will use when requesting the above `Url`. Either `GET` or `POST`. * * @param string $voiceMethod HTTP method to use with the URL * @return $this Fluent Builder */ public function setVoiceMethod($voiceMethod) { $this->options['voiceMethod'] = $voiceMethod; return $this; } /** * The URL that Twilio will request if an error occurs retrieving or executing the TwiML requested by `Url`. * * @param string $voiceFallbackUrl Fallback URL * @return $this Fluent Builder */ public function setVoiceFallbackUrl($voiceFallbackUrl) { $this->options['voiceFallbackUrl'] = $voiceFallbackUrl; return $this; } /** * The HTTP method Twilio will use when requesting the `VoiceFallbackUrl`. Either `GET` or `POST`. * * @param string $voiceFallbackMethod HTTP method to use with the fallback url * @return $this Fluent Builder */ public function setVoiceFallbackMethod($voiceFallbackMethod) { $this->options['voiceFallbackMethod'] = $voiceFallbackMethod; return $this; } /** * The URL that Twilio will request to pass status parameters (such as call ended) to your application. * * @param string $statusCallback URL to hit with status updates * @return $this Fluent Builder */ public function setStatusCallback($statusCallback) { $this->options['statusCallback'] = $statusCallback; return $this; } /** * The HTTP method Twilio will use to make requests to the `StatusCallback` URL. Either `GET` or `POST`. * * @param string $statusCallbackMethod HTTP method to use with the status * callback * @return $this Fluent Builder */ public function setStatusCallbackMethod($statusCallbackMethod) { $this->options['statusCallbackMethod'] = $statusCallbackMethod; return $this; } /** * Look up the caller's caller-ID name from the CNAM database (additional charges apply). Either `true` or `false`. * * @param boolean $voiceCallerIdLookup True or False * @return $this Fluent Builder */ public function setVoiceCallerIdLookup($voiceCallerIdLookup) { $this->options['voiceCallerIdLookup'] = $voiceCallerIdLookup; return $this; } /** * The URL Twilio will request when a phone number assigned to this application receives an incoming SMS message. * * @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 Twilio will use when making requests to the `SmsUrl`. Either `GET` or `POST`. * * @param string $smsMethod HTTP method to use with sms_url * @return $this Fluent Builder */ public function setSmsMethod($smsMethod) { $this->options['smsMethod'] = $smsMethod; return $this; } /** * The URL that Twilio will request if an error occurs retrieving or executing the TwiML from `SmsUrl`. * * @param string $smsFallbackUrl Fallback URL if there's an error parsing TwiML * @return $this Fluent Builder */ public function setSmsFallbackUrl($smsFallbackUrl) { $this->options['smsFallbackUrl'] = $smsFallbackUrl; return $this; } /** * The HTTP method Twilio will use when requesting the above URL. Either `GET` or `POST`. * * @param string $smsFallbackMethod HTTP method to use with sms_fallback_method * @return $this Fluent Builder */ public function setSmsFallbackMethod($smsFallbackMethod) { $this->options['smsFallbackMethod'] = $smsFallbackMethod; return $this; } /** * The URL that Twilio will `POST` to when a message is sent via the `/SMS/Messages` endpoint if you specify the `Sid` of this application on an outgoing SMS request. * * @param string $smsStatusCallback URL Twilio with request with status updates * @return $this Fluent Builder */ public function setSmsStatusCallback($smsStatusCallback) { $this->options['smsStatusCallback'] = $smsStatusCallback; return $this; } /** * Twilio will make a `POST` request to this URL to pass status parameters (such as sent or failed) to your application if you use the `/Messages` endpoint to send the message and specify this application's `Sid` as the `ApplicationSid` on an outgoing SMS request. * * @param string $messageStatusCallback URL to make requests to with status * updates * @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.CreateApplicationOptions ' . implode(' ', $options) . ']'; } } class ReadApplicationOptions extends Options { /** * @param string $friendlyName Filter by friendly name */ public function __construct($friendlyName = Values::NONE) { $this->options['friendlyName'] = $friendlyName; } /** * Only return application resources with friendly names that match exactly with this name * * @param string $friendlyName Filter by 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.ReadApplicationOptions ' . implode(' ', $options) . ']'; } } class UpdateApplicationOptions extends Options { /** * @param string $friendlyName Human readable description of this resource * @param string $apiVersion The API version to use * @param string $voiceUrl URL Twilio will make requests to when relieving a * call * @param string $voiceMethod HTTP method to use with the URL * @param string $voiceFallbackUrl Fallback URL * @param string $voiceFallbackMethod HTTP method to use with the fallback url * @param string $statusCallback URL to hit with status updates * @param string $statusCallbackMethod HTTP method to use with the status * callback * @param boolean $voiceCallerIdLookup True or False * @param string $smsUrl URL Twilio will request when receiving an SMS * @param string $smsMethod HTTP method to use with sms_url * @param string $smsFallbackUrl Fallback URL if there's an error parsing TwiML * @param string $smsFallbackMethod HTTP method to use with sms_fallback_method * @param string $smsStatusCallback URL Twilio with request with status updates * @param string $messageStatusCallback URL to make requests to with status * updates */ 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 human readable descriptive text for this resource, up to 64 characters long. * * @param string $friendlyName Human readable description of this resource * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * Requests to this application will start a new TwiML session with this API version. * * @param string $apiVersion The API version to use * @return $this Fluent Builder */ public function setApiVersion($apiVersion) { $this->options['apiVersion'] = $apiVersion; return $this; } /** * The URL Twilio will request when a phone number assigned to this application receives a call. * * @param string $voiceUrl URL Twilio will make requests to when relieving a * call * @return $this Fluent Builder */ public function setVoiceUrl($voiceUrl) { $this->options['voiceUrl'] = $voiceUrl; return $this; } /** * The HTTP method Twilio will use when requesting the above `Url`. Either `GET` or `POST`. * * @param string $voiceMethod HTTP method to use with the URL * @return $this Fluent Builder */ public function setVoiceMethod($voiceMethod) { $this->options['voiceMethod'] = $voiceMethod; return $this; } /** * The URL that Twilio will request if an error occurs retrieving or executing the TwiML requested by `Url`. * * @param string $voiceFallbackUrl Fallback URL * @return $this Fluent Builder */ public function setVoiceFallbackUrl($voiceFallbackUrl) { $this->options['voiceFallbackUrl'] = $voiceFallbackUrl; return $this; } /** * The HTTP method Twilio will use when requesting the `VoiceFallbackUrl`. Either `GET` or `POST`. * * @param string $voiceFallbackMethod HTTP method to use with the fallback url * @return $this Fluent Builder */ public function setVoiceFallbackMethod($voiceFallbackMethod) { $this->options['voiceFallbackMethod'] = $voiceFallbackMethod; return $this; } /** * The URL that Twilio will request to pass status parameters (such as call ended) to your application. * * @param string $statusCallback URL to hit with status updates * @return $this Fluent Builder */ public function setStatusCallback($statusCallback) { $this->options['statusCallback'] = $statusCallback; return $this; } /** * The HTTP method Twilio will use to make requests to the `StatusCallback` URL. Either `GET` or `POST`. * * @param string $statusCallbackMethod HTTP method to use with the status * callback * @return $this Fluent Builder */ public function setStatusCallbackMethod($statusCallbackMethod) { $this->options['statusCallbackMethod'] = $statusCallbackMethod; return $this; } /** * Look up the caller's caller-ID name from the CNAM database (additional charges apply). Either `true` or `false`. * * @param boolean $voiceCallerIdLookup True or False * @return $this Fluent Builder */ public function setVoiceCallerIdLookup($voiceCallerIdLookup) { $this->options['voiceCallerIdLookup'] = $voiceCallerIdLookup; return $this; } /** * The URL Twilio will request when a phone number assigned to this application receives an incoming SMS message. * * @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 Twilio will use when making requests to the `SmsUrl`. Either `GET` or `POST`. * * @param string $smsMethod HTTP method to use with sms_url * @return $this Fluent Builder */ public function setSmsMethod($smsMethod) { $this->options['smsMethod'] = $smsMethod; return $this; } /** * The URL that Twilio will request if an error occurs retrieving or executing the TwiML from `SmsUrl`. * * @param string $smsFallbackUrl Fallback URL if there's an error parsing TwiML * @return $this Fluent Builder */ public function setSmsFallbackUrl($smsFallbackUrl) { $this->options['smsFallbackUrl'] = $smsFallbackUrl; return $this; } /** * The HTTP method Twilio will use when requesting the above URL. Either `GET` or `POST`. * * @param string $smsFallbackMethod HTTP method to use with sms_fallback_method * @return $this Fluent Builder */ public function setSmsFallbackMethod($smsFallbackMethod) { $this->options['smsFallbackMethod'] = $smsFallbackMethod; return $this; } /** * The URL that Twilio will `POST` to when a message is sent via the `/SMS/Messages` endpoint if you specify the `Sid` of this application on an outgoing SMS request. * * @param string $smsStatusCallback URL Twilio with request with status updates * @return $this Fluent Builder */ public function setSmsStatusCallback($smsStatusCallback) { $this->options['smsStatusCallback'] = $smsStatusCallback; return $this; } /** * Twilio will make a `POST` request to this URL to pass status parameters (such as sent or failed) to your application if you use the `/Messages` endpoint to send the message and specify this application's `Sid` as the `ApplicationSid` on an outgoing SMS request. * * @param string $messageStatusCallback URL to make requests to with status * updates * @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/Twilio/Rest/Api/V2010/Account/Call/FeedbackPage.php 0000604 00000001524 15174325132 0016174 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/Twilio/Rest/Api/V2010/Account/Call/NotificationPage.php 0000604 00000001540 15174325132 0017134 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/Twilio/Rest/Api/V2010/Account/Call/NotificationOptions.php 0000604 00000005573 15174325132 0017725 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 integer $log The log * @param string $messageDateBefore The message_date * @param string $messageDate The message_date * @param string $messageDateAfter The message_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 integer $log The log * @param string $messageDateBefore The message_date * @param string $messageDate The message_date * @param string $messageDateAfter The message_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; } /** * The log * * @param integer $log The log * @return $this Fluent Builder */ public function setLog($log) { $this->options['log'] = $log; return $this; } /** * The message_date * * @param string $messageDateBefore The message_date * @return $this Fluent Builder */ public function setMessageDateBefore($messageDateBefore) { $this->options['messageDateBefore'] = $messageDateBefore; return $this; } /** * The message_date * * @param string $messageDate The message_date * @return $this Fluent Builder */ public function setMessageDate($messageDate) { $this->options['messageDate'] = $messageDate; return $this; } /** * The message_date * * @param string $messageDateAfter The message_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/Twilio/Rest/Api/V2010/Account/Call/RecordingInstance.php 0000604 00000011427 15174325132 0017317 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 string conferenceSid * @property \DateTime dateCreated * @property \DateTime dateUpdated * @property string duration * @property string sid * @property string price * @property string uri * @property array encryptionDetails * @property string priceUnit * @property string status * @property integer channels * @property string source * @property integer 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 account_sid * @param string $callSid The call_sid * @param string $sid The sid * @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')), '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; } /** * Fetch a RecordingInstance * * @return RecordingInstance Fetched RecordingInstance */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the RecordingInstance * * @return boolean True if delete succeeds, false otherwise */ 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/Twilio/Rest/Api/V2010/Account/Call/NotificationContext.php 0000604 00000004200 15174325132 0017700 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Call; 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 account_sid * @param string $callSid The call_sid * @param string $sid The sid * @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 */ 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 */ 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/Twilio/Rest/Api/V2010/Account/Call/FeedbackList.php 0000604 00000002472 15174325132 0016236 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 account_sid * @param string $callSid A 34 character string that uniquely 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/Twilio/Rest/Api/V2010/Account/Call/FeedbackSummaryOptions.php 0000604 00000005327 15174325132 0020336 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 boolean $includeSubaccounts The include_subaccounts * @param string $statusCallback The status_callback * @param string $statusCallbackMethod The status_callback_method * @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 boolean $includeSubaccounts The include_subaccounts * @param string $statusCallback The status_callback * @param string $statusCallbackMethod The status_callback_method */ public function __construct($includeSubaccounts = Values::NONE, $statusCallback = Values::NONE, $statusCallbackMethod = Values::NONE) { $this->options['includeSubaccounts'] = $includeSubaccounts; $this->options['statusCallback'] = $statusCallback; $this->options['statusCallbackMethod'] = $statusCallbackMethod; } /** * The include_subaccounts * * @param boolean $includeSubaccounts The include_subaccounts * @return $this Fluent Builder */ public function setIncludeSubaccounts($includeSubaccounts) { $this->options['includeSubaccounts'] = $includeSubaccounts; return $this; } /** * The status_callback * * @param string $statusCallback The status_callback * @return $this Fluent Builder */ public function setStatusCallback($statusCallback) { $this->options['statusCallback'] = $statusCallback; return $this; } /** * The status_callback_method * * @param string $statusCallbackMethod The status_callback_method * @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/Twilio/Rest/Api/V2010/Account/Call/NotificationList.php 0000604 00000013227 15174325132 0017200 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 account_sid * @param string $callSid The call_sid * @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 sid * @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/Twilio/Rest/Api/V2010/Account/Call/FeedbackSummaryContext.php 0000604 00000004012 15174325132 0020315 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Call; 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 account_sid * @param string $sid The sid * @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 */ 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 */ 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/Twilio/Rest/Api/V2010/Account/Call/NotificationInstance.php 0000604 00000011765 15174325132 0020036 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 account_sid * @param string $callSid The call_sid * @param string $sid The sid * @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'), 'sid' => Values::array_get($payload, 'sid'), 'uri' => Values::array_get($payload, 'uri'), 'requestVariables' => Values::array_get($payload, 'request_variables'), 'responseBody' => Values::array_get($payload, 'response_body'), 'responseHeaders' => Values::array_get($payload, 'response_headers'), ); $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 */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the NotificationInstance * * @return boolean True if delete succeeds, false otherwise */ 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/Twilio/Rest/Api/V2010/Account/Call/FeedbackSummaryInstance.php 0000604 00000011455 15174325132 0020446 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 integer callCount * @property integer callFeedbackCount * @property \DateTime dateCreated * @property \DateTime dateUpdated * @property \DateTime endDate * @property boolean 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 unique id of the Account responsible for * creating this Call * @param string $sid The sid * @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 */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the FeedbackSummaryInstance * * @return boolean True if delete succeeds, false otherwise */ 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/Twilio/Rest/Api/V2010/Account/Call/RecordingOptions.php 0000604 00000004774 15174325132 0017215 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 $dateCreatedBefore The date_created * @param string $dateCreated The date_created * @param string $dateCreatedAfter The date_created * @return ReadRecordingOptions Options builder */ public static function read($dateCreatedBefore = Values::NONE, $dateCreated = Values::NONE, $dateCreatedAfter = Values::NONE) { return new ReadRecordingOptions($dateCreatedBefore, $dateCreated, $dateCreatedAfter); } } class ReadRecordingOptions extends Options { /** * @param string $dateCreatedBefore The date_created * @param string $dateCreated The date_created * @param string $dateCreatedAfter The date_created */ 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 * * @param string $dateCreatedBefore The date_created * @return $this Fluent Builder */ public function setDateCreatedBefore($dateCreatedBefore) { $this->options['dateCreatedBefore'] = $dateCreatedBefore; return $this; } /** * The date_created * * @param string $dateCreated The date_created * @return $this Fluent Builder */ public function setDateCreated($dateCreated) { $this->options['dateCreated'] = $dateCreated; return $this; } /** * The date_created * * @param string $dateCreatedAfter The date_created * @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/Twilio/Rest/Api/V2010/Account/Call/FeedbackContext.php 0000604 00000006743 15174325132 0016754 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Call; 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 account_sid * @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 integer $qualityScore The quality_score * @param array|Options $options Optional Arguments * @return FeedbackInstance Newly created FeedbackInstance */ 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 */ 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 integer $qualityScore An integer from 1 to 5 * @param array|Options $options Optional Arguments * @return FeedbackInstance Updated FeedbackInstance */ 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/Twilio/Rest/Api/V2010/Account/Call/FeedbackOptions.php 0000604 00000004770 15174325132 0016761 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 The issue * @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 The issue */ public function __construct($issue = Values::NONE) { $this->options['issue'] = $issue; } /** * The issue * * @param string $issue The issue * @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 of the issues experienced during the call * * @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/Twilio/Rest/Api/V2010/Account/Call/RecordingContext.php 0000604 00000004142 15174325132 0017173 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account\Call; 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 $accountSid The account_sid * @param string $callSid The call_sid * @param string $sid The sid * @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'; } /** * Fetch a RecordingInstance * * @return RecordingInstance Fetched RecordingInstance */ 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 */ 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/Twilio/Rest/Api/V2010/Account/Call/RecordingPage.php 0000604 00000001527 15174325132 0016427 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/Twilio/Rest/Api/V2010/Account/Call/FeedbackSummaryPage.php 0000604 00000001423 15174325132 0017550 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/Twilio/Rest/Api/V2010/Account/Call/FeedbackInstance.php 0000604 00000010301 15174325132 0017055 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 integer 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 account_sid * @param string $callSid A 34 character string that uniquely 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 integer $qualityScore The quality_score * @param array|Options $options Optional Arguments * @return FeedbackInstance Newly created FeedbackInstance */ public function create($qualityScore, $options = array()) { return $this->proxy()->create($qualityScore, $options); } /** * Fetch a FeedbackInstance * * @return FeedbackInstance Fetched FeedbackInstance */ public function fetch() { return $this->proxy()->fetch(); } /** * Update the FeedbackInstance * * @param integer $qualityScore An integer from 1 to 5 * @param array|Options $options Optional Arguments * @return FeedbackInstance Updated FeedbackInstance */ 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/Twilio/Rest/Api/V2010/Account/Call/RecordingList.php 0000604 00000013076 15174325132 0016470 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 RecordingList extends ListResource { /** * Construct the RecordingList * * @param Version $version Version that contains the resource * @param string $accountSid The account_sid * @param string $callSid The call_sid * @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'; } /** * 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 sid * @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/Twilio/Rest/Api/V2010/Account/Call/FeedbackSummaryList.php 0000604 00000004753 15174325132 0017620 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 FeedbackSummaryList extends ListResource { /** * Construct the FeedbackSummaryList * * @param Version $version Version that contains the resource * @param string $accountSid The unique id of the Account responsible for * creating this Call * @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 The start_date * @param \DateTime $endDate The end_date * @param array|Options $options Optional Arguments * @return FeedbackSummaryInstance Newly created FeedbackSummaryInstance */ 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 The sid * @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/Twilio/Rest/Api/V2010/Account/ValidationRequestInstance.php 0000604 00000004314 15174325132 0020170 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 integer 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 account_sid * @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/Twilio/Rest/Api/V2010/Account/ApplicationContext.php 0000604 00000007076 15174325132 0016660 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; 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 account_sid * @param string $sid Fetch by unique Application Sid * @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 */ public function delete() { return $this->version->delete('delete', $this->uri); } /** * Fetch a ApplicationInstance * * @return ApplicationInstance Fetched ApplicationInstance */ 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 */ 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/Twilio/Rest/Api/V2010/Account/ApplicationList.php 0000604 00000015433 15174325132 0016143 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 ApplicationList extends ListResource { /** * Construct the ApplicationList * * @param Version $version Version that contains the resource * @param string $accountSid A string that uniquely identifies this 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 string $friendlyName The friendly_name * @param array|Options $options Optional Arguments * @return ApplicationInstance Newly created ApplicationInstance */ public function create($friendlyName, $options = array()) { $options = new Values($options); $data = Values::of(array( 'FriendlyName' => $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->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 Fetch by unique Application Sid * @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/Twilio/Rest/Api/V2010/Account/AuthorizedConnectAppInstance.php 0000604 00000010404 15174325132 0020613 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 unique sid that identifies this account * @param string $connectAppSid The connect_app_sid * @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 */ 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/Twilio/Rest/Api/V2010/Account/NotificationContext.php 0000604 00000003766 15174325132 0017045 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010\Account; 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 account_sid * @param string $sid Fetch by unique notification Sid * @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 */ 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'] ); } /** * Deletes the NotificationInstance * * @return boolean True if delete succeeds, false otherwise */ 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/Twilio/Rest/Api/V2010/Account/NewKeyOptions.php 0000604 00000002634 15174325132 0015621 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 The friendly_name * @return CreateNewKeyOptions Options builder */ public static function create($friendlyName = Values::NONE) { return new CreateNewKeyOptions($friendlyName); } } class CreateNewKeyOptions 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.CreateNewKeyOptions ' . implode(' ', $options) . ']'; } } sdk/Twilio/Rest/Api/V2010/Account/MessageOptions.php 0000604 00000027676 15174325132 0016020 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 messaging_service_sid * @param string $body The body * @param string $mediaUrl The media_url * @param string $statusCallback URL Twilio will request when the status changes * @param string $applicationSid The application to use for callbacks * @param string $maxPrice The max_price * @param boolean $provideFeedback The provide_feedback * @param integer $validityPeriod The validity_period * @param string $maxRate The max_rate * @param boolean $forceDelivery The force_delivery * @param string $providerSid The provider_sid * @param string $contentRetention The content_retention * @param string $addressRetention The address_retention * @param boolean $smartEncoded The smart_encoded * @return CreateMessageOptions Options builder */ public static function create($from = Values::NONE, $messagingServiceSid = Values::NONE, $body = Values::NONE, $mediaUrl = Values::NONE, $statusCallback = Values::NONE, $applicationSid = Values::NONE, $maxPrice = Values::NONE, $provideFeedback = Values::NONE, $validityPeriod = Values::NONE, $maxRate = Values::NONE, $forceDelivery = Values::NONE, $providerSid = Values::NONE, $contentRetention = Values::NONE, $addressRetention = Values::NONE, $smartEncoded = Values::NONE) { return new CreateMessageOptions($from, $messagingServiceSid, $body, $mediaUrl, $statusCallback, $applicationSid, $maxPrice, $provideFeedback, $validityPeriod, $maxRate, $forceDelivery, $providerSid, $contentRetention, $addressRetention, $smartEncoded); } /** * @param string $to Filter by messages to this number * @param string $from Filter by from number * @param string $dateSentBefore Filter by date sent * @param string $dateSent Filter by date sent * @param string $dateSentAfter Filter by date sent * @return ReadMessageOptions Options builder */ public static function read($to = Values::NONE, $from = Values::NONE, $dateSentBefore = Values::NONE, $dateSent = Values::NONE, $dateSentAfter = Values::NONE) { return new ReadMessageOptions($to, $from, $dateSentBefore, $dateSent, $dateSentAfter); } } class CreateMessageOptions extends Options { /** * @param string $from The phone number that initiated the message * @param string $messagingServiceSid The messaging_service_sid * @param string $body The body * @param string $mediaUrl The media_url * @param string $statusCallback URL Twilio will request when the status changes * @param string $applicationSid The application to use for callbacks * @param string $maxPrice The max_price * @param boolean $provideFeedback The provide_feedback * @param integer $validityPeriod The validity_period * @param string $maxRate The max_rate * @param boolean $forceDelivery The force_delivery * @param string $providerSid The provider_sid * @param string $contentRetention The content_retention * @param string $addressRetention The address_retention * @param boolean $smartEncoded The smart_encoded */ public function __construct($from = Values::NONE, $messagingServiceSid = Values::NONE, $body = Values::NONE, $mediaUrl = Values::NONE, $statusCallback = Values::NONE, $applicationSid = Values::NONE, $maxPrice = Values::NONE, $provideFeedback = Values::NONE, $validityPeriod = Values::NONE, $maxRate = Values::NONE, $forceDelivery = Values::NONE, $providerSid = Values::NONE, $contentRetention = Values::NONE, $addressRetention = Values::NONE, $smartEncoded = Values::NONE) { $this->options['from'] = $from; $this->options['messagingServiceSid'] = $messagingServiceSid; $this->options['body'] = $body; $this->options['mediaUrl'] = $mediaUrl; $this->options['statusCallback'] = $statusCallback; $this->options['applicationSid'] = $applicationSid; $this->options['maxPrice'] = $maxPrice; $this->options['provideFeedback'] = $provideFeedback; $this->options['validityPeriod'] = $validityPeriod; $this->options['maxRate'] = $maxRate; $this->options['forceDelivery'] = $forceDelivery; $this->options['providerSid'] = $providerSid; $this->options['contentRetention'] = $contentRetention; $this->options['addressRetention'] = $addressRetention; $this->options['smartEncoded'] = $smartEncoded; } /** * A Twilio phone number or alphanumeric sender ID enabled for the type of message you wish to send. * * @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 messaging_service_sid * * @param string $messagingServiceSid The messaging_service_sid * @return $this Fluent Builder */ public function setMessagingServiceSid($messagingServiceSid) { $this->options['messagingServiceSid'] = $messagingServiceSid; return $this; } /** * The body * * @param string $body The body * @return $this Fluent Builder */ public function setBody($body) { $this->options['body'] = $body; return $this; } /** * The media_url * * @param string $mediaUrl The media_url * @return $this Fluent Builder */ public function setMediaUrl($mediaUrl) { $this->options['mediaUrl'] = $mediaUrl; return $this; } /** * The URL that Twilio will POST to each time your message status changes * * @param string $statusCallback URL Twilio will request when the status changes * @return $this Fluent Builder */ public function setStatusCallback($statusCallback) { $this->options['statusCallback'] = $statusCallback; return $this; } /** * Twilio the POST MessageSid as well as MessageStatus to the URL in the MessageStatusCallback property of this Application * * @param string $applicationSid The application to use for callbacks * @return $this Fluent Builder */ public function setApplicationSid($applicationSid) { $this->options['applicationSid'] = $applicationSid; return $this; } /** * The max_price * * @param string $maxPrice The max_price * @return $this Fluent Builder */ public function setMaxPrice($maxPrice) { $this->options['maxPrice'] = $maxPrice; return $this; } /** * The provide_feedback * * @param boolean $provideFeedback The provide_feedback * @return $this Fluent Builder */ public function setProvideFeedback($provideFeedback) { $this->options['provideFeedback'] = $provideFeedback; return $this; } /** * The validity_period * * @param integer $validityPeriod The validity_period * @return $this Fluent Builder */ public function setValidityPeriod($validityPeriod) { $this->options['validityPeriod'] = $validityPeriod; return $this; } /** * The max_rate * * @param string $maxRate The max_rate * @return $this Fluent Builder */ public function setMaxRate($maxRate) { $this->options['maxRate'] = $maxRate; return $this; } /** * The force_delivery * * @param boolean $forceDelivery The force_delivery * @return $this Fluent Builder */ public function setForceDelivery($forceDelivery) { $this->options['forceDelivery'] = $forceDelivery; return $this; } /** * The provider_sid * * @param string $providerSid The provider_sid * @return $this Fluent Builder */ public function setProviderSid($providerSid) { $this->options['providerSid'] = $providerSid; return $this; } /** * The content_retention * * @param string $contentRetention The content_retention * @return $this Fluent Builder */ public function setContentRetention($contentRetention) { $this->options['contentRetention'] = $contentRetention; return $this; } /** * The address_retention * * @param string $addressRetention The address_retention * @return $this Fluent Builder */ public function setAddressRetention($addressRetention) { $this->options['addressRetention'] = $addressRetention; return $this; } /** * The smart_encoded * * @param boolean $smartEncoded The smart_encoded * @return $this Fluent Builder */ public function setSmartEncoded($smartEncoded) { $this->options['smartEncoded'] = $smartEncoded; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { $options = array(); foreach ($this->options as $key => $value) { if ($value != Values::NONE) { $options[] = "$key=$value"; } } return '[Twilio.Api.V2010.CreateMessageOptions ' . implode(' ', $options) . ']'; } } class ReadMessageOptions extends Options { /** * @param string $to Filter by messages to this number * @param string $from Filter by from number * @param string $dateSentBefore Filter by date sent * @param string $dateSent Filter by date sent * @param string $dateSentAfter Filter by date sent */ public function __construct($to = Values::NONE, $from = Values::NONE, $dateSentBefore = Values::NONE, $dateSent = Values::NONE, $dateSentAfter = Values::NONE) { $this->options['to'] = $to; $this->options['from'] = $from; $this->options['dateSentBefore'] = $dateSentBefore; $this->options['dateSent'] = $dateSent; $this->options['dateSentAfter'] = $dateSentAfter; } /** * Filter by messages to this number * * @param string $to Filter by messages to this number * @return $this Fluent Builder */ public function setTo($to) { $this->options['to'] = $to; return $this; } /** * Only show messages from this phone number * * @param string $from Filter by from number * @return $this Fluent Builder */ public function setFrom($from) { $this->options['from'] = $from; return $this; } /** * Filter messages sent by this date * * @param string $dateSentBefore Filter by date sent * @return $this Fluent Builder */ public function setDateSentBefore($dateSentBefore) { $this->options['dateSentBefore'] = $dateSentBefore; return $this; } /** * Filter messages sent by this date * * @param string $dateSent Filter by date sent * @return $this Fluent Builder */ public function setDateSent($dateSent) { $this->options['dateSent'] = $dateSent; return $this; } /** * Filter messages sent by this 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/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumberOptions.php 0000604 00000110651 15174325132 0020324 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 new owner of the phone number * @param string $apiVersion The Twilio REST API version to use * @param string $friendlyName A human readable description of this resource * @param string $smsApplicationSid Unique string that identifies the * application * @param string $smsFallbackMethod HTTP method used with sms fallback url * @param string $smsFallbackUrl URL Twilio will request if an error occurs in * executing TwiML * @param string $smsMethod HTTP method to use with sms url * @param string $smsUrl URL Twilio will request when receiving an SMS * @param string $statusCallback URL Twilio will use to pass status parameters * @param string $statusCallbackMethod HTTP method twilio will use with status * callback * @param string $voiceApplicationSid The unique sid of the application to * handle this number * @param boolean $voiceCallerIdLookup Look up the caller's caller-ID * @param string $voiceFallbackMethod HTTP method used with fallback_url * @param string $voiceFallbackUrl URL Twilio will request when an error occurs * in TwiML * @param string $voiceMethod HTTP method used with the voice url * @param string $voiceUrl URL Twilio will request when receiving a call * @param string $emergencyStatus The emergency_status * @param string $emergencyAddressSid The emergency_address_sid * @param string $trunkSid Unique string to identify the trunk * @param string $voiceReceiveMode The voice_receive_mode * @param string $identitySid Unique string that identifies the identity * associated with number * @param string $addressSid Unique string that identifies the address * 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) { 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); } /** * @param boolean $beta Include new phone numbers * @param string $friendlyName Filter by friendly name * @param string $phoneNumber Filter by incoming phone number * @param string $origin The origin * @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 * @param string $areaCode The desired area code for the new number * @param string $apiVersion The Twilio Rest API version to use * @param string $friendlyName A human readable description of this resource * @param string $smsApplicationSid Unique string that identifies the * application * @param string $smsFallbackMethod HTTP method used with sms fallback url * @param string $smsFallbackUrl URL Twilio will request if an error occurs in * executing TwiML * @param string $smsMethod HTTP method to use with sms url * @param string $smsUrl URL Twilio will request when receiving an SMS * @param string $statusCallback URL Twilio will use to pass status parameters * @param string $statusCallbackMethod HTTP method twilio will use with status * callback * @param string $voiceApplicationSid The unique sid of the application to * handle this number * @param boolean $voiceCallerIdLookup Look up the caller's caller-ID * @param string $voiceFallbackMethod HTTP method used with fallback_url * @param string $voiceFallbackUrl URL Twilio will request when an error occurs * in TwiML * @param string $voiceMethod HTTP method used with the voice url * @param string $voiceUrl URL Twilio will request when receiving a call * @param string $emergencyStatus The emergency_status * @param string $emergencyAddressSid The emergency_address_sid * @param string $trunkSid Unique string to identify the trunk * @param string $identitySid Unique string that identifies the identity * associated with number * @param string $addressSid Unique string that identifies the address * 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) { 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); } } class UpdateIncomingPhoneNumberOptions extends Options { /** * @param string $accountSid The new owner of the phone number * @param string $apiVersion The Twilio REST API version to use * @param string $friendlyName A human readable description of this resource * @param string $smsApplicationSid Unique string that identifies the * application * @param string $smsFallbackMethod HTTP method used with sms fallback url * @param string $smsFallbackUrl URL Twilio will request if an error occurs in * executing TwiML * @param string $smsMethod HTTP method to use with sms url * @param string $smsUrl URL Twilio will request when receiving an SMS * @param string $statusCallback URL Twilio will use to pass status parameters * @param string $statusCallbackMethod HTTP method twilio will use with status * callback * @param string $voiceApplicationSid The unique sid of the application to * handle this number * @param boolean $voiceCallerIdLookup Look up the caller's caller-ID * @param string $voiceFallbackMethod HTTP method used with fallback_url * @param string $voiceFallbackUrl URL Twilio will request when an error occurs * in TwiML * @param string $voiceMethod HTTP method used with the voice url * @param string $voiceUrl URL Twilio will request when receiving a call * @param string $emergencyStatus The emergency_status * @param string $emergencyAddressSid The emergency_address_sid * @param string $trunkSid Unique string to identify the trunk * @param string $voiceReceiveMode The voice_receive_mode * @param string $identitySid Unique string that identifies the identity * associated with number * @param string $addressSid Unique string that identifies the address * 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) { $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; } /** * The unique id of the Account to which you wish to transfer this phone number * * @param string $accountSid The new owner of the phone number * @return $this Fluent Builder */ public function setAccountSid($accountSid) { $this->options['accountSid'] = $accountSid; return $this; } /** * Calls to this phone number will start a new TwiML session with this API version. * * @param string $apiVersion The Twilio REST API version to use * @return $this Fluent Builder */ public function setApiVersion($apiVersion) { $this->options['apiVersion'] = $apiVersion; return $this; } /** * A human readable descriptive text for this resource, up to 64 characters long. By default, the `FriendlyName` is a nicely formatted version of the phone number. * * @param string $friendlyName A human readable description of this resource * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The 34 character sid of the application Twilio should use to handle SMSs 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 Unique string that identifies the * application * @return $this Fluent Builder */ public function setSmsApplicationSid($smsApplicationSid) { $this->options['smsApplicationSid'] = $smsApplicationSid; return $this; } /** * The HTTP method Twilio will use when requesting the above URL. Either `GET` or `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 Twilio will request if an error occurs retrieving or executing the TwiML from `SmsUrl`. * * @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 Twilio will use when making requests to the `SmsUrl`. Either `GET` or `POST`. * * @param string $smsMethod HTTP method to use with sms url * @return $this Fluent Builder */ public function setSmsMethod($smsMethod) { $this->options['smsMethod'] = $smsMethod; return $this; } /** * The URL Twilio will request when receiving an incoming SMS message to this number. * * @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 URL that Twilio will request to pass status parameters (such as call ended) to your application. * * @param string $statusCallback URL Twilio will use to pass status parameters * @return $this Fluent Builder */ public function setStatusCallback($statusCallback) { $this->options['statusCallback'] = $statusCallback; return $this; } /** * The HTTP method Twilio will use to make requests to the `StatusCallback` URL. Either `GET` or `POST`. * * @param string $statusCallbackMethod HTTP method twilio will use with status * callback * @return $this Fluent Builder */ public function setStatusCallbackMethod($statusCallbackMethod) { $this->options['statusCallbackMethod'] = $statusCallbackMethod; return $this; } /** * The 34 character sid of the application Twilio should use to handle phone calls to this number. If a `VoiceApplicationSid` is present, Twilio will ignore all of the voice urls above and use those set on the application. Setting a `VoiceApplicationSid` will automatically delete your `TrunkSid` and vice versa. * * @param string $voiceApplicationSid The unique sid of the application to * handle this number * @return $this Fluent Builder */ public function setVoiceApplicationSid($voiceApplicationSid) { $this->options['voiceApplicationSid'] = $voiceApplicationSid; return $this; } /** * Look up the caller's caller-ID name from the CNAM database ($0.01 per look up). Either `true` or `false`. * * @param boolean $voiceCallerIdLookup Look up the caller's caller-ID * @return $this Fluent Builder */ public function setVoiceCallerIdLookup($voiceCallerIdLookup) { $this->options['voiceCallerIdLookup'] = $voiceCallerIdLookup; return $this; } /** * The HTTP method Twilio will use when requesting the `VoiceFallbackUrl`. Either `GET` or `POST`. * * @param string $voiceFallbackMethod HTTP method used with fallback_url * @return $this Fluent Builder */ public function setVoiceFallbackMethod($voiceFallbackMethod) { $this->options['voiceFallbackMethod'] = $voiceFallbackMethod; return $this; } /** * The URL that Twilio will request if an error occurs retrieving or executing the TwiML requested by `Url`. * * @param string $voiceFallbackUrl URL Twilio will request when an error occurs * in TwiML * @return $this Fluent Builder */ public function setVoiceFallbackUrl($voiceFallbackUrl) { $this->options['voiceFallbackUrl'] = $voiceFallbackUrl; return $this; } /** * The HTTP method Twilio will use when requesting the above `Url`. Either `GET` or `POST`. * * @param string $voiceMethod HTTP method used with the voice url * @return $this Fluent Builder */ public function setVoiceMethod($voiceMethod) { $this->options['voiceMethod'] = $voiceMethod; return $this; } /** * The URL Twilio will request when this phone number receives a call. The VoiceURL will no longer be used if a `VoiceApplicationSid` or a `TrunkSid` is set. * * @param string $voiceUrl URL Twilio will request when receiving a call * @return $this Fluent Builder */ public function setVoiceUrl($voiceUrl) { $this->options['voiceUrl'] = $voiceUrl; return $this; } /** * The emergency_status * * @param string $emergencyStatus The emergency_status * @return $this Fluent Builder */ public function setEmergencyStatus($emergencyStatus) { $this->options['emergencyStatus'] = $emergencyStatus; return $this; } /** * The emergency_address_sid * * @param string $emergencyAddressSid The emergency_address_sid * @return $this Fluent Builder */ public function setEmergencyAddressSid($emergencyAddressSid) { $this->options['emergencyAddressSid'] = $emergencyAddressSid; return $this; } /** * The 34 character sid of the Trunk Twilio should use to handle phone calls to this number. If a `TrunkSid` is present, Twilio will ignore all of the voice urls and voice applications above and use those set on the Trunk. Setting a `TrunkSid` will automatically delete your `VoiceApplicationSid` and vice versa. * * @param string $trunkSid Unique string to identify the trunk * @return $this Fluent Builder */ public function setTrunkSid($trunkSid) { $this->options['trunkSid'] = $trunkSid; return $this; } /** * The voice_receive_mode * * @param string $voiceReceiveMode The voice_receive_mode * @return $this Fluent Builder */ public function setVoiceReceiveMode($voiceReceiveMode) { $this->options['voiceReceiveMode'] = $voiceReceiveMode; return $this; } /** * The 34 character sid of the identity Twilio should use to associate with the number. Identities are required in some regions 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 34 character sid of the address Twilio should use to associate with the number. Addresses are required in some regions to meet local regulations * * @param string $addressSid Unique string that identifies the address * associated with number * @return $this Fluent Builder */ public function setAddressSid($addressSid) { $this->options['addressSid'] = $addressSid; return $this; } /** * Provide a friendly representation * * @return 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 boolean $beta Include new phone numbers * @param string $friendlyName Filter by friendly name * @param string $phoneNumber Filter by incoming phone number * @param string $origin The origin */ 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; } /** * Include phone numbers new to the Twilio platform * * @param boolean $beta Include new phone numbers * @return $this Fluent Builder */ public function setBeta($beta) { $this->options['beta'] = $beta; return $this; } /** * Only show the incoming phone number resources with friendly names that exactly match this name * * @param string $friendlyName Filter by friendly name * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * Only show the incoming phone number resources that match this pattern * * @param string $phoneNumber Filter by incoming phone number * @return $this Fluent Builder */ public function setPhoneNumber($phoneNumber) { $this->options['phoneNumber'] = $phoneNumber; return $this; } /** * The origin * * @param string $origin The origin * @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 * @param string $areaCode The desired area code for the new number * @param string $apiVersion The Twilio Rest API version to use * @param string $friendlyName A human readable description of this resource * @param string $smsApplicationSid Unique string that identifies the * application * @param string $smsFallbackMethod HTTP method used with sms fallback url * @param string $smsFallbackUrl URL Twilio will request if an error occurs in * executing TwiML * @param string $smsMethod HTTP method to use with sms url * @param string $smsUrl URL Twilio will request when receiving an SMS * @param string $statusCallback URL Twilio will use to pass status parameters * @param string $statusCallbackMethod HTTP method twilio will use with status * callback * @param string $voiceApplicationSid The unique sid of the application to * handle this number * @param boolean $voiceCallerIdLookup Look up the caller's caller-ID * @param string $voiceFallbackMethod HTTP method used with fallback_url * @param string $voiceFallbackUrl URL Twilio will request when an error occurs * in TwiML * @param string $voiceMethod HTTP method used with the voice url * @param string $voiceUrl URL Twilio will request when receiving a call * @param string $emergencyStatus The emergency_status * @param string $emergencyAddressSid The emergency_address_sid * @param string $trunkSid Unique string to identify the trunk * @param string $identitySid Unique string that identifies the identity * associated with number * @param string $addressSid Unique string that identifies the address * 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) { $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; } /** * The phone number to purchase. e.g., +16175551212 (E.164 format) * * @param string $phoneNumber The phone number * @return $this Fluent Builder */ public function setPhoneNumber($phoneNumber) { $this->options['phoneNumber'] = $phoneNumber; return $this; } /** * The desired area code for the new phone number. Any three digit US or Canada rea code is valid * * @param string $areaCode The desired area code for the new number * @return $this Fluent Builder */ public function setAreaCode($areaCode) { $this->options['areaCode'] = $areaCode; return $this; } /** * Calls to this phone number will start a new TwiML session with this API version. * * @param string $apiVersion The Twilio Rest API version to use * @return $this Fluent Builder */ public function setApiVersion($apiVersion) { $this->options['apiVersion'] = $apiVersion; return $this; } /** * A human readable descriptive text for this resource, up to 64 characters long. By default, the `FriendlyName` is a nicely formatted version of the phone number. * * @param string $friendlyName A human readable description of this resource * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The 34 character sid of the application Twilio should use to handle SMSs 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 Unique string that identifies the * application * @return $this Fluent Builder */ public function setSmsApplicationSid($smsApplicationSid) { $this->options['smsApplicationSid'] = $smsApplicationSid; return $this; } /** * The HTTP method Twilio will use when requesting the above URL. Either `GET` or `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 Twilio will request if an error occurs retrieving or executing the TwiML from `SmsUrl`. * * @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 Twilio will use when making requests to the `SmsUrl`. Either `GET` or `POST`. * * @param string $smsMethod HTTP method to use with sms url * @return $this Fluent Builder */ public function setSmsMethod($smsMethod) { $this->options['smsMethod'] = $smsMethod; return $this; } /** * The URL Twilio will request when receiving an incoming SMS message to this number. * * @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 URL that Twilio will request to pass status parameters (such as call ended) to your application. * * @param string $statusCallback URL Twilio will use to pass status parameters * @return $this Fluent Builder */ public function setStatusCallback($statusCallback) { $this->options['statusCallback'] = $statusCallback; return $this; } /** * The HTTP method Twilio will use to make requests to the `StatusCallback` URL. Either `GET` or `POST`. * * @param string $statusCallbackMethod HTTP method twilio will use with status * callback * @return $this Fluent Builder */ public function setStatusCallbackMethod($statusCallbackMethod) { $this->options['statusCallbackMethod'] = $statusCallbackMethod; return $this; } /** * The 34 character sid of the application Twilio should use to handle phone calls to this number. If a `VoiceApplicationSid` is present, Twilio will ignore all of the voice urls above and use those set on the application. Setting a `VoiceApplicationSid` will automatically delete your `TrunkSid` and vice versa. * * @param string $voiceApplicationSid The unique sid of the application to * handle this number * @return $this Fluent Builder */ public function setVoiceApplicationSid($voiceApplicationSid) { $this->options['voiceApplicationSid'] = $voiceApplicationSid; return $this; } /** * Look up the caller's caller-ID name from the CNAM database ($0.01 per look up). Either `true` or `false`. * * @param boolean $voiceCallerIdLookup Look up the caller's caller-ID * @return $this Fluent Builder */ public function setVoiceCallerIdLookup($voiceCallerIdLookup) { $this->options['voiceCallerIdLookup'] = $voiceCallerIdLookup; return $this; } /** * The HTTP method Twilio will use when requesting the `VoiceFallbackUrl`. Either `GET` or `POST`. * * @param string $voiceFallbackMethod HTTP method used with fallback_url * @return $this Fluent Builder */ public function setVoiceFallbackMethod($voiceFallbackMethod) { $this->options['voiceFallbackMethod'] = $voiceFallbackMethod; return $this; } /** * The URL that Twilio will request if an error occurs retrieving or executing the TwiML requested by `Url`. * * @param string $voiceFallbackUrl URL Twilio will request when an error occurs * in TwiML * @return $this Fluent Builder */ public function setVoiceFallbackUrl($voiceFallbackUrl) { $this->options['voiceFallbackUrl'] = $voiceFallbackUrl; return $this; } /** * The HTTP method Twilio will use when requesting the above `Url`. Either `GET` or `POST`. * * @param string $voiceMethod HTTP method used with the voice url * @return $this Fluent Builder */ public function setVoiceMethod($voiceMethod) { $this->options['voiceMethod'] = $voiceMethod; return $this; } /** * The URL Twilio will request when this phone number receives a call. The VoiceURL will no longer be used if a `VoiceApplicationSid` or a `TrunkSid` is set. * * @param string $voiceUrl URL Twilio will request when receiving a call * @return $this Fluent Builder */ public function setVoiceUrl($voiceUrl) { $this->options['voiceUrl'] = $voiceUrl; return $this; } /** * The emergency_status * * @param string $emergencyStatus The emergency_status * @return $this Fluent Builder */ public function setEmergencyStatus($emergencyStatus) { $this->options['emergencyStatus'] = $emergencyStatus; return $this; } /** * The emergency_address_sid * * @param string $emergencyAddressSid The emergency_address_sid * @return $this Fluent Builder */ public function setEmergencyAddressSid($emergencyAddressSid) { $this->options['emergencyAddressSid'] = $emergencyAddressSid; return $this; } /** * The 34 character sid of the Trunk Twilio should use to handle phone calls to this number. If a `TrunkSid` is present, Twilio will ignore all of the voice urls and voice applications above and use those set on the Trunk. Setting a `TrunkSid` will automatically delete your `VoiceApplicationSid` and vice versa. * * @param string $trunkSid Unique string to identify the trunk * @return $this Fluent Builder */ public function setTrunkSid($trunkSid) { $this->options['trunkSid'] = $trunkSid; return $this; } /** * The 34 character sid of the identity Twilio should use to associate with the number. Identities are required in some regions 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 34 character sid of the address Twilio should use to associate with the number. Addresses are required in some regions to meet local regulations * * @param string $addressSid Unique string that identifies the address * associated with number * @return $this Fluent Builder */ public function setAddressSid($addressSid) { $this->options['addressSid'] = $addressSid; return $this; } /** * Provide a friendly representation * * @return 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/Twilio/Rest/Api/V2010/Account/CallPage.php 0000604 00000001355 15174325132 0014512 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/Twilio/Rest/Api/V2010/AccountInstance.php 0000604 00000022564 15174325132 0014534 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 $_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 */ public function fetch() { return $this->proxy()->fetch(); } /** * Update the AccountInstance * * @param array|Options $options Optional Arguments * @return AccountInstance Updated AccountInstance */ 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 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/Twilio/Rest/Api/V2010/AccountList.php 0000604 00000013041 15174325132 0013671 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Api\V2010; 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 */ 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/Twilio/Rest/Api/V2010/AccountContext.php 0000604 00000040073 15174325132 0014407 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\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\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 $_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 */ 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 */ 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 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 \Twilio\Exceptions\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 \Twilio\Exceptions\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/Twilio/Rest/Api/V2010/AccountOptions.php 0000604 00000012042 15174325132 0014411 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; } /** * Filter accounts where the friendly name exactly matches the desired FriendlyName * * @param string $friendlyName FriendlyName to filter on * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * Only show accounts with the given Status * * @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 with a given Status * * @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/Twilio/Rest/Api/V2010/AccountPage.php 0000604 00000001317 15174325132 0013635 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/Twilio/Rest/Api/V2010.php 0000604 00000025656 15174325132 0011460 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\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 $_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\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 \Twilio\Exceptions\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 \Twilio\Exceptions\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/Twilio/Rest/Preview.php 0000604 00000031177 15174325132 0011653 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; use Twilio\Rest\Preview\BulkExports; use Twilio\Rest\Preview\DeployedDevices; use Twilio\Rest\Preview\HostedNumbers; use Twilio\Rest\Preview\Marketplace; use Twilio\Rest\Preview\Proxy; use Twilio\Rest\Preview\Studio; use Twilio\Rest\Preview\Sync; use Twilio\Rest\Preview\Understand; use Twilio\Rest\Preview\Wireless; /** * @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\Proxy proxy * @property \Twilio\Rest\Preview\Studio studio * @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\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\Understand\ServiceList services * @property \Twilio\Rest\Preview\Studio\FlowList flows * @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\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\Understand\ServiceContext services(string $sid) * @method \Twilio\Rest\Preview\Studio\FlowContext flows(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) */ class Preview extends Domain { protected $_bulkExports = null; protected $_deployedDevices = null; protected $_hostedNumbers = null; protected $_marketplace = null; protected $_proxy = null; protected $_studio = null; protected $_accSecurity = null; protected $_sync = null; protected $_understand = null; protected $_wireless = 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 BulkExports($this); } return $this->_bulkExports; } /** * @return \Twilio\Rest\Preview\DeployedDevices Version deployedDevices of * preview */ protected function getDeployedDevices() { if (!$this->_deployedDevices) { $this->_deployedDevices = new DeployedDevices($this); } return $this->_deployedDevices; } /** * @return \Twilio\Rest\Preview\HostedNumbers Version hostedNumbers of preview */ protected function getHostedNumbers() { if (!$this->_hostedNumbers) { $this->_hostedNumbers = new HostedNumbers($this); } return $this->_hostedNumbers; } /** * @return \Twilio\Rest\Preview\Marketplace Version marketplace of preview */ protected function getMarketplace() { if (!$this->_marketplace) { $this->_marketplace = new Marketplace($this); } return $this->_marketplace; } /** * @return \Twilio\Rest\Preview\Proxy Version proxy of preview */ protected function getProxy() { if (!$this->_proxy) { $this->_proxy = new Proxy($this); } return $this->_proxy; } /** * @return \Twilio\Rest\Preview\Studio Version studio of preview */ protected function getStudio() { if (!$this->_studio) { $this->_studio = new Studio($this); } return $this->_studio; } /** * @return \Twilio\Rest\Preview\AccSecurity Version accSecurity of preview */ protected function getAccSecurity() { if (!$this->_accSecurity) { $this->_accSecurity = new AccSecurity($this); } return $this->_accSecurity; } /** * @return \Twilio\Rest\Preview\Sync Version sync of preview */ protected function getSync() { if (!$this->_sync) { $this->_sync = new Sync($this); } return $this->_sync; } /** * @return \Twilio\Rest\Preview\Understand Version understand of preview */ protected function getUnderstand() { if (!$this->_understand) { $this->_understand = new Understand($this); } return $this->_understand; } /** * @return \Twilio\Rest\Preview\Wireless Version wireless of preview */ protected function getWireless() { if (!$this->_wireless) { $this->_wireless = new Wireless($this); } return $this->_wireless; } /** * Magic getter to lazy load version * * @param string $name Version to return * @return \Twilio\Version The requested version * @throws \Twilio\Exceptions\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 \Twilio\Exceptions\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 unique Available Add-on Sid * @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 unique Installed Add-on Sid * @return \Twilio\Rest\Preview\Marketplace\InstalledAddOnContext */ protected function contextInstalledAddOns($sid) { return $this->marketplace->installedAddOns($sid); } /** * @return \Twilio\Rest\Preview\Understand\ServiceList */ protected function getServices() { return $this->understand->services; } /** * @param string $sid The sid * @return \Twilio\Rest\Preview\Understand\ServiceContext */ protected function contextServices($sid) { return $this->understand->services($sid); } /** * @return \Twilio\Rest\Preview\Studio\FlowList */ protected function getFlows() { return $this->studio->flows; } /** * @param string $sid The sid * @return \Twilio\Rest\Preview\Studio\FlowContext */ protected function contextFlows($sid) { return $this->studio->flows($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); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Preview]'; } } sdk/Twilio/Rest/Lookups/V1/PhoneNumberPage.php 0000604 00000001335 15174325132 0015164 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/Twilio/Rest/Lookups/V1/PhoneNumberContext.php 0000604 00000004061 15174325132 0015733 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Lookups\V1; 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 * @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 */ 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/Twilio/Rest/Lookups/V1/PhoneNumberList.php 0000604 00000002110 15174325132 0015213 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 * @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/Twilio/Rest/Lookups/V1/PhoneNumberOptions.php 0000604 00000005235 15174325132 0015746 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 country_code * @param string $type The type * @param string $addOns The add_ons * @param string $addOnsData The add_ons_data * @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 country_code * @param string $type The type * @param string $addOns The add_ons * @param string $addOnsData The add_ons_data */ 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 country_code * * @param string $countryCode The country_code * @return $this Fluent Builder */ public function setCountryCode($countryCode) { $this->options['countryCode'] = $countryCode; return $this; } /** * The type * * @param string $type The type * @return $this Fluent Builder */ public function setType($type) { $this->options['type'] = $type; return $this; } /** * The add_ons * * @param string $addOns The add_ons * @return $this Fluent Builder */ public function setAddOns($addOns) { $this->options['addOns'] = $addOns; return $this; } /** * The add_ons_data * * @param string $addOnsData The add_ons_data * @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/Twilio/Rest/Lookups/V1/PhoneNumberInstance.php 0000604 00000006570 15174325132 0016062 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 string callerName * @property string countryCode * @property string phoneNumber * @property string nationalFormat * @property string 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 * @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 */ 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/Twilio/Rest/Lookups/V1.php 0000604 00000004534 15174325132 0012151 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 \Twilio\Exceptions\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 \Twilio\Exceptions\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/Twilio/Rest/Accounts/V1.php 0000604 00000004402 15174325132 0012266 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 \Twilio\Exceptions\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 \Twilio\Exceptions\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/Twilio/Rest/Accounts/V1/CredentialPage.php 0000604 00000001334 15174325132 0015136 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/Twilio/Rest/Accounts/V1/Credential/PublicKeyInstance.php 0000604 00000007447 15174325132 0017730 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 Fetch by unique Credential Sid * @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 */ public function fetch() { return $this->proxy()->fetch(); } /** * Update the PublicKeyInstance * * @param array|Options $options Optional Arguments * @return PublicKeyInstance Updated PublicKeyInstance */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Deletes the PublicKeyInstance * * @return boolean True if delete succeeds, false otherwise */ 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/Twilio/Rest/Accounts/V1/Credential/AwsContext.php 0000604 00000004367 15174325132 0016451 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Accounts\V1\Credential; 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 sid * @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 */ 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 */ 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 */ 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/Twilio/Rest/Accounts/V1/Credential/AwsPage.php 0000604 00000001322 15174325132 0015665 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/Twilio/Rest/Accounts/V1/Credential/PublicKeyList.php 0000604 00000012702 15174325132 0017065 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Accounts\V1\Credential; 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 URL encoded representation of the public key * @param array|Options $options Optional Arguments * @return PublicKeyInstance Newly created PublicKeyInstance */ 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 Fetch by unique Credential Sid * @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/Twilio/Rest/Accounts/V1/Credential/AwsOptions.php 0000604 00000006041 15174325132 0016447 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 The friendly_name * @param string $accountSid The account_sid * @return CreateAwsOptions Options builder */ public static function create($friendlyName = Values::NONE, $accountSid = Values::NONE) { return new CreateAwsOptions($friendlyName, $accountSid); } /** * @param string $friendlyName The friendly_name * @return UpdateAwsOptions Options builder */ public static function update($friendlyName = Values::NONE) { return new UpdateAwsOptions($friendlyName); } } class CreateAwsOptions extends Options { /** * @param string $friendlyName The friendly_name * @param string $accountSid The account_sid */ public function __construct($friendlyName = Values::NONE, $accountSid = Values::NONE) { $this->options['friendlyName'] = $friendlyName; $this->options['accountSid'] = $accountSid; } /** * The friendly_name * * @param string $friendlyName The friendly_name * @return $this Fluent Builder */ public function setFriendlyName($friendlyName) { $this->options['friendlyName'] = $friendlyName; return $this; } /** * The account_sid * * @param string $accountSid The account_sid * @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 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.Accounts.V1.UpdateAwsOptions ' . implode(' ', $options) . ']'; } } sdk/Twilio/Rest/Accounts/V1/Credential/AwsInstance.php 0000604 00000007162 15174325132 0016565 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 sid * @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 */ public function fetch() { return $this->proxy()->fetch(); } /** * Update the AwsInstance * * @param array|Options $options Optional Arguments * @return AwsInstance Updated AwsInstance */ public function update($options = array()) { return $this->proxy()->update($options); } /** * Deletes the AwsInstance * * @return boolean True if delete succeeds, false otherwise */ 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/Twilio/Rest/Accounts/V1/Credential/AwsList.php 0000604 00000012427 15174325132 0015734 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Accounts\V1\Credential; 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 The credentials * @param array|Options $options Optional Arguments * @return AwsInstance Newly created AwsInstance */ 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 sid * @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/Twilio/Rest/Accounts/V1/Credential/PublicKeyPage.php 0000604 00000001344 15174325132 0017026 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/Twilio/Rest/Accounts/V1/Credential/PublicKeyOptions.php 0000604 00000007260 15174325132 0017610 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 human readable description of this 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 human readable description of this resource * @return UpdatePublicKeyOptions Options builder */ public static function update($friendlyName = Values::NONE) { return new UpdatePublicKeyOptions($friendlyName); } } class CreatePublicKeyOptions extends Options { /** * @param string $friendlyName A human readable description of this 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 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; } /** * The Subaccount this Credential should be associated with. Needs to 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 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.Accounts.V1.UpdatePublicKeyOptions ' . implode(' ', $options) . ']'; } } sdk/Twilio/Rest/Accounts/V1/Credential/PublicKeyContext.php 0000604 00000004543 15174325132 0017602 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Accounts\V1\Credential; 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 Fetch by unique Credential Sid * @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 */ 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 */ 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 */ 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/Twilio/Rest/Accounts/V1/CredentialList.php 0000604 00000005467 15174325132 0015210 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 \Twilio\Exceptions\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 \Twilio\Exceptions\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/Twilio/Rest/Accounts/V1/CredentialInstance.php 0000604 00000002721 15174325132 0016027 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\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/Twilio/Rest/Client.php 0000604 00000061431 15174325132 0011444 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\Chat chat * @property \Twilio\Rest\Fax fax * @property \Twilio\Rest\IpMessaging ipMessaging * @property \Twilio\Rest\Lookups lookups * @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\Taskrouter taskrouter * @property \Twilio\Rest\Trunking trunking * @property \Twilio\Rest\Video video * @property \Twilio\Rest\Messaging messaging * @property \Twilio\Rest\Wireless wireless * @property \Twilio\Rest\Sync sync * @property \Twilio\Rest\Studio studio * @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\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 $_chat = null; protected $_fax = null; protected $_ipMessaging = null; protected $_lookups = null; protected $_monitor = null; protected $_notify = null; protected $_preview = null; protected $_pricing = null; protected $_proxy = null; protected $_taskrouter = null; protected $_trunking = null; protected $_video = null; protected $_messaging = null; protected $_wireless = null; protected $_sync = null; protected $_studio = 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 sid * @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 Fetch by unique Application Sid * @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 connect_app_sid * @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 country_code * @return \Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountryContext */ protected function contextAvailablePhoneNumbers($countryCode) { return $this->api->v2010->account->availablePhoneNumbers($countryCode); } /** * @return \Twilio\Rest\Api\V2010\Account\CallList */ protected function getCalls() { return $this->api->v2010->account->calls; } /** * @param string $sid Call Sid that uniquely identifies the Call 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 Fetch by unique conference Sid * @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 Fetch by unique connect-app Sid * @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 Fetch by unique incoming-phone-number Sid * @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 sid * @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 Fetch by unique message Sid * @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 Fetch by unique notification Sid * @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 Fetch by unique outgoing-caller-id Sid * @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 Fetch by unique queue Sid * @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 Fetch by unique recording Sid * @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 Fetch by unique short-code Sid * @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 Fetch by unique transcription Sid * @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 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 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 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 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 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 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 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 Wireless Twilio Domain * * @return \Twilio\Rest\Wireless Wireless Twilio Domain */ protected function getWireless() { if (!$this->_wireless) { $this->_wireless = new Wireless($this); } return $this->_wireless; } /** * 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 Studio Twilio Domain * * @return \Twilio\Rest\Studio Studio Twilio Domain */ protected function getStudio() { if (!$this->_studio) { $this->_studio = new Studio($this); } return $this->_studio; } /** * 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() . ']'; } } sdk/Twilio/Rest/Studio/V1.php 0000604 00000004367 15174325132 0011770 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 \Twilio\Exceptions\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 \Twilio\Exceptions\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/Twilio/Rest/Studio/V1/Flow/EngagementInstance.php 0000604 00000010235 15174325132 0016425 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; /** * 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 flowSid * @property string contactSid * @property string contactChannelAddress * @property string status * @property array context * @property \DateTime dateCreated * @property \DateTime dateUpdated * @property string url * @property array links */ class EngagementInstance extends InstanceResource { protected $_steps = null; /** * Initialize the EngagementInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $flowSid The flow_sid * @param string $sid The sid * @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'), 'status' => Values::array_get($payload, 'status'), 'context' => Values::array_get($payload, 'context'), '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 */ public function fetch() { return $this->proxy()->fetch(); } /** * Access the steps * * @return \Twilio\Rest\Studio\V1\Flow\Engagement\StepList */ protected function getSteps() { return $this->proxy()->steps; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (property_exists($this, '_' . $name)) { $method = 'get' . ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide 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/Twilio/Rest/Studio/V1/Flow/EngagementList.php 0000604 00000013125 15174325132 0015575 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Studio\V1\Flow; 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 EngagementList extends ListResource { /** * Construct the EngagementList * * @param Version $version Version that contains the resource * @param string $flowSid The flow_sid * @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 to * @param string $from The from * @param array|Options $options Optional Arguments * @return EngagementInstance Newly created EngagementInstance */ public function create($to, $from, $options = array()) { $options = new Values($options); $data = Values::of(array('To' => $to, 'From' => $from, 'Parameters' => $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 * @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/Twilio/Rest/Studio/V1/Flow/EngagementPage.php 0000604 00000001552 15174325132 0015537 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Studio\V1\Flow; use Twilio\Page; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ 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/Twilio/Rest/Studio/V1/Flow/Engagement/StepPage.php 0000604 00000001677 15174325132 0016462 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Studio\V1\Flow\Engagement; use Twilio\Page; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ 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/Twilio/Rest/Studio/V1/Flow/Engagement/StepInstance.php 0000604 00000010200 15174325132 0017330 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; /** * 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 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 */ class StepInstance extends InstanceResource { /** * Initialize the StepInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $flowSid The flow_sid * @param string $engagementSid The engagement_sid * @param string $sid The sid * @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'), ); $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 */ 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.StepInstance ' . implode(' ', $context) . ']'; } } sdk/Twilio/Rest/Studio/V1/Flow/Engagement/StepContext.php 0000604 00000003737 15174325132 0017231 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Studio\V1\Flow\Engagement; 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 StepContext extends InstanceContext { /** * Initialize the StepContext * * @param \Twilio\Version $version Version that contains the resource * @param string $flowSid The flow_sid * @param string $engagementSid The engagement_sid * @param string $sid The sid * @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 */ 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'] ); } /** * Provide 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/Twilio/Rest/Studio/V1/Flow/Engagement/StepList.php 0000604 00000012064 15174325132 0016511 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; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ class StepList extends ListResource { /** * Construct the StepList * * @param Version $version Version that contains the resource * @param string $flowSid The flow_sid * @param string $engagementSid The engagement_sid * @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 * @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/Twilio/Rest/Studio/V1/Flow/EngagementContext.php 0000604 00000006776 15174325132 0016324 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\StepList; 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\Studio\V1\Flow\Engagement\StepList steps * @method \Twilio\Rest\Studio\V1\Flow\Engagement\StepContext steps(string $sid) */ class EngagementContext extends InstanceContext { protected $_steps = null; /** * Initialize the EngagementContext * * @param \Twilio\Version $version Version that contains the resource * @param string $flowSid The flow_sid * @param string $sid The sid * @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 */ 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'] ); } /** * 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; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws \Twilio\Exceptions\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 \Twilio\Exceptions\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/Twilio/Rest/Studio/V1/Flow/EngagementOptions.php 0000604 00000002772 15174325132 0016323 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Studio\V1\Flow; 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 EngagementOptions { /** * @param string $parameters The parameters * @return CreateEngagementOptions Options builder */ public static function create($parameters = Values::NONE) { return new CreateEngagementOptions($parameters); } } class CreateEngagementOptions extends Options { /** * @param string $parameters The parameters */ public function __construct($parameters = Values::NONE) { $this->options['parameters'] = $parameters; } /** * The parameters * * @param string $parameters The parameters * @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/Twilio/Rest/Studio/V1/FlowPage.php 0000604 00000001467 15174325132 0013472 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Studio\V1; use Twilio\Page; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ 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/Twilio/Rest/Studio/V1/FlowContext.php 0000604 00000006730 15174325132 0014240 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\Values; use Twilio\Version; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. * * @property \Twilio\Rest\Studio\V1\Flow\EngagementList engagements * @method \Twilio\Rest\Studio\V1\Flow\EngagementContext engagements(string $sid) */ class FlowContext extends InstanceContext { protected $_engagements = null; /** * Initialize the FlowContext * * @param \Twilio\Version $version Version that contains the resource * @param string $sid The sid * @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 */ 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 */ 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; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws \Twilio\Exceptions\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 \Twilio\Exceptions\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/Twilio/Rest/Studio/V1/FlowList.php 0000604 00000011200 15174325132 0013513 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; /** * PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. */ 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 * @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/Twilio/Rest/Studio/V1/FlowInstance.php 0000604 00000007552 15174325132 0014363 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; /** * 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 status * @property integer version * @property \DateTime dateCreated * @property \DateTime dateUpdated * @property string url * @property array links */ class FlowInstance extends InstanceResource { protected $_engagements = null; /** * Initialize the FlowInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $sid The sid * @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 */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the FlowInstance * * @return boolean True if delete succeeds, false otherwise */ public function delete() { return $this->proxy()->delete(); } /** * Access the engagements * * @return \Twilio\Rest\Studio\V1\Flow\EngagementList */ protected function getEngagements() { return $this->proxy()->engagements; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (property_exists($this, '_' . $name)) { $method = 'get' . ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide 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/Twilio/Rest/Video/V1/RecordingOptions.php 0000604 00000006641 15174325132 0015054 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 The status * @param string $sourceSid The source_sid * @param string $groupingSid The grouping_sid * @param \DateTime $dateCreatedAfter The date_created_after * @param \DateTime $dateCreatedBefore The date_created_before * @return ReadRecordingOptions Options builder */ public static function read($status = Values::NONE, $sourceSid = Values::NONE, $groupingSid = Values::NONE, $dateCreatedAfter = Values::NONE, $dateCreatedBefore = Values::NONE) { return new ReadRecordingOptions($status, $sourceSid, $groupingSid, $dateCreatedAfter, $dateCreatedBefore); } } class ReadRecordingOptions extends Options { /** * @param string $status The status * @param string $sourceSid The source_sid * @param string $groupingSid The grouping_sid * @param \DateTime $dateCreatedAfter The date_created_after * @param \DateTime $dateCreatedBefore The date_created_before */ public function __construct($status = Values::NONE, $sourceSid = Values::NONE, $groupingSid = Values::NONE, $dateCreatedAfter = Values::NONE, $dateCreatedBefore = Values::NONE) { $this->options['status'] = $status; $this->options['sourceSid'] = $sourceSid; $this->options['groupingSid'] = $groupingSid; $this->options['dateCreatedAfter'] = $dateCreatedAfter; $this->options['dateCreatedBefore'] = $dateCreatedBefore; } /** * The status * * @param string $status The status * @return $this Fluent Builder */ public function setStatus($status) { $this->options['status'] = $status; return $this; } /** * The source_sid * * @param string $sourceSid The source_sid * @return $this Fluent Builder */ public function setSourceSid($sourceSid) { $this->options['sourceSid'] = $sourceSid; return $this; } /** * The grouping_sid * * @param string $groupingSid The grouping_sid * @return $this Fluent Builder */ public function setGroupingSid($groupingSid) { $this->options['groupingSid'] = $groupingSid; return $this; } /** * The date_created_after * * @param \DateTime $dateCreatedAfter The date_created_after * @return $this Fluent Builder */ public function setDateCreatedAfter($dateCreatedAfter) { $this->options['dateCreatedAfter'] = $dateCreatedAfter; return $this; } /** * The date_created_before * * @param \DateTime $dateCreatedBefore The date_created_before * @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.ReadRecordingOptions ' . implode(' ', $options) . ']'; } } sdk/Twilio/Rest/Video/V1/RecordingContext.php 0000604 00000003310 15174325133 0015034 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Video\V1; 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 * @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 */ 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 */ 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/Twilio/Rest/Video/V1/CompositionInstance.php 0000604 00000010765 15174325133 0015557 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 string dateCompleted * @property string dateDeleted * @property string sid * @property string audioSources * @property string videoSources * @property string videoLayout * @property string resolution * @property string format * @property integer bitrate * @property integer size * @property integer 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 * @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' => Values::array_get($payload, 'date_completed'), 'dateDeleted' => Values::array_get($payload, 'date_deleted'), 'sid' => Values::array_get($payload, 'sid'), 'audioSources' => Values::array_get($payload, 'audio_sources'), 'videoSources' => Values::array_get($payload, 'video_sources'), 'videoLayout' => Values::array_get($payload, 'video_layout'), 'resolution' => Values::array_get($payload, 'resolution'), '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 */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the CompositionInstance * * @return boolean True if delete succeeds, false otherwise */ 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/Twilio/Rest/Video/V1/RecordingInstance.php 0000604 00000010057 15174325133 0015162 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 integer size * @property string url * @property string type * @property integer duration * @property string containerFormat * @property string codec * @property array groupingSids * @property string trackName * @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 * @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'), '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 */ public function fetch() { return $this->proxy()->fetch(); } /** * Deletes the RecordingInstance * * @return boolean True if delete succeeds, false otherwise */ 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/Twilio/Rest/Video/V1/CompositionOptions.php 0000604 00000020033 15174325133 0015433 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 The status * @param \DateTime $dateCreatedAfter The date_created_after * @param \DateTime $dateCreatedBefore The date_created_before * @return ReadCompositionOptions Options builder */ public static function read($status = Values::NONE, $dateCreatedAfter = Values::NONE, $dateCreatedBefore = Values::NONE) { return new ReadCompositionOptions($status, $dateCreatedAfter, $dateCreatedBefore); } /** * @param string $audioSources The audio_sources * @param string $videoSources The video_sources * @param string $videoLayout The video_layout * @param string $resolution The resolution * @param string $format The format * @param integer $desiredBitrate The desired_bitrate * @param integer $desiredMaxDuration The desired_max_duration * @param string $statusCallback The status_callback * @param string $statusCallbackMethod The status_callback_method * @return CreateCompositionOptions Options builder */ public static function create($audioSources = Values::NONE, $videoSources = Values::NONE, $videoLayout = Values::NONE, $resolution = Values::NONE, $format = Values::NONE, $desiredBitrate = Values::NONE, $desiredMaxDuration = Values::NONE, $statusCallback = Values::NONE, $statusCallbackMethod = Values::NONE) { return new CreateCompositionOptions($audioSources, $videoSources, $videoLayout, $resolution, $format, $desiredBitrate, $desiredMaxDuration, $statusCallback, $statusCallbackMethod); } } class ReadCompositionOptions extends Options { /** * @param string $status The status * @param \DateTime $dateCreatedAfter The date_created_after * @param \DateTime $dateCreatedBefore The date_created_before */ public function __construct($status = Values::NONE, $dateCreatedAfter = Values::NONE, $dateCreatedBefore = Values::NONE) { $this->options['status'] = $status; $this->options['dateCreatedAfter'] = $dateCreatedAfter; $this->options['dateCreatedBefore'] = $dateCreatedBefore; } /** * The status * * @param string $status The status * @return $this Fluent Builder */ public function setStatus($status) { $this->options['status'] = $status; return $this; } /** * The date_created_after * * @param \DateTime $dateCreatedAfter The date_created_after * @return $this Fluent Builder */ public function setDateCreatedAfter($dateCreatedAfter) { $this->options['dateCreatedAfter'] = $dateCreatedAfter; return $this; } /** * The date_created_before * * @param \DateTime $dateCreatedBefore The date_created_before * @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.ReadCompositionOptions ' . implode(' ', $options) . ']'; } } class CreateCompositionOptions extends Options { /** * @param string $audioSources The audio_sources * @param string $videoSources The video_sources * @param string $videoLayout The video_layout * @param string $resolution The resolution * @param string $format The format * @param integer $desiredBitrate The desired_bitrate * @param integer $desiredMaxDuration The desired_max_duration * @param string $statusCallback The status_callback * @param string $statusCallbackMethod The status_callback_method */ public function __construct($audioSources = Values::NONE, $videoSources = Values::NONE, $videoLayout = Values::NONE, $resolution = Values::NONE, $format = Values::NONE, $desiredBitrate = Values::NONE, $desiredMaxDuration = Values::NONE, $statusCallback = Values::NONE, $statusCallbackMethod = Values::NONE) { $this->options['audioSources'] = $audioSources; $this->options['videoSources'] = $videoSources; $this->options['videoLayout'] = $videoLayout; $this->options['resolution'] = $resolution; $this->options['format'] = $format; $this->options['desiredBitrate'] = $desiredBitrate; $this->options['desiredMaxDuration'] = $desiredMaxDuration; $this->options['statusCallback'] = $statusCallback; $this->options['statusCallbackMethod'] = $statusCallbackMethod; } /** * The audio_sources * * @param string $audioSources The audio_sources * @return $this Fluent Builder */ public function setAudioSources($audioSources) { $this->options['audioSources'] = $audioSources; return $this; } /** * The video_sources * * @param string $videoSources The video_sources * @return $this Fluent Builder */ public function setVideoSources($videoSources) { $this->options['videoSources'] = $videoSources; return $this; } /** * The video_layout * * @param string $videoLayout The video_layout * @return $this Fluent Builder */ public function setVideoLayout($videoLayout) { $this->options['videoLayout'] = $videoLayout; return $this; } /** * The resolution * * @param string $resolution The resolution * @return $this Fluent Builder */ public function setResolution($resolution) { $this->options['resolution'] = $resolution; return $this; } /** * The format * * @param string $format The format * @return $this Fluent Builder */ public function setFormat($format) { $this->options['format'] = $format; return $this; } /** * The desired_bitrate * * @param integer $desiredBitrate The desired_bitrate * @return $this Fluent Builder */ public function setDesiredBitrate($desiredBitrate) { $this->options['desiredBitrate'] = $desiredBitrate; return $this; } /** * The desired_max_duration * * @param integer $desiredMaxDuration The desired_max_duration * @return $this Fluent Builder */ public function setDesiredMaxDuration($desiredMaxDuration) { $this->options['desiredMaxDuration'] = $desiredMaxDuration; return $this; } /** * The status_callback * * @param string $statusCallback The status_callback * @return $this Fluent Builder */ public function setStatusCallback($statusCallback) { $this->options['statusCallback'] = $statusCallback; return $this; } /** * The status_callback_method * * @param string $statusCallbackMethod The status_callback_method * @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.CreateCompositionOptions ' . implode(' ', $options) . ']'; } } sdk/Twilio/Rest/Video/V1/RoomInstance.php 0000604 00000012045 15174325133 0014161 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 boolean enableTurn * @property string uniqueName * @property string statusCallback * @property string statusCallbackMethod * @property \DateTime endTime * @property integer duration * @property string type * @property integer maxParticipants * @property boolean 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 * @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 */ public function fetch() { return $this->proxy()->fetch(); } /** * Update the RoomInstance * * @param string $status The status * @return RoomInstance Updated RoomInstance */ 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/Twilio/Rest/Video/V1/CompositionContext.php 0000604 00000003647 15174325133 0015440 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Video\V1; 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 * @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 */ 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 */ 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/Twilio/Rest/Video/V1/CompositionList.php 0000604 00000014774 15174325133 0014732 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; /** * PLEASE NOTE that this class contains preview products 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']), '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 array|Options $options Optional Arguments * @return CompositionInstance Newly created CompositionInstance */ public function create($options = array()) { $options = new Values($options); $data = Values::of(array( 'AudioSources' => Serialize::map($options['audioSources'], function($e) { return $e; }), 'VideoSources' => Serialize::map($options['videoSources'], function($e) { return $e; }), 'VideoLayout' => $options['videoLayout'], 'Resolution' => $options['resolution'], 'Format' => $options['format'], 'DesiredBitrate' => $options['desiredBitrate'], 'DesiredMaxDuration' => $options['desiredMaxDuration'], 'StatusCallback' => $options['statusCallback'], 'StatusCallbackMethod' => $options['statusCallbackMethod'], )); $payload = $this->version->create( 'POST', $this->uri, array(), $data ); return new CompositionInstance($this->version, $payload); } /** * Constructs a CompositionContext * * @param string $sid The sid * @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/Twilio/Rest/Video/V1/RecordingList.php 0000604 00000012446 15174325133 0014335 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']), '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 * @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/Twilio/Rest/Video/V1/RoomList.php 0000604 00000014347 15174325133 0013337 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 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 */ 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 * @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/Twilio/Rest/Video/V1/RoomOptions.php 0000604 00000020746 15174325133 0014057 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 boolean $enableTurn The enable_turn * @param string $type The type * @param string $uniqueName The unique_name * @param string $statusCallback The status_callback * @param string $statusCallbackMethod The status_callback_method * @param integer $maxParticipants The max_participants * @param boolean $recordParticipantsOnConnect The * record_participants_on_connect * @param string $videoCodecs The video_codecs * @param string $mediaRegion The media_region * @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 The status * @param string $uniqueName The unique_name * @param \DateTime $dateCreatedAfter The date_created_after * @param \DateTime $dateCreatedBefore The date_created_before * @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 boolean $enableTurn The enable_turn * @param string $type The type * @param string $uniqueName The unique_name * @param string $statusCallback The status_callback * @param string $statusCallbackMethod The status_callback_method * @param integer $maxParticipants The max_participants * @param boolean $recordParticipantsOnConnect The * record_participants_on_connect * @param string $videoCodecs The video_codecs * @param string $mediaRegion The media_region */ 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; } /** * The enable_turn * * @param boolean $enableTurn The enable_turn * @return $this Fluent Builder */ public function setEnableTurn($enableTurn) { $this->options['enableTurn'] = $enableTurn; return $this; } /** * The type * * @param string $type The type * @return $this Fluent Builder */ public function setType($type) { $this->options['type'] = $type; return $this; } /** * The unique_name * * @param string $uniqueName The unique_name * @return $this Fluent Builder */ public function setUniqueName($uniqueName) { $this->options['uniqueName'] = $uniqueName; return $this; } /** * The status_callback * * @param string $statusCallback The status_callback * @return $this Fluent Builder */ public function setStatusCallback($statusCallback) { $this->options['statusCallback'] = $statusCallback; return $this; } /** * The status_callback_method * * @param string $statusCallbackMethod The status_callback_method * @return $this Fluent Builder */ public function setStatusCallbackMethod($statusCallbackMethod) { $this->options['statusCallbackMethod'] = $statusCallbackMethod; return $this; } /** * The max_participants * * @param integer $maxParticipants The max_participants * @return $this Fluent Builder */ public function setMaxParticipants($maxParticipants) { $this->options['maxParticipants'] = $maxParticipants; return $this; } /** * The record_participants_on_connect * * @param boolean $recordParticipantsOnConnect The * record_participants_on_connect * @return $this Fluent Builder */ public function setRecordParticipantsOnConnect($recordParticipantsOnConnect) { $this->options['recordParticipantsOnConnect'] = $recordParticipantsOnConnect; return $this; } /** * The video_codecs * * @param string $videoCodecs The video_codecs * @return $this Fluent Builder */ public function setVideoCodecs($videoCodecs) { $this->options['videoCodecs'] = $videoCodecs; return $this; } /** * The media_region * * @param string $mediaRegion The media_region * @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 The status * @param string $uniqueName The unique_name * @param \DateTime $dateCreatedAfter The date_created_after * @param \DateTime $dateCreatedBefore The date_created_before */ 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; } /** * The status * * @param string $status The status * @return $this Fluent Builder */ public function setStatus($status) { $this->options['status'] = $status; return $this; } /** * The unique_name * * @param string $uniqueName The unique_name * @return $this Fluent Builder */ public function setUniqueName($uniqueName) { $this->options['uniqueName'] = $uniqueName; return $this; } /** * The date_created_after * * @param \DateTime $dateCreatedAfter The date_created_after * @return $this Fluent Builder */ public function setDateCreatedAfter($dateCreatedAfter) { $this->options['dateCreatedAfter'] = $dateCreatedAfter; return $this; } /** * The date_created_before * * @param \DateTime $dateCreatedBefore The date_created_before * @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/Twilio/Rest/Video/V1/RoomContext.php 0000604 00000010252 15174325133 0014037 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 * @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 */ 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 status * @return RoomInstance Updated RoomInstance */ 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 \Twilio\Exceptions\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 \Twilio\Exceptions\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/Twilio/Rest/Video/V1/RoomPage.php 0000604 00000001304 15174325133 0013265 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/Twilio/Rest/Video/V1/RecordingPage.php 0000604 00000001323 15174325133 0014266 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/Twilio/Rest/Video/V1/Room/RoomRecordingList.php 0000604 00000012637 15174325133 0016110 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 room_sid * @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 * @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/Twilio/Rest/Video/V1/Room/ParticipantInstance.php 0000604 00000011433 15174325133 0016437 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 integer duration * @property string url * @property array links */ class ParticipantInstance extends InstanceResource { protected $_publishedTracks = null; protected $_subscribedTracks = null; /** * Initialize the ParticipantInstance * * @param \Twilio\Version $version Version that contains the resource * @param mixed[] $payload The response payload * @param string $roomSid The room_sid * @param string $sid The sid * @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 */ public function fetch() { return $this->proxy()->fetch(); } /** * Update the ParticipantInstance * * @param array|Options $options Optional Arguments * @return ParticipantInstance Updated ParticipantInstance */ 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; } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (property_exists($this, '_' . $name)) { $method = 'get' . ucfirst($name); return $this->$method(); } throw new TwilioException('Unknown property: ' . $name); } /** * Provide 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/Twilio/Rest/Video/V1/Room/ParticipantContext.php 0000604 00000011636 15174325133 0016324 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\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 * @method \Twilio\Rest\Video\V1\Room\Participant\PublishedTrackContext publishedTracks(string $sid) */ class ParticipantContext extends InstanceContext { protected $_publishedTracks = null; protected $_subscribedTracks = null; /** * Initialize the ParticipantContext * * @param \Twilio\Version $version Version that contains the resource * @param string $roomSid The room_sid * @param string $sid The sid * @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 */ 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 */ 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; } /** * Magic getter to lazy load subresources * * @param string $name Subresource to return * @return \Twilio\ListResource The requested subresource * @throws \Twilio\Exceptions\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 \Twilio\Exceptions\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/Twilio/Rest/Video/V1/Room/ParticipantOptions.php 0000604 00000010020 15174325133 0016315 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 The status * @param string $identity The identity * @param \DateTime $dateCreatedAfter The date_created_after * @param \DateTime $dateCreatedBefore The date_created_before * @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 status * @return UpdateParticipantOptions Options builder */ public static function update($status = Values::NONE) { return new UpdateParticipantOptions($status); } } class ReadParticipantOptions extends Options { /** * @param string $status The status * @param string $identity The identity * @param \DateTime $dateCreatedAfter The date_created_after * @param \DateTime $dateCreatedBefore The date_created_before */ 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; } /** * The status * * @param string $status The status * @return $this Fluent Builder */ public function setStatus($status) { $this->options['status'] = $status; return $this; } /** * The identity * * @param string $identity The identity * @return $this Fluent Builder */ public function setIdentity($identity) { $this->options['identity'] = $identity; return $this; } /** * The date_created_after * * @param \DateTime $dateCreatedAfter The date_created_after * @return $this Fluent Builder */ public function setDateCreatedAfter($dateCreatedAfter) { $this->options['dateCreatedAfter'] = $dateCreatedAfter; return $this; } /** * The date_created_before * * @param \DateTime $dateCreatedBefore The date_created_before * @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 status */ public function __construct($status = Values::NONE) { $this->options['status'] = $status; } /** * The status * * @param string $status The status * @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/Twilio/Rest/Video/V1/Room/RoomRecordingPage.php 0000604 00000001400 15174325133 0016033 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/Twilio/Rest/Video/V1/Room/RoomRecordingContext.php 0000604 00000003331 15174325133 0016610 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Video\V1\Room; 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 room_sid * @param string $sid The sid * @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 */ 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'] ); } /** * Provide 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/Twilio/Rest/Video/V1/Room/ParticipantPage.php 0000604 00000001372 15174325133 0015550 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/Twilio/Rest/Video/V1/Room/Participant/PublishedTrackPage.php 0000604 00000001554 15174325133 0020456 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/Twilio/Rest/Video/V1/Room/Participant/PublishedTrackContext.php 0000604 00000003717 15174325133 0021231 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Video\V1\Room\Participant; 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 room_sid * @param string $participantSid The participant_sid * @param string $sid The sid * @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 */ 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/Twilio/Rest/Video/V1/Room/Participant/SubscribedTrackList.php 0000604 00000014267 15174325133 0020670 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Rest\Video\V1\Room\Participant; use Twilio\ListResource; use Twilio\Options; use Twilio\Serialize; 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 room_sid * @param string $subscriberSid The subscriber_sid * @return \Twilio\Rest\Video\V1\Room\Participant\SubscribedTrackList */ public function __construct(Version $version, $roomSid, $subscriberSid) { parent::__construct($version); // Path Solution $this->solution = array('roomSid' => $roomSid, 'subscriberSid' => $subscriberSid, ); $this->uri = '/Rooms/' . rawurlencode($roomSid) . '/Participants/' . rawurlencode($subscriberSid) . '/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 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 SubscribedTrackInstance 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 SubscribedTrackInstance[] 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 SubscribedTrackInstance 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 SubscribedTrackInstance */ public function page($options = array(), $pageSize = Values::NONE, $pageToken = Values::NONE, $pageNumber = Values::NONE) { $options = new Values($options); $params = Values::of(array( 'DateCreatedAfter' => Serialize::iso8601DateTime($options['dateCreatedAfter']), 'DateCreatedBefore' => Serialize::iso8601DateTime($options['dateCreatedBefore']), 'Track' => $options['track'], 'Publisher' => $options['publisher'], 'Kind' => $options['kind'], '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); } /** * Update the SubscribedTrackInstance * * @param array|Options $options Optional Arguments * @return SubscribedTrackInstance Updated SubscribedTrackInstance */ public function update($options = array()) { $options = new Values($options); $data = Values::of(array( 'Track' => $options['track'], 'Publisher' => $options['publisher'], 'Kind' => $options['kind'], 'Status' => $options['status'], )); $payload = $this->version->update( 'POST', $this->uri, array(), $data ); return new SubscribedTrackInstance( $this->version, $payload, $this->solution['roomSid'], $this->solution['subscriberSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Video.V1.SubscribedTrackList]'; } } sdk/Twilio/Rest/Video/V1/Room/Participant/SubscribedTrackInstance.php 0000604 00000005320 15174325133 0021507 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 roomSid * @property string name * @property string publisherSid * @property string subscriberSid * @property \DateTime dateCreated * @property \DateTime dateUpdated * @property boolean enabled * @property string kind */ 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 room_sid * @param string $subscriberSid The subscriber_sid * @return \Twilio\Rest\Video\V1\Room\Participant\SubscribedTrackInstance */ public function __construct(Version $version, array $payload, $roomSid, $subscriberSid) { parent::__construct($version); // Marshaled Properties $this->properties = array( 'sid' => Values::array_get($payload, 'sid'), 'roomSid' => Values::array_get($payload, 'room_sid'), 'name' => Values::array_get($payload, 'name'), 'publisherSid' => Values::array_get($payload, 'publisher_sid'), 'subscriberSid' => Values::array_get($payload, 'subscriber_sid'), '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'), ); $this->solution = array('roomSid' => $roomSid, 'subscriberSid' => $subscriberSid, ); } /** * Magic getter to access properties * * @param string $name Property to access * @return mixed The requested property * @throws TwilioException For unknown properties */ public function __get($name) { if (array_key_exists($name, $this->properties)) { return $this->properties[$name]; } if (property_exists($this, '_' . $name)) { $method = '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.SubscribedTrackInstance]'; } } sdk/Twilio/Rest/Video/V1/Room/Participant/PublishedTrackList.php 0000604 00000012164 15174325133 0020514 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 room_sid * @param string $participantSid The participant_sid * @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 * @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/Twilio/Rest/Video/V1/Room/Participant/SubscribedTrackOptions.php 0000604 00000013224 15174325133 0021400 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; abstract class SubscribedTrackOptions { /** * @param \DateTime $dateCreatedAfter The date_created_after * @param \DateTime $dateCreatedBefore The date_created_before * @param string $track The track * @param string $publisher The publisher * @param string $kind The kind * @return ReadSubscribedTrackOptions Options builder */ public static function read($dateCreatedAfter = Values::NONE, $dateCreatedBefore = Values::NONE, $track = Values::NONE, $publisher = Values::NONE, $kind = Values::NONE) { return new ReadSubscribedTrackOptions($dateCreatedAfter, $dateCreatedBefore, $track, $publisher, $kind); } /** * @param string $track The track * @param string $publisher The publisher * @param string $kind The kind * @param string $status The status * @return UpdateSubscribedTrackOptions Options builder */ public static function update($track = Values::NONE, $publisher = Values::NONE, $kind = Values::NONE, $status = Values::NONE) { return new UpdateSubscribedTrackOptions($track, $publisher, $kind, $status); } } class ReadSubscribedTrackOptions extends Options { /** * @param \DateTime $dateCreatedAfter The date_created_after * @param \DateTime $dateCreatedBefore The date_created_before * @param string $track The track * @param string $publisher The publisher * @param string $kind The kind */ public function __construct($dateCreatedAfter = Values::NONE, $dateCreatedBefore = Values::NONE, $track = Values::NONE, $publisher = Values::NONE, $kind = Values::NONE) { $this->options['dateCreatedAfter'] = $dateCreatedAfter; $this->options['dateCreatedBefore'] = $dateCreatedBefore; $this->options['track'] = $track; $this->options['publisher'] = $publisher; $this->options['kind'] = $kind; } /** * The date_created_after * * @param \DateTime $dateCreatedAfter The date_created_after * @return $this Fluent Builder */ public function setDateCreatedAfter($dateCreatedAfter) { $this->options['dateCreatedAfter'] = $dateCreatedAfter; return $this; } /** * The date_created_before * * @param \DateTime $dateCreatedBefore The date_created_before * @return $this Fluent Builder */ public function setDateCreatedBefore($dateCreatedBefore) { $this->options['dateCreatedBefore'] = $dateCreatedBefore; return $this; } /** * The track * * @param string $track The track * @return $this Fluent Builder */ public function setTrack($track) { $this->options['track'] = $track; return $this; } /** * The publisher * * @param string $publisher The publisher * @return $this Fluent Builder */ public function setPublisher($publisher) { $this->options['publisher'] = $publisher; return $this; } /** * The kind * * @param string $kind The kind * @return $this Fluent Builder */ public function setKind($kind) { $this->options['kind'] = $kind; return $this; } /** * Provide a friendly representation * * @return 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.ReadSubscribedTrackOptions ' . implode(' ', $options) . ']'; } } class UpdateSubscribedTrackOptions extends Options { /** * @param string $track The track * @param string $publisher The publisher * @param string $kind The kind * @param string $status The status */ public function __construct($track = Values::NONE, $publisher = Values::NONE, $kind = Values::NONE, $status = Values::NONE) { $this->options['track'] = $track; $this->options['publisher'] = $publisher; $this->options['kind'] = $kind; $this->options['status'] = $status; } /** * The track * * @param string $track The track * @return $this Fluent Builder */ public function setTrack($track) { $this->options['track'] = $track; return $this; } /** * The publisher * * @param string $publisher The publisher * @return $this Fluent Builder */ public function setPublisher($publisher) { $this->options['publisher'] = $publisher; return $this; } /** * The kind * * @param string $kind The kind * @return $this Fluent Builder */ public function setKind($kind) { $this->options['kind'] = $kind; return $this; } /** * The status * * @param string $status The status * @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.UpdateSubscribedTrackOptions ' . implode(' ', $options) . ']'; } } sdk/Twilio/Rest/Video/V1/Room/Participant/SubscribedTrackPage.php 0000604 00000001556 15174325133 0020626 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['subscriberSid'] ); } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString() { return '[Twilio.Video.V1.SubscribedTrackPage]'; } } sdk/Twilio/Rest/Video/V1/Room/Participant/PublishedTrackInstance.php 0000604 00000010044 15174325133 0021340 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 boolean 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 room_sid * @param string $participantSid The participant_sid * @param string $sid The sid * @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 */ 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/Twilio/Rest/Video/V1/Room/RoomRecordingOptions.php 0000604 00000005711 15174325133 0016623 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 The status * @param string $sourceSid The source_sid * @param \DateTime $dateCreatedAfter The date_created_after * @param \DateTime $dateCreatedBefore The date_created_before * @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 The status * @param string $sourceSid The source_sid * @param \DateTime $dateCreatedAfter The date_created_after * @param \DateTime $dateCreatedBefore The date_created_before */ 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; } /** * The status * * @param string $status The status * @return $this Fluent Builder */ public function setStatus($status) { $this->options['status'] = $status; return $this; } /** * The source_sid * * @param string $sourceSid The source_sid * @return $this Fluent Builder */ public function setSourceSid($sourceSid) { $this->options['sourceSid'] = $sourceSid; return $this; } /** * The date_created_after * * @param \DateTime $dateCreatedAfter The date_created_after * @return $this Fluent Builder */ public function setDateCreatedAfter($dateCreatedAfter) { $this->options['dateCreatedAfter'] = $dateCreatedAfter; return $this; } /** * The date_created_before * * @param \DateTime $dateCreatedBefore The date_created_before * @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/Twilio/Rest/Video/V1/Room/RoomRecordingInstance.php 0000604 00000010103 15174325133 0016723 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 integer size * @property string type * @property integer duration * @property string containerFormat * @property string codec * @property array groupingSids * @property string roomSid * @property string url * @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 room_sid * @param string $sid The sid * @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'), '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'), 'roomSid' => Values::array_get($payload, 'room_sid'), '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\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 */ 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.RoomRecordingInstance ' . implode(' ', $context) . ']'; } } sdk/Twilio/Rest/Video/V1/Room/ParticipantList.php 0000604 00000012577 15174325133 0015620 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 room_sid * @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 * @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/Twilio/Rest/Video/V1/CompositionPage.php 0000604 00000001644 15174325133 0014663 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/Twilio/Rest/Video/V1.php 0000604 00000006246 15174325133 0011566 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\CompositionList; use Twilio\Rest\Video\V1\RecordingList; use Twilio\Rest\Video\V1\RoomList; use Twilio\Version; /** * @property \Twilio\Rest\Video\V1\CompositionList compositions * @property \Twilio\Rest\Video\V1\RecordingList recordings * @property \Twilio\Rest\Video\V1\RoomList rooms * @method \Twilio\Rest\Video\V1\CompositionContext compositions(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 $_recordings = 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\RecordingList */ protected function getRecordings() { if (!$this->_recordings) { $this->_recordings = new RecordingList($this); } return $this->_recordings; } /** * @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 \Twilio\Exceptions\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 \Twilio\Exceptions\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/Twilio/Domain.php 0000604 00000004034 15174325133 0010515 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/Twilio/Exceptions/RestException.php 0000604 00000001460 15174325133 0014223 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/Twilio/Exceptions/TwilioException.php 0000604 00000000124 15174325133 0014551 0 ustar 00 <?php namespace Twilio\Exceptions; class TwilioException extends \Exception { } sdk/Twilio/Exceptions/HttpException.php 0000604 00000000127 15174325133 0014224 0 ustar 00 <?php namespace Twilio\Exceptions; class HttpException extends TwilioException { } sdk/Twilio/Exceptions/DeserializeException.php 0000604 00000000136 15174325133 0015545 0 ustar 00 <?php namespace Twilio\Exceptions; class DeserializeException extends TwilioException { } sdk/Twilio/Exceptions/ConfigurationException.php 0000604 00000000140 15174325133 0016107 0 ustar 00 <?php namespace Twilio\Exceptions; class ConfigurationException extends TwilioException { } sdk/Twilio/Exceptions/TwimlException.php 0000604 00000000130 15174325133 0014373 0 ustar 00 <?php namespace Twilio\Exceptions; class TwimlException extends TwilioException { } sdk/Twilio/Exceptions/EnvironmentException.php 0000604 00000000136 15174325133 0015611 0 ustar 00 <?php namespace Twilio\Exceptions; class EnvironmentException extends TwilioException { } sdk/Twilio/Http/Response.php 0000604 00000001514 15174325133 0012023 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/Twilio/Http/CurlClient.php 0000604 00000013716 15174325133 0012300 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) = ($parts[0] == 'HTTP/1.1 100 Continue') ? 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/Twilio/Http/Client.php 0000604 00000000402 15174325133 0011436 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/Twilio/Deserialize.php 0000604 00000001012 15174325133 0011537 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 { return new \DateTime($s, new \DateTimeZone('UTC')); } catch (\Exception $e) { return $s; } } } sdk/Twilio/Stream.php 0000604 00000005300 15174325133 0010536 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/Twilio/VersionInfo.php 0000604 00000000352 15174325133 0011546 0 ustar 00 <?php namespace Twilio; class VersionInfo { const MAJOR = 5; const MINOR = 16; const PATCH = 4; public static function string() { return implode('.', array(self::MAJOR, self::MINOR, self::PATCH)); } } sdk/Twilio/Page.php 0000604 00000013154 15174325133 0010165 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/Twilio/Jwt/AccessToken.php 0000604 00000005553 15174325133 0012263 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; 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(); } /** * 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; } 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( '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/Twilio/Jwt/Client/ScopeURI.php 0000604 00000003173 15174325133 0012724 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/Twilio/Jwt/ClientToken.php 0000604 00000007324 15174325133 0012276 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; /** * 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; } /** * 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, '', '&'), )); } /** * 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( '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/Twilio/Jwt/JWT.php 0000604 00000012342 15174325133 0010517 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/Twilio/Jwt/TaskRouter/WorkspaceCapability.php 0000604 00000000701 15174325133 0016112 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/Twilio/Jwt/TaskRouter/TaskQueueCapability.php 0000604 00000001233 15174325133 0016064 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/Twilio/Jwt/TaskRouter/CapabilityToken.php 0000604 00000012630 15174325133 0015240 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/Twilio/Jwt/TaskRouter/WorkerCapability.php 0000604 00000003357 15174325133 0015437 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/Twilio/Jwt/TaskRouter/Policy.php 0000604 00000003006 15174325133 0013412 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/Twilio/Jwt/Grants/IpMessagingGrant.php 0000604 00000006057 15174325133 0014521 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/Twilio/Jwt/Grants/Grant.php 0000604 00000000471 15174325133 0012364 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/Twilio/Jwt/Grants/VoiceGrant.php 0000604 00000006406 15174325133 0013356 0 ustar 00 <?php namespace Twilio\Jwt\Grants; class VoiceGrant implements Grant { private $outgoingApplicationSid; private $outgoingApplicationParams; private $pushCredentialSid; private $endpointId; /** * 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->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/Twilio/Jwt/Grants/VideoGrant.php 0000604 00000003545 15174325133 0013360 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/Twilio/Jwt/Grants/ConversationsGrant.php 0000604 00000002446 15174325133 0015146 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/Twilio/Jwt/Grants/SyncGrant.php 0000604 00000006050 15174325133 0013220 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/Twilio/Jwt/Grants/TaskRouterGrant.php 0000604 00000004246 15174325133 0014414 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/Twilio/Jwt/Grants/ChatGrant.php 0000604 00000005627 15174325133 0013174 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/Twilio/InstanceResource.php 0000604 00000000653 15174325133 0012565 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/Twilio/Version.php 0000604 00000014571 15174325133 0010742 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()); } } 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(); } 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(); } 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); } 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/Twilio/Tests/Unit/ValuesTest.php 0000604 00000003157 15174325133 0013433 0 ustar 00 <?php namespace Twilio\Tests\Unit; use Twilio\Values; class ValuesTest extends UnitTest { public function testDirectKeyAccess() { $values = new Values(array( 'a' => 1, 'b' => 2, 'c' => 3, )); $this->assertEquals(1, $values['a']); $this->assertEquals(2, $values['b']); $this->assertEquals(3, $values['c']); } public function testCaseInsensitiveAccess() { $values = new Values(array( 'lowercase' => 1, 'UPPERCASE' => 2, 'MixedCase' => 3, )); $this->assertEquals(1, $values['lowercase']); $this->assertEquals(1, $values['LOWERCASE']); $this->assertEquals(1, $values['LowerCase']); $this->assertEquals(2, $values['uppercase']); $this->assertEquals(2, $values['UPPERCASE']); $this->assertEquals(2, $values['UpperCase']); $this->assertEquals(3, $values['mixedcase']); $this->assertEquals(3, $values['MIXEDCASE']); $this->assertEquals(3, $values['MixedCase']); } public function testUnknownKeySentinel() { $values = new Values(array( 'known' => 1, )); $this->assertEquals(1, $values['known']); $this->assertEquals(Values::NONE, $values['unknown']); } public function testUnknownValuesRemoved() { $values = new Values(array( 'known' => 1, )); $data = Values::of(array( 'Known' => $values['known'], 'Unknown' => $values['unknown'], )); $this->assertEquals(array('Known' => 1), $data); } } sdk/Twilio/Tests/Unit/VersionTest.php 0000604 00000017106 15174325133 0013620 0 ustar 00 <?php namespace Twilio\Tests\Unit; use Twilio\Domain; use Twilio\Rest\Client; use Twilio\Values; use Twilio\Version; /** * Simplified Domain for testing * @package Twilio\Tests\Unit */ class TestDomain extends Domain { /** * Translate version relative URIs into absolute URLs * Since this test file is about testing the behaviors of Version * the Domain methods are all simplified. * * @param string $uri Version relative URI * @return string Absolute URL for this domain */ public function absoluteUrl($uri) { return "domain:$uri"; } } /** * TestVersion is used for testing Version behaviors * @package Twilio\Tests\Unit */ class TestVersion extends Version { /** * @return string */ public function getVersion() { return $this->version; } /** * @param string $version */ public function setVersion($version) { $this->version = $version; } } class VersionTest extends UnitTest { /** @var \Twilio\Rest\Client $client*/ protected $client; /** @var \Twilio\Tests\Unit\TestDomain $domain */ protected $domain; /** @var \Twilio\Tests\Unit\TestVersion $version */ protected $version; /** * Sets up the fixture, for example, open a network connection. * This method is called before a test is executed. */ protected function setUp() { parent::setUp(); $this->client = new Client('username', 'password'); $this->domain = new TestDomain($this->client); $this->version = new TestVersion($this->domain); } /** * @param string $message Case message to display on assertion error * @param int|null $limit Limit provided by the user * @param int|null $pageSize PageSize provided by the user * @param int|Values::NONE $expectedLimit Expected limit returned by readLimits * @param int|Values::NONE $expectedPageSize Expected page size returned by readLimits * @param int|Values::NONe $expectedPageLimit Expected page limit returned by readLimits * @dataProvider readLimitProvider */ public function testReadLimits($message, $limit, $pageSize, $expectedLimit, $expectedPageSize, $expectedPageLimit) { $actual = $this->version->readLimits($limit, $pageSize); $this->assertEquals($expectedLimit, $actual['limit'], "$message: Limit does not match"); $this->assertEquals($expectedPageSize, $actual['pageSize'], "$message: PageSize does not match"); $this->assertEquals($expectedPageLimit, $actual['pageLimit'], "$message: PageLimit does not match"); } public function readLimitProvider() { return array( array( 'Nothing Specified', null, null, Values::NONE, Values::NONE, Values::NONE, ), array( 'Limit Specified - Under Max Page Size', Version::MAX_PAGE_SIZE - 1, null, Version::MAX_PAGE_SIZE - 1, Version::MAX_PAGE_SIZE - 1, 1, ), array( 'Limit Specified - At Max Page Size', Version::MAX_PAGE_SIZE, null, Version::MAX_PAGE_SIZE, Version::MAX_PAGE_SIZE, 1, ), array( 'Limit Specified - Over Max Page Size', Version::MAX_PAGE_SIZE + 1, null, Version::MAX_PAGE_SIZE + 1, Version::MAX_PAGE_SIZE, 2, ), array( 'Page Size Specified - Under Max Page Size', null, Version::MAX_PAGE_SIZE - 1, Values::NONE, Version::MAX_PAGE_SIZE - 1, Values::NONE, ), array( 'Page Size Specified - At Max Page Size', null, Version::MAX_PAGE_SIZE, Values::NONE, Version::MAX_PAGE_SIZE, Values::NONE, ), array( 'Page Size Specified - Over Max Page Size', null, Version::MAX_PAGE_SIZE + 1, Values::NONE, Version::MAX_PAGE_SIZE, Values::NONE ), array( 'Limit less than Page Size', 50, 100, 50, 100, 1, ), array( 'Limit equal to Page Size', 100, 100, 100, 100, 1, ), array( 'Limit greater than Page Size - evenly divisible', 100, 50, 100, 50, 2, ), array( 'Limit greater than Page Size - not evenly divisible', 100, 30, 100, 30, 4 ), ); } /** * @param string $message Case message to display on assertion error * @param string $prefix Version prefix to test * @param string $uri URI to make relative to the version * @param string $expected Expected relative URI * @dataProvider relativeUriProvider */ public function testRelativeUri($message, $prefix, $uri, $expected) { $this->version->setVersion($prefix); $actual = $this->version->relativeUri($uri); $this->assertEquals($expected, $actual, $message); } public function relativeUriProvider() { $cases = array(); $modes = array( 'normal' => function($x) { return $x; }, 'prepend' => function($x) { return "/$x"; }, 'append' => function($x) { return "$x/"; }, 'surround' => function($x) { return "/$x/"; }, ); foreach ($modes as $prefixMode => $prefixFunc) { foreach ($modes as $pathMode => $pathFunc) { $prefix = $prefixFunc('v1'); $path = $pathFunc('path'); $cases[] = array( "Scalar - Prefix $prefixMode - Path $pathMode", $prefix, $path, 'v1/path', ); } } foreach ($modes as $prefixMode => $prefixFunc) { foreach ($modes as $pathMode => $pathFunc) { $prefix = $prefixFunc('v2'); $path = $pathFunc('path/to/resource'); $cases[] = array( "Multipart Path - Prefix $prefixMode - Path $pathMode", $prefix, $path, 'v2/path/to/resource', ); } } foreach ($modes as $prefixMode => $prefixFunc) { foreach ($modes as $pathMode => $pathFunc) { $prefix = $prefixFunc('v3'); $path = $pathFunc('path/to/resource.json'); $cases[] = array( "Multipart Path with Extension - Prefix $prefixMode - Path $pathMode", $prefix, $path, 'v3/path/to/resource.json', ); } } return $cases; } /** * @param string $message Case message to display on assertion error * @param string $prefix Version prefix to test * @param string $uri URI to make absolute to the domain * @param string $expected Expected absolute URL * @dataProvider absoluteUrlProvider */ public function testAbsoluteUrl($message, $prefix, $uri, $expected) { $this->version->setVersion($prefix); $actual = $this->version->absoluteUrl($uri); $this->assertEquals($expected, $actual, $message); } public function absoluteUrlProvider() { $cases = $this->relativeUriProvider(); foreach ($cases as &$case) { $case[3] = "domain:{$case[3]}"; } return $cases; } } sdk/Twilio/Tests/Unit/TwimlTest.php 0000604 00000015340 15174325133 0013265 0 ustar 00 <?php namespace Twilio\Tests\Unit; use Twilio\Twiml; class TwimlTest extends UnitTest { public function twiml($body) { return '<?xml version="1.0" encoding="UTF-8"?>' . "\n$body\n"; } public function testEmpty() { $twiml = new Twiml(); $actual = (string)$twiml; $this->assertTrue( ($this->twiml('<Response></Response>') == $actual) || ($this->twiml('<Response/>') == $actual) ); } public function testSingle() { $twiml = new Twiml(); $twiml->Example(); $actual = (string)$twiml; $this->assertTrue( ($this->twiml('<Response><Example></Example></Response>') == $actual) || ($this->twiml('<Response><Example/></Response>') == $actual) ); } public function testSingleWithBody() { $twiml = new Twiml(); $twiml->Example('body'); $actual = (string)$twiml; $this->assertEquals($this->twiml('<Response><Example>body</Example></Response>'), $actual); } public function testSingleWithAttributes() { $twiml = new Twiml(); $twiml->Example(array('attr1' => 'val1', 'attr2' => 'val2')); $actual = (string)$twiml; $this->assertTrue( ($this->twiml('<Response><Example attr1="val1" attr2="val2"></Example></Response>') == $actual) || ($this->twiml('<Response><Example attr1="val1" attr2="val2"/></Response>') == $actual) ); } public function testSingleWithBodyAndAttributes() { $twiml = new Twiml(); $twiml->Example('body', array('attr1' => 'val1', 'attr2' => 'val2')); $actual = (string)$twiml; $this->assertEquals($this->twiml('<Response><Example attr1="val1" attr2="val2">body</Example></Response>'), $actual); } public function testNested() { $twiml = new Twiml(); $twiml->Parent()->Child(); $actual = (string)$twiml; $this->assertTrue( ($this->twiml('<Response><Parent><Child></Child></Parent></Response>') == $actual) || ($this->twiml('<Response><Parent><Child/></Parent></Response>') == $actual) ); } /** * This behavior is almost certainly incorrect. Writing a test case just to * capture it and warn if we break backwards compatibility */ public function testNestedWithParentBody() { $twiml = new Twiml(); $twiml->Parent('body')->Child(); $actual = (string)$twiml; $this->assertTrue( ($this->twiml('<Response><Parent>body<Child></Child></Parent></Response>') == $actual) || ($this->twiml('<Response><Parent>body<Child/></Parent></Response>') == $actual) ); } public function testNestedWithChildBody() { $twiml = new Twiml(); $twiml->Parent()->Child('body'); $actual = (string)$twiml; $this->assertEquals($this->twiml('<Response><Parent><Child>body</Child></Parent></Response>'), $actual); } /** * This behavior is almost certainly incorrect. Writing a test case just to * capture it and warn if we break backwards compatibility */ public function testNestedWithParentAndChildBody() { $twiml = new Twiml(); $twiml->Parent('parent-body')->Child('child-body'); $actual = (string)$twiml; $this->assertEquals($this->twiml('<Response><Parent>parent-body<Child>child-body</Child></Parent></Response>'), $actual); } public function testNestedWithAttributes() { $twiml = new Twiml(); $twiml->Parent(array('attr1' => 'val1'))->Child(array('attr2' => 'val2')); $actual = (string)$twiml; $this->assertTrue( ($this->twiml('<Response><Parent attr1="val1"><Child attr2="val2"></Child></Parent></Response>') == $actual) || ($this->twiml('<Response><Parent attr1="val1"><Child attr2="val2"/></Parent></Response>') == $actual) ); } /** * This behavior is almost certainly incorrect. Writing a test case just to * capture it and warn if we break backwards compatibility */ public function testNestedWithAttributesAndParentBody() { $twiml = new Twiml(); $twiml->Parent('body', array('attr1' => 'val1'))->Child(array('attr2' => 'val2')); $actual = (string)$twiml; $this->assertTrue( ($this->twiml('<Response><Parent attr1="val1">body<Child attr2="val2"></Child></Parent></Response>') == $actual) || ($this->twiml('<Response><Parent attr1="val1">body<Child attr2="val2"/></Parent></Response>') == $actual) ); } public function testNestedWithAttributesAndChildBody() { $twiml = new Twiml(); $twiml->Parent(array('attr1' => 'val1'))->Child('body', array('attr2' => 'val2')); $actual = (string)$twiml; $this->assertEquals($this->twiml('<Response><Parent attr1="val1"><Child attr2="val2">body</Child></Parent></Response>'), $actual); } /** * This behavior is almost certainly incorrect. Writing a test case just to * capture it and warn if we break backwards compatibility */ public function testNestedWithAttributesAndParentAndChildBody() { $twiml = new Twiml(); $twiml->Parent('parent-body', array('attr1' => 'val1'))->Child('child-body', array('attr2' => 'val2')); $actual = (string)$twiml; $this->assertEquals($this->twiml('<Response><Parent attr1="val1">parent-body<Child attr2="val2">child-body</Child></Parent></Response>'), $actual); } /** * @param mixed $value A "Falsey" value that should become the body of the * Example tag * @dataProvider printingFalseyProvider */ public function testPrintingFalseyBody($value) { $twiml = new Twiml(); $twiml->Example($value); $actual = (string)$twiml; $this->assertEquals($this->twiml('<Response><Example>' . $value . '</Example></Response>'), $actual); } public function printingFalseyProvider() { return array( array(0), array('0'), array('false'), ); } /** * @param mixed $value A "Falsey" value that should be ignored by the TwiML * generator * @dataProvider silentFalseyProvider */ public function testSilentFalseyBody($value) { $twiml = new Twiml(); $twiml->Example($value); $actual = (string)$twiml; $this->assertTrue( ($this->twiml('<Response><Example></Example></Response>') == $actual) || ($this->twiml('<Response><Example/></Response>') == $actual) ); } public function silentFalseyProvider() { return array( array(''), array(false), array(null), array(array()), ); } } sdk/Twilio/Tests/Unit/UnitTest.php 0000604 00000000206 15174325133 0013103 0 ustar 00 <?php namespace Twilio\Tests\Unit; use PHPUnit_Framework_TestCase; abstract class UnitTest extends PHPUnit_Framework_TestCase { } sdk/Twilio/Tests/Unit/WorkflowTest.php 0000604 00000034423 15174325133 0014006 0 ustar 00 <?php namespace Twilio\Tests\Unit; use Twilio\TaskRouter\WorkflowConfiguration; use Twilio\TaskRouter\WorkflowRule; use Twilio\TaskRouter\WorkflowRuleTarget; class WorkflowTest extends UnitTest { public function testDefaultRuleTarget() { $everyoneQueue = "WQf6724bd5005b30eeb6ea990c3e59e536"; $defaultTarget = new WorkflowRuleTarget($everyoneQueue); $this->assertEquals($defaultTarget->queue, "WQf6724bd5005b30eeb6ea990c3e59e536"); $this->assertEquals($defaultTarget->priority, null); $this->assertEquals($defaultTarget->timeout, null); $this->assertEquals($defaultTarget->expression, null); } public function testSimpleRuleTarget() { $everyoneQueue = "WQf6724bd5005b30eeb6ea990c3e59e536"; $priority = 10; $timeout = 60; $filterWorkerExpression = null; $ruleTarget = new WorkflowRuleTarget($everyoneQueue, $priority, $timeout, $filterWorkerExpression); $this->assertEquals($ruleTarget->queue, "WQf6724bd5005b30eeb6ea990c3e59e536"); $this->assertEquals($ruleTarget->priority, $priority); $this->assertEquals($ruleTarget->timeout, $timeout); $this->assertEquals($ruleTarget->expression, $filterWorkerExpression); } public function testFilterWorkerRuleTarget() { $everyoneQueue = "WQf6724bd5005b30eeb6ea990c3e59e536"; $priority = 10; $timeout = 60; $filterWorkerExpression = "task.language IN worker.languages"; $ruleTarget = new WorkflowRuleTarget($everyoneQueue, $priority, $timeout, $filterWorkerExpression); $this->assertEquals($ruleTarget->queue, "WQf6724bd5005b30eeb6ea990c3e59e536"); $this->assertEquals($ruleTarget->priority, $priority); $this->assertEquals($ruleTarget->timeout, $timeout); $this->assertEquals($ruleTarget->expression, $filterWorkerExpression); } public function testSimpleRule() { $salesQueue = "WQf6724bd5005b30eeb6ea990c3e59e536"; $salesTarget = new WorkflowRuleTarget($salesQueue); $expression = "type=='sales'"; $friendlyName = "Sales"; $salesTargets[] = $salesTarget; $salesRule = new WorkflowRule($expression, $salesTargets, $friendlyName); $this->assertEquals($salesRule->expression, $expression); $this->assertEquals($salesRule->friendly_name, $friendlyName); $this->assertEquals($salesRule->targets[0], $salesTarget); } public function testFullWorkflow() { $salesQueue = "WQf6724bd5005b30eeb6ea990c3e59e536"; $marketingQueue = "WQ8c62f84b61ccfa6a333757cd508f0aae"; $supportQueue = "WQ5940dc0da87eaf6e3321d62041d4403b"; $everyoneQueue = "WQ6d29383312b24bd898a8df32779fc043"; $defaultTarget = new WorkflowRuleTarget($everyoneQueue); $salesTargets = array(); $salesTarget = new WorkflowRuleTarget($salesQueue); $salesTargets[] = $salesTarget; $salesRule = new WorkflowRule("type=='sales'", $salesTargets, 'Sales'); $marketingTargets = array(); $marketingTarget = new WorkflowRuleTarget($marketingQueue); $marketingTargets[] = $marketingTarget; $marketingRule = new WorkflowRule("type=='marketing'", $marketingTargets, 'Marketing'); $supportTargets = array(); $supportTarget = new WorkflowRuleTarget($supportQueue); $supportTargets[] = $supportTarget; $supportRule = new WorkflowRule("type=='support'", $supportTargets, 'Support'); $rules[] = $salesRule; $rules[] = $marketingRule; $rules[] = $supportRule; $configuration = new WorkflowConfiguration($rules, $defaultTarget); $json = $configuration->toJSON(); $expectedJsonString = "{ \"task_routing\":{ \"filters\":[ { \"expression\":\"type=='sales'\", \"targets\":[ { \"queue\":\"WQf6724bd5005b30eeb6ea990c3e59e536\" } ], \"friendly_name\":\"Sales\" }, { \"expression\":\"type=='marketing'\", \"targets\":[ { \"queue\":\"WQ8c62f84b61ccfa6a333757cd508f0aae\" } ], \"friendly_name\":\"Marketing\" }, { \"expression\":\"type=='support'\", \"targets\":[ { \"queue\":\"WQ5940dc0da87eaf6e3321d62041d4403b\" } ], \"friendly_name\":\"Support\" } ], \"default_filter\":{ \"queue\":\"WQ6d29383312b24bd898a8df32779fc043\" } } }"; // getting a trimmed, simple string $jsonObject = json_decode($expectedJsonString); $expectedJson = json_encode($jsonObject); $this->assertEquals($json, $expectedJson); } public function testFullWorkflowWithTimeouts() { $salesQueue = "WQf6724bd5005b30eeb6ea990c3e59e536"; $marketingQueue = "WQ8c62f84b61ccfa6a333757cd508f0aae"; $supportQueue = "WQ5940dc0da87eaf6e3321d62041d4403b"; $everyoneQueue = "WQ6d29383312b24bd898a8df32779fc043"; $defaultTarget = new WorkflowRuleTarget($everyoneQueue); $salesTargets = array(); $salesTarget1 = new WorkflowRuleTarget($salesQueue, 5, 30); $salesTarget2 = new WorkflowRuleTarget($salesQueue, 10); $salesTargets[] = $salesTarget1; $salesTargets[] = $salesTarget2; $salesRule = new WorkflowRule("type=='sales'", $salesTargets, 'Sales'); $marketingTargets = array(); $marketingTarget1 = new WorkflowRuleTarget($marketingQueue, 1, 120); $marketingTarget2 = new WorkflowRuleTarget($marketingQueue, 3); $marketingTargets[] = $marketingTarget1; $marketingTargets[] = $marketingTarget2; $marketingRule = new WorkflowRule("type=='marketing'", $marketingTargets, 'Marketing'); $supportTargets = array(); $supportTarget1 = new WorkflowRuleTarget($supportQueue, 10, 30); $supportTarget2 = new WorkflowRuleTarget($supportQueue, 15); $supportTargets[] = $supportTarget1; $supportTargets[] = $supportTarget2; $supportRule = new WorkflowRule("type=='support'", $supportTargets, 'Support'); $rules[] = $salesRule; $rules[] = $marketingRule; $rules[] = $supportRule; $configuration = new WorkflowConfiguration($rules, $defaultTarget); $json = $configuration->toJSON(); $expectedJsonString = "{ \"task_routing\":{ \"filters\":[ { \"expression\":\"type=='sales'\", \"targets\":[ { \"queue\":\"WQf6724bd5005b30eeb6ea990c3e59e536\", \"priority\": 5, \"timeout\": 30 }, { \"queue\":\"WQf6724bd5005b30eeb6ea990c3e59e536\", \"priority\": 10 } ], \"friendly_name\":\"Sales\" }, { \"expression\":\"type=='marketing'\", \"targets\":[ { \"queue\":\"WQ8c62f84b61ccfa6a333757cd508f0aae\", \"priority\": 1, \"timeout\": 120 }, { \"queue\":\"WQ8c62f84b61ccfa6a333757cd508f0aae\", \"priority\": 3 } ], \"friendly_name\":\"Marketing\" }, { \"expression\":\"type=='support'\", \"targets\":[ { \"queue\":\"WQ5940dc0da87eaf6e3321d62041d4403b\", \"priority\": 10, \"timeout\": 30 }, { \"queue\":\"WQ5940dc0da87eaf6e3321d62041d4403b\", \"priority\": 15 } ], \"friendly_name\":\"Support\" } ], \"default_filter\":{ \"queue\":\"WQ6d29383312b24bd898a8df32779fc043\" } } }"; // getting a trimmed, simple string $jsonObject = json_decode($expectedJsonString); $expectedJson = json_encode($jsonObject); $this->assertEquals($json, $expectedJson); } public function testParseWorkflow() { $json = "{ \"task_routing\":{ \"filters\":[ { \"expression\":\"type=='sales'\", \"targets\":[ { \"queue\":\"WQf6724bd5005b30eeb6ea990c3e59e536\", \"priority\": 5, \"timeout\": 30 }, { \"queue\":\"WQf6724bd5005b30eeb6ea990c3e59e536\", \"priority\": 10 } ], \"friendly_name\":\"Sales\" }, { \"expression\":\"type=='marketing'\", \"targets\":[ { \"queue\":\"WQ8c62f84b61ccfa6a333757cd508f0aae\", \"priority\": 1, \"timeout\": 120 }, { \"queue\":\"WQ8c62f84b61ccfa6a333757cd508f0aae\", \"priority\": 3 } ], \"friendly_name\":\"Marketing\" }, { \"expression\":\"type=='support'\", \"targets\":[ { \"queue\":\"WQ5940dc0da87eaf6e3321d62041d4403b\", \"priority\": 10, \"timeout\": 30 }, { \"queue\":\"WQ5940dc0da87eaf6e3321d62041d4403b\", \"priority\": 15 } ], \"friendly_name\":\"Support\" } ], \"default_filter\":{ \"queue\":\"WQ6d29383312b24bd898a8df32779fc043\" } } }"; $config = WorkflowConfiguration::fromJson($json); $taskRoutingConfig = WorkflowConfiguration::parse($json)->task_routing; $this->assertEquals(3, count($taskRoutingConfig->filters)); $this->assertEquals(3, count($config->filters)); $this->assertEquals(1, count($config->default_filter)); // sales assertions $this->assertEquals("type=='sales'", $config->filters[0]->expression); $this->assertEquals("Sales", $config->filters[0]->friendly_name); $this->assertEquals(2, count($config->filters[0]->targets)); $this->assertEquals("WQf6724bd5005b30eeb6ea990c3e59e536", $config->filters[0]->targets[0]->queue); $this->assertEquals(5, $config->filters[0]->targets[0]->priority); $this->assertEquals(30, $config->filters[0]->targets[0]->timeout); $this->assertEquals("WQf6724bd5005b30eeb6ea990c3e59e536", $config->filters[0]->targets[1]->queue); $this->assertEquals(10, $config->filters[0]->targets[1]->priority); // marketing assertions $this->assertEquals("type=='marketing'", $config->filters[1]->expression); $this->assertEquals("Marketing", $config->filters[1]->friendly_name); $this->assertEquals(2, count($config->filters[1]->targets)); $this->assertEquals("WQ8c62f84b61ccfa6a333757cd508f0aae", $config->filters[1]->targets[0]->queue); $this->assertEquals(1, $config->filters[1]->targets[0]->priority); $this->assertEquals(120, $config->filters[1]->targets[0]->timeout); $this->assertEquals("WQ8c62f84b61ccfa6a333757cd508f0aae", $config->filters[1]->targets[1]->queue); $this->assertEquals(3, $config->filters[1]->targets[1]->priority); // support assertions $this->assertEquals("type=='support'", $config->filters[2]->expression); $this->assertEquals("Support", $config->filters[2]->friendly_name); $this->assertEquals(2, count($config->filters[2]->targets)); $this->assertEquals("WQ5940dc0da87eaf6e3321d62041d4403b", $config->filters[2]->targets[0]->queue); $this->assertEquals(10, $config->filters[2]->targets[0]->priority); $this->assertEquals(30, $config->filters[2]->targets[0]->timeout); $this->assertEquals("WQ5940dc0da87eaf6e3321d62041d4403b", $config->filters[2]->targets[1]->queue); $this->assertEquals(15, $config->filters[2]->targets[1]->priority); // default filter $this->assertEquals("WQ6d29383312b24bd898a8df32779fc043", $config->default_filter->queue); } public function testParseWorkflowFilterFriendlyName() { $json = "{ \"task_routing\":{ \"filters\":[ { \"expression\":\"type=='sales'\", \"targets\":[ { \"queue\":\"WQf6724bd5005b30eeb6ea990c3e59e536\", \"priority\": 5, \"timeout\": 30 }, { \"queue\":\"WQf6724bd5005b30eeb6ea990c3e59e536\", \"priority\": 10 } ], \"filter_friendly_name\":\"Sales\" }, { \"expression\":\"type=='marketing'\", \"targets\":[ { \"queue\":\"WQ8c62f84b61ccfa6a333757cd508f0aae\", \"priority\": 1, \"timeout\": 120 }, { \"queue\":\"WQ8c62f84b61ccfa6a333757cd508f0aae\", \"priority\": 3 } ], \"filter_friendly_name\":\"Marketing\" }, { \"expression\":\"type=='support'\", \"targets\":[ { \"queue\":\"WQ5940dc0da87eaf6e3321d62041d4403b\", \"priority\": 10, \"timeout\": 30 }, { \"queue\":\"WQ5940dc0da87eaf6e3321d62041d4403b\", \"priority\": 15 } ], \"filter_friendly_name\":\"Support\" } ], \"default_filter\":{ \"queue\":\"WQ6d29383312b24bd898a8df32779fc043\" } } }"; $config = WorkflowConfiguration::fromJson($json); $taskRoutingConfig = WorkflowConfiguration::parse($json)->task_routing; $this->assertEquals(3, count($taskRoutingConfig->filters)); $this->assertEquals(3, count($config->filters)); $this->assertEquals(1, count($config->default_filter)); // sales assertions $this->assertEquals("type=='sales'", $config->filters[0]->expression); $this->assertEquals("Sales", $config->filters[0]->friendly_name); $this->assertEquals(2, count($config->filters[0]->targets)); $this->assertEquals("WQf6724bd5005b30eeb6ea990c3e59e536", $config->filters[0]->targets[0]->queue); $this->assertEquals(5, $config->filters[0]->targets[0]->priority); $this->assertEquals(30, $config->filters[0]->targets[0]->timeout); $this->assertEquals("WQf6724bd5005b30eeb6ea990c3e59e536", $config->filters[0]->targets[1]->queue); $this->assertEquals(10, $config->filters[0]->targets[1]->priority); // marketing assertions $this->assertEquals("type=='marketing'", $config->filters[1]->expression); $this->assertEquals("Marketing", $config->filters[1]->friendly_name); $this->assertEquals(2, count($config->filters[1]->targets)); $this->assertEquals("WQ8c62f84b61ccfa6a333757cd508f0aae", $config->filters[1]->targets[0]->queue); $this->assertEquals(1, $config->filters[1]->targets[0]->priority); $this->assertEquals(120, $config->filters[1]->targets[0]->timeout); $this->assertEquals("WQ8c62f84b61ccfa6a333757cd508f0aae", $config->filters[1]->targets[1]->queue); $this->assertEquals(3, $config->filters[1]->targets[1]->priority); // support assertions $this->assertEquals("type=='support'", $config->filters[2]->expression); $this->assertEquals("Support", $config->filters[2]->friendly_name); $this->assertEquals(2, count($config->filters[2]->targets)); $this->assertEquals("WQ5940dc0da87eaf6e3321d62041d4403b", $config->filters[2]->targets[0]->queue); $this->assertEquals(10, $config->filters[2]->targets[0]->priority); $this->assertEquals(30, $config->filters[2]->targets[0]->timeout); $this->assertEquals("WQ5940dc0da87eaf6e3321d62041d4403b", $config->filters[2]->targets[1]->queue); $this->assertEquals(15, $config->filters[2]->targets[1]->priority); // default filter $this->assertEquals("WQ6d29383312b24bd898a8df32779fc043", $config->default_filter->queue); } } sdk/Twilio/Tests/Unit/Rest/ClientTest.php 0000604 00000007526 15174325133 0014333 0 ustar 00 <?php namespace Twilio\Tests\Unit\Rest; use Twilio\Rest\Client; use Twilio\Tests\Holodeck; use Twilio\Tests\Request; use Twilio\Tests\Unit\UnitTest; class ClientTest extends UnitTest { /** * @expectedException \Twilio\Exceptions\ConfigurationException */ public function testThrowsWhenUsernameAndPasswordMissing() { new Client(null, null, null, null, null, array()); } /** * @expectedException \Twilio\Exceptions\ConfigurationException */ public function testThrowsWhenUsernameMissing() { new Client(null, 'password', null, null, null, array()); } /** * @expectedException \Twilio\Exceptions\ConfigurationException */ public function testThrowsWhenPasswordMissing() { new Client('username', null, null, null, null, array()); } public function testUsernamePulledFromEnvironment() { $client = new Client(null, 'password', null, null, null, array( Client::ENV_ACCOUNT_SID => 'username', )); $this->assertEquals('username', $client->getUsername()); } public function testPasswordPulledFromEnvironment() { $client = new Client('username', null, null, null, null, array( Client::ENV_AUTH_TOKEN => 'password', )); $this->assertEquals('password', $client->getPassword()); } public function testUsernameAndPasswordPulledFromEnvironment() { $client = new Client(null, null, null, null, null, array( Client::ENV_ACCOUNT_SID => 'username', Client::ENV_AUTH_TOKEN => 'password', )); $this->assertEquals('username', $client->getUsername()); $this->assertEquals('password', $client->getPassword()); } public function testUsernameParameterPreferredOverEnvironment() { $client = new Client('username', 'password', null, null, null, array( Client::ENV_ACCOUNT_SID => 'environmentUsername', )); $this->assertEquals('username', $client->getUsername()); } public function testPasswordParameterPreferredOverEnvironment() { $client = new Client('username', 'password', null, null, null, array( Client::ENV_AUTH_TOKEN => 'environmentPassword', )); $this->assertEquals('password', $client->getPassword()); } public function testUsernameAndPasswordParametersPreferredOverEnvironment() { $client = new Client('username', 'password', null, null, null, array( Client::ENV_ACCOUNT_SID => 'environmentUsername', Client::ENV_AUTH_TOKEN => 'environmentPassword', )); $this->assertEquals('username', $client->getUsername()); $this->assertEquals('password', $client->getPassword()); } public function testAccountSidDefaultsToUsername() { $client = new Client('username', 'password'); $this->assertEquals('username', $client->getAccountSid()); } public function testAccountSidPreferredOverUsername() { $client = new Client('username', 'password', 'accountSid'); $this->assertEquals('accountSid', $client->getAccountSid()); } public function testRegionDefaultsToEmpty() { $network = new Holodeck(); $client = new Client('username', 'password', null, null, $network); $client->request('POST', 'https://test.twilio.com/v1/Resources'); $expected = new Request('POST', 'https://test.twilio.com/v1/Resources'); $this->assertTrue($network->hasRequest($expected)); } public function testRegionInjectedWhenSet() { $network = new Holodeck(); $client = new Client('username', 'password', null, 'ie1', $network); $client->request('POST', 'https://test.twilio.com/v1/Resources'); $expected = new Request('POST', 'https://test.ie1.twilio.com/v1/Resources'); $this->assertTrue($network->hasRequest($expected)); } } sdk/Twilio/Tests/Unit/SerializeTest.php 0000604 00000013207 15174325133 0014120 0 ustar 00 <?php namespace Twilio\Tests\Unit; use Twilio\Serialize; use Twilio\Values; class SerializeTest extends UnitTest { public function testNull() { $actual = Serialize::prefixedCollapsibleMap(null, "Prefix"); $this->assertEquals(array(), $actual); } public function testEmptyArray() { $actual = Serialize::prefixedCollapsibleMap(array(), "Prefix"); $this->assertEquals(array(), $actual); } public function testSingleKey() { $actual = Serialize::prefixedCollapsibleMap(array( "foo" => "bar" ), "Prefix"); $this->assertEquals(array( "Prefix.foo" => "bar" ), $actual); } public function testNestedKey() { $actual = Serialize::prefixedCollapsibleMap(array( "foo" => array( "bar" => "baz" ) ), "Prefix"); $this->assertEquals(array( "Prefix.foo.bar" => "baz" ), $actual); } public function testMultipleKeys() { $actual = Serialize::prefixedCollapsibleMap(array( "watson" => array( "language" => "en", "alice" => "bob" ), "foo" => "bar" ), "Prefix"); $this->assertEquals(array( "Prefix.watson.language" => "en", "Prefix.watson.alice" => "bob", "Prefix.foo" => "bar" ), $actual); } public function testIso8601DateNull() { $actual = Serialize::iso8601Date(null); $this->assertEquals(\Twilio\Values::NONE, $actual); } public function testIso8601DateNone() { $actual = Serialize::iso8601Date(\Twilio\Values::NONE); $this->assertEquals(\Twilio\Values::NONE, $actual); } public function testIso8601DatePassString() { // Backwards compatibility, prior to 5.5.0 date parameters were passed as strings. // After 5.5.0 parameters can be DateTime objects or strings. $actual = Serialize::iso8601DateTime("2017-02-01"); $this->assertEquals("2017-02-01", $actual); } public function testIso8601DateSameTimezone() { $date = new \DateTime("now", new \DateTimeZone("UTC")); $actual = Serialize::iso8601Date($date); $this->assertEquals($date->format("Y-m-d"), $actual); } public function testIso8601DateDifferentTimezone() { $date = new \DateTime("2017-02-01T17:15:41-0800"); $actual = Serialize::iso8601Date($date); // assert original date time object is unchanged $this->assertEquals("2017-02-01T17:15:41-0800", $date->format(\DateTime::ISO8601)); $this->assertEquals("2017-02-02", $actual); } public function testIso8601DateTimeNull() { $actual = Serialize::iso8601DateTime(null); $this->assertEquals(\Twilio\Values::NONE, $actual); } public function testIso8601DateTimeNone() { $actual = Serialize::iso8601DateTime(\Twilio\Values::NONE); $this->assertEquals(\Twilio\Values::NONE, $actual); } public function testIso8601DateTimePassString() { // Backwards compatibility, prior to 5.5.0 date parameters were passed as strings. // After 5.5.0 parameters can be DateTime objects or strings. $actual = Serialize::iso8601DateTime("2017-02-01T17:15:41Z"); $this->assertEquals("2017-02-01T17:15:41Z", $actual); } public function testIso8601DateTimeSameTimezone() { $date = new \DateTime("2017-02-01T17:15:41", new \DateTimeZone("UTC")); $actual = Serialize::iso8601DateTime($date); $this->assertEquals("2017-02-01T17:15:41Z", $actual); } public function testIso8601DateTimeDifferentTimezone() { $date = new \DateTime("2017-02-01T17:15:41-0800"); $actual = Serialize::iso8601DateTime($date); // assert original date time object is unchanged $this->assertEquals("2017-02-01T17:15:41-0800", $date->format(\DateTime::ISO8601)); $this->assertEquals("2017-02-02T01:15:41Z", $actual); } public function testBooleanToString() { $actual = Serialize::booleanToString(True); $this->assertEquals("True", $actual); $actual = Serialize::booleanToString(False); $this->assertEquals("False", $actual); } public function testBooleanToStringPassThroughSpecialVals() { $actual = Serialize::booleanToString(null); $this->assertEquals(null, $actual); // For backwards compatibility $actual = Serialize::booleanToString("True"); $this->assertEquals("True", $actual); } public function testJsonObjectSerializesArrays() { $actual = Serialize::jsonObject(array("this", "is", "a", "list")); $this->assertEquals('["this","is","a","list"]', $actual); $actual = Serialize::jsonObject(array("twilio" => "rocks")); $this->assertEquals('{"twilio":"rocks"}', $actual); } public function testJsonObjectPassThroughOtherVals() { $actual = Serialize::jsonObject('{"already":"serialized"}'); $this->assertEquals('{"already":"serialized"}', $actual); } public function testMapAppliesFunctionToArray() { $actual = Serialize::map(array(1, 2, 3), function($e) { return $e * 2; }); $this->assertEquals(array(2, 4, 6), $actual); } public function testMapPassThroughOtherVals() { $actual = Serialize::map("abc", function($e) { return $e*2; }); $this->assertEquals("abc", $actual); $actual = Serialize::map(Values::NONE, function($e) { return $e*2; }); $this->assertEquals(Values::NONE, $actual); $actual = Serialize::map(10, function($e) { return $e*2; }); $this->assertEquals(10, $actual); } } sdk/Twilio/Tests/Unit/Jwt/TaskRouter/CapabilityTokenTest.php 0000604 00000026532 15174325133 0020127 0 ustar 00 <?php namespace Twilio\Tests\Unit\Jwt\TaskRouter; use Twilio\Jwt\JWT; use Twilio\Jwt\TaskRouter\TaskQueueCapability; use Twilio\Jwt\TaskRouter\WorkerCapability; use Twilio\Jwt\TaskRouter\WorkspaceCapability; use Twilio\Tests\Unit\UnitTest; class CapabilityTokenTest extends UnitTest { public function testDefaultWorker() { $workerCapability = new WorkerCapability('AC123', 'foobar', 'WS456', 'WK789'); $token = $workerCapability->generateToken(); $payload = JWT::decode($token, 'foobar'); $this->assertEquals('AC123', $payload->iss); $this->assertEquals('AC123', $payload->account_sid); $this->assertEquals('WK789', $payload->channel); $this->assertEquals('WS456', $payload->workspace_sid); $this->assertEquals('WK789', $payload->worker_sid); $this->assertEquals('v1', $payload->version); $policies = $payload->policies; $this->assertEquals(6, count($policies)); $this->assertEquals('https://event-bridge.twilio.com/v1/wschannels/AC123/WK789', $policies[0]->url); $this->assertEquals('GET', $policies[0]->method); $this->assertObjectNotHasAttribute('query_filter', $policies[0]); $this->assertObjectNotHasAttribute('post_filter', $policies[0]); $this->assertEquals(true, $policies[0]->allow); $this->assertEquals('https://event-bridge.twilio.com/v1/wschannels/AC123/WK789', $policies[1]->url); $this->assertEquals('POST', $policies[1]->method); $this->assertObjectNotHasAttribute('query_filter', $policies[1]); $this->assertObjectNotHasAttribute('post_filter', $policies[1]); $this->assertEquals(true, $policies[1]->allow); $this->assertEquals('https://taskrouter.twilio.com/v1/Workspaces/WS456/Workers/WK789', $policies[2]->url); $this->assertEquals('GET', $policies[2]->method); $this->assertObjectNotHasAttribute('query_filter', $policies[2]); $this->assertObjectNotHasAttribute('post_filter', $policies[2]); $this->assertEquals(true, $policies[2]->allow); $this->assertEquals('https://taskrouter.twilio.com/v1/Workspaces/WS456/Activities', $policies[3]->url); $this->assertEquals('GET', $policies[3]->method); $this->assertObjectNotHasAttribute('query_filter', $policies[3]); $this->assertObjectNotHasAttribute('post_filter', $policies[3]); $this->assertEquals(true, $policies[3]->allow); $this->assertEquals('https://taskrouter.twilio.com/v1/Workspaces/WS456/Tasks/**', $policies[4]->url); $this->assertEquals('GET', $policies[4]->method); $this->assertObjectNotHasAttribute('query_filter', $policies[4]); $this->assertObjectNotHasAttribute('post_filter', $policies[4]); $this->assertEquals(true, $policies[4]->allow); $this->assertEquals('https://taskrouter.twilio.com/v1/Workspaces/WS456/Workers/WK789/Reservations/**', $policies[5]->url); $this->assertEquals('GET', $policies[5]->method); $this->assertObjectNotHasAttribute('query_filter', $policies[5]); $this->assertObjectNotHasAttribute('post_filter', $policies[5]); $this->assertEquals(true, $policies[5]->allow); } public function testAllowWorkerUpdates() { $workerCapability = new WorkerCapability('AC123', 'foobar', 'WS456', 'WK789'); $workerCapability->allowActivityUpdates(); $token = $workerCapability->generateToken(); $payload = JWT::decode($token, 'foobar'); $this->assertEquals('AC123', $payload->iss); $this->assertEquals('AC123', $payload->account_sid); $this->assertEquals('WK789', $payload->channel); $this->assertEquals('WS456', $payload->workspace_sid); $this->assertEquals('WK789', $payload->worker_sid); $this->assertEquals('v1', $payload->version); $policies = $payload->policies; $this->assertEquals(7, count($policies)); $this->assertEquals('https://taskrouter.twilio.com/v1/Workspaces/WS456/Workers/WK789', $policies[6]->url); $this->assertEquals('POST', $policies[6]->method); $this->assertEquals(new \stdClass(), $policies[6]->query_filter); $this->assertEquals(true, $policies[6]->post_filter->ActivitySid->required); $this->assertEquals(true, $policies[6]->allow); } public function testAllowReservationUpdates() { $workerCapability = new WorkerCapability('AC123', 'foobar', 'WS456', 'WK789'); $workerCapability->allowActivityUpdates(); $workerCapability->allowReservationUpdates(); $token = $workerCapability->generateToken(); $payload = JWT::decode($token, 'foobar'); $this->assertEquals('AC123', $payload->iss); $this->assertEquals('AC123', $payload->account_sid); $this->assertEquals('WK789', $payload->channel); $this->assertEquals('WS456', $payload->workspace_sid); $this->assertEquals('WK789', $payload->worker_sid); $this->assertEquals('v1', $payload->version); $policies = $payload->policies; $this->assertEquals(9, count($policies)); $this->assertEquals('https://taskrouter.twilio.com/v1/Workspaces/WS456/Tasks/**', $policies[7]->url); $this->assertEquals('POST', $policies[7]->method); $this->assertEquals(new \stdClass(), $policies[7]->query_filter); $this->assertEquals(new \stdClass(), $policies[7]->post_filter); $this->assertEquals(true, $policies[7]->allow); $this->assertEquals('https://taskrouter.twilio.com/v1/Workspaces/WS456/Workers/WK789/Reservations/**', $policies[8]->url); $this->assertEquals('POST', $policies[8]->method); $this->assertEquals(new \stdClass(), $policies[8]->query_filter); $this->assertEquals(new \stdClass(), $policies[8]->post_filter); $this->assertEquals(true, $policies[8]->allow); } public function testDefaultWorkspace() { $workspaceCapability = new WorkspaceCapability('AC123', 'foobar', 'WS456'); $token = $workspaceCapability->generateToken(); $payload = JWT::decode($token, 'foobar'); $this->assertEquals('AC123', $payload->iss); $this->assertEquals('AC123', $payload->account_sid); $this->assertEquals('WS456', $payload->channel); $this->assertEquals('WS456', $payload->workspace_sid); $this->assertEquals('v1', $payload->version); $policies = $payload->policies; $this->assertEquals(3, count($policies)); $this->assertEquals('https://event-bridge.twilio.com/v1/wschannels/AC123/WS456', $policies[0]->url); $this->assertEquals('GET', $policies[0]->method); $this->assertObjectNotHasAttribute('query_filter', $policies[0]); $this->assertObjectNotHasAttribute('post_filter', $policies[0]); $this->assertEquals(true, $policies[0]->allow); $this->assertEquals('https://event-bridge.twilio.com/v1/wschannels/AC123/WS456', $policies[1]->url); $this->assertEquals('POST', $policies[1]->method); $this->assertObjectNotHasAttribute('query_filter', $policies[1]); $this->assertObjectNotHasAttribute('post_filter', $policies[1]); $this->assertEquals(true, $policies[1]->allow); $this->assertEquals('https://taskrouter.twilio.com/v1/Workspaces/WS456', $policies[2]->url); $this->assertEquals('GET', $policies[2]->method); $this->assertObjectNotHasAttribute('query_filter', $policies[2]); $this->assertObjectNotHasAttribute('post_filter', $policies[2]); $this->assertEquals(true, $policies[2]->allow); } public function testWorkspaceFetchAll() { $workspaceCapability = new WorkspaceCapability('AC123', 'foobar', 'WS456'); $workspaceCapability->allowFetchSubresources(); $token = $workspaceCapability->generateToken(); $payload = JWT::decode($token, 'foobar'); $this->assertEquals('AC123', $payload->iss); $this->assertEquals('AC123', $payload->account_sid); $this->assertEquals('WS456', $payload->channel); $this->assertEquals('WS456', $payload->workspace_sid); $this->assertEquals('v1', $payload->version); $policies = $payload->policies; $this->assertEquals(4, count($policies)); $this->assertEquals('https://event-bridge.twilio.com/v1/wschannels/AC123/WS456', $policies[0]->url); $this->assertEquals('GET', $policies[0]->method); $this->assertObjectNotHasAttribute('query_filter', $policies[0]); $this->assertObjectNotHasAttribute('post_filter', $policies[0]); $this->assertEquals(true, $policies[0]->allow); $this->assertEquals('https://event-bridge.twilio.com/v1/wschannels/AC123/WS456', $policies[1]->url); $this->assertEquals('POST', $policies[1]->method); $this->assertObjectNotHasAttribute('query_filter', $policies[1]); $this->assertObjectNotHasAttribute('post_filter', $policies[1]); $this->assertEquals(true, $policies[1]->allow); $this->assertEquals('https://taskrouter.twilio.com/v1/Workspaces/WS456', $policies[2]->url); $this->assertEquals('GET', $policies[2]->method); $this->assertObjectNotHasAttribute('query_filter', $policies[2]); $this->assertObjectNotHasAttribute('post_filter', $policies[2]); $this->assertEquals(true, $policies[2]->allow); $this->assertEquals('https://taskrouter.twilio.com/v1/Workspaces/WS456/**', $policies[3]->url); $this->assertEquals('GET', $policies[3]->method); $this->assertEquals(new \stdClass(), $policies[3]->query_filter); $this->assertEquals(new \stdClass(), $policies[3]->post_filter); $this->assertEquals(true, $policies[3]->allow); } public function testDefaultTaskQueue() { $taskQueueCapability = new TaskQueueCapability('AC123', 'foobar', 'WS456', 'WQ789'); $token = $taskQueueCapability->generateToken(); $payload = JWT::decode($token, 'foobar'); $this->assertEquals('AC123', $payload->iss); $this->assertEquals('AC123', $payload->account_sid); $this->assertEquals('WQ789', $payload->channel); $this->assertEquals('WS456', $payload->workspace_sid); $this->assertEquals('WQ789', $payload->taskqueue_sid); $this->assertEquals('v1', $payload->version); $policies = $payload->policies; $this->assertEquals(3, count($policies)); $this->assertEquals('https://event-bridge.twilio.com/v1/wschannels/AC123/WQ789', $policies[0]->url); $this->assertEquals('GET', $policies[0]->method); $this->assertObjectNotHasAttribute('query_filter', $policies[0]); $this->assertObjectNotHasAttribute('post_filter', $policies[0]); $this->assertEquals(true, $policies[0]->allow); $this->assertEquals('https://event-bridge.twilio.com/v1/wschannels/AC123/WQ789', $policies[1]->url); $this->assertEquals('POST', $policies[1]->method); $this->assertObjectNotHasAttribute('query_filter', $policies[1]); $this->assertObjectNotHasAttribute('post_filter', $policies[1]); $this->assertEquals(true, $policies[1]->allow); $this->assertEquals('https://taskrouter.twilio.com/v1/Workspaces/WS456/TaskQueues/WQ789', $policies[2]->url); $this->assertEquals('GET', $policies[2]->method); $this->assertObjectNotHasAttribute('query_filter', $policies[2]); $this->assertObjectNotHasAttribute('post_filter', $policies[2]); $this->assertEquals(true, $policies[2]->allow); } } sdk/Twilio/Tests/Unit/Jwt/AccessTokenTest.php 0000604 00000016321 15174325133 0015137 0 ustar 00 <?php namespace Twilio\Tests\Unit\Jwt; use Twilio\Jwt\AccessToken; use Twilio\Jwt\Grants\ChatGrant; use Twilio\Jwt\Grants\IpMessagingGrant; use Twilio\Jwt\Grants\SyncGrant; use Twilio\Jwt\Grants\TaskRouterGrant; use Twilio\Jwt\Grants\VideoGrant; use Twilio\Jwt\Grants\VoiceGrant; use Twilio\Jwt\JWT; use Twilio\Tests\Unit\UnitTest; class AccessTokenTest extends UnitTest { const SIGNING_KEY_SID = 'SK123'; const ACCOUNT_SID = 'AC123'; protected function validateClaims($payload) { $this->assertEquals(self::SIGNING_KEY_SID, $payload->iss); $this->assertEquals(self::ACCOUNT_SID, $payload->sub); $this->assertNotNull($payload->exp); $this->assertGreaterThanOrEqual(time(), $payload->exp); $this->assertNotNull($payload->jti); $this->assertStringStartsWith($payload->iss . '-', $payload->jti); $this->assertNotNull($payload->grants); } function testEmptyGrants() { $scat = new AccessToken(self::ACCOUNT_SID, self::SIGNING_KEY_SID, 'secret'); $token = $scat->toJWT(); $this->assertNotNull($token); $payload = JWT::decode($token, 'secret'); $this->validateClaims($payload); $this->assertEquals('{}', json_encode($payload->grants)); } function testNbf() { $scat = new AccessToken(self::ACCOUNT_SID, self::SIGNING_KEY_SID, 'secret'); $now = time(); $scat->setNbf($now); $token = $scat->toJWT(); $this->assertNotNull($token); $payload = JWT::decode($token, 'secret'); $this->validateClaims($payload); $this->assertEquals('{}', json_encode($payload->grants)); $this->assertEquals($now, $payload->nbf); $this->assertGreaterThan($payload->nbf, $payload->exp); } function testIpMessagingGrant() { $scat = new AccessToken(self::ACCOUNT_SID, self::SIGNING_KEY_SID, 'secret'); @$grant = new IpMessagingGrant(); $grant->setEndpointId("EP123"); $grant->setServiceSid("IS123"); $scat->addGrant($grant); $token = $scat->toJWT(); $this->assertNotNull($token); $payload = JWT::decode($token, 'secret'); $this->validateClaims($payload); $grants = json_decode(json_encode($payload->grants), true); $this->assertEquals(1, count($grants)); $this->assertArrayHasKey("ip_messaging", $grants); $this->assertEquals("EP123", $grants['ip_messaging']['endpoint_id']); $this->assertEquals("IS123", $grants['ip_messaging']['service_sid']); } function testChatGrant() { $scat = new AccessToken(self::ACCOUNT_SID, self::SIGNING_KEY_SID, 'secret'); $grant = new ChatGrant(); $grant->setEndpointId("EP123"); $grant->setServiceSid("IS123"); $scat->addGrant($grant); $token = $scat->toJWT(); $this->assertNotNull($token); $payload = JWT::decode($token, 'secret'); $this->validateClaims($payload); $grants = json_decode(json_encode($payload->grants), true); $this->assertEquals(1, count($grants)); $this->assertArrayHasKey("chat", $grants); $this->assertEquals("EP123", $grants['chat']['endpoint_id']); $this->assertEquals("IS123", $grants['chat']['service_sid']); } function testSyncGrant() { $scat = new AccessToken(self::ACCOUNT_SID, self::SIGNING_KEY_SID, 'secret'); $grant = new SyncGrant(); $grant->setEndpointId("EP123"); $grant->setServiceSid("IS123"); $scat->addGrant($grant); $token = $scat->toJWT(); $this->assertNotNull($token); $payload = JWT::decode($token, 'secret'); $this->validateClaims($payload); $grants = json_decode(json_encode($payload->grants), true); $this->assertEquals(1, count($grants)); $this->assertArrayHasKey("data_sync", $grants); $this->assertEquals("EP123", $grants['data_sync']['endpoint_id']); $this->assertEquals("IS123", $grants['data_sync']['service_sid']); } function testVideoGrant() { $scat = new AccessToken(self::ACCOUNT_SID, self::SIGNING_KEY_SID, 'secret'); $grant = new VideoGrant(); $grant->setRoom("RM123"); $scat->addGrant($grant); $token = $scat->toJWT(); $this->assertNotNull($token); $payload = JWT::decode($token, 'secret'); $this->validateClaims($payload); $grants = json_decode(json_encode($payload->grants), true); $this->assertEquals(1, count($grants)); $this->assertArrayHasKey("video", $grants); $this->assertEquals("RM123", $grants['video']['room']); } function testGrants() { $scat = new AccessToken(self::ACCOUNT_SID, self::SIGNING_KEY_SID, 'secret'); $scat->setIdentity('test identity'); @$scat->addGrant(new IpMessagingGrant()); $scat->addGrant(new VideoGrant()); $scat->addGrant(new TaskRouterGrant()); $token = $scat->toJWT(); $this->assertNotNull($token); $payload = JWT::decode($token, 'secret'); $this->validateClaims($payload); $grants = json_decode(json_encode($payload->grants), true); $this->assertEquals(4, count($grants)); $this->assertEquals('test identity', $payload->grants->identity); $this->assertEquals('{}', json_encode($payload->grants->ip_messaging)); $this->assertEquals('{}', json_encode($payload->grants->video)); $this->assertEquals('{}', json_encode($payload->grants->task_router)); } function testVoiceGrant() { $scat = new AccessToken(self::ACCOUNT_SID, self::SIGNING_KEY_SID, 'secret'); $scat->setIdentity('test identity'); $pvg = new VoiceGrant(); $pvg->setOutgoingApplication('AP123', array('foo' => 'bar')); $scat->addGrant($pvg); $token = $scat->toJWT(); $this->assertNotNull($token); $payload = JWT::decode($token, 'secret'); $this->validateClaims($payload); $grants = json_decode(json_encode($payload->grants), true); $this->assertEquals(2, count($grants)); $this->assertEquals('test identity', $payload->grants->identity); $decodedGrant = $grants['voice']; $outgoing = $decodedGrant['outgoing']; $this->assertEquals('AP123', $outgoing['application_sid']); $params = $outgoing['params']; $this->assertEquals('bar', $params['foo']); } function testTaskRouterGrant() { $scat = new AccessToken(self::ACCOUNT_SID, self::SIGNING_KEY_SID, 'secret'); $grant = new TaskRouterGrant(); $grant->setWorkspaceSid("WS123"); $grant->setWorkerSid("WK123"); $grant->setRole("worker"); $scat->addGrant($grant); $token = $scat->toJWT(); $this->assertNotNull($token); $payload = JWT::decode($token, 'secret'); $this->validateClaims($payload); $grants = json_decode(json_encode($payload->grants), true); $this->assertEquals(1, count($grants)); $this->assertArrayHasKey("task_router", $grants); $this->assertEquals("WS123", $grants['task_router']['workspace_sid']); $this->assertEquals("WK123", $grants['task_router']['worker_sid']); $this->assertEquals("worker", $grants['task_router']['role']); } } sdk/Twilio/Tests/Unit/Jwt/ClientTokenTest.php 0000604 00000007412 15174325133 0015155 0 ustar 00 <?php namespace Twilio\Tests\Unit\Jwt; use Twilio\Jwt\ClientToken; use Twilio\Jwt\JWT; use Twilio\Tests\Unit\UnitTest; class ClientTokenTest extends UnitTest { public function testNoPermissions() { $token = new ClientToken('AC123', 'foo'); $payload = JWT::decode($token->generateToken(), 'foo'); $this->assertEquals($payload->iss, "AC123"); $this->assertEquals($payload->scope, ''); } public function testInboundPermissions() { $token = new ClientToken('AC123', 'foo'); $token->allowClientIncoming("andy"); $payload = JWT::decode($token->generateToken(), 'foo'); $eurl = "scope:client:incoming?clientName=andy"; $this->assertEquals($payload->scope, $eurl); } public function testOutboundPermissions() { $token = new ClientToken('AC123', 'foo'); $token->allowClientOutgoing("AP123"); $payload = JWT::decode($token->generateToken(), 'foo');; $eurl = "scope:client:outgoing?appSid=AP123"; $this->assertContains($eurl, $payload->scope); } public function testOutboundPermissionsParams() { $token = new ClientToken('AC123', 'foo'); $token->allowClientOutgoing("AP123", array("foobar" => 3)); $payload = JWT::decode($token->generateToken(), 'foo'); $eurl = "scope:client:outgoing?appSid=AP123&appParams=foobar%3D3"; $this->assertEquals($payload->scope, $eurl); } public function testEvents() { $token = new ClientToken('AC123', 'foo'); $token->allowEventStream(); $payload = JWT::decode($token->generateToken(), 'foo'); $event_uri = "scope:stream:subscribe?path=%2F2010" . "-04-01%2FEvents¶ms="; $this->assertEquals($payload->scope, $event_uri); } public function testEventsWithFilters() { $token = new ClientToken('AC123', 'foo'); $token->allowEventStream(array("foobar" => "hey")); $payload = JWT::decode($token->generateToken(), 'foo'); $event_uri = "scope:stream:subscribe?path=%2F2010-" . "04-01%2FEvents¶ms=foobar%3Dhey"; $this->assertEquals($payload->scope, $event_uri); } public function testDecode() { $token = new ClientToken('AC123', 'foo'); $token->allowClientOutgoing("AP123", array("foobar"=> 3)); $token->allowClientIncoming("andy"); $token->allowEventStream(); $outgoing_uri = "scope:client:outgoing?appSid=" . "AP123&appParams=foobar%3D3&clientName=andy"; $incoming_uri = "scope:client:incoming?clientName=andy"; $event_uri = "scope:stream:subscribe?path=%2F2010-04-01%2FEvents"; $payload = JWT::decode($token->generateToken(), 'foo'); $scope = $payload->scope; $this->assertContains($outgoing_uri, $scope); $this->assertContains($incoming_uri, $scope); $this->assertContains($event_uri, $scope); } function testDecodeWithAuthToken() { try { $token = new ClientToken('AC123', 'foo'); $payload = JWT::decode($token->generateToken(), 'foo'); $this->assertSame($payload->iss, 'AC123'); } catch (\UnexpectedValueException $e) { $this->assertTrue(false, "Could not decode with 'foo'"); } } function testClientNameValidation() { $this->setExpectedException('InvalidArgumentException'); $token = new ClientToken('AC123', 'foo'); $token->allowClientIncoming('@'); $this->fail('exception should have been raised'); } function zeroLengthNameInvalid() { $this->setExpectedException('InvalidArgumentException'); $token = new ClientToken('AC123', 'foo'); $token->allowClientIncoming(""); $this->fail('exception should have been raised'); } } sdk/Twilio/Tests/Unit/Http/CurlClientTest.php 0000604 00000021140 15174325133 0015147 0 ustar 00 <?php namespace Twilio\Tests\Unit\Http; use Twilio\Http\CurlClient; use Twilio\Tests\Unit\UnitTest; class CurlClientTest extends UnitTest { public function testPreemptiveAuthorization() { $client = new CurlClient(); $options = $client->options( 'GET', 'http://api.twilio.com', array(), array(), array(), 'test-user', 'test-password' ); $this->assertArrayHasKey(CURLOPT_HTTPHEADER, $options); $headers = $options[CURLOPT_HTTPHEADER]; $authorization = null; foreach ($headers as $header) { $parse = explode(':', $header); $headerKey = $parse[0]; if ($headerKey == 'Authorization') { $authorization = $header; break; } } $this->assertNotNull($authorization); $authorizationPayload = explode(' ', $authorization); $encodedAuthorization = array_pop($authorizationPayload); $decodedAuthorization = base64_decode($encodedAuthorization); $this->assertEquals('test-user:test-password', $decodedAuthorization); } /** * @param string $message Failure Message * @param mixed[] $params Params with which to build the query * @param string $expected Expected query string * @dataProvider buildQueryProvider */ public function testBuildQuery($message, $params, $expected) { $client = new CurlClient(); $actual = $client->buildQuery($params); $this->assertEquals($expected, $actual, $message); } public function buildQueryProvider() { return array( array( 'Null Params', null, '' ), array( 'Empty Params', array(), '', ), array( 'Single Scalar', array('a' => 'z'), 'a=z', ), array( 'Multiple Scalars', array( 'a' => 'z', 'b' => 'y', ), 'a=z&b=y', ), array( 'Type Coercion: Booleans', array( 'a' => true, 'b' => false, ), 'a=1&b=', ), array( 'Type Coercion: Integers', array( 'a' => 7, 'b' => -14, 'c' => 0, ), 'a=7&b=-14&c=0', ), array( 'Nested Arrays', array( 'a' => array(1, 2, 3), 'b' => array('x', 'y', 'z'), ), 'a=1&a=2&a=3&b=x&b=y&b=z', ), array( 'URL Safety', array( 'a' => 'un$afe:// value!', ), 'a=un%24afe%3A%2F%2F+value%21', ), array( 'Encoded Key', array( 'StartTime>' => '2012-06-14', ), 'StartTime%3E=2012-06-14', ) ); } /** * @param $method * @param $params * @param $expected * @dataProvider queryStringProvider * @throws \Twilio\Exceptions\EnvironmentException */ public function testQueryString($method, $params, $expected) { $client = new CurlClient(); $actual = $client->options($method, 'url', $params); $this->assertEquals($expected, $actual[CURLOPT_URL]); } public function queryStringProvider() { $methods = array('GET', 'POST', 'PUT', 'DELETE', 'OPTIONS', 'HEAD', 'CUSTOM'); $cases = array(); foreach ($methods as $method) { $cases[] = array( $method, array(), 'url', ); $cases[] = array( $method, array( 'a' => '$z', 'b' => 7, 'c' => array(1, 'x', 2), ), 'url?a=%24z&b=7&c=1&c=x&c=2', ); } return $cases; } /** * @param mixed[] $params Parameters to post * @param mixed[] $data Data to post * @param string $expected Expected POSTFIELDS * @dataProvider postFieldsProvider * @throws \Twilio\Exceptions\EnvironmentException */ public function testPostFields($params, $data, $expected) { $client = new CurlClient(); $actual = $client->options('POST', 'url', $params, $data); $this->assertEquals($expected, $actual[CURLOPT_POSTFIELDS]); } public function postFieldsProvider() { return array( array( array(), array(), '', ), array( array( 'a' => 'x', ), array( 'a' => 'b', ), 'a=b' ), array( array( 'a' => 'x', ), array( 'a' => 'x', ), 'a=x' ), array( array( 'a' => 'x', ), array( 'a' => 'z', 'b' => 7, 'c' => array(1, 2, 3), ), 'a=z&b=7&c=1&c=2&c=3', ), array( '', 'a=x&b=z', 'a=x&b=z', ), ); } public function testPutFile() { $client = new CurlClient(); $actual = $client->options('PUT', 'url', array(), array('a' => 1, 'b' => 2)); $this->assertNotNull($actual[CURLOPT_INFILE]); $this->assertEquals('a=1&b=2', fread($actual[CURLOPT_INFILE], $actual[CURLOPT_INFILESIZE])); $this->assertEquals(7, $actual[CURLOPT_INFILESIZE]); } /** * @param string $message Case message, displayed on assertion error * @param mixed[] $options Options to inject * @param mixed[] $expected Partial array to expect * @dataProvider userInjectedOptionsProvider */ public function testUserInjectedOptions($message, $options, $expected) { $client = new CurlClient($options); $actual = $client->options( 'GET', 'url', array('param-key' => 'param-value'), array('data-key' => 'data-value'), array('header-key' => 'header-value'), 'user', 'password', 20 ); foreach ($expected as $key => $value) { $this->assertEquals($value, $actual[$key], $message); } } public function userInjectedOptionsProvider() { return array( array( 'No Conflict Options', array( CURLOPT_VERBOSE => true, ), array( CURLOPT_VERBOSE => true, ), ), array( 'Options preferred over Defaults', array( CURLOPT_TIMEOUT => 1000, ), array( CURLOPT_TIMEOUT => 1000, ), ), array( 'Required Options can not be injected', array( CURLOPT_HTTPGET => false, ), array( CURLOPT_HTTPGET => true, ), ), array( 'Injected URL decorated with Query String', array( CURLOPT_URL => 'user-provided-url', ), array( CURLOPT_URL => 'user-provided-url?param-key=param-value', ), ), array( 'Injected Headers are additive', array( CURLOPT_HTTPHEADER => array( 'injected-key: injected-value', ), ), array( CURLOPT_HTTPHEADER => array( 'injected-key: injected-value', 'header-key: header-value', 'Authorization: Basic ' . base64_encode('user:password'), ), ), ), ); } } sdk/Twilio/Tests/HolodeckTestCase.php 0000604 00000001317 15174325133 0013575 0 ustar 00 <?php namespace Twilio\Tests; use PHPUnit_Framework_TestCase; use Twilio\Rest\Client; class HolodeckTestCase extends PHPUnit_Framework_TestCase { /** @var Holodeck $holodeck */ protected $holodeck = null; /** @var Client $twilio */ protected $twilio = null; protected function setUp() { $this->holodeck = new Holodeck(); $this->twilio = new Client('ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'AUTHTOKEN', null, null, $this->holodeck); } protected function tearDown() { $this->twilio = null; $this->holodeck = null; } public function assertRequest($request) { $this->holodeck->assertRequest($request); $this->assertTrue(true); } } sdk/Twilio/Tests/Holodeck.php 0000604 00000004163 15174325133 0012143 0 ustar 00 <?php namespace Twilio\Tests; use Twilio\Http\Client; use Twilio\Http\Response; class Holodeck implements Client { private $requests = array(); private $responses = array(); public function request($method, $url, $params = array(), $data = array(), $headers = array(), $user = null, $password = null, $timeout = null) { array_push($this->requests, new Request($method, $url, $params, $data, $headers, $user, $password)); if (count($this->responses) === 0) { return new Response(404, null, null); } else { return array_shift($this->responses); } } public function mock($response) { array_push($this->responses, $response); } public function assertRequest($request) { if ($this->hasRequest($request)) { return; } $message = "Failed asserting that the following request exists: \n"; $message .= ' - ' . $this->printRequest($request); $message .= "\n" . str_repeat('-', 3) . "\n"; $message .= "Candidate Requests:\n"; foreach ($this->requests as $candidate) { $message .= ' + ' . $this->printRequest($candidate) . "\n"; } throw new \PHPUnit_Framework_ExpectationFailedException($message); } public function hasRequest($request) { for ($i = 0; $i < count($this->requests); $i++) { $c = $this->requests[$i]; if (strtolower($request->method) == strtolower($c->method) && $request->url == $c->url && $request->params == $c->params && $request->data == $c->data) { return true; } } return false; } protected function printRequest($request) { $url = $request->url; if ($request->params) { $url .= '?' . http_build_query($request->params); } $data = $request->data ? '-d ' . http_build_query($request->data) : ''; return implode(' ', array(strtoupper($request->method), $url, $data)); } } sdk/Twilio/Tests/phpunit.xml 0000604 00000000440 15174325133 0012105 0 ustar 00 <!--suppress XmlUnboundNsPrefix --> <phpunit bootstrap="./Bootstrap.php" convertNoticesToExceptions="false"> <testsuites> <testsuite name="Twilio Test Suite"> <directory>./</directory> <exclude>Unit/WorkflowTest.php</exclude> </testsuite> </testsuites> </phpunit> sdk/Twilio/Tests/Request.php 0000604 00000000632 15174325133 0012040 0 ustar 00 <?php namespace Twilio\Tests; class Request { function __construct($method, $url, $params = array(), $data = array(), $headers = array(), $user = null, $password = null) { $this->method = $method; $this->url = $url; $this->params = $params; $this->data = $data; $this->headers = $headers; $this->user = $user; $this->password = $password; } } sdk/Twilio/Tests/Bootstrap.php 0000604 00000001120 15174325133 0012356 0 ustar 00 <?php error_reporting(E_ALL | E_STRICT); ini_set('display_errors', 1); $root = realpath(dirname(dirname(__FILE__))); $library = "$root/Rest"; $tests = "$root/Tests"; $path = array($library, $tests, get_include_path()); set_include_path(implode(PATH_SEPARATOR, $path)); $vendorFilename = dirname(__FILE__) . '/../../vendor/autoload.php'; if (file_exists($vendorFilename)) { /* composer install */ /** @noinspection PhpIncludeInspection */ require $vendorFilename; } /** @noinspection PhpIncludeInspection */ require_once 'Client.php'; unset($root, $library, $tests, $path); sdk/Twilio/Tests/Integration/Chat/V1/CredentialTest.php 0000604 00000016251 15174325133 0016756 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Chat\V1; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class CredentialTest extends HolodeckTestCase { public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->chat->v1->credentials->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://chat.twilio.com/v1/Credentials' )); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "credentials": [ { "sid": "CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "friendly_name": "Test slow create", "type": "apn", "sandbox": "False", "date_created": "2015-10-07T17:50:01Z", "date_updated": "2015-10-07T17:50:01Z", "url": "https://chat.twilio.com/v1/Credentials/CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ], "meta": { "page": 0, "page_size": 1, "first_page_url": "https://chat.twilio.com/v1/Credentials?PageSize=1&Page=0", "previous_page_url": null, "url": "https://chat.twilio.com/v1/Credentials?PageSize=1&Page=0", "next_page_url": null, "key": "credentials" } } ' )); $actual = $this->twilio->chat->v1->credentials->read(); $this->assertGreaterThan(0, count($actual)); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "credentials": [], "meta": { "page": 0, "page_size": 1, "first_page_url": "https://chat.twilio.com/v1/Credentials?PageSize=1&Page=0", "previous_page_url": null, "url": "https://chat.twilio.com/v1/Credentials?PageSize=1&Page=0", "next_page_url": null, "key": "credentials" } } ' )); $actual = $this->twilio->chat->v1->credentials->read(); $this->assertNotNull($actual); } public function testCreateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->chat->v1->credentials->create("gcm"); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $values = array('Type' => "gcm", ); $this->assertRequest(new Request( 'post', 'https://chat.twilio.com/v1/Credentials', null, $values )); } public function testCreateResponse() { $this->holodeck->mock(new Response( 201, ' { "sid": "CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "friendly_name": "Test slow create", "type": "apn", "sandbox": "False", "date_created": "2015-10-07T17:50:01Z", "date_updated": "2015-10-07T17:50:01Z", "url": "https://chat.twilio.com/v1/Credentials/CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->chat->v1->credentials->create("gcm"); $this->assertNotNull($actual); } public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->chat->v1->credentials("CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://chat.twilio.com/v1/Credentials/CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "sid": "CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "friendly_name": "Test slow create", "type": "apn", "sandbox": "False", "date_created": "2015-10-07T17:50:01Z", "date_updated": "2015-10-07T17:50:01Z", "url": "https://chat.twilio.com/v1/Credentials/CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->chat->v1->credentials("CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); $this->assertNotNull($actual); } public function testUpdateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->chat->v1->credentials("CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'post', 'https://chat.twilio.com/v1/Credentials/CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testUpdateResponse() { $this->holodeck->mock(new Response( 200, ' { "sid": "CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "friendly_name": "Test slow create", "type": "apn", "sandbox": "False", "date_created": "2015-10-07T17:50:01Z", "date_updated": "2015-10-07T17:50:01Z", "url": "https://chat.twilio.com/v1/Credentials/CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->chat->v1->credentials("CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); $this->assertNotNull($actual); } public function testDeleteRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->chat->v1->credentials("CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'delete', 'https://chat.twilio.com/v1/Credentials/CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testDeleteResponse() { $this->holodeck->mock(new Response( 204, null )); $actual = $this->twilio->chat->v1->credentials("CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); $this->assertTrue($actual); } } sdk/Twilio/Tests/Integration/Chat/V1/ServiceTest.php 0000604 00000025143 15174325133 0016304 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Chat\V1; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class ServiceTest extends HolodeckTestCase { public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->chat->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "consumption_report_interval": 100, "date_created": "2015-07-30T20:00:00Z", "date_updated": "2015-07-30T20:00:00Z", "default_channel_creator_role_sid": "RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "default_channel_role_sid": "RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "default_service_role_sid": "RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "friendly_name": "friendly_name", "limits": { "actions_per_second": 20, "channel_members": 100, "user_channels": 250 }, "links": {}, "notifications": {}, "post_webhook_url": "post_webhook_url", "pre_webhook_url": "pre_webhook_url", "reachability_enabled": false, "read_status_enabled": false, "sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "typing_indicator_timeout": 100, "url": "http://www.example.com", "webhook_filters": [ "webhook_filters" ], "webhook_method": "webhook_method", "webhooks": {} } ' )); $actual = $this->twilio->chat->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); $this->assertNotNull($actual); } public function testDeleteRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->chat->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'delete', 'https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testDeleteResponse() { $this->holodeck->mock(new Response( 204, null )); $actual = $this->twilio->chat->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); $this->assertTrue($actual); } public function testCreateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->chat->v1->services->create("friendlyName"); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $values = array('FriendlyName' => "friendlyName", ); $this->assertRequest(new Request( 'post', 'https://chat.twilio.com/v1/Services', null, $values )); } public function testCreateResponse() { $this->holodeck->mock(new Response( 201, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "consumption_report_interval": 100, "date_created": "2015-07-30T20:00:00Z", "date_updated": "2015-07-30T20:00:00Z", "default_channel_creator_role_sid": "RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "default_channel_role_sid": "RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "default_service_role_sid": "RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "friendly_name": "friendly_name", "limits": { "actions_per_second": 20, "channel_members": 100, "user_channels": 250 }, "links": {}, "notifications": {}, "post_webhook_url": "post_webhook_url", "pre_webhook_url": "pre_webhook_url", "reachability_enabled": false, "read_status_enabled": false, "sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "typing_indicator_timeout": 100, "url": "http://www.example.com", "webhook_filters": [ "webhook_filters" ], "webhook_method": "webhook_method", "webhooks": {} } ' )); $actual = $this->twilio->chat->v1->services->create("friendlyName"); $this->assertNotNull($actual); } public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->chat->v1->services->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://chat.twilio.com/v1/Services' )); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "meta": { "first_page_url": "https://chat.twilio.com/v1/Services?Page=0&PageSize=50", "key": "services", "next_page_url": null, "page": 0, "page_size": 0, "previous_page_url": null, "url": "https://chat.twilio.com/v1/Services" }, "services": [] } ' )); $actual = $this->twilio->chat->v1->services->read(); $this->assertNotNull($actual); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "meta": { "first_page_url": "https://chat.twilio.com/v1/Services?Page=0&PageSize=50", "key": "services", "next_page_url": null, "page": 0, "page_size": 1, "previous_page_url": null, "url": "https://chat.twilio.com/v1/Services" }, "services": [ { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "consumption_report_interval": 100, "date_created": "2015-07-30T20:00:00Z", "date_updated": "2015-07-30T20:00:00Z", "default_channel_creator_role_sid": "RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "default_channel_role_sid": "RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "default_service_role_sid": "RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "friendly_name": "friendly_name", "limits": { "actions_per_second": 20, "channel_members": 100, "user_channels": 250 }, "links": {}, "notifications": {}, "post_webhook_url": "post_webhook_url", "pre_webhook_url": "pre_webhook_url", "reachability_enabled": false, "read_status_enabled": false, "sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "typing_indicator_timeout": 100, "url": "http://www.example.com", "webhook_filters": [ "webhook_filters" ], "webhook_method": "webhook_method", "webhooks": {} } ] } ' )); $actual = $this->twilio->chat->v1->services->read(); $this->assertGreaterThan(0, count($actual)); } public function testUpdateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->chat->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'post', 'https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testUpdateResponse() { $this->holodeck->mock(new Response( 200, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "consumption_report_interval": 100, "date_created": "2015-07-30T20:00:00Z", "date_updated": "2015-07-30T20:00:00Z", "default_channel_creator_role_sid": "RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "default_channel_role_sid": "RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "default_service_role_sid": "RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "friendly_name": "friendly_name", "limits": { "actions_per_second": 20, "channel_members": 500, "user_channels": 600 }, "links": {}, "notifications": {}, "post_webhook_url": "post_webhook_url", "pre_webhook_url": "pre_webhook_url", "reachability_enabled": false, "read_status_enabled": false, "sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "typing_indicator_timeout": 100, "url": "http://www.example.com", "webhook_filters": [ "webhook_filters" ], "webhook_method": "webhook_method", "webhooks": {} } ' )); $actual = $this->twilio->chat->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/Chat/V1/Service/Channel/MessageTest.php 0000604 00000030564 15174325133 0021243 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Chat\V1\Service\Channel; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class MessageTest extends HolodeckTestCase { public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->chat->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->messages("IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "sid": "IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "to": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "channel_sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "2016-03-24T20:37:57Z", "date_updated": "2016-03-24T20:37:57Z", "was_edited": false, "from": "system", "attributes": "{}", "body": "Hello", "index": 0, "url": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->chat->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->messages("IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); $this->assertNotNull($actual); } public function testCreateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->chat->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->messages->create("body"); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $values = array('Body' => "body", ); $this->assertRequest(new Request( 'post', 'https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages', null, $values )); } public function testCreateResponse() { $this->holodeck->mock(new Response( 201, ' { "sid": "IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "to": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "channel_sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "attributes": null, "date_created": "2016-03-24T20:37:57Z", "date_updated": "2016-03-24T20:37:57Z", "was_edited": false, "from": "system", "body": "Hello", "index": 0, "url": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->chat->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->messages->create("body"); $this->assertNotNull($actual); } public function testCreateWithAttributesResponse() { $this->holodeck->mock(new Response( 201, ' { "sid": "IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "to": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "channel_sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "2016-03-24T20:37:57Z", "date_updated": "2016-03-24T20:37:57Z", "was_edited": false, "from": "system", "attributes": "{}", "body": "Hello", "index": 0, "url": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->chat->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->messages->create("body"); $this->assertNotNull($actual); } public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->chat->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->messages->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages' )); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "meta": { "page": 0, "page_size": 50, "first_page_url": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages?PageSize=50&Page=0", "previous_page_url": null, "url": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages?PageSize=50&Page=0", "next_page_url": null, "key": "messages" }, "messages": [ { "sid": "IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "to": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "channel_sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "2016-03-24T20:37:57Z", "date_updated": "2016-03-24T20:37:57Z", "was_edited": false, "from": "system", "attributes": "{}", "body": "Hello", "index": 0, "url": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ] } ' )); $actual = $this->twilio->chat->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->messages->read(); $this->assertGreaterThan(0, count($actual)); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "meta": { "page": 0, "page_size": 50, "first_page_url": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages?PageSize=50&Page=0", "previous_page_url": null, "url": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages?PageSize=50&Page=0", "next_page_url": null, "key": "messages" }, "messages": [] } ' )); $actual = $this->twilio->chat->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->messages->read(); $this->assertNotNull($actual); } public function testDeleteRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->chat->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->messages("IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'delete', 'https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testDeleteResponse() { $this->holodeck->mock(new Response( 204, null )); $actual = $this->twilio->chat->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->messages("IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); $this->assertTrue($actual); } public function testUpdateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->chat->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->messages("IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'post', 'https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testUpdateResponse() { $this->holodeck->mock(new Response( 200, ' { "sid": "IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "to": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "channel_sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "attributes": "{\\"test\\": \\"test\\"}", "date_created": "2016-03-24T20:37:57Z", "date_updated": "2016-03-24T20:37:57Z", "was_edited": false, "from": "system", "body": "Hello", "index": 0, "url": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->chat->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->messages("IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/Chat/V1/Service/Channel/MemberTest.php 0000604 00000030406 15174325133 0021061 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Chat\V1\Service\Channel; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class MemberTest extends HolodeckTestCase { public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->chat->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->members("MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members/MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "sid": "MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "channel_sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "identity": "jing", "role_sid": "RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "last_consumed_message_index": null, "last_consumption_timestamp": null, "date_created": "2016-03-24T21:05:50Z", "date_updated": "2016-03-24T21:05:50Z", "url": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members/MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->chat->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->members("MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); $this->assertNotNull($actual); } public function testCreateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->chat->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->members->create("identity"); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $values = array('Identity' => "identity", ); $this->assertRequest(new Request( 'post', 'https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members', null, $values )); } public function testCreateResponse() { $this->holodeck->mock(new Response( 201, ' { "sid": "MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "channel_sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "identity": "jing", "role_sid": "RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "last_consumed_message_index": null, "last_consumption_timestamp": null, "date_created": "2016-03-24T21:05:50Z", "date_updated": "2016-03-24T21:05:50Z", "url": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members/MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->chat->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->members->create("identity"); $this->assertNotNull($actual); } public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->chat->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->members->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members' )); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "meta": { "page": 0, "page_size": 50, "first_page_url": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members?PageSize=50&Page=0", "previous_page_url": null, "url": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members?PageSize=50&Page=0", "next_page_url": null, "key": "members" }, "members": [ { "sid": "MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "channel_sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "identity": "jing", "role_sid": "RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "last_consumed_message_index": null, "last_consumption_timestamp": null, "date_created": "2016-03-24T21:05:50Z", "date_updated": "2016-03-24T21:05:50Z", "url": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members/MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ] } ' )); $actual = $this->twilio->chat->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->members->read(); $this->assertGreaterThan(0, count($actual)); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "meta": { "page": 0, "page_size": 50, "first_page_url": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members?PageSize=50&Page=0", "previous_page_url": null, "url": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members?PageSize=50&Page=0", "next_page_url": null, "key": "members" }, "members": [] } ' )); $actual = $this->twilio->chat->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->members->read(); $this->assertNotNull($actual); } public function testDeleteRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->chat->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->members("MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'delete', 'https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members/MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testDeleteResponse() { $this->holodeck->mock(new Response( 204, null )); $actual = $this->twilio->chat->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->members("MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); $this->assertTrue($actual); } public function testUpdateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->chat->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->members("MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'post', 'https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members/MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testUpdateRoleSidResponse() { $this->holodeck->mock(new Response( 200, ' { "sid": "MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "channel_sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "identity": "jing", "role_sid": "RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "last_consumed_message_index": null, "last_consumption_timestamp": null, "date_created": "2016-03-24T21:05:50Z", "date_updated": "2016-03-24T21:05:50Z", "url": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members/MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->chat->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->members("MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); $this->assertNotNull($actual); } public function testUpdateLastConsumedMessageIndexResponse() { $this->holodeck->mock(new Response( 200, ' { "sid": "MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "channel_sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "identity": "jing", "role_sid": "RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "last_consumed_message_index": 666, "last_consumption_timestamp": null, "date_created": "2016-03-24T21:05:50Z", "date_updated": "2016-03-24T21:05:50Z", "url": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members/MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->chat->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->members("MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/Chat/V1/Service/Channel/InviteTest.php 0000604 00000021601 15174325133 0021105 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Chat\V1\Service\Channel; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class InviteTest extends HolodeckTestCase { public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->chat->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->invites("INaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Invites/INaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "channel_sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "created_by": "created_by", "date_created": "2015-07-30T20:00:00Z", "date_updated": "2015-07-30T20:00:00Z", "identity": "identity", "role_sid": "RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "sid": "INaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "url": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Invites/INaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->chat->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->invites("INaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); $this->assertNotNull($actual); } public function testCreateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->chat->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->invites->create("identity"); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $values = array('Identity' => "identity", ); $this->assertRequest(new Request( 'post', 'https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Invites', null, $values )); } public function testCreateResponse() { $this->holodeck->mock(new Response( 201, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "channel_sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "created_by": "created_by", "date_created": "2015-07-30T20:00:00Z", "date_updated": "2015-07-30T20:00:00Z", "identity": "identity", "role_sid": "RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "sid": "INaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "url": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Invites/INaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->chat->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->invites->create("identity"); $this->assertNotNull($actual); } public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->chat->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->invites->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Invites' )); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "invites": [], "meta": { "first_page_url": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Invites?PageSize=50&Page=0", "key": "invites", "next_page_url": null, "page": 0, "page_size": 50, "previous_page_url": null, "url": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Invites?PageSize=50&Page=0" } } ' )); $actual = $this->twilio->chat->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->invites->read(); $this->assertNotNull($actual); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "invites": [ { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "channel_sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "created_by": "created_by", "date_created": "2015-07-30T20:00:00Z", "date_updated": "2015-07-30T20:00:00Z", "identity": "identity", "role_sid": "RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "sid": "INaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "url": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Invites/INaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ], "meta": { "first_page_url": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Invites?PageSize=50&Page=0", "key": "invites", "next_page_url": null, "page": 0, "page_size": 50, "previous_page_url": null, "url": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Invites?PageSize=50&Page=0" } } ' )); $actual = $this->twilio->chat->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->invites->read(); $this->assertGreaterThan(0, count($actual)); } public function testDeleteRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->chat->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->invites("INaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'delete', 'https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Invites/INaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testDeleteResponse() { $this->holodeck->mock(new Response( 204, null )); $actual = $this->twilio->chat->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->invites("INaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); $this->assertTrue($actual); } } sdk/Twilio/Tests/Integration/Chat/V1/Service/RoleTest.php 0000604 00000023641 15174325133 0017206 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Chat\V1\Service; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Serialize; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class RoleTest extends HolodeckTestCase { public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->chat->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->roles("RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Roles/RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "sid": "RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "friendly_name": "channel user", "type": "channel", "permissions": [ "sendMessage", "leaveChannel", "editOwnMessage", "deleteOwnMessage" ], "date_created": "2016-03-03T19:47:15Z", "date_updated": "2016-03-03T19:47:15Z", "url": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Roles/RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->chat->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->roles("RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); $this->assertNotNull($actual); } public function testDeleteRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->chat->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->roles("RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'delete', 'https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Roles/RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testDeleteResponse() { $this->holodeck->mock(new Response( 204, null )); $actual = $this->twilio->chat->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->roles("RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); $this->assertTrue($actual); } public function testCreateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->chat->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->roles->create("friendlyName", "channel", array('permission')); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $values = array( 'FriendlyName' => "friendlyName", 'Type' => "channel", 'Permission' => Serialize::map(array('permission'), function($e) { return $e; }), ); $this->assertRequest(new Request( 'post', 'https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Roles', null, $values )); } public function testCreateResponse() { $this->holodeck->mock(new Response( 201, ' { "sid": "RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "friendly_name": "channel user", "type": "channel", "permissions": [ "sendMessage", "leaveChannel", "editOwnMessage", "deleteOwnMessage" ], "date_created": "2016-03-03T19:47:15Z", "date_updated": "2016-03-03T19:47:15Z", "url": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Roles/RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->chat->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->roles->create("friendlyName", "channel", array('permission')); $this->assertNotNull($actual); } public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->chat->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->roles->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Roles' )); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "meta": { "page": 0, "page_size": 50, "first_page_url": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Roles?PageSize=50&Page=0", "previous_page_url": null, "url": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Roles?PageSize=50&Page=0", "next_page_url": null, "key": "roles" }, "roles": [ { "sid": "RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "friendly_name": "channel user", "type": "channel", "permissions": [ "sendMessage", "leaveChannel", "editOwnMessage", "deleteOwnMessage" ], "date_created": "2016-03-03T19:47:15Z", "date_updated": "2016-03-03T19:47:15Z", "url": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Roles/RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ] } ' )); $actual = $this->twilio->chat->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->roles->read(); $this->assertGreaterThan(0, count($actual)); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "meta": { "page": 0, "page_size": 50, "first_page_url": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Roles?PageSize=50&Page=0", "previous_page_url": null, "url": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Roles?PageSize=50&Page=0", "next_page_url": null, "key": "roles" }, "roles": [] } ' )); $actual = $this->twilio->chat->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->roles->read(); $this->assertNotNull($actual); } public function testUpdateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->chat->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->roles("RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(array('permission')); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $values = array('Permission' => Serialize::map(array('permission'), function($e) { return $e; }), ); $this->assertRequest(new Request( 'post', 'https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Roles/RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', null, $values )); } public function testUpdateResponse() { $this->holodeck->mock(new Response( 200, ' { "sid": "RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "friendly_name": "channel user", "type": "channel", "permissions": [ "sendMessage", "leaveChannel", "editOwnMessage", "deleteOwnMessage" ], "date_created": "2016-03-03T19:47:15Z", "date_updated": "2016-03-03T19:47:15Z", "url": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Roles/RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->chat->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->roles("RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(array('permission')); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/Chat/V1/Service/UserTest.php 0000604 00000024540 15174325133 0017222 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Chat\V1\Service; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class UserTest extends HolodeckTestCase { public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->chat->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->users("USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "sid": "USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "role_sid": "RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "identity": "jing", "attributes": null, "is_online": true, "is_notifiable": null, "friendly_name": null, "joined_channels_count": 0, "date_created": "2016-03-24T21:05:19Z", "date_updated": "2016-03-24T21:05:19Z", "links": { "user_channels": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels" }, "url": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->chat->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->users("USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); $this->assertNotNull($actual); } public function testDeleteRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->chat->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->users("USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'delete', 'https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testDeleteResponse() { $this->holodeck->mock(new Response( 204, null )); $actual = $this->twilio->chat->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->users("USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); $this->assertTrue($actual); } public function testCreateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->chat->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->users->create("identity"); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $values = array('Identity' => "identity", ); $this->assertRequest(new Request( 'post', 'https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users', null, $values )); } public function testCreateResponse() { $this->holodeck->mock(new Response( 201, ' { "sid": "USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "role_sid": "RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "identity": "jing", "attributes": null, "is_online": true, "is_notifiable": null, "friendly_name": null, "joined_channels_count": 0, "date_created": "2016-03-24T21:05:19Z", "date_updated": "2016-03-24T21:05:19Z", "links": { "user_channels": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels" }, "url": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->chat->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->users->create("identity"); $this->assertNotNull($actual); } public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->chat->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->users->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users' )); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "meta": { "page": 0, "page_size": 50, "first_page_url": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users?PageSize=50&Page=0", "previous_page_url": null, "url": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users?PageSize=50&Page=0", "next_page_url": null, "key": "users" }, "users": [ { "sid": "USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "role_sid": "RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "identity": "jing", "attributes": null, "is_online": true, "is_notifiable": null, "friendly_name": null, "date_created": "2016-03-24T21:05:19Z", "date_updated": "2016-03-24T21:05:19Z", "joined_channels_count": 0, "links": { "user_channels": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels" }, "url": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ] } ' )); $actual = $this->twilio->chat->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->users->read(); $this->assertGreaterThan(0, count($actual)); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "meta": { "page": 0, "page_size": 50, "first_page_url": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users?PageSize=50&Page=0", "previous_page_url": null, "url": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users?PageSize=50&Page=0", "next_page_url": null, "key": "users" }, "users": [] } ' )); $actual = $this->twilio->chat->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->users->read(); $this->assertNotNull($actual); } public function testUpdateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->chat->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->users("USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'post', 'https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testUpdateResponse() { $this->holodeck->mock(new Response( 200, ' { "sid": "USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "role_sid": "RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "identity": "jing", "attributes": null, "is_online": true, "is_notifiable": null, "friendly_name": null, "joined_channels_count": 0, "date_created": "2016-03-24T21:05:19Z", "date_updated": "2016-03-24T21:05:19Z", "links": { "user_channels": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels" }, "url": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->chat->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->users("USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/Chat/V1/Service/User/UserChannelTest.php 0000604 00000010074 15174325133 0021426 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Chat\V1\Service\User; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class UserChannelTest extends HolodeckTestCase { public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->chat->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->users("USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->userChannels->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels' )); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "meta": { "page": 0, "page_size": 50, "first_page_url": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels?PageSize=50&Page=0", "previous_page_url": null, "url": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels?PageSize=50&Page=0", "next_page_url": null, "key": "channels" }, "channels": [ { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "channel_sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "member_sid": "MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "status": "joined", "last_consumed_message_index": 5, "unread_messages_count": 5, "links": { "channel": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "member": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members/MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } } ] } ' )); $actual = $this->twilio->chat->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->users("USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->userChannels->read(); $this->assertGreaterThan(0, count($actual)); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "meta": { "page": 0, "page_size": 50, "first_page_url": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels?PageSize=50&Page=0", "previous_page_url": null, "url": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels?PageSize=50&Page=0", "next_page_url": null, "key": "channels" }, "channels": [] } ' )); $actual = $this->twilio->chat->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->users("USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->userChannels->read(); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/Chat/V1/Service/ChannelTest.php 0000604 00000027376 15174325133 0017666 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Chat\V1\Service; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class ChannelTest extends HolodeckTestCase { public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->chat->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "friendly_name": "friendly_name", "unique_name": "unique_name", "attributes": "{ \\"foo\\": \\"bar\\" }", "type": "public", "date_created": "2015-12-16T22:18:37Z", "date_updated": "2015-12-16T22:18:37Z", "created_by": "system", "members_count": 0, "messages_count": 0, "url": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "links": { "members": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members", "messages": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages", "invites": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Invites", "last_message": null } } ' )); $actual = $this->twilio->chat->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); $this->assertNotNull($actual); } public function testDeleteRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->chat->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'delete', 'https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testDeleteResponse() { $this->holodeck->mock(new Response( 204, null )); $actual = $this->twilio->chat->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); $this->assertTrue($actual); } public function testCreateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->chat->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels->create(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'post', 'https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels' )); } public function testCreateResponse() { $this->holodeck->mock(new Response( 201, ' { "sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "friendly_name": "friendly_name", "unique_name": "unique_name", "attributes": "{ \\"foo\\": \\"bar\\" }", "type": "public", "date_created": "2015-12-16T22:18:37Z", "date_updated": "2015-12-16T22:18:37Z", "created_by": "system", "members_count": 0, "messages_count": 0, "url": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "links": { "members": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members", "messages": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages", "invites": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Invites", "last_message": null } } ' )); $actual = $this->twilio->chat->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels->create(); $this->assertNotNull($actual); } public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->chat->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels' )); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "channels": [ { "sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "friendly_name": "friendly_name", "unique_name": "unique_name", "attributes": "{ \\"foo\\": \\"bar\\" }", "type": "public", "date_created": "2015-12-16T22:18:37Z", "date_updated": "2015-12-16T22:18:37Z", "created_by": "system", "members_count": 0, "messages_count": 0, "url": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "links": { "members": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members", "messages": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages", "invites": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Invites", "last_message": null } } ], "meta": { "page": 0, "page_size": 50, "first_page_url": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels?PageSize=50&Page=0", "previous_page_url": null, "url": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels?PageSize=50&Page=0", "next_page_url": null, "key": "channels" } } ' )); $actual = $this->twilio->chat->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels->read(); $this->assertGreaterThan(0, count($actual)); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "channels": [], "meta": { "page": 0, "page_size": 50, "first_page_url": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels?PageSize=50&Page=0", "previous_page_url": null, "url": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels?PageSize=50&Page=0", "next_page_url": null, "key": "channels" } } ' )); $actual = $this->twilio->chat->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels->read(); $this->assertNotNull($actual); } public function testUpdateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->chat->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'post', 'https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testUpdateResponse() { $this->holodeck->mock(new Response( 200, ' { "sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "friendly_name": "friendly_name", "unique_name": "unique_name", "attributes": "{ \\"foo\\": \\"bar\\" }", "type": "public", "date_created": "2015-12-16T22:18:37Z", "date_updated": "2015-12-16T22:18:37Z", "created_by": "system", "members_count": 0, "messages_count": 0, "url": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "links": { "members": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members", "messages": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages", "invites": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Invites", "last_message": null } } ' )); $actual = $this->twilio->chat->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/Chat/V2/Service/UserTest.php 0000604 00000025754 15174325133 0017233 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Chat\V2\Service; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class UserTest extends HolodeckTestCase { public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->chat->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->users("USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "sid": "USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "role_sid": "RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "identity": "jing", "attributes": null, "is_online": true, "is_notifiable": null, "friendly_name": null, "joined_channels_count": 0, "date_created": "2016-03-24T21:05:19Z", "date_updated": "2016-03-24T21:05:19Z", "links": { "user_channels": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels", "user_bindings": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings" }, "url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->chat->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->users("USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); $this->assertNotNull($actual); } public function testDeleteRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->chat->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->users("USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'delete', 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testDeleteResponse() { $this->holodeck->mock(new Response( 204, null )); $actual = $this->twilio->chat->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->users("USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); $this->assertTrue($actual); } public function testCreateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->chat->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->users->create("identity"); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $values = array('Identity' => "identity", ); $this->assertRequest(new Request( 'post', 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users', null, $values )); } public function testCreateResponse() { $this->holodeck->mock(new Response( 201, ' { "sid": "USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "role_sid": "RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "identity": "jing", "attributes": null, "is_online": true, "is_notifiable": null, "friendly_name": null, "joined_channels_count": 0, "date_created": "2016-03-24T21:05:19Z", "date_updated": "2016-03-24T21:05:19Z", "links": { "user_channels": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels", "user_bindings": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings" }, "url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->chat->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->users->create("identity"); $this->assertNotNull($actual); } public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->chat->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->users->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users' )); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "meta": { "page": 0, "page_size": 50, "first_page_url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users?PageSize=50&Page=0", "previous_page_url": null, "url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users?PageSize=50&Page=0", "next_page_url": null, "key": "users" }, "users": [ { "sid": "USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "role_sid": "RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "identity": "jing", "attributes": null, "is_online": true, "is_notifiable": null, "friendly_name": null, "date_created": "2016-03-24T21:05:19Z", "date_updated": "2016-03-24T21:05:19Z", "joined_channels_count": 0, "links": { "user_channels": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels", "user_bindings": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings" }, "url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ] } ' )); $actual = $this->twilio->chat->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->users->read(); $this->assertGreaterThan(0, count($actual)); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "meta": { "page": 0, "page_size": 50, "first_page_url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users?PageSize=50&Page=0", "previous_page_url": null, "url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users?PageSize=50&Page=0", "next_page_url": null, "key": "users" }, "users": [] } ' )); $actual = $this->twilio->chat->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->users->read(); $this->assertNotNull($actual); } public function testUpdateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->chat->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->users("USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'post', 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testUpdateResponse() { $this->holodeck->mock(new Response( 200, ' { "sid": "USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "role_sid": "RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "identity": "jing", "attributes": null, "is_online": true, "is_notifiable": null, "friendly_name": null, "joined_channels_count": 0, "date_created": "2016-03-24T21:05:19Z", "date_updated": "2016-03-24T21:05:19Z", "links": { "user_channels": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels", "user_bindings": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings" }, "url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->chat->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->users("USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/Chat/V2/Service/Channel/MemberTest.php 0000604 00000026011 15174325133 0021057 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Chat\V2\Service\Channel; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class MemberTest extends HolodeckTestCase { public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->chat->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->members("MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members/MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "sid": "MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "channel_sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "identity": "jing", "role_sid": "RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "last_consumed_message_index": null, "last_consumption_timestamp": null, "date_created": "2016-03-24T21:05:50Z", "date_updated": "2016-03-24T21:05:50Z", "url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members/MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->chat->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->members("MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); $this->assertNotNull($actual); } public function testCreateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->chat->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->members->create("identity"); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $values = array('Identity' => "identity", ); $this->assertRequest(new Request( 'post', 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members', null, $values )); } public function testCreateResponse() { $this->holodeck->mock(new Response( 201, ' { "sid": "MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "channel_sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "identity": "jing", "role_sid": "RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "last_consumed_message_index": null, "last_consumption_timestamp": null, "date_created": "2016-03-24T21:05:50Z", "date_updated": "2016-03-24T21:05:50Z", "url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members/MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->chat->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->members->create("identity"); $this->assertNotNull($actual); } public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->chat->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->members->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members' )); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "meta": { "page": 0, "page_size": 50, "first_page_url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members?PageSize=50&Page=0", "previous_page_url": null, "url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members?PageSize=50&Page=0", "next_page_url": null, "key": "members" }, "members": [ { "sid": "MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "channel_sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "identity": "jing", "role_sid": "RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "last_consumed_message_index": null, "last_consumption_timestamp": null, "date_created": "2016-03-24T21:05:50Z", "date_updated": "2016-03-24T21:05:50Z", "url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members/MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ] } ' )); $actual = $this->twilio->chat->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->members->read(); $this->assertGreaterThan(0, count($actual)); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "meta": { "page": 0, "page_size": 50, "first_page_url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members?PageSize=50&Page=0", "previous_page_url": null, "url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members?PageSize=50&Page=0", "next_page_url": null, "key": "members" }, "members": [] } ' )); $actual = $this->twilio->chat->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->members->read(); $this->assertNotNull($actual); } public function testDeleteRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->chat->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->members("MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'delete', 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members/MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testDeleteResponse() { $this->holodeck->mock(new Response( 204, null )); $actual = $this->twilio->chat->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->members("MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); $this->assertTrue($actual); } public function testUpdateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->chat->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->members("MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'post', 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members/MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testUpdateRoleSidResponse() { $this->holodeck->mock(new Response( 200, ' { "sid": "MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "channel_sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "identity": "jing", "role_sid": "RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "last_consumed_message_index": 20, "last_consumption_timestamp": "2016-03-24T21:05:52Z", "date_created": "2016-03-24T21:05:50Z", "date_updated": "2016-03-24T21:05:51Z", "url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members/MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->chat->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->members("MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/Chat/V2/Service/Channel/MessageTest.php 0000604 00000042416 15174325133 0021243 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Chat\V2\Service\Channel; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class MessageTest extends HolodeckTestCase { public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->chat->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->messages("IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "sid": "IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "to": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "channel_sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "2016-03-24T20:37:57Z", "date_updated": "2016-03-24T20:37:57Z", "last_updated_by": null, "was_edited": false, "from": "system", "attributes": "{}", "body": "Hello", "index": 0, "type": "text", "media": null, "url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->chat->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->messages("IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); $this->assertNotNull($actual); } public function testFetchMediaResponse() { $this->holodeck->mock(new Response( 200, ' { "sid": "IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "to": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "channel_sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "2016-03-24T20:37:57Z", "date_updated": "2016-03-24T20:37:57Z", "last_updated_by": null, "was_edited": false, "from": "system", "attributes": "{}", "body": "Hello", "index": 0, "type": "media", "media": { "sid": "MEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "size": 99999999999999, "content_type": "application/pdf", "filename": "hello.pdf" }, "url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->chat->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->messages("IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); $this->assertNotNull($actual); } public function testCreateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->chat->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->messages->create(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'post', 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages' )); } public function testCreateResponse() { $this->holodeck->mock(new Response( 201, ' { "sid": "IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "to": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "channel_sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "attributes": null, "date_created": "2016-03-24T20:37:57Z", "date_updated": "2016-03-24T20:37:57Z", "last_updated_by": "system", "was_edited": false, "from": "system", "body": "Hello", "index": 0, "type": "text", "media": null, "url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->chat->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->messages->create(); $this->assertNotNull($actual); } public function testCreateWithAllResponse() { $this->holodeck->mock(new Response( 201, ' { "sid": "IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "to": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "channel_sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "2015-12-16T22:18:37Z", "date_updated": "2015-12-16T22:18:38Z", "last_updated_by": "username", "was_edited": true, "from": "system", "attributes": "{\\"test\\": \\"test\\"}", "body": "Hello", "index": 0, "type": "text", "media": null, "url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->chat->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->messages->create(); $this->assertNotNull($actual); } public function testCreateMediaResponse() { $this->holodeck->mock(new Response( 201, ' { "sid": "IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "to": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "channel_sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "attributes": null, "date_created": "2016-03-24T20:37:57Z", "date_updated": "2016-03-24T20:37:57Z", "last_updated_by": "system", "was_edited": false, "from": "system", "body": "Hello", "index": 0, "type": "text", "media": { "sid": "MEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "size": 99999999999999, "content_type": "application/pdf", "filename": "hello.pdf" }, "url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->chat->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->messages->create(); $this->assertNotNull($actual); } public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->chat->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->messages->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages' )); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "meta": { "page": 0, "page_size": 50, "first_page_url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages?PageSize=50&Page=0", "previous_page_url": null, "url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages?PageSize=50&Page=0", "next_page_url": null, "key": "messages" }, "messages": [ { "sid": "IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "to": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "channel_sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "2016-03-24T20:37:57Z", "date_updated": "2016-03-24T20:37:57Z", "last_updated_by": null, "was_edited": false, "from": "system", "attributes": "{}", "body": "Hello", "index": 0, "type": "text", "media": null, "url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" }, { "sid": "IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "to": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "channel_sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "2016-03-24T20:37:57Z", "date_updated": "2016-03-24T20:37:57Z", "last_updated_by": null, "was_edited": false, "from": "system", "attributes": "{}", "body": "Hello", "index": 0, "type": "media", "media": { "sid": "MEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "size": 99999999999999, "content_type": "application/pdf", "filename": "hello.pdf" }, "url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ] } ' )); $actual = $this->twilio->chat->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->messages->read(); $this->assertGreaterThan(0, count($actual)); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "meta": { "page": 0, "page_size": 50, "first_page_url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages?PageSize=50&Page=0", "previous_page_url": null, "url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages?PageSize=50&Page=0", "next_page_url": null, "key": "messages" }, "messages": [] } ' )); $actual = $this->twilio->chat->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->messages->read(); $this->assertNotNull($actual); } public function testDeleteRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->chat->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->messages("IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'delete', 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testDeleteResponse() { $this->holodeck->mock(new Response( 204, null )); $actual = $this->twilio->chat->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->messages("IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); $this->assertTrue($actual); } public function testUpdateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->chat->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->messages("IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'post', 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testUpdateResponse() { $this->holodeck->mock(new Response( 200, ' { "sid": "IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "to": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "channel_sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "attributes": "{ \\"foo\\": \\"bar\\" }", "date_created": "2015-12-16T22:18:37Z", "date_updated": "2015-12-16T22:18:38Z", "last_updated_by": "username", "was_edited": true, "from": "system", "body": "Hello", "index": 0, "type": "text", "media": null, "url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->chat->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->messages("IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/Chat/V2/Service/Channel/InviteTest.php 0000604 00000021601 15174325133 0021106 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Chat\V2\Service\Channel; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class InviteTest extends HolodeckTestCase { public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->chat->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->invites("INaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Invites/INaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "channel_sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "created_by": "created_by", "date_created": "2015-07-30T20:00:00Z", "date_updated": "2015-07-30T20:00:00Z", "identity": "identity", "role_sid": "RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "sid": "INaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Invites/INaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->chat->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->invites("INaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); $this->assertNotNull($actual); } public function testCreateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->chat->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->invites->create("identity"); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $values = array('Identity' => "identity", ); $this->assertRequest(new Request( 'post', 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Invites', null, $values )); } public function testCreateResponse() { $this->holodeck->mock(new Response( 201, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "channel_sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "created_by": "created_by", "date_created": "2015-07-30T20:00:00Z", "date_updated": "2015-07-30T20:00:00Z", "identity": "identity", "role_sid": "RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "sid": "INaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Invites/INaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->chat->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->invites->create("identity"); $this->assertNotNull($actual); } public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->chat->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->invites->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Invites' )); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "invites": [], "meta": { "first_page_url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Invites?PageSize=50&Page=0", "key": "invites", "next_page_url": null, "page": 0, "page_size": 50, "previous_page_url": null, "url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Invites?PageSize=50&Page=0" } } ' )); $actual = $this->twilio->chat->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->invites->read(); $this->assertNotNull($actual); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "invites": [ { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "channel_sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "created_by": "created_by", "date_created": "2015-07-30T20:00:00Z", "date_updated": "2015-07-30T20:00:00Z", "identity": "identity", "role_sid": "RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "sid": "INaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Invites/INaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ], "meta": { "first_page_url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Invites?PageSize=50&Page=0", "key": "invites", "next_page_url": null, "page": 0, "page_size": 50, "previous_page_url": null, "url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Invites?PageSize=50&Page=0" } } ' )); $actual = $this->twilio->chat->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->invites->read(); $this->assertGreaterThan(0, count($actual)); } public function testDeleteRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->chat->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->invites("INaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'delete', 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Invites/INaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testDeleteResponse() { $this->holodeck->mock(new Response( 204, null )); $actual = $this->twilio->chat->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->invites("INaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); $this->assertTrue($actual); } } sdk/Twilio/Tests/Integration/Chat/V2/Service/RoleTest.php 0000604 00000023641 15174325133 0017207 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Chat\V2\Service; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Serialize; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class RoleTest extends HolodeckTestCase { public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->chat->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->roles("RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Roles/RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "sid": "RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "friendly_name": "channel user", "type": "channel", "permissions": [ "sendMessage", "leaveChannel", "editOwnMessage", "deleteOwnMessage" ], "date_created": "2016-03-03T19:47:15Z", "date_updated": "2016-03-03T19:47:15Z", "url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Roles/RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->chat->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->roles("RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); $this->assertNotNull($actual); } public function testDeleteRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->chat->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->roles("RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'delete', 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Roles/RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testDeleteResponse() { $this->holodeck->mock(new Response( 204, null )); $actual = $this->twilio->chat->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->roles("RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); $this->assertTrue($actual); } public function testCreateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->chat->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->roles->create("friendlyName", "channel", array('permission')); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $values = array( 'FriendlyName' => "friendlyName", 'Type' => "channel", 'Permission' => Serialize::map(array('permission'), function($e) { return $e; }), ); $this->assertRequest(new Request( 'post', 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Roles', null, $values )); } public function testCreateResponse() { $this->holodeck->mock(new Response( 201, ' { "sid": "RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "friendly_name": "channel user", "type": "channel", "permissions": [ "sendMessage", "leaveChannel", "editOwnMessage", "deleteOwnMessage" ], "date_created": "2016-03-03T19:47:15Z", "date_updated": "2016-03-03T19:47:15Z", "url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Roles/RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->chat->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->roles->create("friendlyName", "channel", array('permission')); $this->assertNotNull($actual); } public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->chat->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->roles->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Roles' )); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "meta": { "page": 0, "page_size": 50, "first_page_url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Roles?PageSize=50&Page=0", "previous_page_url": null, "url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Roles?PageSize=50&Page=0", "next_page_url": null, "key": "roles" }, "roles": [ { "sid": "RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "friendly_name": "channel user", "type": "channel", "permissions": [ "sendMessage", "leaveChannel", "editOwnMessage", "deleteOwnMessage" ], "date_created": "2016-03-03T19:47:15Z", "date_updated": "2016-03-03T19:47:15Z", "url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Roles/RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ] } ' )); $actual = $this->twilio->chat->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->roles->read(); $this->assertGreaterThan(0, count($actual)); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "meta": { "page": 0, "page_size": 50, "first_page_url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Roles?PageSize=50&Page=0", "previous_page_url": null, "url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Roles?PageSize=50&Page=0", "next_page_url": null, "key": "roles" }, "roles": [] } ' )); $actual = $this->twilio->chat->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->roles->read(); $this->assertNotNull($actual); } public function testUpdateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->chat->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->roles("RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(array('permission')); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $values = array('Permission' => Serialize::map(array('permission'), function($e) { return $e; }), ); $this->assertRequest(new Request( 'post', 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Roles/RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', null, $values )); } public function testUpdateResponse() { $this->holodeck->mock(new Response( 200, ' { "sid": "RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "friendly_name": "channel user", "type": "channel", "permissions": [ "sendMessage", "leaveChannel", "editOwnMessage", "deleteOwnMessage" ], "date_created": "2016-03-03T19:47:15Z", "date_updated": "2016-03-03T19:47:15Z", "url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Roles/RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->chat->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->roles("RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(array('permission')); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/Chat/V2/Service/User/UserBindingTest.php 0000604 00000017076 15174325133 0021442 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Chat\V2\Service\User; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class UserBindingTest extends HolodeckTestCase { public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->chat->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->users("USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->userBindings->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings' )); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "meta": { "page": 0, "page_size": 50, "first_page_url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings?PageSize=50&Page=0", "previous_page_url": null, "url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings?PageSize=50&Page=0", "next_page_url": null, "key": "bindings" }, "bindings": [ { "sid": "BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "2016-10-21T11:37:03Z", "date_updated": "2016-10-21T11:37:03Z", "endpoint": "TestUser-endpoint", "identity": "TestUser", "user_sid": "USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "binding_type": "gcm", "credential_sid": "CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "message_types": [ "removed_from_channel", "new_message", "added_to_channel", "invited_to_channel" ], "url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings/BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ] } ' )); $actual = $this->twilio->chat->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->users("USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->userBindings->read(); $this->assertGreaterThan(0, count($actual)); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "meta": { "page": 0, "page_size": 50, "first_page_url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings?PageSize=50&Page=0", "previous_page_url": null, "url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings?PageSize=50&Page=0", "next_page_url": null, "key": "bindings" }, "bindings": [] } ' )); $actual = $this->twilio->chat->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->users("USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->userBindings->read(); $this->assertNotNull($actual); } public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->chat->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->users("USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->userBindings("BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings/BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "sid": "BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "2016-10-21T11:37:03Z", "date_updated": "2016-10-21T11:37:03Z", "endpoint": "TestUser-endpoint", "identity": "TestUser", "user_sid": "USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "binding_type": "gcm", "credential_sid": "CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "message_types": [ "removed_from_channel", "new_message", "added_to_channel", "invited_to_channel" ], "url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings/BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->chat->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->users("USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->userBindings("BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); $this->assertNotNull($actual); } public function testDeleteRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->chat->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->users("USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->userBindings("BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'delete', 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings/BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testDeleteResponse() { $this->holodeck->mock(new Response( 204, null )); $actual = $this->twilio->chat->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->users("USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->userBindings("BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); $this->assertTrue($actual); } } sdk/Twilio/Tests/Integration/Chat/V2/Service/User/UserChannelTest.php 0000604 00000010074 15174325133 0021427 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Chat\V2\Service\User; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class UserChannelTest extends HolodeckTestCase { public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->chat->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->users("USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->userChannels->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels' )); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "meta": { "page": 0, "page_size": 50, "first_page_url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels?PageSize=50&Page=0", "previous_page_url": null, "url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels?PageSize=50&Page=0", "next_page_url": null, "key": "channels" }, "channels": [ { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "channel_sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "member_sid": "MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "status": "joined", "last_consumed_message_index": 5, "unread_messages_count": 5, "links": { "channel": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "member": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members/MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } } ] } ' )); $actual = $this->twilio->chat->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->users("USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->userChannels->read(); $this->assertGreaterThan(0, count($actual)); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "meta": { "page": 0, "page_size": 50, "first_page_url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels?PageSize=50&Page=0", "previous_page_url": null, "url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels?PageSize=50&Page=0", "next_page_url": null, "key": "channels" }, "channels": [] } ' )); $actual = $this->twilio->chat->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->users("USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->userChannels->read(); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/Chat/V2/Service/ChannelTest.php 0000604 00000027402 15174325133 0017655 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Chat\V2\Service; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class ChannelTest extends HolodeckTestCase { public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->chat->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "friendly_name": "friendly_name", "unique_name": "unique_name", "attributes": "{ \\"foo\\": \\"bar\\" }", "type": "public", "date_created": "2015-12-16T22:18:37Z", "date_updated": "2015-12-16T22:18:37Z", "created_by": "system", "members_count": 0, "messages_count": 0, "url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "links": { "members": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members", "messages": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages", "invites": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Invites", "last_message": null } } ' )); $actual = $this->twilio->chat->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); $this->assertNotNull($actual); } public function testDeleteRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->chat->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'delete', 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testDeleteResponse() { $this->holodeck->mock(new Response( 204, null )); $actual = $this->twilio->chat->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); $this->assertTrue($actual); } public function testCreateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->chat->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels->create(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'post', 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels' )); } public function testCreateResponse() { $this->holodeck->mock(new Response( 201, ' { "sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "friendly_name": "friendly_name", "unique_name": "unique_name", "attributes": "{ \\"foo\\": \\"bar\\" }", "type": "public", "date_created": "2015-12-16T22:18:37Z", "date_updated": "2015-12-16T22:18:38Z", "created_by": "username", "members_count": 0, "messages_count": 0, "url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "links": { "members": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members", "messages": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages", "invites": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Invites", "last_message": null } } ' )); $actual = $this->twilio->chat->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels->create(); $this->assertNotNull($actual); } public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->chat->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels' )); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "channels": [ { "sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "friendly_name": "friendly_name", "unique_name": "unique_name", "attributes": "{ \\"foo\\": \\"bar\\" }", "type": "public", "date_created": "2015-12-16T22:18:37Z", "date_updated": "2015-12-16T22:18:37Z", "created_by": "system", "members_count": 0, "messages_count": 0, "url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "links": { "members": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members", "messages": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages", "invites": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Invites", "last_message": null } } ], "meta": { "page": 0, "page_size": 50, "first_page_url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels?PageSize=50&Page=0", "previous_page_url": null, "url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels?PageSize=50&Page=0", "next_page_url": null, "key": "channels" } } ' )); $actual = $this->twilio->chat->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels->read(); $this->assertGreaterThan(0, count($actual)); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "channels": [], "meta": { "page": 0, "page_size": 50, "first_page_url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels?PageSize=50&Page=0", "previous_page_url": null, "url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels?PageSize=50&Page=0", "next_page_url": null, "key": "channels" } } ' )); $actual = $this->twilio->chat->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels->read(); $this->assertNotNull($actual); } public function testUpdateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->chat->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'post', 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testUpdateResponse() { $this->holodeck->mock(new Response( 200, ' { "sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "friendly_name": "friendly_name", "unique_name": "unique_name", "attributes": "{ \\"foo\\": \\"bar\\" }", "type": "public", "date_created": "2015-12-16T22:18:37Z", "date_updated": "2015-12-16T22:18:38Z", "created_by": "username", "members_count": 0, "messages_count": 0, "url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "links": { "members": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members", "messages": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages", "invites": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Invites", "last_message": null } } ' )); $actual = $this->twilio->chat->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/Chat/V2/Service/BindingTest.php 0000604 00000015451 15174325133 0017660 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Chat\V2\Service; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class BindingTest extends HolodeckTestCase { public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->chat->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->bindings->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings' )); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "meta": { "page": 0, "page_size": 50, "first_page_url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings?PageSize=50&Page=0", "previous_page_url": null, "url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings?PageSize=50&Page=0", "next_page_url": null, "key": "bindings" }, "bindings": [ { "sid": "BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "2016-10-21T11:37:03Z", "date_updated": "2016-10-21T11:37:03Z", "endpoint": "TestUser-endpoint", "identity": "TestUser", "binding_type": "gcm", "credential_sid": "CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "message_types": [ "removed_from_channel", "new_message", "added_to_channel", "invited_to_channel" ], "url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings/BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "links": { "user": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/TestUser" } } ] } ' )); $actual = $this->twilio->chat->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->bindings->read(); $this->assertGreaterThan(0, count($actual)); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "meta": { "page": 0, "page_size": 50, "first_page_url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings?PageSize=50&Page=0", "previous_page_url": null, "url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings?PageSize=50&Page=0", "next_page_url": null, "key": "bindings" }, "bindings": [] } ' )); $actual = $this->twilio->chat->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->bindings->read(); $this->assertNotNull($actual); } public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->chat->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->bindings("BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings/BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "sid": "BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "2016-10-21T11:37:03Z", "date_updated": "2016-10-21T11:37:03Z", "endpoint": "TestUser-endpoint", "identity": "TestUser", "binding_type": "gcm", "credential_sid": "CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "message_types": [ "removed_from_channel", "new_message", "added_to_channel", "invited_to_channel" ], "url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings/BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "links": { "user": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/TestUser" } } ' )); $actual = $this->twilio->chat->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->bindings("BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); $this->assertNotNull($actual); } public function testDeleteRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->chat->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->bindings("BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'delete', 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings/BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testDeleteResponse() { $this->holodeck->mock(new Response( 204, null )); $actual = $this->twilio->chat->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->bindings("BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); $this->assertTrue($actual); } } sdk/Twilio/Tests/Integration/IpMessaging/V2/Service/ChannelTest.php 0000604 00000027713 15174325133 0021211 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\IpMessaging\V2\Service; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class ChannelTest extends HolodeckTestCase { public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->ipMessaging->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://ip-messaging.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "friendly_name": "friendly_name", "unique_name": "unique_name", "attributes": "{ \\"foo\\": \\"bar\\" }", "type": "public", "date_created": "2015-12-16T22:18:37Z", "date_updated": "2015-12-16T22:18:37Z", "created_by": "system", "members_count": 0, "messages_count": 0, "url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "links": { "members": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members", "messages": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages", "invites": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Invites", "last_message": null } } ' )); $actual = $this->twilio->ipMessaging->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); $this->assertNotNull($actual); } public function testDeleteRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->ipMessaging->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'delete', 'https://ip-messaging.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testDeleteResponse() { $this->holodeck->mock(new Response( 204, null )); $actual = $this->twilio->ipMessaging->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); $this->assertTrue($actual); } public function testCreateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->ipMessaging->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels->create(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'post', 'https://ip-messaging.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels' )); } public function testCreateResponse() { $this->holodeck->mock(new Response( 201, ' { "sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "friendly_name": "friendly_name", "unique_name": "unique_name", "attributes": "{ \\"foo\\": \\"bar\\" }", "type": "public", "date_created": "2015-12-16T22:18:37Z", "date_updated": "2015-12-16T22:18:38Z", "created_by": "username", "members_count": 0, "messages_count": 0, "url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "links": { "members": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members", "messages": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages", "invites": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Invites", "last_message": null } } ' )); $actual = $this->twilio->ipMessaging->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels->create(); $this->assertNotNull($actual); } public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->ipMessaging->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://ip-messaging.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels' )); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "channels": [ { "sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "friendly_name": "friendly_name", "unique_name": "unique_name", "attributes": "{ \\"foo\\": \\"bar\\" }", "type": "public", "date_created": "2015-12-16T22:18:37Z", "date_updated": "2015-12-16T22:18:37Z", "created_by": "system", "members_count": 0, "messages_count": 0, "url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "links": { "members": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members", "messages": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages", "invites": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Invites", "last_message": null } } ], "meta": { "page": 0, "page_size": 50, "first_page_url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels?PageSize=50&Page=0", "previous_page_url": null, "url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels?PageSize=50&Page=0", "next_page_url": null, "key": "channels" } } ' )); $actual = $this->twilio->ipMessaging->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels->read(); $this->assertGreaterThan(0, count($actual)); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "channels": [], "meta": { "page": 0, "page_size": 50, "first_page_url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels?PageSize=50&Page=0", "previous_page_url": null, "url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels?PageSize=50&Page=0", "next_page_url": null, "key": "channels" } } ' )); $actual = $this->twilio->ipMessaging->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels->read(); $this->assertNotNull($actual); } public function testUpdateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->ipMessaging->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'post', 'https://ip-messaging.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testUpdateResponse() { $this->holodeck->mock(new Response( 200, ' { "sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "friendly_name": "friendly_name", "unique_name": "unique_name", "attributes": "{ \\"foo\\": \\"bar\\" }", "type": "public", "date_created": "2015-12-16T22:18:37Z", "date_updated": "2015-12-16T22:18:38Z", "created_by": "username", "members_count": 0, "messages_count": 0, "url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "links": { "members": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members", "messages": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages", "invites": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Invites", "last_message": null } } ' )); $actual = $this->twilio->ipMessaging->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/IpMessaging/V2/Service/UserTest.php 0000604 00000026265 15174325133 0020560 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\IpMessaging\V2\Service; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class UserTest extends HolodeckTestCase { public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->ipMessaging->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->users("USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://ip-messaging.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "sid": "USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "role_sid": "RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "identity": "jing", "attributes": null, "is_online": true, "is_notifiable": null, "friendly_name": null, "joined_channels_count": 0, "date_created": "2016-03-24T21:05:19Z", "date_updated": "2016-03-24T21:05:19Z", "links": { "user_channels": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels", "user_bindings": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings" }, "url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->ipMessaging->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->users("USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); $this->assertNotNull($actual); } public function testDeleteRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->ipMessaging->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->users("USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'delete', 'https://ip-messaging.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testDeleteResponse() { $this->holodeck->mock(new Response( 204, null )); $actual = $this->twilio->ipMessaging->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->users("USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); $this->assertTrue($actual); } public function testCreateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->ipMessaging->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->users->create("identity"); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $values = array('Identity' => "identity", ); $this->assertRequest(new Request( 'post', 'https://ip-messaging.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users', null, $values )); } public function testCreateResponse() { $this->holodeck->mock(new Response( 201, ' { "sid": "USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "role_sid": "RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "identity": "jing", "attributes": null, "is_online": true, "is_notifiable": null, "friendly_name": null, "joined_channels_count": 0, "date_created": "2016-03-24T21:05:19Z", "date_updated": "2016-03-24T21:05:19Z", "links": { "user_channels": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels", "user_bindings": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings" }, "url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->ipMessaging->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->users->create("identity"); $this->assertNotNull($actual); } public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->ipMessaging->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->users->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://ip-messaging.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users' )); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "meta": { "page": 0, "page_size": 50, "first_page_url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users?PageSize=50&Page=0", "previous_page_url": null, "url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users?PageSize=50&Page=0", "next_page_url": null, "key": "users" }, "users": [ { "sid": "USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "role_sid": "RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "identity": "jing", "attributes": null, "is_online": true, "is_notifiable": null, "friendly_name": null, "date_created": "2016-03-24T21:05:19Z", "date_updated": "2016-03-24T21:05:19Z", "joined_channels_count": 0, "links": { "user_channels": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels", "user_bindings": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings" }, "url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ] } ' )); $actual = $this->twilio->ipMessaging->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->users->read(); $this->assertGreaterThan(0, count($actual)); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "meta": { "page": 0, "page_size": 50, "first_page_url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users?PageSize=50&Page=0", "previous_page_url": null, "url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users?PageSize=50&Page=0", "next_page_url": null, "key": "users" }, "users": [] } ' )); $actual = $this->twilio->ipMessaging->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->users->read(); $this->assertNotNull($actual); } public function testUpdateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->ipMessaging->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->users("USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'post', 'https://ip-messaging.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testUpdateResponse() { $this->holodeck->mock(new Response( 200, ' { "sid": "USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "role_sid": "RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "identity": "jing", "attributes": null, "is_online": true, "is_notifiable": null, "friendly_name": null, "joined_channels_count": 0, "date_created": "2016-03-24T21:05:19Z", "date_updated": "2016-03-24T21:05:19Z", "links": { "user_channels": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels", "user_bindings": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings" }, "url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->ipMessaging->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->users("USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/IpMessaging/V2/Service/RoleTest.php 0000604 00000024152 15174325133 0020534 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\IpMessaging\V2\Service; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Serialize; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class RoleTest extends HolodeckTestCase { public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->ipMessaging->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->roles("RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://ip-messaging.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Roles/RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "sid": "RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "friendly_name": "channel user", "type": "channel", "permissions": [ "sendMessage", "leaveChannel", "editOwnMessage", "deleteOwnMessage" ], "date_created": "2016-03-03T19:47:15Z", "date_updated": "2016-03-03T19:47:15Z", "url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Roles/RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->ipMessaging->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->roles("RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); $this->assertNotNull($actual); } public function testDeleteRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->ipMessaging->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->roles("RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'delete', 'https://ip-messaging.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Roles/RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testDeleteResponse() { $this->holodeck->mock(new Response( 204, null )); $actual = $this->twilio->ipMessaging->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->roles("RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); $this->assertTrue($actual); } public function testCreateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->ipMessaging->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->roles->create("friendlyName", "channel", array('permission')); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $values = array( 'FriendlyName' => "friendlyName", 'Type' => "channel", 'Permission' => Serialize::map(array('permission'), function($e) { return $e; }), ); $this->assertRequest(new Request( 'post', 'https://ip-messaging.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Roles', null, $values )); } public function testCreateResponse() { $this->holodeck->mock(new Response( 201, ' { "sid": "RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "friendly_name": "channel user", "type": "channel", "permissions": [ "sendMessage", "leaveChannel", "editOwnMessage", "deleteOwnMessage" ], "date_created": "2016-03-03T19:47:15Z", "date_updated": "2016-03-03T19:47:15Z", "url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Roles/RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->ipMessaging->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->roles->create("friendlyName", "channel", array('permission')); $this->assertNotNull($actual); } public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->ipMessaging->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->roles->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://ip-messaging.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Roles' )); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "meta": { "page": 0, "page_size": 50, "first_page_url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Roles?PageSize=50&Page=0", "previous_page_url": null, "url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Roles?PageSize=50&Page=0", "next_page_url": null, "key": "roles" }, "roles": [ { "sid": "RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "friendly_name": "channel user", "type": "channel", "permissions": [ "sendMessage", "leaveChannel", "editOwnMessage", "deleteOwnMessage" ], "date_created": "2016-03-03T19:47:15Z", "date_updated": "2016-03-03T19:47:15Z", "url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Roles/RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ] } ' )); $actual = $this->twilio->ipMessaging->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->roles->read(); $this->assertGreaterThan(0, count($actual)); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "meta": { "page": 0, "page_size": 50, "first_page_url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Roles?PageSize=50&Page=0", "previous_page_url": null, "url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Roles?PageSize=50&Page=0", "next_page_url": null, "key": "roles" }, "roles": [] } ' )); $actual = $this->twilio->ipMessaging->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->roles->read(); $this->assertNotNull($actual); } public function testUpdateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->ipMessaging->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->roles("RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(array('permission')); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $values = array('Permission' => Serialize::map(array('permission'), function($e) { return $e; }), ); $this->assertRequest(new Request( 'post', 'https://ip-messaging.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Roles/RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', null, $values )); } public function testUpdateResponse() { $this->holodeck->mock(new Response( 200, ' { "sid": "RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "friendly_name": "channel user", "type": "channel", "permissions": [ "sendMessage", "leaveChannel", "editOwnMessage", "deleteOwnMessage" ], "date_created": "2016-03-03T19:47:15Z", "date_updated": "2016-03-03T19:47:15Z", "url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Roles/RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->ipMessaging->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->roles("RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(array('permission')); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/IpMessaging/V2/Service/Channel/MessageTest.php 0000604 00000043143 15174325133 0022570 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\IpMessaging\V2\Service\Channel; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class MessageTest extends HolodeckTestCase { public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->ipMessaging->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->messages("IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://ip-messaging.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "sid": "IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "to": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "channel_sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "2016-03-24T20:37:57Z", "date_updated": "2016-03-24T20:37:57Z", "last_updated_by": null, "was_edited": false, "from": "system", "attributes": "{}", "body": "Hello", "index": 0, "type": "text", "media": null, "url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->ipMessaging->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->messages("IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); $this->assertNotNull($actual); } public function testFetchMediaResponse() { $this->holodeck->mock(new Response( 200, ' { "sid": "IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "to": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "channel_sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "2016-03-24T20:37:57Z", "date_updated": "2016-03-24T20:37:57Z", "last_updated_by": null, "was_edited": false, "from": "system", "attributes": "{}", "body": "Hello", "index": 0, "type": "media", "media": { "sid": "MEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "size": 99999999999999, "content_type": "application/pdf", "filename": "hello.pdf" }, "url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->ipMessaging->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->messages("IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); $this->assertNotNull($actual); } public function testCreateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->ipMessaging->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->messages->create(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'post', 'https://ip-messaging.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages' )); } public function testCreateResponse() { $this->holodeck->mock(new Response( 201, ' { "sid": "IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "to": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "channel_sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "attributes": null, "date_created": "2016-03-24T20:37:57Z", "date_updated": "2016-03-24T20:37:57Z", "last_updated_by": "system", "was_edited": false, "from": "system", "body": "Hello", "index": 0, "type": "text", "media": null, "url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->ipMessaging->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->messages->create(); $this->assertNotNull($actual); } public function testCreateWithAllResponse() { $this->holodeck->mock(new Response( 201, ' { "sid": "IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "to": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "channel_sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "2015-12-16T22:18:37Z", "date_updated": "2015-12-16T22:18:38Z", "last_updated_by": "username", "was_edited": true, "from": "system", "attributes": "{\\"test\\": \\"test\\"}", "body": "Hello", "index": 0, "type": "text", "media": null, "url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->ipMessaging->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->messages->create(); $this->assertNotNull($actual); } public function testCreateMediaResponse() { $this->holodeck->mock(new Response( 201, ' { "sid": "IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "to": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "channel_sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "attributes": null, "date_created": "2016-03-24T20:37:57Z", "date_updated": "2016-03-24T20:37:57Z", "last_updated_by": "system", "was_edited": false, "from": "system", "body": "Hello", "index": 0, "type": "text", "media": { "sid": "MEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "size": 99999999999999, "content_type": "application/pdf", "filename": "hello.pdf" }, "url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->ipMessaging->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->messages->create(); $this->assertNotNull($actual); } public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->ipMessaging->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->messages->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://ip-messaging.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages' )); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "meta": { "page": 0, "page_size": 50, "first_page_url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages?PageSize=50&Page=0", "previous_page_url": null, "url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages?PageSize=50&Page=0", "next_page_url": null, "key": "messages" }, "messages": [ { "sid": "IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "to": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "channel_sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "2016-03-24T20:37:57Z", "date_updated": "2016-03-24T20:37:57Z", "last_updated_by": null, "was_edited": false, "from": "system", "attributes": "{}", "body": "Hello", "index": 0, "type": "text", "media": null, "url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" }, { "sid": "IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "to": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "channel_sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "2016-03-24T20:37:57Z", "date_updated": "2016-03-24T20:37:57Z", "last_updated_by": null, "was_edited": false, "from": "system", "attributes": "{}", "body": "Hello", "index": 0, "type": "media", "media": { "sid": "MEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "size": 99999999999999, "content_type": "application/pdf", "filename": "hello.pdf" }, "url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ] } ' )); $actual = $this->twilio->ipMessaging->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->messages->read(); $this->assertGreaterThan(0, count($actual)); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "meta": { "page": 0, "page_size": 50, "first_page_url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages?PageSize=50&Page=0", "previous_page_url": null, "url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages?PageSize=50&Page=0", "next_page_url": null, "key": "messages" }, "messages": [] } ' )); $actual = $this->twilio->ipMessaging->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->messages->read(); $this->assertNotNull($actual); } public function testDeleteRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->ipMessaging->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->messages("IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'delete', 'https://ip-messaging.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testDeleteResponse() { $this->holodeck->mock(new Response( 204, null )); $actual = $this->twilio->ipMessaging->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->messages("IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); $this->assertTrue($actual); } public function testUpdateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->ipMessaging->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->messages("IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'post', 'https://ip-messaging.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testUpdateResponse() { $this->holodeck->mock(new Response( 200, ' { "sid": "IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "to": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "channel_sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "attributes": "{ \\"foo\\": \\"bar\\" }", "date_created": "2015-12-16T22:18:37Z", "date_updated": "2015-12-16T22:18:38Z", "last_updated_by": "username", "was_edited": true, "from": "system", "body": "Hello", "index": 0, "type": "text", "media": null, "url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->ipMessaging->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->messages("IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/IpMessaging/V2/Service/Channel/InviteTest.php 0000604 00000022145 15174325133 0022441 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\IpMessaging\V2\Service\Channel; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class InviteTest extends HolodeckTestCase { public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->ipMessaging->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->invites("INaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://ip-messaging.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Invites/INaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "channel_sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "created_by": "created_by", "date_created": "2015-07-30T20:00:00Z", "date_updated": "2015-07-30T20:00:00Z", "identity": "identity", "role_sid": "RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "sid": "INaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Invites/INaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->ipMessaging->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->invites("INaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); $this->assertNotNull($actual); } public function testCreateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->ipMessaging->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->invites->create("identity"); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $values = array('Identity' => "identity", ); $this->assertRequest(new Request( 'post', 'https://ip-messaging.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Invites', null, $values )); } public function testCreateResponse() { $this->holodeck->mock(new Response( 201, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "channel_sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "created_by": "created_by", "date_created": "2015-07-30T20:00:00Z", "date_updated": "2015-07-30T20:00:00Z", "identity": "identity", "role_sid": "RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "sid": "INaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Invites/INaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->ipMessaging->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->invites->create("identity"); $this->assertNotNull($actual); } public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->ipMessaging->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->invites->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://ip-messaging.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Invites' )); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "invites": [], "meta": { "first_page_url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Invites?PageSize=50&Page=0", "key": "invites", "next_page_url": null, "page": 0, "page_size": 50, "previous_page_url": null, "url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Invites?PageSize=50&Page=0" } } ' )); $actual = $this->twilio->ipMessaging->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->invites->read(); $this->assertNotNull($actual); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "invites": [ { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "channel_sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "created_by": "created_by", "date_created": "2015-07-30T20:00:00Z", "date_updated": "2015-07-30T20:00:00Z", "identity": "identity", "role_sid": "RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "sid": "INaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Invites/INaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ], "meta": { "first_page_url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Invites?PageSize=50&Page=0", "key": "invites", "next_page_url": null, "page": 0, "page_size": 50, "previous_page_url": null, "url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Invites?PageSize=50&Page=0" } } ' )); $actual = $this->twilio->ipMessaging->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->invites->read(); $this->assertGreaterThan(0, count($actual)); } public function testDeleteRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->ipMessaging->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->invites("INaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'delete', 'https://ip-messaging.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Invites/INaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testDeleteResponse() { $this->holodeck->mock(new Response( 204, null )); $actual = $this->twilio->ipMessaging->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->invites("INaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); $this->assertTrue($actual); } } sdk/Twilio/Tests/Integration/IpMessaging/V2/Service/Channel/MemberTest.php 0000604 00000026437 15174325133 0022422 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\IpMessaging\V2\Service\Channel; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class MemberTest extends HolodeckTestCase { public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->ipMessaging->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->members("MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://ip-messaging.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members/MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "sid": "MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "channel_sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "identity": "jing", "role_sid": "RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "last_consumed_message_index": null, "last_consumption_timestamp": null, "date_created": "2016-03-24T21:05:50Z", "date_updated": "2016-03-24T21:05:50Z", "url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members/MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->ipMessaging->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->members("MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); $this->assertNotNull($actual); } public function testCreateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->ipMessaging->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->members->create("identity"); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $values = array('Identity' => "identity", ); $this->assertRequest(new Request( 'post', 'https://ip-messaging.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members', null, $values )); } public function testCreateResponse() { $this->holodeck->mock(new Response( 201, ' { "sid": "MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "channel_sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "identity": "jing", "role_sid": "RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "last_consumed_message_index": null, "last_consumption_timestamp": null, "date_created": "2016-03-24T21:05:50Z", "date_updated": "2016-03-24T21:05:50Z", "url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members/MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->ipMessaging->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->members->create("identity"); $this->assertNotNull($actual); } public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->ipMessaging->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->members->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://ip-messaging.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members' )); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "meta": { "page": 0, "page_size": 50, "first_page_url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members?PageSize=50&Page=0", "previous_page_url": null, "url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members?PageSize=50&Page=0", "next_page_url": null, "key": "members" }, "members": [ { "sid": "MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "channel_sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "identity": "jing", "role_sid": "RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "last_consumed_message_index": null, "last_consumption_timestamp": null, "date_created": "2016-03-24T21:05:50Z", "date_updated": "2016-03-24T21:05:50Z", "url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members/MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ] } ' )); $actual = $this->twilio->ipMessaging->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->members->read(); $this->assertGreaterThan(0, count($actual)); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "meta": { "page": 0, "page_size": 50, "first_page_url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members?PageSize=50&Page=0", "previous_page_url": null, "url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members?PageSize=50&Page=0", "next_page_url": null, "key": "members" }, "members": [] } ' )); $actual = $this->twilio->ipMessaging->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->members->read(); $this->assertNotNull($actual); } public function testDeleteRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->ipMessaging->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->members("MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'delete', 'https://ip-messaging.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members/MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testDeleteResponse() { $this->holodeck->mock(new Response( 204, null )); $actual = $this->twilio->ipMessaging->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->members("MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); $this->assertTrue($actual); } public function testUpdateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->ipMessaging->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->members("MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'post', 'https://ip-messaging.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members/MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testUpdateRoleSidResponse() { $this->holodeck->mock(new Response( 200, ' { "sid": "MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "channel_sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "identity": "jing", "role_sid": "RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "last_consumed_message_index": 20, "last_consumption_timestamp": "2016-03-24T21:05:52Z", "date_created": "2016-03-24T21:05:50Z", "date_updated": "2016-03-24T21:05:51Z", "url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members/MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->ipMessaging->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->members("MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/IpMessaging/V2/Service/BindingTest.php 0000604 00000015652 15174325133 0021212 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\IpMessaging\V2\Service; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class BindingTest extends HolodeckTestCase { public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->ipMessaging->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->bindings->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://ip-messaging.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings' )); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "meta": { "page": 0, "page_size": 50, "first_page_url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings?PageSize=50&Page=0", "previous_page_url": null, "url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings?PageSize=50&Page=0", "next_page_url": null, "key": "bindings" }, "bindings": [ { "sid": "BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "2016-10-21T11:37:03Z", "date_updated": "2016-10-21T11:37:03Z", "endpoint": "TestUser-endpoint", "identity": "TestUser", "binding_type": "gcm", "credential_sid": "CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "message_types": [ "removed_from_channel", "new_message", "added_to_channel", "invited_to_channel" ], "url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings/BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "links": { "user": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/TestUser" } } ] } ' )); $actual = $this->twilio->ipMessaging->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->bindings->read(); $this->assertGreaterThan(0, count($actual)); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "meta": { "page": 0, "page_size": 50, "first_page_url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings?PageSize=50&Page=0", "previous_page_url": null, "url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings?PageSize=50&Page=0", "next_page_url": null, "key": "bindings" }, "bindings": [] } ' )); $actual = $this->twilio->ipMessaging->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->bindings->read(); $this->assertNotNull($actual); } public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->ipMessaging->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->bindings("BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://ip-messaging.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings/BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "sid": "BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "2016-10-21T11:37:03Z", "date_updated": "2016-10-21T11:37:03Z", "endpoint": "TestUser-endpoint", "identity": "TestUser", "binding_type": "gcm", "credential_sid": "CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "message_types": [ "removed_from_channel", "new_message", "added_to_channel", "invited_to_channel" ], "url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings/BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "links": { "user": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/TestUser" } } ' )); $actual = $this->twilio->ipMessaging->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->bindings("BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); $this->assertNotNull($actual); } public function testDeleteRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->ipMessaging->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->bindings("BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'delete', 'https://ip-messaging.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings/BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testDeleteResponse() { $this->holodeck->mock(new Response( 204, null )); $actual = $this->twilio->ipMessaging->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->bindings("BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); $this->assertTrue($actual); } } sdk/Twilio/Tests/Integration/IpMessaging/V2/Service/User/UserBindingTest.php 0000604 00000017360 15174325133 0022765 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\IpMessaging\V2\Service\User; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class UserBindingTest extends HolodeckTestCase { public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->ipMessaging->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->users("USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->userBindings->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://ip-messaging.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings' )); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "meta": { "page": 0, "page_size": 50, "first_page_url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings?PageSize=50&Page=0", "previous_page_url": null, "url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings?PageSize=50&Page=0", "next_page_url": null, "key": "bindings" }, "bindings": [ { "sid": "BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "2016-10-21T11:37:03Z", "date_updated": "2016-10-21T11:37:03Z", "endpoint": "TestUser-endpoint", "identity": "TestUser", "user_sid": "USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "binding_type": "gcm", "credential_sid": "CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "message_types": [ "removed_from_channel", "new_message", "added_to_channel", "invited_to_channel" ], "url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings/BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ] } ' )); $actual = $this->twilio->ipMessaging->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->users("USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->userBindings->read(); $this->assertGreaterThan(0, count($actual)); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "meta": { "page": 0, "page_size": 50, "first_page_url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings?PageSize=50&Page=0", "previous_page_url": null, "url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings?PageSize=50&Page=0", "next_page_url": null, "key": "bindings" }, "bindings": [] } ' )); $actual = $this->twilio->ipMessaging->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->users("USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->userBindings->read(); $this->assertNotNull($actual); } public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->ipMessaging->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->users("USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->userBindings("BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://ip-messaging.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings/BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "sid": "BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "2016-10-21T11:37:03Z", "date_updated": "2016-10-21T11:37:03Z", "endpoint": "TestUser-endpoint", "identity": "TestUser", "user_sid": "USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "binding_type": "gcm", "credential_sid": "CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "message_types": [ "removed_from_channel", "new_message", "added_to_channel", "invited_to_channel" ], "url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings/BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->ipMessaging->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->users("USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->userBindings("BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); $this->assertNotNull($actual); } public function testDeleteRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->ipMessaging->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->users("USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->userBindings("BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'delete', 'https://ip-messaging.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings/BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testDeleteResponse() { $this->holodeck->mock(new Response( 204, null )); $actual = $this->twilio->ipMessaging->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->users("USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->userBindings("BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); $this->assertTrue($actual); } } sdk/Twilio/Tests/Integration/IpMessaging/V2/Service/User/UserChannelTest.php 0000604 00000010212 15174325133 0022750 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\IpMessaging\V2\Service\User; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class UserChannelTest extends HolodeckTestCase { public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->ipMessaging->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->users("USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->userChannels->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://ip-messaging.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels' )); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "meta": { "page": 0, "page_size": 50, "first_page_url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels?PageSize=50&Page=0", "previous_page_url": null, "url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels?PageSize=50&Page=0", "next_page_url": null, "key": "channels" }, "channels": [ { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "channel_sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "member_sid": "MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "status": "joined", "last_consumed_message_index": 5, "unread_messages_count": 5, "links": { "channel": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "member": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members/MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } } ] } ' )); $actual = $this->twilio->ipMessaging->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->users("USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->userChannels->read(); $this->assertGreaterThan(0, count($actual)); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "meta": { "page": 0, "page_size": 50, "first_page_url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels?PageSize=50&Page=0", "previous_page_url": null, "url": "https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels?PageSize=50&Page=0", "next_page_url": null, "key": "channels" }, "channels": [] } ' )); $actual = $this->twilio->ipMessaging->v2->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->users("USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->userChannels->read(); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/IpMessaging/V1/ServiceTest.php 0000604 00000025337 15174325133 0017640 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\IpMessaging\V1; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class ServiceTest extends HolodeckTestCase { public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->ipMessaging->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://ip-messaging.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "consumption_report_interval": 100, "date_created": "2015-07-30T20:00:00Z", "date_updated": "2015-07-30T20:00:00Z", "default_channel_creator_role_sid": "RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "default_channel_role_sid": "RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "default_service_role_sid": "RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "friendly_name": "friendly_name", "limits": { "actions_per_second": 20, "channel_members": 100, "user_channels": 250 }, "links": {}, "notifications": {}, "post_webhook_url": "post_webhook_url", "pre_webhook_url": "pre_webhook_url", "reachability_enabled": false, "read_status_enabled": false, "sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "typing_indicator_timeout": 100, "url": "http://www.example.com", "webhook_filters": [ "webhook_filters" ], "webhook_method": "webhook_method", "webhooks": {} } ' )); $actual = $this->twilio->ipMessaging->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); $this->assertNotNull($actual); } public function testDeleteRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->ipMessaging->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'delete', 'https://ip-messaging.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testDeleteResponse() { $this->holodeck->mock(new Response( 204, null )); $actual = $this->twilio->ipMessaging->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); $this->assertTrue($actual); } public function testCreateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->ipMessaging->v1->services->create("friendlyName"); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $values = array('FriendlyName' => "friendlyName", ); $this->assertRequest(new Request( 'post', 'https://ip-messaging.twilio.com/v1/Services', null, $values )); } public function testCreateResponse() { $this->holodeck->mock(new Response( 201, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "consumption_report_interval": 100, "date_created": "2015-07-30T20:00:00Z", "date_updated": "2015-07-30T20:00:00Z", "default_channel_creator_role_sid": "RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "default_channel_role_sid": "RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "default_service_role_sid": "RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "friendly_name": "friendly_name", "limits": { "actions_per_second": 20, "channel_members": 100, "user_channels": 250 }, "links": {}, "notifications": {}, "post_webhook_url": "post_webhook_url", "pre_webhook_url": "pre_webhook_url", "reachability_enabled": false, "read_status_enabled": false, "sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "typing_indicator_timeout": 100, "url": "http://www.example.com", "webhook_filters": [ "webhook_filters" ], "webhook_method": "webhook_method", "webhooks": {} } ' )); $actual = $this->twilio->ipMessaging->v1->services->create("friendlyName"); $this->assertNotNull($actual); } public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->ipMessaging->v1->services->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://ip-messaging.twilio.com/v1/Services' )); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "meta": { "first_page_url": "https://chat.twilio.com/v1/Services?Page=0&PageSize=50", "key": "services", "next_page_url": null, "page": 0, "page_size": 0, "previous_page_url": null, "url": "https://chat.twilio.com/v1/Services" }, "services": [] } ' )); $actual = $this->twilio->ipMessaging->v1->services->read(); $this->assertNotNull($actual); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "meta": { "first_page_url": "https://chat.twilio.com/v1/Services?Page=0&PageSize=50", "key": "services", "next_page_url": null, "page": 0, "page_size": 1, "previous_page_url": null, "url": "https://chat.twilio.com/v1/Services" }, "services": [ { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "consumption_report_interval": 100, "date_created": "2015-07-30T20:00:00Z", "date_updated": "2015-07-30T20:00:00Z", "default_channel_creator_role_sid": "RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "default_channel_role_sid": "RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "default_service_role_sid": "RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "friendly_name": "friendly_name", "limits": { "actions_per_second": 20, "channel_members": 100, "user_channels": 250 }, "links": {}, "notifications": {}, "post_webhook_url": "post_webhook_url", "pre_webhook_url": "pre_webhook_url", "reachability_enabled": false, "read_status_enabled": false, "sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "typing_indicator_timeout": 100, "url": "http://www.example.com", "webhook_filters": [ "webhook_filters" ], "webhook_method": "webhook_method", "webhooks": {} } ] } ' )); $actual = $this->twilio->ipMessaging->v1->services->read(); $this->assertGreaterThan(0, count($actual)); } public function testUpdateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->ipMessaging->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'post', 'https://ip-messaging.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testUpdateResponse() { $this->holodeck->mock(new Response( 200, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "consumption_report_interval": 100, "date_created": "2015-07-30T20:00:00Z", "date_updated": "2015-07-30T20:00:00Z", "default_channel_creator_role_sid": "RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "default_channel_role_sid": "RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "default_service_role_sid": "RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "friendly_name": "friendly_name", "limits": { "actions_per_second": 20, "channel_members": 500, "user_channels": 600 }, "links": {}, "notifications": {}, "post_webhook_url": "post_webhook_url", "pre_webhook_url": "pre_webhook_url", "reachability_enabled": false, "read_status_enabled": false, "sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "typing_indicator_timeout": 100, "url": "http://www.example.com", "webhook_filters": [ "webhook_filters" ], "webhook_method": "webhook_method", "webhooks": {} } ' )); $actual = $this->twilio->ipMessaging->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/IpMessaging/V1/Service/ChannelTest.php 0000604 00000027707 15174325133 0021213 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\IpMessaging\V1\Service; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class ChannelTest extends HolodeckTestCase { public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->ipMessaging->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://ip-messaging.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "friendly_name": "friendly_name", "unique_name": "unique_name", "attributes": "{ \\"foo\\": \\"bar\\" }", "type": "public", "date_created": "2015-12-16T22:18:37Z", "date_updated": "2015-12-16T22:18:37Z", "created_by": "system", "members_count": 0, "messages_count": 0, "url": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "links": { "members": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members", "messages": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages", "invites": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Invites", "last_message": null } } ' )); $actual = $this->twilio->ipMessaging->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); $this->assertNotNull($actual); } public function testDeleteRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->ipMessaging->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'delete', 'https://ip-messaging.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testDeleteResponse() { $this->holodeck->mock(new Response( 204, null )); $actual = $this->twilio->ipMessaging->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); $this->assertTrue($actual); } public function testCreateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->ipMessaging->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels->create(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'post', 'https://ip-messaging.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels' )); } public function testCreateResponse() { $this->holodeck->mock(new Response( 201, ' { "sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "friendly_name": "friendly_name", "unique_name": "unique_name", "attributes": "{ \\"foo\\": \\"bar\\" }", "type": "public", "date_created": "2015-12-16T22:18:37Z", "date_updated": "2015-12-16T22:18:37Z", "created_by": "system", "members_count": 0, "messages_count": 0, "url": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "links": { "members": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members", "messages": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages", "invites": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Invites", "last_message": null } } ' )); $actual = $this->twilio->ipMessaging->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels->create(); $this->assertNotNull($actual); } public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->ipMessaging->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://ip-messaging.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels' )); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "channels": [ { "sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "friendly_name": "friendly_name", "unique_name": "unique_name", "attributes": "{ \\"foo\\": \\"bar\\" }", "type": "public", "date_created": "2015-12-16T22:18:37Z", "date_updated": "2015-12-16T22:18:37Z", "created_by": "system", "members_count": 0, "messages_count": 0, "url": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "links": { "members": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members", "messages": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages", "invites": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Invites", "last_message": null } } ], "meta": { "page": 0, "page_size": 50, "first_page_url": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels?PageSize=50&Page=0", "previous_page_url": null, "url": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels?PageSize=50&Page=0", "next_page_url": null, "key": "channels" } } ' )); $actual = $this->twilio->ipMessaging->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels->read(); $this->assertGreaterThan(0, count($actual)); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "channels": [], "meta": { "page": 0, "page_size": 50, "first_page_url": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels?PageSize=50&Page=0", "previous_page_url": null, "url": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels?PageSize=50&Page=0", "next_page_url": null, "key": "channels" } } ' )); $actual = $this->twilio->ipMessaging->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels->read(); $this->assertNotNull($actual); } public function testUpdateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->ipMessaging->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'post', 'https://ip-messaging.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testUpdateResponse() { $this->holodeck->mock(new Response( 200, ' { "sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "friendly_name": "friendly_name", "unique_name": "unique_name", "attributes": "{ \\"foo\\": \\"bar\\" }", "type": "public", "date_created": "2015-12-16T22:18:37Z", "date_updated": "2015-12-16T22:18:37Z", "created_by": "system", "members_count": 0, "messages_count": 0, "url": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "links": { "members": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members", "messages": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages", "invites": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Invites", "last_message": null } } ' )); $actual = $this->twilio->ipMessaging->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/IpMessaging/V1/Service/RoleTest.php 0000604 00000024152 15174325133 0020533 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\IpMessaging\V1\Service; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Serialize; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class RoleTest extends HolodeckTestCase { public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->ipMessaging->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->roles("RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://ip-messaging.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Roles/RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "sid": "RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "friendly_name": "channel user", "type": "channel", "permissions": [ "sendMessage", "leaveChannel", "editOwnMessage", "deleteOwnMessage" ], "date_created": "2016-03-03T19:47:15Z", "date_updated": "2016-03-03T19:47:15Z", "url": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Roles/RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->ipMessaging->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->roles("RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); $this->assertNotNull($actual); } public function testDeleteRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->ipMessaging->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->roles("RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'delete', 'https://ip-messaging.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Roles/RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testDeleteResponse() { $this->holodeck->mock(new Response( 204, null )); $actual = $this->twilio->ipMessaging->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->roles("RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); $this->assertTrue($actual); } public function testCreateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->ipMessaging->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->roles->create("friendlyName", "channel", array('permission')); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $values = array( 'FriendlyName' => "friendlyName", 'Type' => "channel", 'Permission' => Serialize::map(array('permission'), function($e) { return $e; }), ); $this->assertRequest(new Request( 'post', 'https://ip-messaging.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Roles', null, $values )); } public function testCreateResponse() { $this->holodeck->mock(new Response( 201, ' { "sid": "RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "friendly_name": "channel user", "type": "channel", "permissions": [ "sendMessage", "leaveChannel", "editOwnMessage", "deleteOwnMessage" ], "date_created": "2016-03-03T19:47:15Z", "date_updated": "2016-03-03T19:47:15Z", "url": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Roles/RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->ipMessaging->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->roles->create("friendlyName", "channel", array('permission')); $this->assertNotNull($actual); } public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->ipMessaging->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->roles->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://ip-messaging.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Roles' )); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "meta": { "page": 0, "page_size": 50, "first_page_url": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Roles?PageSize=50&Page=0", "previous_page_url": null, "url": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Roles?PageSize=50&Page=0", "next_page_url": null, "key": "roles" }, "roles": [ { "sid": "RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "friendly_name": "channel user", "type": "channel", "permissions": [ "sendMessage", "leaveChannel", "editOwnMessage", "deleteOwnMessage" ], "date_created": "2016-03-03T19:47:15Z", "date_updated": "2016-03-03T19:47:15Z", "url": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Roles/RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ] } ' )); $actual = $this->twilio->ipMessaging->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->roles->read(); $this->assertGreaterThan(0, count($actual)); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "meta": { "page": 0, "page_size": 50, "first_page_url": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Roles?PageSize=50&Page=0", "previous_page_url": null, "url": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Roles?PageSize=50&Page=0", "next_page_url": null, "key": "roles" }, "roles": [] } ' )); $actual = $this->twilio->ipMessaging->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->roles->read(); $this->assertNotNull($actual); } public function testUpdateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->ipMessaging->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->roles("RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(array('permission')); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $values = array('Permission' => Serialize::map(array('permission'), function($e) { return $e; }), ); $this->assertRequest(new Request( 'post', 'https://ip-messaging.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Roles/RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', null, $values )); } public function testUpdateResponse() { $this->holodeck->mock(new Response( 200, ' { "sid": "RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "friendly_name": "channel user", "type": "channel", "permissions": [ "sendMessage", "leaveChannel", "editOwnMessage", "deleteOwnMessage" ], "date_created": "2016-03-03T19:47:15Z", "date_updated": "2016-03-03T19:47:15Z", "url": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Roles/RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->ipMessaging->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->roles("RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(array('permission')); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/IpMessaging/V1/Service/UserTest.php 0000604 00000025051 15174325133 0020547 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\IpMessaging\V1\Service; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class UserTest extends HolodeckTestCase { public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->ipMessaging->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->users("USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://ip-messaging.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "sid": "USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "role_sid": "RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "identity": "jing", "attributes": null, "is_online": true, "is_notifiable": null, "friendly_name": null, "joined_channels_count": 0, "date_created": "2016-03-24T21:05:19Z", "date_updated": "2016-03-24T21:05:19Z", "links": { "user_channels": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels" }, "url": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->ipMessaging->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->users("USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); $this->assertNotNull($actual); } public function testDeleteRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->ipMessaging->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->users("USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'delete', 'https://ip-messaging.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testDeleteResponse() { $this->holodeck->mock(new Response( 204, null )); $actual = $this->twilio->ipMessaging->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->users("USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); $this->assertTrue($actual); } public function testCreateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->ipMessaging->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->users->create("identity"); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $values = array('Identity' => "identity", ); $this->assertRequest(new Request( 'post', 'https://ip-messaging.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users', null, $values )); } public function testCreateResponse() { $this->holodeck->mock(new Response( 201, ' { "sid": "USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "role_sid": "RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "identity": "jing", "attributes": null, "is_online": true, "is_notifiable": null, "friendly_name": null, "joined_channels_count": 0, "date_created": "2016-03-24T21:05:19Z", "date_updated": "2016-03-24T21:05:19Z", "links": { "user_channels": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels" }, "url": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->ipMessaging->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->users->create("identity"); $this->assertNotNull($actual); } public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->ipMessaging->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->users->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://ip-messaging.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users' )); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "meta": { "page": 0, "page_size": 50, "first_page_url": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users?PageSize=50&Page=0", "previous_page_url": null, "url": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users?PageSize=50&Page=0", "next_page_url": null, "key": "users" }, "users": [ { "sid": "USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "role_sid": "RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "identity": "jing", "attributes": null, "is_online": true, "is_notifiable": null, "friendly_name": null, "date_created": "2016-03-24T21:05:19Z", "date_updated": "2016-03-24T21:05:19Z", "joined_channels_count": 0, "links": { "user_channels": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels" }, "url": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ] } ' )); $actual = $this->twilio->ipMessaging->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->users->read(); $this->assertGreaterThan(0, count($actual)); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "meta": { "page": 0, "page_size": 50, "first_page_url": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users?PageSize=50&Page=0", "previous_page_url": null, "url": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users?PageSize=50&Page=0", "next_page_url": null, "key": "users" }, "users": [] } ' )); $actual = $this->twilio->ipMessaging->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->users->read(); $this->assertNotNull($actual); } public function testUpdateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->ipMessaging->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->users("USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'post', 'https://ip-messaging.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testUpdateResponse() { $this->holodeck->mock(new Response( 200, ' { "sid": "USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "role_sid": "RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "identity": "jing", "attributes": null, "is_online": true, "is_notifiable": null, "friendly_name": null, "joined_channels_count": 0, "date_created": "2016-03-24T21:05:19Z", "date_updated": "2016-03-24T21:05:19Z", "links": { "user_channels": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels" }, "url": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->ipMessaging->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->users("USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/IpMessaging/V1/Service/User/UserChannelTest.php 0000604 00000010212 15174325133 0022747 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\IpMessaging\V1\Service\User; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class UserChannelTest extends HolodeckTestCase { public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->ipMessaging->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->users("USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->userChannels->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://ip-messaging.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels' )); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "meta": { "page": 0, "page_size": 50, "first_page_url": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels?PageSize=50&Page=0", "previous_page_url": null, "url": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels?PageSize=50&Page=0", "next_page_url": null, "key": "channels" }, "channels": [ { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "channel_sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "member_sid": "MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "status": "joined", "last_consumed_message_index": 5, "unread_messages_count": 5, "links": { "channel": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "member": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members/MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } } ] } ' )); $actual = $this->twilio->ipMessaging->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->users("USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->userChannels->read(); $this->assertGreaterThan(0, count($actual)); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "meta": { "page": 0, "page_size": 50, "first_page_url": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels?PageSize=50&Page=0", "previous_page_url": null, "url": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels?PageSize=50&Page=0", "next_page_url": null, "key": "channels" }, "channels": [] } ' )); $actual = $this->twilio->ipMessaging->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->users("USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->userChannels->read(); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/IpMessaging/V1/Service/Channel/InviteTest.php 0000604 00000022145 15174325133 0022440 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\IpMessaging\V1\Service\Channel; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class InviteTest extends HolodeckTestCase { public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->ipMessaging->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->invites("INaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://ip-messaging.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Invites/INaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "channel_sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "created_by": "created_by", "date_created": "2015-07-30T20:00:00Z", "date_updated": "2015-07-30T20:00:00Z", "identity": "identity", "role_sid": "RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "sid": "INaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "url": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Invites/INaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->ipMessaging->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->invites("INaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); $this->assertNotNull($actual); } public function testCreateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->ipMessaging->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->invites->create("identity"); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $values = array('Identity' => "identity", ); $this->assertRequest(new Request( 'post', 'https://ip-messaging.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Invites', null, $values )); } public function testCreateResponse() { $this->holodeck->mock(new Response( 201, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "channel_sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "created_by": "created_by", "date_created": "2015-07-30T20:00:00Z", "date_updated": "2015-07-30T20:00:00Z", "identity": "identity", "role_sid": "RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "sid": "INaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "url": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Invites/INaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->ipMessaging->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->invites->create("identity"); $this->assertNotNull($actual); } public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->ipMessaging->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->invites->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://ip-messaging.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Invites' )); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "invites": [], "meta": { "first_page_url": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Invites?PageSize=50&Page=0", "key": "invites", "next_page_url": null, "page": 0, "page_size": 50, "previous_page_url": null, "url": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Invites?PageSize=50&Page=0" } } ' )); $actual = $this->twilio->ipMessaging->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->invites->read(); $this->assertNotNull($actual); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "invites": [ { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "channel_sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "created_by": "created_by", "date_created": "2015-07-30T20:00:00Z", "date_updated": "2015-07-30T20:00:00Z", "identity": "identity", "role_sid": "RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "sid": "INaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "url": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Invites/INaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ], "meta": { "first_page_url": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Invites?PageSize=50&Page=0", "key": "invites", "next_page_url": null, "page": 0, "page_size": 50, "previous_page_url": null, "url": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Invites?PageSize=50&Page=0" } } ' )); $actual = $this->twilio->ipMessaging->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->invites->read(); $this->assertGreaterThan(0, count($actual)); } public function testDeleteRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->ipMessaging->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->invites("INaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'delete', 'https://ip-messaging.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Invites/INaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testDeleteResponse() { $this->holodeck->mock(new Response( 204, null )); $actual = $this->twilio->ipMessaging->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->invites("INaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); $this->assertTrue($actual); } } sdk/Twilio/Tests/Integration/IpMessaging/V1/Service/Channel/MemberTest.php 0000604 00000031061 15174325133 0022406 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\IpMessaging\V1\Service\Channel; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class MemberTest extends HolodeckTestCase { public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->ipMessaging->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->members("MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://ip-messaging.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members/MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "sid": "MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "channel_sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "identity": "jing", "role_sid": "RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "last_consumed_message_index": null, "last_consumption_timestamp": null, "date_created": "2016-03-24T21:05:50Z", "date_updated": "2016-03-24T21:05:50Z", "url": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members/MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->ipMessaging->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->members("MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); $this->assertNotNull($actual); } public function testCreateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->ipMessaging->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->members->create("identity"); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $values = array('Identity' => "identity", ); $this->assertRequest(new Request( 'post', 'https://ip-messaging.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members', null, $values )); } public function testCreateResponse() { $this->holodeck->mock(new Response( 201, ' { "sid": "MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "channel_sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "identity": "jing", "role_sid": "RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "last_consumed_message_index": null, "last_consumption_timestamp": null, "date_created": "2016-03-24T21:05:50Z", "date_updated": "2016-03-24T21:05:50Z", "url": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members/MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->ipMessaging->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->members->create("identity"); $this->assertNotNull($actual); } public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->ipMessaging->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->members->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://ip-messaging.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members' )); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "meta": { "page": 0, "page_size": 50, "first_page_url": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members?PageSize=50&Page=0", "previous_page_url": null, "url": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members?PageSize=50&Page=0", "next_page_url": null, "key": "members" }, "members": [ { "sid": "MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "channel_sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "identity": "jing", "role_sid": "RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "last_consumed_message_index": null, "last_consumption_timestamp": null, "date_created": "2016-03-24T21:05:50Z", "date_updated": "2016-03-24T21:05:50Z", "url": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members/MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ] } ' )); $actual = $this->twilio->ipMessaging->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->members->read(); $this->assertGreaterThan(0, count($actual)); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "meta": { "page": 0, "page_size": 50, "first_page_url": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members?PageSize=50&Page=0", "previous_page_url": null, "url": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members?PageSize=50&Page=0", "next_page_url": null, "key": "members" }, "members": [] } ' )); $actual = $this->twilio->ipMessaging->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->members->read(); $this->assertNotNull($actual); } public function testDeleteRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->ipMessaging->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->members("MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'delete', 'https://ip-messaging.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members/MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testDeleteResponse() { $this->holodeck->mock(new Response( 204, null )); $actual = $this->twilio->ipMessaging->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->members("MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); $this->assertTrue($actual); } public function testUpdateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->ipMessaging->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->members("MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'post', 'https://ip-messaging.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members/MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testUpdateRoleSidResponse() { $this->holodeck->mock(new Response( 200, ' { "sid": "MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "channel_sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "identity": "jing", "role_sid": "RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "last_consumed_message_index": null, "last_consumption_timestamp": null, "date_created": "2016-03-24T21:05:50Z", "date_updated": "2016-03-24T21:05:50Z", "url": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members/MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->ipMessaging->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->members("MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); $this->assertNotNull($actual); } public function testUpdateLastConsumedMessageIndexResponse() { $this->holodeck->mock(new Response( 200, ' { "sid": "MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "channel_sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "identity": "jing", "role_sid": "RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "last_consumed_message_index": 666, "last_consumption_timestamp": null, "date_created": "2016-03-24T21:05:50Z", "date_updated": "2016-03-24T21:05:50Z", "url": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members/MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->ipMessaging->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->members("MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/IpMessaging/V1/Service/Channel/MessageTest.php 0000604 00000031237 15174325133 0022570 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\IpMessaging\V1\Service\Channel; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class MessageTest extends HolodeckTestCase { public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->ipMessaging->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->messages("IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://ip-messaging.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "sid": "IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "to": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "channel_sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "2016-03-24T20:37:57Z", "date_updated": "2016-03-24T20:37:57Z", "was_edited": false, "from": "system", "attributes": "{}", "body": "Hello", "index": 0, "url": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->ipMessaging->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->messages("IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); $this->assertNotNull($actual); } public function testCreateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->ipMessaging->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->messages->create("body"); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $values = array('Body' => "body", ); $this->assertRequest(new Request( 'post', 'https://ip-messaging.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages', null, $values )); } public function testCreateResponse() { $this->holodeck->mock(new Response( 201, ' { "sid": "IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "to": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "channel_sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "attributes": null, "date_created": "2016-03-24T20:37:57Z", "date_updated": "2016-03-24T20:37:57Z", "was_edited": false, "from": "system", "body": "Hello", "index": 0, "url": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->ipMessaging->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->messages->create("body"); $this->assertNotNull($actual); } public function testCreateWithAttributesResponse() { $this->holodeck->mock(new Response( 201, ' { "sid": "IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "to": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "channel_sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "2016-03-24T20:37:57Z", "date_updated": "2016-03-24T20:37:57Z", "was_edited": false, "from": "system", "attributes": "{}", "body": "Hello", "index": 0, "url": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->ipMessaging->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->messages->create("body"); $this->assertNotNull($actual); } public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->ipMessaging->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->messages->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://ip-messaging.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages' )); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "meta": { "page": 0, "page_size": 50, "first_page_url": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages?PageSize=50&Page=0", "previous_page_url": null, "url": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages?PageSize=50&Page=0", "next_page_url": null, "key": "messages" }, "messages": [ { "sid": "IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "to": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "channel_sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "2016-03-24T20:37:57Z", "date_updated": "2016-03-24T20:37:57Z", "was_edited": false, "from": "system", "attributes": "{}", "body": "Hello", "index": 0, "url": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ] } ' )); $actual = $this->twilio->ipMessaging->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->messages->read(); $this->assertGreaterThan(0, count($actual)); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "meta": { "page": 0, "page_size": 50, "first_page_url": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages?PageSize=50&Page=0", "previous_page_url": null, "url": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages?PageSize=50&Page=0", "next_page_url": null, "key": "messages" }, "messages": [] } ' )); $actual = $this->twilio->ipMessaging->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->messages->read(); $this->assertNotNull($actual); } public function testDeleteRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->ipMessaging->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->messages("IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'delete', 'https://ip-messaging.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testDeleteResponse() { $this->holodeck->mock(new Response( 204, null )); $actual = $this->twilio->ipMessaging->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->messages("IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); $this->assertTrue($actual); } public function testUpdateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->ipMessaging->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->messages("IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'post', 'https://ip-messaging.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testUpdateResponse() { $this->holodeck->mock(new Response( 200, ' { "sid": "IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "to": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "channel_sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "attributes": "{\\"test\\": \\"test\\"}", "date_created": "2016-03-24T20:37:57Z", "date_updated": "2016-03-24T20:37:57Z", "was_edited": false, "from": "system", "body": "Hello", "index": 0, "url": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->ipMessaging->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->channels("CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->messages("IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/IpMessaging/V1/CredentialTest.php 0000604 00000016445 15174325133 0020312 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\IpMessaging\V1; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class CredentialTest extends HolodeckTestCase { public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->ipMessaging->v1->credentials->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://ip-messaging.twilio.com/v1/Credentials' )); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "credentials": [ { "sid": "CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "friendly_name": "Test slow create", "type": "apn", "sandbox": "False", "date_created": "2015-10-07T17:50:01Z", "date_updated": "2015-10-07T17:50:01Z", "url": "https://chat.twilio.com/v1/Credentials/CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ], "meta": { "page": 0, "page_size": 1, "first_page_url": "https://chat.twilio.com/v1/Credentials?PageSize=1&Page=0", "previous_page_url": null, "url": "https://chat.twilio.com/v1/Credentials?PageSize=1&Page=0", "next_page_url": null, "key": "credentials" } } ' )); $actual = $this->twilio->ipMessaging->v1->credentials->read(); $this->assertGreaterThan(0, count($actual)); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "credentials": [], "meta": { "page": 0, "page_size": 1, "first_page_url": "https://chat.twilio.com/v1/Credentials?PageSize=1&Page=0", "previous_page_url": null, "url": "https://chat.twilio.com/v1/Credentials?PageSize=1&Page=0", "next_page_url": null, "key": "credentials" } } ' )); $actual = $this->twilio->ipMessaging->v1->credentials->read(); $this->assertNotNull($actual); } public function testCreateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->ipMessaging->v1->credentials->create("gcm"); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $values = array('Type' => "gcm", ); $this->assertRequest(new Request( 'post', 'https://ip-messaging.twilio.com/v1/Credentials', null, $values )); } public function testCreateResponse() { $this->holodeck->mock(new Response( 201, ' { "sid": "CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "friendly_name": "Test slow create", "type": "apn", "sandbox": "False", "date_created": "2015-10-07T17:50:01Z", "date_updated": "2015-10-07T17:50:01Z", "url": "https://chat.twilio.com/v1/Credentials/CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->ipMessaging->v1->credentials->create("gcm"); $this->assertNotNull($actual); } public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->ipMessaging->v1->credentials("CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://ip-messaging.twilio.com/v1/Credentials/CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "sid": "CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "friendly_name": "Test slow create", "type": "apn", "sandbox": "False", "date_created": "2015-10-07T17:50:01Z", "date_updated": "2015-10-07T17:50:01Z", "url": "https://chat.twilio.com/v1/Credentials/CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->ipMessaging->v1->credentials("CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); $this->assertNotNull($actual); } public function testUpdateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->ipMessaging->v1->credentials("CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'post', 'https://ip-messaging.twilio.com/v1/Credentials/CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testUpdateResponse() { $this->holodeck->mock(new Response( 200, ' { "sid": "CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "friendly_name": "Test slow create", "type": "apn", "sandbox": "False", "date_created": "2015-10-07T17:50:01Z", "date_updated": "2015-10-07T17:50:01Z", "url": "https://chat.twilio.com/v1/Credentials/CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->ipMessaging->v1->credentials("CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); $this->assertNotNull($actual); } public function testDeleteRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->ipMessaging->v1->credentials("CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'delete', 'https://ip-messaging.twilio.com/v1/Credentials/CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testDeleteResponse() { $this->holodeck->mock(new Response( 204, null )); $actual = $this->twilio->ipMessaging->v1->credentials("CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); $this->assertTrue($actual); } } sdk/Twilio/Tests/Integration/Monitor/V1/EventTest.php 0000604 00000012776 15174325133 0016545 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Monitor\V1; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class EventTest extends HolodeckTestCase { public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->monitor->v1->events("AEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://monitor.twilio.com/v1/Events/AEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "actor_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "actor_type": "account", "description": null, "event_data": { "friendly_name": { "previous": "SubAccount Created at 2014-10-03 09:48 am", "updated": "Mr. Friendly" } }, "event_date": "2014-10-03T16:48:25Z", "event_type": "account.updated", "links": { "actor": "https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "resource": "https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" }, "resource_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "resource_type": "account", "sid": "AEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "source": "api", "source_ip_address": "10.86.6.250", "url": "https://monitor.twilio.com/v1/Events/AEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->monitor->v1->events("AEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); $this->assertNotNull($actual); } public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->monitor->v1->events->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://monitor.twilio.com/v1/Events' )); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "events": [ { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "actor_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "actor_type": "account", "description": null, "event_data": { "friendly_name": { "previous": "SubAccount Created at 2014-10-03 09:48 am", "updated": "Mr. Friendly" } }, "event_date": "2014-10-03T16:48:25Z", "event_type": "account.updated", "links": { "actor": "https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "resource": "https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" }, "resource_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "resource_type": "account", "sid": "AEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "source": "api", "source_ip_address": "10.86.6.250", "url": "https://monitor.twilio.com/v1/Events/AEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ], "meta": { "first_page_url": "https://monitor.twilio.com/v1/Events?PageSize=50&Page=0", "key": "events", "next_page_url": null, "page": 0, "page_size": 50, "previous_page_url": null, "url": "https://monitor.twilio.com/v1/Events?PageSize=50&Page=0" } } ' )); $actual = $this->twilio->monitor->v1->events->read(); $this->assertGreaterThan(0, count($actual)); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "events": [], "meta": { "first_page_url": "https://monitor.twilio.com/v1/Events?PageSize=50&Page=0", "key": "events", "next_page_url": null, "page": 0, "page_size": 50, "previous_page_url": null, "url": "https://monitor.twilio.com/v1/Events?PageSize=50&Page=0" } } ' )); $actual = $this->twilio->monitor->v1->events->read(); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/Monitor/V1/AlertTest.php 0000604 00000012624 15174325133 0016523 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Monitor\V1; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class AlertTest extends HolodeckTestCase { public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->monitor->v1->alerts("NOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://monitor.twilio.com/v1/Alerts/NOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "alert_text": "alert_text", "api_version": "2010-04-01", "date_created": "2015-07-30T20:00:00Z", "date_generated": "2015-07-30T20:00:00Z", "date_updated": "2015-07-30T20:00:00Z", "error_code": "error_code", "log_level": "log_level", "more_info": "more_info", "request_method": "GET", "request_url": "http://www.example.com", "request_variables": "request_variables", "resource_sid": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "response_body": "response_body", "response_headers": "response_headers", "sid": "NOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "url": "http://www.example.com" } ' )); $actual = $this->twilio->monitor->v1->alerts("NOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); $this->assertNotNull($actual); } public function testDeleteRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->monitor->v1->alerts("NOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'delete', 'https://monitor.twilio.com/v1/Alerts/NOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testDeleteResponse() { $this->holodeck->mock(new Response( 204, null )); $actual = $this->twilio->monitor->v1->alerts("NOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); $this->assertTrue($actual); } public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->monitor->v1->alerts->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://monitor.twilio.com/v1/Alerts' )); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "alerts": [], "meta": { "first_page_url": "https://monitor.twilio.com/v1/Alerts?Page=0&PageSize=50", "key": "alerts", "next_page_url": null, "page": 0, "page_size": 0, "previous_page_url": null, "url": "https://monitor.twilio.com/v1/Alerts" } } ' )); $actual = $this->twilio->monitor->v1->alerts->read(); $this->assertNotNull($actual); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "alerts": [ { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "alert_text": "alert_text", "api_version": "2010-04-01", "date_created": "2015-07-30T20:00:00Z", "date_generated": "2015-07-30T20:00:00Z", "date_updated": "2015-07-30T20:00:00Z", "error_code": "error_code", "log_level": "log_level", "more_info": "more_info", "request_method": "GET", "request_url": "http://www.example.com", "resource_sid": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "sid": "NOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "url": "http://www.example.com" } ], "meta": { "first_page_url": "https://monitor.twilio.com/v1/Alerts?Page=0&PageSize=50", "key": "alerts", "next_page_url": null, "page": 0, "page_size": 1, "previous_page_url": null, "url": "https://monitor.twilio.com/v1/Alerts" } } ' )); $actual = $this->twilio->monitor->v1->alerts->read(); $this->assertGreaterThan(0, count($actual)); } } sdk/Twilio/Tests/Integration/Studio/V1/Flow/Engagement/StepTest.php 0000604 00000007715 15174325133 0021175 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Studio\V1\Flow\Engagement; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class StepTest extends HolodeckTestCase { public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->studio->v1->flows("FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->engagements("FNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->steps->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://studio.twilio.com/v1/Flows/FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Engagements/FNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Steps' )); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "meta": { "previous_page_url": null, "next_page_url": null, "url": "https://studio.twilio.com/v1/Flows/FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Engagements/FNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Steps?PageSize=50&Page=0", "page": 0, "first_page_url": "https://studio.twilio.com/v1/Flows/FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Engagements/FNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Steps?PageSize=50&Page=0", "page_size": 50, "key": "steps" }, "steps": [] } ' )); $actual = $this->twilio->studio->v1->flows("FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->engagements("FNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->steps->read(); $this->assertNotNull($actual); } public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->studio->v1->flows("FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->engagements("FNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->steps("FTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://studio.twilio.com/v1/Flows/FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Engagements/FNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Steps/FTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "sid": "FTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "flow_sid": "FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "engagement_sid": "FNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "name": "incomingRequest", "context": {}, "transitioned_from": "Trigger", "transitioned_to": "Ended", "date_created": "2017-11-06T12:00:00Z", "date_updated": null, "url": "https://studio.twilio.com/v1/Flows/FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Engagements/FNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Steps/FTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->studio->v1->flows("FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->engagements("FNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->steps("FTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/Studio/V1/Flow/EngagementTest.php 0000604 00000013072 15174325133 0020253 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Studio\V1\Flow; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class EngagementTest extends HolodeckTestCase { public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->studio->v1->flows("FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->engagements->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://studio.twilio.com/v1/Flows/FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Engagements' )); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "meta": { "previous_page_url": null, "next_page_url": null, "url": "https://studio.twilio.com/v1/Flows/FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Engagements?PageSize=50&Page=0", "page": 0, "first_page_url": "https://studio.twilio.com/v1/Flows/FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Engagements?PageSize=50&Page=0", "page_size": 50, "key": "engagements" }, "engagements": [] } ' )); $actual = $this->twilio->studio->v1->flows("FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->engagements->read(); $this->assertNotNull($actual); } public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->studio->v1->flows("FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->engagements("FNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://studio.twilio.com/v1/Flows/FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Engagements/FNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "sid": "FNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "flow_sid": "FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "contact_sid": "FCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "contact_channel_address": "+14155555555", "status": "ended", "context": {}, "date_created": "2017-11-06T12:00:00Z", "date_updated": null, "url": "https://studio.twilio.com/v1/Flows/FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Engagements/FNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "links": { "steps": "https://studio.twilio.com/v1/Flows/FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Engagements/FNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Steps" } } ' )); $actual = $this->twilio->studio->v1->flows("FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->engagements("FNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); $this->assertNotNull($actual); } public function testCreateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->studio->v1->flows("FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->engagements->create("+15558675310", "+15017122661"); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $values = array('To' => "+15558675310", 'From' => "+15017122661", ); $this->assertRequest(new Request( 'post', 'https://studio.twilio.com/v1/Flows/FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Engagements', null, $values )); } public function testCreateResponse() { $this->holodeck->mock(new Response( 201, ' { "url": "https://studio.twilio.com/v1/Flows/FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Engagements/FNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "sid": "FNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "flow_sid": "FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "context": { "flow": { "first_name": "Foo" } }, "contact_sid": "FCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "contact_channel_address": "+18001234567", "status": "active", "date_created": "2015-07-30T20:00:00Z", "date_updated": "2015-07-30T20:00:00Z", "links": { "steps": "https://studio.twilio.com/v1/Flows/FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Engagements/FNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Steps" } } ' )); $actual = $this->twilio->studio->v1->flows("FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->engagements->create("+15558675310", "+15017122661"); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/Notify/V1/Service/SegmentTest.php 0000604 00000006226 15174325133 0020300 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Notify\V1\Service; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class SegmentTest extends HolodeckTestCase { public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->notify->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->segments->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://notify.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Segments' )); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "meta": { "first_page_url": "https://notify.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Segments?PageSize=50&Page=0", "key": "segments", "next_page_url": null, "page": 0, "page_size": 50, "previous_page_url": null, "url": "https://notify.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Segments?PageSize=50&Page=0" }, "segments": [] } ' )); $actual = $this->twilio->notify->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->segments->read(); $this->assertNotNull($actual); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "segments": [ { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "2017-02-14T14:36:41Z", "date_updated": "2017-02-14T14:36:41Z", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "sid": "GSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "unique_name": "segment" } ], "meta": { "first_page_url": "https://notify.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Segments?PageSize=50&Page=0", "key": "segments", "next_page_url": null, "page": 0, "page_size": 50, "previous_page_url": null, "url": "https://notify.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Segments?PageSize=50&Page=0" } } ' )); $actual = $this->twilio->notify->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->segments->read(); $this->assertGreaterThan(0, count($actual)); } } sdk/Twilio/Tests/Integration/Notify/V1/Service/NotificationTest.php 0000604 00000006314 15174325133 0021322 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Notify\V1\Service; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class NotificationTest extends HolodeckTestCase { public function testCreateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->notify->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->notifications->create(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'post', 'https://notify.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Notifications' )); } public function testCreateResponse() { $this->holodeck->mock(new Response( 201, ' { "sid": "NOb8021351170b4e1286adaac3fdd6d082", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "IS699b53e02da45a1ba9d13b7d7d2766af", "date_created": "2016-03-24T23:42:28Z", "identities": [ "jing" ], "tags": [], "segments": [], "priority": "high", "ttl": 2419200, "title": "test", "body": "body", "sound": null, "action": null, "data": null, "apn": null, "fcm": null, "gcm": null, "sms": null, "facebook_messenger": null, "alexa": null } ' )); $actual = $this->twilio->notify->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->notifications->create(); $this->assertNotNull($actual); } public function testCreateDirectNotificationResponse() { $this->holodeck->mock(new Response( 201, ' { "sid": "NOb8021351170b4e1286adaac3fdd6d082", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "IS699b53e02da45a1ba9d13b7d7d2766af", "date_created": "2016-03-24T23:42:28Z", "identities": [], "tags": [], "segments": [], "priority": "high", "ttl": 2419200, "title": null, "body": "body", "sound": null, "action": null, "data": null, "apn": null, "fcm": null, "gcm": null, "sms": null, "facebook_messenger": null, "alexa": null } ' )); $actual = $this->twilio->notify->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->notifications->create(); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/Notify/V1/Service/UserTest.php 0000604 00000020424 15174325133 0017610 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Notify\V1\Service; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class UserTest extends HolodeckTestCase { public function testCreateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->notify->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->users->create("identity"); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $values = array('Identity' => "identity", ); $this->assertRequest(new Request( 'post', 'https://notify.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users', null, $values )); } public function testCreateResponse() { $this->holodeck->mock(new Response( 201, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "2017-02-17T07:17:02Z", "date_updated": "2017-02-17T07:17:02Z", "identity": "identity", "links": { "bindings": "https://notify.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/identity/Bindings", "segment_memberships": "https://notify.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/identity/SegmentMemberships" }, "segments": [ "segment1" ], "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "sid": "USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "url": "https://notify.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/identity" } ' )); $actual = $this->twilio->notify->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->users->create("identity"); $this->assertNotNull($actual); } public function testDeleteRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->notify->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->users("NUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'delete', 'https://notify.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/NUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testDeleteResponse() { $this->holodeck->mock(new Response( 204, null )); $actual = $this->twilio->notify->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->users("NUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); $this->assertTrue($actual); } public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->notify->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->users("NUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://notify.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/NUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "sid": "USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "2017-02-17T07:17:02Z", "date_updated": "2017-02-17T07:17:02Z", "identity": "identity", "links": { "bindings": "https://notify.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/identity/Bindings", "segment_memberships": "https://notify.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/identity/SegmentMemberships" }, "segments": [ "segment1" ], "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "url": "https://notify.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/identity" } ' )); $actual = $this->twilio->notify->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->users("NUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); $this->assertNotNull($actual); } public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->notify->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->users->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://notify.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users' )); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "users": [], "meta": { "first_page_url": "https://notify.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users?PageSize=50&Page=0", "key": "users", "next_page_url": null, "page": 0, "page_size": 50, "previous_page_url": null, "url": "https://notify.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users?PageSize=50&Page=0" } } ' )); $actual = $this->twilio->notify->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->users->read(); $this->assertNotNull($actual); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "users": [ { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "2017-02-17T07:17:02Z", "date_updated": "2017-02-17T07:17:02Z", "identity": "identity", "links": { "bindings": "https://notify.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/identity/Bindings", "segment_memberships": "https://notify.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/identity/SegmentMemberships" }, "segments": [ "segment1" ], "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "sid": "USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "url": "https://notify.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/identity" } ], "meta": { "first_page_url": "https://notify.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users?PageSize=50&Page=0", "key": "users", "next_page_url": null, "page": 0, "page_size": 50, "previous_page_url": null, "url": "https://notify.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users?PageSize=50&Page=0" } } ' )); $actual = $this->twilio->notify->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->users->read(); $this->assertGreaterThan(0, count($actual)); } } sdk/Twilio/Tests/Integration/Notify/V1/Service/User/UserBindingTest.php 0000604 00000026457 15174325133 0022035 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Notify\V1\Service\User; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class UserBindingTest extends HolodeckTestCase { public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->notify->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->users("NUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->bindings("BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://notify.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/NUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings/BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "address": "address", "binding_type": "binding_type", "credential_sid": "CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "2015-07-30T20:00:00Z", "date_updated": "2015-07-30T20:00:00Z", "endpoint": "endpoint", "links": { "user": "https://notify.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/identity" }, "identity": "identity", "notification_protocol_version": "notification_protocol_version", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "sid": "BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "tags": [ "tag" ], "url": "https://notify.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/identity/Bindings/BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->notify->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->users("NUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->bindings("BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); $this->assertNotNull($actual); } public function testDeleteRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->notify->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->users("NUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->bindings("BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'delete', 'https://notify.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/NUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings/BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testDeleteResponse() { $this->holodeck->mock(new Response( 204, null )); $actual = $this->twilio->notify->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->users("NUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->bindings("BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); $this->assertTrue($actual); } public function testCreateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->notify->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->users("NUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->bindings->create("apn", "address"); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $values = array('BindingType' => "apn", 'Address' => "address", ); $this->assertRequest(new Request( 'post', 'https://notify.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/NUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings', null, $values )); } public function testCreateResponse() { $this->holodeck->mock(new Response( 201, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "address": "address", "binding_type": "binding_type", "credential_sid": "CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "2015-07-30T20:00:00Z", "date_updated": "2015-07-30T20:00:00Z", "endpoint": "endpoint", "identity": "identity", "links": { "user": "https://notify.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/identity" }, "notification_protocol_version": "notification_protocol_version", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "sid": "BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "tags": [ "tag" ], "url": "https://notify.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/identity/Bindings/BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->notify->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->users("NUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->bindings->create("apn", "address"); $this->assertNotNull($actual); } public function testCreateAlexaResponse() { $this->holodeck->mock(new Response( 201, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "address": "address", "binding_type": "binding_type", "credential_sid": "CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "2015-07-30T20:00:00Z", "date_updated": "2015-07-30T20:00:00Z", "endpoint": "endpoint", "identity": "identity", "links": { "user": "https://notify.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/identity" }, "notification_protocol_version": "notification_protocol_version", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "sid": "BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "tags": [ "tag" ], "url": "https://notify.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/identity/Bindings/BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->notify->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->users("NUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->bindings->create("apn", "address"); $this->assertNotNull($actual); } public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->notify->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->users("NUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->bindings->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://notify.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/NUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings' )); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "bindings": [], "meta": { "first_page_url": "https://notify.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/identity/Bindings?PageSize=50&Page=0", "key": "bindings", "next_page_url": null, "page": 0, "page_size": 50, "previous_page_url": null, "url": "https://notify.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/identity/Bindings?PageSize=50&Page=0" } } ' )); $actual = $this->twilio->notify->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->users("NUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->bindings->read(); $this->assertNotNull($actual); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "bindings": [ { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "address": "address", "binding_type": "binding_type", "credential_sid": "CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "2015-07-30T20:00:00Z", "date_updated": "2015-07-30T20:00:00Z", "endpoint": "endpoint", "identity": "identity", "links": { "user": "https://notify.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/identity" }, "notification_protocol_version": "notification_protocol_version", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "sid": "BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "tags": [ "tag" ], "url": "https://notify.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/identity/Bindings/BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ], "meta": { "first_page_url": "https://notify.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/identity/Bindings?PageSize=50&Page=0", "key": "bindings", "next_page_url": null, "page": 0, "page_size": 50, "previous_page_url": null, "url": "https://notify.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/identity/Bindings?PageSize=50&Page=0" } } ' )); $actual = $this->twilio->notify->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->users("NUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->bindings->read(); $this->assertGreaterThan(0, count($actual)); } } sdk/Twilio/Tests/Integration/Notify/V1/Service/User/SegmentMembershipTest.php 0000604 00000011060 15174325133 0023222 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Notify\V1\Service\User; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class SegmentMembershipTest extends HolodeckTestCase { public function testCreateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->notify->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->users("NUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->segmentMemberships->create("segment"); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $values = array('Segment' => "segment", ); $this->assertRequest(new Request( 'post', 'https://notify.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/NUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SegmentMemberships', null, $values )); } public function testCreateResponse() { $this->holodeck->mock(new Response( 201, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "identity": "identity", "segment": "segment", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "url": "https://notify.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/identity/SegmentMemberships/segment" } ' )); $actual = $this->twilio->notify->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->users("NUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->segmentMemberships->create("segment"); $this->assertNotNull($actual); } public function testDeleteRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->notify->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->users("NUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->segmentMemberships("segment")->delete(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'delete', 'https://notify.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/NUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SegmentMemberships/segment' )); } public function testDeleteResponse() { $this->holodeck->mock(new Response( 204, null )); $actual = $this->twilio->notify->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->users("NUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->segmentMemberships("segment")->delete(); $this->assertTrue($actual); } public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->notify->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->users("NUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->segmentMemberships("segment")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://notify.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/NUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SegmentMemberships/segment' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "identity": "identity", "segment": "segment", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "url": "https://notify.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/identity/SegmentMemberships/segment" } ' )); $actual = $this->twilio->notify->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->users("NUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->segmentMemberships("segment")->fetch(); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/Notify/V1/Service/BindingTest.php 0000604 00000021507 15174325133 0020247 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Notify\V1\Service; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class BindingTest extends HolodeckTestCase { public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->notify->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->bindings("BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://notify.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings/BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "address": "a7c658f4111ec4ff5a1a647f9d0edd819025b9f20522d2fae897049f32873e73", "binding_type": "apn", "credential_sid": null, "date_created": "2015-07-30T20:00:00Z", "date_updated": "2015-07-30T20:00:00Z", "endpoint": "26607274", "identity": "24987039", "notification_protocol_version": "3", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "sid": "BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "tags": [ "26607274" ], "links": { "user": "https://notify.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/24987039" }, "url": "https://notify.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings/BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->notify->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->bindings("BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); $this->assertNotNull($actual); } public function testDeleteRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->notify->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->bindings("BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'delete', 'https://notify.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings/BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testDeleteResponse() { $this->holodeck->mock(new Response( 204, null )); $actual = $this->twilio->notify->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->bindings("BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); $this->assertTrue($actual); } public function testCreateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->notify->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->bindings->create("identity", "apn", "address"); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $values = array('Identity' => "identity", 'BindingType' => "apn", 'Address' => "address", ); $this->assertRequest(new Request( 'post', 'https://notify.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings', null, $values )); } public function testCreateResponse() { $this->holodeck->mock(new Response( 201, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "address": "a7c658f4111ec4ff5a1a647f9d0edd819025b9f20522d2fae897049f32873e73", "binding_type": "apn", "credential_sid": null, "date_created": "2015-07-30T20:00:00Z", "date_updated": "2015-07-30T20:00:00Z", "endpoint": "26607274", "identity": "24987039", "notification_protocol_version": "3", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "sid": "BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "tags": [ "26607274" ], "links": { "user": "https://notify.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/24987039" }, "url": "https://notify.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings/BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->notify->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->bindings->create("identity", "apn", "address"); $this->assertNotNull($actual); } public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->notify->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->bindings->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://notify.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings' )); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "bindings": [], "meta": { "first_page_url": "https://notify.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings?PageSize=50&Page=0", "key": "bindings", "next_page_url": null, "page": 0, "page_size": 50, "previous_page_url": null, "url": "https://notify.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings?PageSize=50&Page=0" } } ' )); $actual = $this->twilio->notify->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->bindings->read(); $this->assertNotNull($actual); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "bindings": [ { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "address": "a7c658f4111ec4ff5a1a647f9d0edd819025b9f20522d2fae897049f32873e73", "binding_type": "apn", "credential_sid": null, "date_created": "2015-07-30T20:00:00Z", "date_updated": "2015-07-30T20:00:00Z", "endpoint": "26607274", "identity": "24987039", "notification_protocol_version": "3", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "sid": "BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "tags": [ "26607274" ], "links": { "user": "https://notify.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/24987039" }, "url": "https://notify.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings/BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ], "meta": { "first_page_url": "https://notify.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings?PageSize=50&Page=0", "key": "bindings", "next_page_url": null, "page": 0, "page_size": 50, "previous_page_url": null, "url": "https://notify.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings?PageSize=50&Page=0" } } ' )); $actual = $this->twilio->notify->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->bindings->read(); $this->assertGreaterThan(0, count($actual)); } } sdk/Twilio/Tests/Integration/Notify/V1/ServiceTest.php 0000604 00000026554 15174325133 0016704 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Notify\V1; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class ServiceTest extends HolodeckTestCase { public function testCreateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->notify->v1->services->create(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'post', 'https://notify.twilio.com/v1/Services' )); } public function testCreateResponse() { $this->holodeck->mock(new Response( 201, ' { "sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "friendly_name": "733c7f0f-6541-42ec-84ce-e2ae1cac588c", "date_created": "2016-03-09T20:22:31Z", "date_updated": "2016-03-09T20:22:31Z", "apn_credential_sid": null, "gcm_credential_sid": null, "fcm_credential_sid": null, "messaging_service_sid": null, "facebook_messenger_page_id": "4", "alexa_skill_id": null, "default_apn_notification_protocol_version": "3", "default_gcm_notification_protocol_version": "3", "default_fcm_notification_protocol_version": "3", "default_alexa_notification_protocol_version": "3", "log_enabled": true, "type": "S", "url": "https://notify.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "links": { "bindings": "https://notify.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings", "notifications": "https://notify.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Notifications", "segments": "https://notify.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Segments", "users": "https://notify.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users" } } ' )); $actual = $this->twilio->notify->v1->services->create(); $this->assertNotNull($actual); } public function testDeleteRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->notify->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'delete', 'https://notify.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testDeleteResponse() { $this->holodeck->mock(new Response( 204, null )); $actual = $this->twilio->notify->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); $this->assertTrue($actual); } public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->notify->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://notify.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "friendly_name": "733c7f0f-6541-42ec-84ce-e2ae1cac588c", "date_created": "2016-03-09T20:22:31Z", "date_updated": "2016-03-09T20:22:31Z", "apn_credential_sid": null, "gcm_credential_sid": null, "fcm_credential_sid": null, "messaging_service_sid": null, "facebook_messenger_page_id": "4", "alexa_skill_id": null, "default_apn_notification_protocol_version": "3", "default_gcm_notification_protocol_version": "3", "default_fcm_notification_protocol_version": "3", "default_alexa_notification_protocol_version": "3", "log_enabled": true, "type": "S", "url": "https://notify.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "links": { "bindings": "https://notify.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings", "notifications": "https://notify.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Notifications", "segments": "https://notify.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Segments", "users": "https://notify.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users" } } ' )); $actual = $this->twilio->notify->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); $this->assertNotNull($actual); } public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->notify->v1->services->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://notify.twilio.com/v1/Services' )); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "meta": { "page": 0, "page_size": 50, "first_page_url": "https://notify.twilio.com/v1/Services?PageSize=50&Page=0", "previous_page_url": null, "url": "https://notify.twilio.com/v1/Services?PageSize=50&Page=0", "next_page_url": null, "key": "services" }, "services": [ { "sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "friendly_name": "733c7f0f-6541-42ec-84ce-e2ae1cac588c", "date_created": "2016-03-09T20:22:31Z", "date_updated": "2016-03-09T20:22:31Z", "apn_credential_sid": null, "gcm_credential_sid": null, "fcm_credential_sid": null, "messaging_service_sid": null, "facebook_messenger_page_id": "4", "alexa_skill_id": null, "default_apn_notification_protocol_version": "3", "default_gcm_notification_protocol_version": "3", "default_fcm_notification_protocol_version": "3", "default_alexa_notification_protocol_version": "3", "log_enabled": true, "type": "S", "url": "https://notify.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "links": { "bindings": "https://notify.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings", "notifications": "https://notify.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Notifications", "segments": "https://notify.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Segments", "users": "https://notify.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users" } } ] } ' )); $actual = $this->twilio->notify->v1->services->read(); $this->assertGreaterThan(0, count($actual)); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "meta": { "page": 0, "page_size": 50, "first_page_url": "https://notify.twilio.com/v1/Services?PageSize=50&Page=0", "previous_page_url": null, "url": "https://notify.twilio.com/v1/Services?PageSize=50&Page=0", "next_page_url": null, "key": "services" }, "services": [] } ' )); $actual = $this->twilio->notify->v1->services->read(); $this->assertNotNull($actual); } public function testUpdateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->notify->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'post', 'https://notify.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testUpdateResponse() { $this->holodeck->mock(new Response( 200, ' { "sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "friendly_name": "733c7f0f-6541-42ec-84ce-e2ae1cac588c", "date_created": "2016-03-09T20:22:31Z", "date_updated": "2016-03-09T20:22:31Z", "apn_credential_sid": null, "gcm_credential_sid": null, "fcm_credential_sid": null, "default_apn_notification_protocol_version": "3", "default_gcm_notification_protocol_version": "3", "default_fcm_notification_protocol_version": "3", "default_alexa_notification_protocol_version": "3", "messaging_service_sid": null, "alexa_skill_id": null, "facebook_messenger_page_id": "4", "log_enabled": true, "type": "S", "url": "https://notify.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "links": { "bindings": "https://notify.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings", "notifications": "https://notify.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Notifications", "segments": "https://notify.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Segments", "users": "https://notify.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users" } } ' )); $actual = $this->twilio->notify->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/Trunking/V1/Trunk/OriginationUrlTest.php 0000604 00000023421 15174325133 0021673 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Trunking\V1\Trunk; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Serialize; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class OriginationUrlTest extends HolodeckTestCase { public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->trunking->v1->trunks("TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->originationUrls("OUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://trunking.twilio.com/v1/Trunks/TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/OriginationUrls/OUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "weight": 1, "date_updated": "2015-01-02T11:23:45Z", "enabled": true, "friendly_name": "friendly_name", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "priority": 1, "sip_url": "sip://sip-box.com:1234", "sid": "OUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "2015-01-02T11:23:45Z", "trunk_sid": "TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "url": "https://trunking.twilio.com/v1/Trunks/TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/OriginationUrls/OUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->trunking->v1->trunks("TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->originationUrls("OUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); $this->assertNotNull($actual); } public function testDeleteRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->trunking->v1->trunks("TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->originationUrls("OUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'delete', 'https://trunking.twilio.com/v1/Trunks/TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/OriginationUrls/OUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testDeleteResponse() { $this->holodeck->mock(new Response( 204, null )); $actual = $this->twilio->trunking->v1->trunks("TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->originationUrls("OUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); $this->assertTrue($actual); } public function testCreateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->trunking->v1->trunks("TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->originationUrls->create(1, 1, True, "friendlyName", "https://example.com"); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $values = array( 'Weight' => 1, 'Priority' => 1, 'Enabled' => Serialize::booleanToString(True), 'FriendlyName' => "friendlyName", 'SipUrl' => "https://example.com", ); $this->assertRequest(new Request( 'post', 'https://trunking.twilio.com/v1/Trunks/TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/OriginationUrls', null, $values )); } public function testCreateResponse() { $this->holodeck->mock(new Response( 201, ' { "weight": 1, "date_updated": "2015-01-02T11:23:45Z", "enabled": true, "friendly_name": "friendly_name", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "priority": 1, "sip_url": "sip://sip-box.com:1234", "sid": "OUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "2015-01-02T11:23:45Z", "trunk_sid": "TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "url": "https://trunking.twilio.com/v1/Trunks/TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/OriginationUrls/OUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->trunking->v1->trunks("TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->originationUrls->create(1, 1, True, "friendlyName", "https://example.com"); $this->assertNotNull($actual); } public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->trunking->v1->trunks("TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->originationUrls->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://trunking.twilio.com/v1/Trunks/TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/OriginationUrls' )); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "meta": { "first_page_url": "https://trunking.twilio.com/v1/Trunks/TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/OriginationUrls?PageSize=1&Page=0", "key": "origination_urls", "next_page_url": null, "page": 0, "page_size": 1, "previous_page_url": null, "url": "https://trunking.twilio.com/v1/Trunks/TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/OriginationUrls?PageSize=1&Page=0" }, "origination_urls": [ { "weight": 1, "date_updated": "2015-01-02T11:23:45Z", "enabled": true, "friendly_name": "friendly_name", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "priority": 1, "sip_url": "sip://sip-box.com:1234", "sid": "OUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "2015-01-02T11:23:45Z", "trunk_sid": "TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "url": "https://trunking.twilio.com/v1/Trunks/TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/OriginationUrls/OUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ] } ' )); $actual = $this->twilio->trunking->v1->trunks("TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->originationUrls->read(); $this->assertGreaterThan(0, count($actual)); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "meta": { "first_page_url": "https://trunking.twilio.com/v1/Trunks/TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/OriginationUrls?PageSize=1&Page=0", "key": "origination_urls", "next_page_url": null, "page": 0, "page_size": 1, "previous_page_url": null, "url": "https://trunking.twilio.com/v1/Trunks/TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/OriginationUrls?PageSize=1&Page=0" }, "origination_urls": [] } ' )); $actual = $this->twilio->trunking->v1->trunks("TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->originationUrls->read(); $this->assertNotNull($actual); } public function testUpdateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->trunking->v1->trunks("TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->originationUrls("OUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'post', 'https://trunking.twilio.com/v1/Trunks/TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/OriginationUrls/OUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testUpdateResponse() { $this->holodeck->mock(new Response( 200, ' { "weight": 2, "date_updated": "2015-01-02T11:23:45Z", "enabled": false, "friendly_name": "updated_name", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "priority": 2, "sip_url": "sip://sip-updated.com:4321", "sid": "OUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "2015-01-02T11:23:45Z", "trunk_sid": "TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "url": "https://trunking.twilio.com/v1/Trunks/TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/OriginationUrls/OUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->trunking->v1->trunks("TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->originationUrls("OUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/Trunking/V1/Trunk/PhoneNumberTest.php 0000604 00000025447 15174325133 0021162 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Trunking\V1\Trunk; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class PhoneNumberTest extends HolodeckTestCase { public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->trunking->v1->trunks("TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->phoneNumbers("PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://trunking.twilio.com/v1/Trunks/TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/PhoneNumbers/PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "sid": "PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "2010-12-10T17:27:34Z", "date_updated": "2015-10-09T11:36:32Z", "friendly_name": "(415) 867-5309", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "phone_number": "+14158675309", "api_version": "2010-04-01", "voice_caller_id_lookup": null, "voice_url": "", "voice_method": "POST", "voice_fallback_url": null, "voice_fallback_method": null, "status_callback": "", "status_callback_method": "POST", "voice_application_sid": null, "trunk_sid": "TKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "sms_url": "", "sms_method": "POST", "sms_fallback_url": "", "sms_fallback_method": "POST", "sms_application_sid": "", "address_requirements": "none", "beta": false, "url": "https://trunking.twilio.com/v1/Trunks/TKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/PhoneNumbers/PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "capabilities": { "voice": true, "sms": true, "mms": true }, "links": { "phone_number": "https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json" } } ' )); $actual = $this->twilio->trunking->v1->trunks("TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->phoneNumbers("PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); $this->assertNotNull($actual); } public function testDeleteRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->trunking->v1->trunks("TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->phoneNumbers("PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'delete', 'https://trunking.twilio.com/v1/Trunks/TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/PhoneNumbers/PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testDeleteResponse() { $this->holodeck->mock(new Response( 204, null )); $actual = $this->twilio->trunking->v1->trunks("TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->phoneNumbers("PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); $this->assertTrue($actual); } public function testCreateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->trunking->v1->trunks("TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->phoneNumbers->create("PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $values = array('PhoneNumberSid' => "PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", ); $this->assertRequest(new Request( 'post', 'https://trunking.twilio.com/v1/Trunks/TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/PhoneNumbers', null, $values )); } public function testCreateResponse() { $this->holodeck->mock(new Response( 201, ' { "sid": "PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "2010-12-10T17:27:34Z", "date_updated": "2015-10-09T11:36:32Z", "friendly_name": "(415) 867-5309", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "phone_number": "+14158675309", "api_version": "2010-04-01", "voice_caller_id_lookup": null, "voice_url": "", "voice_method": "POST", "voice_fallback_url": null, "voice_fallback_method": null, "status_callback": "", "status_callback_method": "POST", "voice_application_sid": null, "trunk_sid": "TKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "sms_url": "", "sms_method": "POST", "sms_fallback_url": "", "sms_fallback_method": "POST", "sms_application_sid": "", "address_requirements": "none", "beta": false, "url": "https://trunking.twilio.com/v1/Trunks/TKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/PhoneNumbers/PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "capabilities": { "voice": true, "sms": true, "mms": true }, "links": { "phone_number": "https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json" } } ' )); $actual = $this->twilio->trunking->v1->trunks("TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->phoneNumbers->create("PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"); $this->assertNotNull($actual); } public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->trunking->v1->trunks("TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->phoneNumbers->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://trunking.twilio.com/v1/Trunks/TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/PhoneNumbers' )); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "meta": { "first_page_url": "https://trunking.twilio.com/v1/Trunks/TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/PhoneNumbers?PageSize=1&Page=0", "key": "phone_numbers", "next_page_url": null, "page": 0, "page_size": 1, "previous_page_url": null, "url": "https://trunking.twilio.com/v1/Trunks/TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/PhoneNumbers?PageSize=1&Page=0" }, "phone_numbers": [ { "sid": "PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "2010-12-10T17:27:34Z", "date_updated": "2015-10-09T11:36:32Z", "friendly_name": "(415) 867-5309", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "phone_number": "+14158675309", "api_version": "2010-04-01", "voice_caller_id_lookup": null, "voice_url": "", "voice_method": "POST", "voice_fallback_url": null, "voice_fallback_method": null, "status_callback": "", "status_callback_method": "POST", "voice_application_sid": null, "trunk_sid": "TKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "sms_url": "", "sms_method": "POST", "sms_fallback_url": "", "sms_fallback_method": "POST", "sms_application_sid": "", "address_requirements": "none", "beta": false, "url": "https://trunking.twilio.com/v1/Trunks/TKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/PhoneNumbers/PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "capabilities": { "voice": true, "sms": true, "mms": true }, "links": { "phone_number": "https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json" } } ] } ' )); $actual = $this->twilio->trunking->v1->trunks("TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->phoneNumbers->read(); $this->assertGreaterThan(0, count($actual)); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "meta": { "first_page_url": "https://trunking.twilio.com/v1/Trunks/TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/PhoneNumbers?PageSize=1&Page=0", "key": "phone_numbers", "next_page_url": null, "page": 0, "page_size": 1, "previous_page_url": null, "url": "https://trunking.twilio.com/v1/Trunks/TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/PhoneNumbers?PageSize=1&Page=0" }, "phone_numbers": [] } ' )); $actual = $this->twilio->trunking->v1->trunks("TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->phoneNumbers->read(); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/Trunking/V1/Trunk/CredentialListTest.php 0000604 00000017032 15174325133 0021635 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Trunking\V1\Trunk; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class CredentialListTest extends HolodeckTestCase { public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->trunking->v1->trunks("TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->credentialsLists("CLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://trunking.twilio.com/v1/Trunks/TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/CredentialLists/CLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "trunk_sid": "TKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "Wed, 11 Sep 2013 17:51:38 -0000", "date_updated": "Wed, 11 Sep 2013 17:51:38 -0000", "friendly_name": "Low Rises", "sid": "CLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "url": "https://trunking.twilio.com/v1/Trunks/TKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/CredentialLists/CLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->trunking->v1->trunks("TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->credentialsLists("CLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); $this->assertNotNull($actual); } public function testDeleteRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->trunking->v1->trunks("TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->credentialsLists("CLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'delete', 'https://trunking.twilio.com/v1/Trunks/TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/CredentialLists/CLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testDeleteResponse() { $this->holodeck->mock(new Response( 204, null )); $actual = $this->twilio->trunking->v1->trunks("TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->credentialsLists("CLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); $this->assertTrue($actual); } public function testCreateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->trunking->v1->trunks("TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->credentialsLists->create("CLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $values = array('CredentialListSid' => "CLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", ); $this->assertRequest(new Request( 'post', 'https://trunking.twilio.com/v1/Trunks/TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/CredentialLists', null, $values )); } public function testCreateResponse() { $this->holodeck->mock(new Response( 201, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "trunk_sid": "TKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "Wed, 11 Sep 2013 17:51:38 -0000", "date_updated": "Wed, 11 Sep 2013 17:51:38 -0000", "friendly_name": "Low Rises", "sid": "CLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "url": "https://trunking.twilio.com/v1/Trunks/TKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/CredentialLists/CLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->trunking->v1->trunks("TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->credentialsLists->create("CLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"); $this->assertNotNull($actual); } public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->trunking->v1->trunks("TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->credentialsLists->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://trunking.twilio.com/v1/Trunks/TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/CredentialLists' )); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "credential_lists": [ { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "trunk_sid": "TKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "Wed, 11 Sep 2013 17:51:38 -0000", "date_updated": "Wed, 11 Sep 2013 17:51:38 -0000", "friendly_name": "Low Rises", "sid": "CLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "url": "https://trunking.twilio.com/v1/Trunks/TKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/CredentialLists/CLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ], "meta": { "page": 0, "page_size": 50, "first_page_url": "https://trunking.twilio.com/v1/Trunks/TKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/CredentialLists?PageSize=50&Page=0", "previous_page_url": null, "url": "https://trunking.twilio.com/v1/Trunks/TKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/CredentialLists?PageSize=50&Page=0", "next_page_url": null, "key": "credential_lists" } } ' )); $actual = $this->twilio->trunking->v1->trunks("TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->credentialsLists->read(); $this->assertGreaterThan(0, count($actual)); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "credential_lists": [], "meta": { "page": 0, "page_size": 50, "first_page_url": "https://trunking.twilio.com/v1/Trunks/TKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/CredentialLists?PageSize=50&Page=0", "previous_page_url": null, "url": "https://trunking.twilio.com/v1/Trunks/TKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/CredentialLists?PageSize=50&Page=0", "next_page_url": null, "key": "credential_lists" } } ' )); $actual = $this->twilio->trunking->v1->trunks("TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->credentialsLists->read(); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/Trunking/V1/Trunk/IpAccessControlListTest.php 0000604 00000016377 15174325133 0022631 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Trunking\V1\Trunk; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class IpAccessControlListTest extends HolodeckTestCase { public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->trunking->v1->trunks("TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->ipAccessControlLists("ALaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://trunking.twilio.com/v1/Trunks/TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IpAccessControlLists/ALaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "2015-07-30T20:00:00Z", "date_updated": "2015-07-30T20:00:00Z", "friendly_name": "friendly_name", "sid": "ALaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "trunk_sid": "TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "url": "http://www.example.com" } ' )); $actual = $this->twilio->trunking->v1->trunks("TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->ipAccessControlLists("ALaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); $this->assertNotNull($actual); } public function testDeleteRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->trunking->v1->trunks("TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->ipAccessControlLists("ALaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'delete', 'https://trunking.twilio.com/v1/Trunks/TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IpAccessControlLists/ALaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testDeleteResponse() { $this->holodeck->mock(new Response( 204, null )); $actual = $this->twilio->trunking->v1->trunks("TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->ipAccessControlLists("ALaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); $this->assertTrue($actual); } public function testCreateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->trunking->v1->trunks("TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->ipAccessControlLists->create("ALaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $values = array('IpAccessControlListSid' => "ALaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", ); $this->assertRequest(new Request( 'post', 'https://trunking.twilio.com/v1/Trunks/TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IpAccessControlLists', null, $values )); } public function testCreateResponse() { $this->holodeck->mock(new Response( 201, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "2015-07-30T20:00:00Z", "date_updated": "2015-07-30T20:00:00Z", "friendly_name": "friendly_name", "sid": "ALaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "trunk_sid": "TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "url": "http://www.example.com" } ' )); $actual = $this->twilio->trunking->v1->trunks("TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->ipAccessControlLists->create("ALaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"); $this->assertNotNull($actual); } public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->trunking->v1->trunks("TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->ipAccessControlLists->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://trunking.twilio.com/v1/Trunks/TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IpAccessControlLists' )); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "ip_access_control_lists": [], "meta": { "first_page_url": "https://trunking.twilio.com/v1/Trunks/TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IpAccessControlLists?Page=0&PageSize=50", "key": "ip_access_control_lists", "next_page_url": null, "page": 0, "page_size": 0, "previous_page_url": null, "url": "https://trunking.twilio.com/v1/Trunks/TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IpAccessControlLists" } } ' )); $actual = $this->twilio->trunking->v1->trunks("TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->ipAccessControlLists->read(); $this->assertNotNull($actual); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "ip_access_control_lists": [ { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "2015-07-30T20:00:00Z", "date_updated": "2015-07-30T20:00:00Z", "friendly_name": "friendly_name", "sid": "ALaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "trunk_sid": "TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "url": "http://www.example.com" } ], "meta": { "first_page_url": "https://trunking.twilio.com/v1/Trunks/TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IpAccessControlLists?Page=0&PageSize=50", "key": "ip_access_control_lists", "next_page_url": null, "page": 0, "page_size": 1, "previous_page_url": null, "url": "https://trunking.twilio.com/v1/Trunks/TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IpAccessControlLists" } } ' )); $actual = $this->twilio->trunking->v1->trunks("TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->ipAccessControlLists->read(); $this->assertGreaterThan(0, count($actual)); } } sdk/Twilio/Tests/Integration/Messaging/V1/Service/ShortCodeTest.php 0000604 00000015301 15174325133 0021227 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Messaging\V1\Service; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class ShortCodeTest extends HolodeckTestCase { public function testCreateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->messaging->v1->services("MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->shortCodes->create("SCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $values = array('ShortCodeSid' => "SCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", ); $this->assertRequest(new Request( 'post', 'https://messaging.twilio.com/v1/Services/MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ShortCodes', null, $values )); } public function testCreateResponse() { $this->holodeck->mock(new Response( 201, ' { "sid": "SCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "2015-07-30T20:12:31Z", "date_updated": "2015-07-30T20:12:33Z", "short_code": "12345", "country_code": "US", "capabilities": [], "url": "https://messaging.twilio.com/v1/Services/MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ShortCodes/SCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->messaging->v1->services("MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->shortCodes->create("SCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"); $this->assertNotNull($actual); } public function testDeleteRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->messaging->v1->services("MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->shortCodes("SCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'delete', 'https://messaging.twilio.com/v1/Services/MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ShortCodes/SCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testDeleteResponse() { $this->holodeck->mock(new Response( 204, null )); $actual = $this->twilio->messaging->v1->services("MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->shortCodes("SCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); $this->assertTrue($actual); } public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->messaging->v1->services("MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->shortCodes->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://messaging.twilio.com/v1/Services/MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ShortCodes' )); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "meta": { "page": 0, "page_size": 50, "first_page_url": "https://messaging.twilio.com/v1/Services/MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ShortCodes?PageSize=50&Page=0", "previous_page_url": null, "next_page_url": null, "key": "short_codes", "url": "https://messaging.twilio.com/v1/Services/MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ShortCodes?PageSize=50&Page=0" }, "short_codes": [ { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "sid": "SCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "2015-07-30T20:12:31Z", "date_updated": "2015-07-30T20:12:33Z", "short_code": "12345", "country_code": "US", "capabilities": [], "url": "https://messaging.twilio.com/v1/Services/MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ShortCodes/SCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ] } ' )); $actual = $this->twilio->messaging->v1->services("MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->shortCodes->read(); $this->assertGreaterThan(0, count($actual)); } public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->messaging->v1->services("MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->shortCodes("SCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://messaging.twilio.com/v1/Services/MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ShortCodes/SCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "sid": "SCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "2015-07-30T20:12:31Z", "date_updated": "2015-07-30T20:12:33Z", "short_code": "12345", "country_code": "US", "capabilities": [], "url": "https://messaging.twilio.com/v1/Services/MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ShortCodes/SCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->messaging->v1->services("MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->shortCodes("SCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/Messaging/V1/Service/PhoneNumberTest.php 0000604 00000017531 15174325133 0021566 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Messaging\V1\Service; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class PhoneNumberTest extends HolodeckTestCase { public function testCreateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->messaging->v1->services("MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->phoneNumbers->create("PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $values = array('PhoneNumberSid' => "PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", ); $this->assertRequest(new Request( 'post', 'https://messaging.twilio.com/v1/Services/MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/PhoneNumbers', null, $values )); } public function testCreateResponse() { $this->holodeck->mock(new Response( 201, ' { "sid": "PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "2015-07-30T20:12:31Z", "date_updated": "2015-07-30T20:12:33Z", "phone_number": "+987654321", "country_code": "US", "capabilities": [], "url": "https://messaging.twilio.com/v1/Services/MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/PhoneNumbers/PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->messaging->v1->services("MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->phoneNumbers->create("PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"); $this->assertNotNull($actual); } public function testCreateWithCapabilitiesResponse() { $this->holodeck->mock(new Response( 201, ' { "sid": "PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "2015-07-30T20:12:31Z", "date_updated": "2015-07-30T20:12:33Z", "phone_number": "+987654321", "country_code": "US", "capabilities": [ "MMS", "SMS", "Voice" ], "url": "https://messaging.twilio.com/v1/Services/MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/PhoneNumbers/PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->messaging->v1->services("MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->phoneNumbers->create("PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"); $this->assertNotNull($actual); } public function testDeleteRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->messaging->v1->services("MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->phoneNumbers("PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'delete', 'https://messaging.twilio.com/v1/Services/MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/PhoneNumbers/PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testDeleteResponse() { $this->holodeck->mock(new Response( 204, null )); $actual = $this->twilio->messaging->v1->services("MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->phoneNumbers("PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); $this->assertTrue($actual); } public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->messaging->v1->services("MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->phoneNumbers->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://messaging.twilio.com/v1/Services/MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/PhoneNumbers' )); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "meta": { "page": 0, "page_size": 50, "first_page_url": "https://messaging.twilio.com/v1/Services/MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/PhoneNumbers?PageSize=50&Page=0", "previous_page_url": null, "next_page_url": null, "key": "phone_numbers", "url": "https://messaging.twilio.com/v1/Services/MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/PhoneNumbers?PageSize=50&Page=0" }, "phone_numbers": [ { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "sid": "PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "2015-07-30T20:12:31Z", "date_updated": "2015-07-30T20:12:33Z", "phone_number": "+987654321", "country_code": "US", "capabilities": [], "url": "https://messaging.twilio.com/v1/Services/MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/PhoneNumbers/PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ] } ' )); $actual = $this->twilio->messaging->v1->services("MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->phoneNumbers->read(); $this->assertGreaterThan(0, count($actual)); } public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->messaging->v1->services("MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->phoneNumbers("PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://messaging.twilio.com/v1/Services/MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/PhoneNumbers/PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "sid": "SCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "2015-07-30T20:12:31Z", "date_updated": "2015-07-30T20:12:33Z", "phone_number": "12345", "country_code": "US", "capabilities": [], "url": "https://messaging.twilio.com/v1/Services/MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/PhoneNumbers/SCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->messaging->v1->services("MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->phoneNumbers("PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/Messaging/V1/Service/AlphaSenderTest.php 0000604 00000015062 15174325133 0021527 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Messaging\V1\Service; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class AlphaSenderTest extends HolodeckTestCase { public function testCreateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->messaging->v1->services("MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->alphaSenders->create("alphaSender"); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $values = array('AlphaSender' => "alphaSender", ); $this->assertRequest(new Request( 'post', 'https://messaging.twilio.com/v1/Services/MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AlphaSenders', null, $values )); } public function testCreateResponse() { $this->holodeck->mock(new Response( 201, ' { "sid": "AIaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "2015-07-30T20:12:31Z", "date_updated": "2015-07-30T20:12:33Z", "alpha_sender": "Twilio", "capabilities": [], "url": "https://messaging.twilio.com/v1/Services/MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AlphaSenders/AIaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->messaging->v1->services("MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->alphaSenders->create("alphaSender"); $this->assertNotNull($actual); } public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->messaging->v1->services("MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->alphaSenders->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://messaging.twilio.com/v1/Services/MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AlphaSenders' )); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "meta": { "page": 0, "page_size": 50, "first_page_url": "https://messaging.twilio.com/v1/Services/MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AlphaSenders?PageSize=50&Page=0", "previous_page_url": null, "next_page_url": null, "key": "alpha_senders", "url": "https://messaging.twilio.com/v1/Services/MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AlphaSenders?PageSize=50&Page=0" }, "alpha_senders": [ { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "sid": "AIaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "2015-07-30T20:12:31Z", "date_updated": "2015-07-30T20:12:33Z", "alpha_sender": "Twilio", "capabilities": [], "url": "https://messaging.twilio.com/v1/Services/MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AlphaSenders/AIaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ] } ' )); $actual = $this->twilio->messaging->v1->services("MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->alphaSenders->read(); $this->assertGreaterThan(0, count($actual)); } public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->messaging->v1->services("MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->alphaSenders("AIaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://messaging.twilio.com/v1/Services/MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AlphaSenders/AIaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "sid": "AIaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "2015-07-30T20:12:31Z", "date_updated": "2015-07-30T20:12:33Z", "alpha_sender": "Twilio", "capabilities": [], "url": "https://messaging.twilio.com/v1/Services/MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AlphaSenders/AIaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->messaging->v1->services("MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->alphaSenders("AIaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); $this->assertNotNull($actual); } public function testDeleteRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->messaging->v1->services("MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->alphaSenders("AIaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'delete', 'https://messaging.twilio.com/v1/Services/MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AlphaSenders/AIaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testDeleteResponse() { $this->holodeck->mock(new Response( 204, null )); $actual = $this->twilio->messaging->v1->services("MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->alphaSenders("AIaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); $this->assertTrue($actual); } } sdk/Twilio/Tests/Integration/Messaging/V1/ServiceTest.php 0000604 00000024620 15174325133 0017341 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Messaging\V1; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class ServiceTest extends HolodeckTestCase { public function testCreateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->messaging->v1->services->create("friendlyName"); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $values = array('FriendlyName' => "friendlyName", ); $this->assertRequest(new Request( 'post', 'https://messaging.twilio.com/v1/Services', null, $values )); } public function testCreateResponse() { $this->holodeck->mock(new Response( 201, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "sid": "MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "2015-07-30T20:12:31Z", "date_updated": "2015-07-30T20:12:33Z", "friendly_name": "My Service!", "inbound_request_url": "https://www.example.com/", "inbound_method": "POST", "fallback_url": "https://www.example.com", "fallback_method": "GET", "status_callback": "https://www.example.com", "sticky_sender": true, "smart_encoding": false, "mms_converter": true, "fallback_to_long_code": true, "scan_message_content": "inherit", "area_code_geomatch": true, "validity_period": 600, "synchronous_validation": true, "links": { "phone_numbers": "https://messaging.twilio.com/v1/Services/MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/PhoneNumbers", "short_codes": "https://messaging.twilio.com/v1/Services/MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ShortCodes", "alpha_senders": "https://messaging.twilio.com/v1/Services/MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AlphaSenders" }, "url": "https://messaging.twilio.com/v1/Services/MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->messaging->v1->services->create("friendlyName"); $this->assertNotNull($actual); } public function testUpdateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->messaging->v1->services("MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'post', 'https://messaging.twilio.com/v1/Services/MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testUpdateResponse() { $this->holodeck->mock(new Response( 200, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "friendly_name": "My Service!", "sid": "MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "2015-07-30T20:12:31Z", "date_updated": "2015-07-30T20:12:33Z", "sticky_sender": false, "mms_converter": true, "smart_encoding": false, "fallback_to_long_code": true, "scan_message_content": "inherit", "synchronous_validation": true, "area_code_geomatch": true, "validity_period": 600, "inbound_request_url": "https://www.example.com", "inbound_method": "POST", "fallback_url": null, "fallback_method": "POST", "status_callback": "https://www.example.com", "links": { "phone_numbers": "https://messaging.twilio.com/v1/Services/MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/PhoneNumbers", "short_codes": "https://messaging.twilio.com/v1/Services/MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ShortCodes", "alpha_senders": "https://messaging.twilio.com/v1/Services/MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AlphaSenders" }, "url": "https://messaging.twilio.com/v1/Services/MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->messaging->v1->services("MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); $this->assertNotNull($actual); } public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->messaging->v1->services->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://messaging.twilio.com/v1/Services' )); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "meta": { "page": 0, "page_size": 50, "first_page_url": "https://messaging.twilio.com/v1/Services?PageSize=50&Page=0", "previous_page_url": null, "next_page_url": null, "key": "services", "url": "https://messaging.twilio.com/v1/Services?PageSize=50&Page=0" }, "services": [ { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "friendly_name": "My Service!", "sid": "MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "2015-07-30T20:12:31Z", "date_updated": "2015-07-30T20:12:33Z", "sticky_sender": true, "mms_converter": true, "smart_encoding": false, "fallback_to_long_code": true, "area_code_geomatch": true, "validity_period": 600, "scan_message_content": "inherit", "synchronous_validation": true, "inbound_request_url": "https://www.example.com/", "inbound_method": "POST", "fallback_url": null, "fallback_method": "POST", "status_callback": "https://www.example.com", "links": { "phone_numbers": "https://messaging.twilio.com/v1/Services/MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/PhoneNumbers", "short_codes": "https://messaging.twilio.com/v1/Services/MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ShortCodes", "alpha_senders": "https://messaging.twilio.com/v1/Services/MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AlphaSenders" }, "url": "https://messaging.twilio.com/v1/Services/MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ] } ' )); $actual = $this->twilio->messaging->v1->services->read(); $this->assertGreaterThan(0, count($actual)); } public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->messaging->v1->services("MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://messaging.twilio.com/v1/Services/MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "sid": "MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "2015-07-30T20:12:31Z", "date_updated": "2015-07-30T20:12:33Z", "friendly_name": "My Service!", "inbound_request_url": "https://www.example.com/", "inbound_method": "POST", "fallback_url": null, "fallback_method": "POST", "status_callback": "https://www.example.com", "sticky_sender": true, "mms_converter": true, "smart_encoding": false, "fallback_to_long_code": true, "area_code_geomatch": true, "validity_period": 600, "scan_message_content": "inherit", "synchronous_validation": true, "links": { "phone_numbers": "https://messaging.twilio.com/v1/Services/MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/PhoneNumbers", "short_codes": "https://messaging.twilio.com/v1/Services/MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ShortCodes", "alpha_senders": "https://messaging.twilio.com/v1/Services/MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AlphaSenders" }, "url": "https://messaging.twilio.com/v1/Services/MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->messaging->v1->services("MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); $this->assertNotNull($actual); } public function testDeleteRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->messaging->v1->services("MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'delete', 'https://messaging.twilio.com/v1/Services/MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testDeleteResponse() { $this->holodeck->mock(new Response( 204, null )); $actual = $this->twilio->messaging->v1->services("MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); $this->assertTrue($actual); } } sdk/Twilio/Tests/Integration/Proxy/V1/Service/ShortCodeTest.php 0000604 00000015627 15174325133 0020446 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Proxy\V1\Service; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class ShortCodeTest extends HolodeckTestCase { public function testCreateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->proxy->v1->services("KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->shortCodes->create("SCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $values = array('Sid' => "SCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", ); $this->assertRequest(new Request( 'post', 'https://proxy.twilio.com/v1/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ShortCodes', null, $values )); } public function testCreateResponse() { $this->holodeck->mock(new Response( 201, ' { "sid": "SCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "2015-07-30T20:00:00Z", "date_updated": "2015-07-30T20:00:00Z", "short_code": "12345", "iso_country": "US", "capabilities": { "sms_outbound": true, "voice_inbound": false }, "url": "https://proxy.twilio.com/v1/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ShortCodes/SCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->proxy->v1->services("KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->shortCodes->create("SCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"); $this->assertNotNull($actual); } public function testDeleteRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->proxy->v1->services("KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->shortCodes("SCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'delete', 'https://proxy.twilio.com/v1/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ShortCodes/SCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testDeleteResponse() { $this->holodeck->mock(new Response( 204, null )); $actual = $this->twilio->proxy->v1->services("KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->shortCodes("SCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); $this->assertTrue($actual); } public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->proxy->v1->services("KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->shortCodes->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://proxy.twilio.com/v1/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ShortCodes' )); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "meta": { "page": 0, "page_size": 50, "first_page_url": "https://proxy.twilio.com/v1/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ShortCodes?PageSize=50&Page=0", "previous_page_url": null, "next_page_url": null, "key": "short_codes", "url": "https://proxy.twilio.com/v1/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ShortCodes?PageSize=50&Page=0" }, "short_codes": [ { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "sid": "SCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "2015-07-30T20:00:00Z", "date_updated": "2015-07-30T20:00:00Z", "short_code": "12345", "iso_country": "US", "capabilities": { "sms_outbound": true, "voice_inbound": false }, "url": "https://proxy.twilio.com/v1/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ShortCodes/SCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ] } ' )); $actual = $this->twilio->proxy->v1->services("KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->shortCodes->read(); $this->assertGreaterThan(0, count($actual)); } public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->proxy->v1->services("KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->shortCodes("SCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://proxy.twilio.com/v1/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ShortCodes/SCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "sid": "SCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "2015-07-30T20:00:00Z", "date_updated": "2015-07-30T20:00:00Z", "short_code": "12345", "iso_country": "US", "capabilities": { "sms_outbound": true, "voice_inbound": false }, "url": "https://proxy.twilio.com/v1/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ShortCodes/SCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->proxy->v1->services("KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->shortCodes("SCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/Proxy/V1/Service/PhoneNumberTest.php 0000604 00000015663 15174325133 0020776 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Proxy\V1\Service; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class PhoneNumberTest extends HolodeckTestCase { public function testCreateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->proxy->v1->services("KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->phoneNumbers->create(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'post', 'https://proxy.twilio.com/v1/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/PhoneNumbers' )); } public function testCreateResponse() { $this->holodeck->mock(new Response( 201, ' { "sid": "PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "2015-07-30T20:00:00Z", "date_updated": "2015-07-30T20:00:00Z", "phone_number": "+987654321", "friendly_name": "Friendly Name", "iso_country": "US", "capabilities": { "sms_outbound": true, "voice_inbound": false }, "url": "https://proxy.twilio.com/v1/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/PhoneNumbers/PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->proxy->v1->services("KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->phoneNumbers->create(); $this->assertNotNull($actual); } public function testDeleteRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->proxy->v1->services("KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->phoneNumbers("PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'delete', 'https://proxy.twilio.com/v1/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/PhoneNumbers/PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testDeleteResponse() { $this->holodeck->mock(new Response( 204, null )); $actual = $this->twilio->proxy->v1->services("KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->phoneNumbers("PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); $this->assertTrue($actual); } public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->proxy->v1->services("KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->phoneNumbers->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://proxy.twilio.com/v1/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/PhoneNumbers' )); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "meta": { "page": 0, "page_size": 50, "first_page_url": "https://proxy.twilio.com/v1/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/PhoneNumbers?PageSize=50&Page=0", "previous_page_url": null, "next_page_url": null, "key": "phone_numbers", "url": "https://proxy.twilio.com/v1/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/PhoneNumbers?PageSize=50&Page=0" }, "phone_numbers": [ { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "sid": "PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "2015-07-30T20:00:00Z", "date_updated": "2015-07-30T20:00:00Z", "phone_number": "+987654321", "friendly_name": "Friendly Name", "iso_country": "US", "capabilities": { "sms_outbound": true, "voice_inbound": false }, "url": "https://proxy.twilio.com/v1/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/PhoneNumbers/PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ] } ' )); $actual = $this->twilio->proxy->v1->services("KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->phoneNumbers->read(); $this->assertGreaterThan(0, count($actual)); } public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->proxy->v1->services("KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->phoneNumbers("PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://proxy.twilio.com/v1/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/PhoneNumbers/PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "sid": "PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "2015-07-30T20:00:00Z", "date_updated": "2015-07-30T20:00:00Z", "phone_number": "12345", "friendly_name": "Friendly Name", "iso_country": "US", "capabilities": { "sms_outbound": true, "voice_inbound": false }, "url": "https://proxy.twilio.com/v1/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/PhoneNumbers/PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->proxy->v1->services("KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->phoneNumbers("PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/Proxy/V1/Service/SessionTest.php 0000604 00000022335 15174325133 0020171 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Proxy\V1\Service; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class SessionTest extends HolodeckTestCase { public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->proxy->v1->services("KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->sessions("KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://proxy.twilio.com/v1/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sessions/KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "service_sid": "KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "status": "in-progress", "unique_name": "unique_name", "date_started": "2015-07-30T20:00:00Z", "date_ended": "2015-07-30T20:00:00Z", "date_last_interaction": "2015-07-30T20:00:00Z", "date_expiry": "2015-07-30T20:00:00Z", "ttl": 3600, "mode": "message-only", "closed_reason": "", "sid": "KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_updated": "2015-07-30T20:00:00Z", "date_created": "2015-07-30T20:00:00Z", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "url": "https://proxy.twilio.com/v1/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sessions/KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "links": { "interactions": "https://proxy.twilio.com/v1/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sessions/KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Interactions", "participants": "https://proxy.twilio.com/v1/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sessions/KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants" } } ' )); $actual = $this->twilio->proxy->v1->services("KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->sessions("KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); $this->assertNotNull($actual); } public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->proxy->v1->services("KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->sessions->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://proxy.twilio.com/v1/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sessions' )); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "sessions": [], "meta": { "previous_page_url": null, "next_page_url": null, "url": "https://proxy.twilio.com/v1/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sessions?PageSize=50&Page=0", "page": 0, "first_page_url": "https://proxy.twilio.com/v1/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sessions?PageSize=50&Page=0", "page_size": 50, "key": "sessions" } } ' )); $actual = $this->twilio->proxy->v1->services("KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->sessions->read(); $this->assertNotNull($actual); } public function testCreateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->proxy->v1->services("KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->sessions->create(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'post', 'https://proxy.twilio.com/v1/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sessions' )); } public function testCreateResponse() { $this->holodeck->mock(new Response( 201, ' { "service_sid": "KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "status": "in-progress", "unique_name": "unique_name", "date_started": "2015-07-30T20:00:00Z", "date_ended": "2015-07-30T20:00:00Z", "date_last_interaction": "2015-07-30T20:00:00Z", "date_expiry": "2015-07-30T20:00:00Z", "ttl": 3600, "mode": "message-only", "closed_reason": "", "sid": "KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_updated": "2015-07-30T20:00:00Z", "date_created": "2015-07-30T20:00:00Z", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "url": "https://proxy.twilio.com/v1/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sessions/KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "links": { "interactions": "https://proxy.twilio.com/v1/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sessions/KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Interactions", "participants": "https://proxy.twilio.com/v1/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sessions/KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants" } } ' )); $actual = $this->twilio->proxy->v1->services("KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->sessions->create(); $this->assertNotNull($actual); } public function testDeleteRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->proxy->v1->services("KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->sessions("KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'delete', 'https://proxy.twilio.com/v1/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sessions/KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testDeleteResponse() { $this->holodeck->mock(new Response( 204, null )); $actual = $this->twilio->proxy->v1->services("KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->sessions("KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); $this->assertTrue($actual); } public function testUpdateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->proxy->v1->services("KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->sessions("KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'post', 'https://proxy.twilio.com/v1/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sessions/KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testUpdateResponse() { $this->holodeck->mock(new Response( 200, ' { "service_sid": "KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "status": "in-progress", "unique_name": "unique_name", "date_started": "2015-07-30T20:00:00Z", "date_ended": "2015-07-30T20:00:00Z", "date_last_interaction": "2015-07-30T20:00:00Z", "date_expiry": "2015-07-30T20:00:00Z", "ttl": 3600, "mode": "message-only", "closed_reason": "", "sid": "KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_updated": "2015-07-30T20:00:00Z", "date_created": "2015-07-30T20:00:00Z", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "url": "https://proxy.twilio.com/v1/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sessions/KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "links": { "interactions": "https://proxy.twilio.com/v1/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sessions/KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Interactions", "participants": "https://proxy.twilio.com/v1/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sessions/KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants" } } ' )); $actual = $this->twilio->proxy->v1->services("KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->sessions("KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/Proxy/V1/Service/Session/InteractionTest.php 0000604 00000013325 15174325133 0022447 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Proxy\V1\Service\Session; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class InteractionTest extends HolodeckTestCase { public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->proxy->v1->services("KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->sessions("KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->interactions("KIaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://proxy.twilio.com/v1/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sessions/KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Interactions/KIaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "service_sid": "KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "data": "data", "date_created": "2015-07-30T20:00:00Z", "date_updated": "2015-07-30T20:00:00Z", "inbound_participant_sid": "KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "inbound_resource_sid": "SMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "inbound_resource_status": "sent", "inbound_resource_type": "Message", "inbound_resource_url": null, "outbound_participant_sid": "KPbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb", "outbound_resource_sid": "SMbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb", "outbound_resource_status": "sent", "outbound_resource_type": "Message", "outbound_resource_url": null, "sid": "KIaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "type": "message", "url": "https://proxy.twilio.com/v1/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sessions/KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Interactions/KIaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "session_sid": "KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->proxy->v1->services("KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->sessions("KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->interactions("KIaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); $this->assertNotNull($actual); } public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->proxy->v1->services("KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->sessions("KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->interactions->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://proxy.twilio.com/v1/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sessions/KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Interactions' )); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "interactions": [], "meta": { "previous_page_url": null, "next_page_url": null, "url": "https://proxy.twilio.com/v1/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sessions/KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Interactions?PageSize=50&Page=0", "page": 0, "first_page_url": "https://proxy.twilio.com/v1/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sessions/KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Interactions?PageSize=50&Page=0", "page_size": 50, "key": "interactions" } } ' )); $actual = $this->twilio->proxy->v1->services("KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->sessions("KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->interactions->read(); $this->assertNotNull($actual); } public function testDeleteRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->proxy->v1->services("KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->sessions("KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->interactions("KIaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'delete', 'https://proxy.twilio.com/v1/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sessions/KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Interactions/KIaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testDeleteResponse() { $this->holodeck->mock(new Response( 204, null )); $actual = $this->twilio->proxy->v1->services("KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->sessions("KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->interactions("KIaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); $this->assertTrue($actual); } } sdk/Twilio/Tests/Integration/Proxy/V1/Service/Session/Participant/MessageInteractionTest.php 0000604 00000017541 15174325133 0026236 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Proxy\V1\Service\Session\Participant; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class MessageInteractionTest extends HolodeckTestCase { public function testCreateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->proxy->v1->services("KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->sessions("KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->participants("KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->messageInteractions->create(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'post', 'https://proxy.twilio.com/v1/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sessions/KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/MessageInteractions' )); } public function testCreateResponse() { $this->holodeck->mock(new Response( 201, ' { "service_sid": "KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "data": "body", "date_created": "2015-07-30T20:00:00Z", "date_updated": "2015-07-30T20:00:00Z", "participant_sid": "KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "inbound_participant_sid": null, "inbound_resource_sid": null, "inbound_resource_status": null, "inbound_resource_type": null, "inbound_resource_url": null, "outbound_participant_sid": "KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "outbound_resource_sid": "SMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "outbound_resource_status": "sent", "outbound_resource_type": "Message", "outbound_resource_url": null, "sid": "KIaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "type": "message", "url": "https://proxy.twilio.com/v1/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sessions/KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/MessageInteractions/KIaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "session_sid": "KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->proxy->v1->services("KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->sessions("KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->participants("KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->messageInteractions->create(); $this->assertNotNull($actual); } public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->proxy->v1->services("KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->sessions("KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->participants("KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->messageInteractions("KIaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://proxy.twilio.com/v1/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sessions/KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/MessageInteractions/KIaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "service_sid": "KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "data": "data", "date_created": "2015-07-30T20:00:00Z", "date_updated": "2015-07-30T20:00:00Z", "participant_sid": "KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "inbound_participant_sid": null, "inbound_resource_sid": null, "inbound_resource_status": null, "inbound_resource_type": null, "inbound_resource_url": null, "outbound_participant_sid": "KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "outbound_resource_sid": "SMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "outbound_resource_status": "sent", "outbound_resource_type": "Message", "outbound_resource_url": null, "sid": "KIaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "type": "message", "url": "https://proxy.twilio.com/v1/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sessions/KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/MessageInteractions/KIaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "session_sid": "KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->proxy->v1->services("KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->sessions("KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->participants("KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->messageInteractions("KIaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); $this->assertNotNull($actual); } public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->proxy->v1->services("KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->sessions("KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->participants("KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->messageInteractions->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://proxy.twilio.com/v1/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sessions/KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/MessageInteractions' )); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "interactions": [], "meta": { "previous_page_url": null, "next_page_url": null, "url": "https://proxy.twilio.com/v1/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sessions/KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/MessageInteractions?PageSize=50&Page=0", "page": 0, "first_page_url": "https://proxy.twilio.com/v1/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sessions/KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/MessageInteractions?PageSize=50&Page=0", "page_size": 50, "key": "interactions" } } ' )); $actual = $this->twilio->proxy->v1->services("KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->sessions("KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->participants("KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->messageInteractions->read(); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/Proxy/V1/Service/Session/ParticipantTest.php 0000604 00000024325 15174325133 0022450 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Proxy\V1\Service\Session; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class ParticipantTest extends HolodeckTestCase { public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->proxy->v1->services("KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->sessions("KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->participants("KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://proxy.twilio.com/v1/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sessions/KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "sid": "KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "session_sid": "KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "identifier": "identifier", "proxy_identifier": "proxy_identifier", "proxy_identifier_sid": "PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "friendly_name": "friendly_name", "date_deleted": "2015-07-30T20:00:00Z", "date_updated": "2015-07-30T20:00:00Z", "date_created": "2015-07-30T20:00:00Z", "url": "https://proxy.twilio.com/v1/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sessions/KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "links": { "message_interactions": "https://proxy.twilio.com/v1/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sessions/KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/MessageInteractions" } } ' )); $actual = $this->twilio->proxy->v1->services("KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->sessions("KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->participants("KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); $this->assertNotNull($actual); } public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->proxy->v1->services("KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->sessions("KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->participants->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://proxy.twilio.com/v1/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sessions/KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants' )); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "meta": { "previous_page_url": null, "next_page_url": null, "url": "https://proxy.twilio.com/v1/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sessions/KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants?PageSize=50&Page=0", "page": 0, "first_page_url": "https://proxy.twilio.com/v1/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sessions/KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants?PageSize=50&Page=0", "page_size": 50, "key": "participants" }, "participants": [] } ' )); $actual = $this->twilio->proxy->v1->services("KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->sessions("KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->participants->read(); $this->assertNotNull($actual); } public function testCreateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->proxy->v1->services("KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->sessions("KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->participants->create("identifier"); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $values = array('Identifier' => "identifier", ); $this->assertRequest(new Request( 'post', 'https://proxy.twilio.com/v1/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sessions/KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants', null, $values )); } public function testCreateResponse() { $this->holodeck->mock(new Response( 201, ' { "sid": "KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "session_sid": "KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "identifier": "identifier", "proxy_identifier": "proxy_identifier", "proxy_identifier_sid": "PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "friendly_name": "friendly_name", "date_deleted": "2015-07-30T20:00:00Z", "date_updated": "2015-07-30T20:00:00Z", "date_created": "2015-07-30T20:00:00Z", "url": "https://proxy.twilio.com/v1/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sessions/KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "links": { "message_interactions": "https://proxy.twilio.com/v1/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sessions/KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/MessageInteractions" } } ' )); $actual = $this->twilio->proxy->v1->services("KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->sessions("KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->participants->create("identifier"); $this->assertNotNull($actual); } public function testDeleteRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->proxy->v1->services("KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->sessions("KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->participants("KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'delete', 'https://proxy.twilio.com/v1/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sessions/KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testDeleteResponse() { $this->holodeck->mock(new Response( 204, null )); $actual = $this->twilio->proxy->v1->services("KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->sessions("KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->participants("KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); $this->assertTrue($actual); } public function testUpdateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->proxy->v1->services("KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->sessions("KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->participants("KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'post', 'https://proxy.twilio.com/v1/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sessions/KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testUpdateResponse() { $this->holodeck->mock(new Response( 200, ' { "sid": "KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "session_sid": "KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "identifier": "identifier", "proxy_identifier": "proxy_identifier", "proxy_identifier_sid": "PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "friendly_name": "friendly_name", "date_deleted": "2015-07-30T20:00:00Z", "date_updated": "2015-07-30T20:00:00Z", "date_created": "2015-07-30T20:00:00Z", "url": "https://proxy.twilio.com/v1/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sessions/KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "links": { "message_interactions": "https://proxy.twilio.com/v1/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sessions/KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/MessageInteractions" } } ' )); $actual = $this->twilio->proxy->v1->services("KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->sessions("KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->participants("KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/Taskrouter/V1/Workspace/WorkspaceStatisticsTest.php 0000604 00000010166 15174325133 0024136 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Taskrouter\V1\Workspace; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class WorkspaceStatisticsTest extends HolodeckTestCase { public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->taskrouter->v1->workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->statistics()->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Statistics' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Statistics", "cumulative": { "avg_task_acceptance_time": 0.0, "start_time": "2008-01-02T00:00:00Z", "reservations_accepted": 0, "reservations_canceled": 0, "reservations_created": 0, "reservations_rejected": 0, "reservations_rescinded": 0, "reservations_timed_out": 0, "end_time": "2008-01-02T00:00:00Z", "tasks_canceled": 0, "tasks_created": 0, "tasks_deleted": 0, "tasks_moved": 0, "tasks_timed_out_in_workflow": 0 }, "realtime": { "activity_statistics": [ { "friendly_name": "Offline", "sid": "WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "workers": 1 }, { "friendly_name": "Idle", "sid": "WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "workers": 0 }, { "friendly_name": "80fa2beb-3a05-11e5-8fc8-98e0d9a1eb73", "sid": "WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "workers": 0 }, { "friendly_name": "Reserved", "sid": "WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "workers": 0 }, { "friendly_name": "Busy", "sid": "WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "workers": 0 }, { "friendly_name": "817ca1c5-3a05-11e5-9292-98e0d9a1eb73", "sid": "WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "workers": 0 } ], "longest_task_waiting_age": 0, "longest_task_waiting_sid": null, "tasks_by_status": { "assigned": 0, "pending": 0, "reserved": 0, "wrapping": 0 }, "total_tasks": 0, "total_workers": 1 }, "workspace_sid": "WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->taskrouter->v1->workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->statistics()->fetch(); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/Taskrouter/V1/Workspace/TaskTest.php 0000604 00000035314 15174325133 0021031 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Taskrouter\V1\Workspace; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class TaskTest extends HolodeckTestCase { public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->taskrouter->v1->workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->tasks("WTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Tasks/WTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "age": 25200, "assignment_status": "pending", "attributes": "{\\"body\\": \\"hello\\"}", "date_created": "2014-05-14T18:50:02Z", "date_updated": "2014-05-15T07:26:06Z", "priority": 0, "reason": "Test Reason", "sid": "WTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "task_queue_sid": "WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "task_channel_sid": "TCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "task_channel_unique_name": "task-channel", "timeout": 60, "url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Tasks/WTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "workflow_sid": "WFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "workspace_sid": "WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "workflow_friendly_name": "Test Workflow", "task_queue_friendly_name": "Test Queue", "addons": "{}", "links": { "task_queue": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TaskQueues/WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "workflow": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workflows/WFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "workspace": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "reservations": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Tasks/WTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Reservations" } } ' )); $actual = $this->twilio->taskrouter->v1->workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->tasks("WTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); $this->assertNotNull($actual); } public function testUpdateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->taskrouter->v1->workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->tasks("WTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'post', 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Tasks/WTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testUpdateResponse() { $this->holodeck->mock(new Response( 200, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "age": 25200, "assignment_status": "pending", "attributes": "{\\"body\\": \\"hello\\"}", "date_created": "2014-05-14T18:50:02Z", "date_updated": "2014-05-15T07:26:06Z", "priority": 0, "reason": "Test Reason", "sid": "WTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "task_queue_sid": "WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "task_channel_sid": "TCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "task_channel_unique_name": "task-channel", "timeout": 60, "url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Tasks/WTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "workflow_sid": "WFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "workspace_sid": "WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "workflow_friendly_name": "Test Workflow", "task_queue_friendly_name": "Test Queue", "addons": "{}", "links": { "task_queue": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TaskQueues/WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "workflow": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workflows/WFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "workspace": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "reservations": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Tasks/WTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Reservations" } } ' )); $actual = $this->twilio->taskrouter->v1->workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->tasks("WTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); $this->assertNotNull($actual); } public function testDeleteRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->taskrouter->v1->workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->tasks("WTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'delete', 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Tasks/WTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testDeleteResponse() { $this->holodeck->mock(new Response( 204, null )); $actual = $this->twilio->taskrouter->v1->workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->tasks("WTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); $this->assertTrue($actual); } public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->taskrouter->v1->workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->tasks->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Tasks' )); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "meta": { "first_page_url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Tasks?PageSize=50&Page=0", "key": "tasks", "next_page_url": null, "page": 0, "page_size": 50, "previous_page_url": null, "url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Tasks?PageSize=50&Page=0" }, "tasks": [ { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "age": 25200, "assignment_status": "pending", "attributes": "{\\"body\\": \\"hello\\"}", "date_created": "2014-05-14T14:26:54Z", "date_updated": "2014-05-15T16:03:42Z", "priority": 0, "reason": "Test Reason", "sid": "WTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "task_queue_sid": "WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "task_channel_sid": "TCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "task_channel_unique_name": "task-channel", "timeout": 60, "url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Tasks/WTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "workflow_sid": "WFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "workspace_sid": "WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "workflow_friendly_name": "Test Workflow", "task_queue_friendly_name": "Test Queue", "addons": "{}", "links": { "task_queue": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TaskQueues/WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "workflow": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workflows/WFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "workspace": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "reservations": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Tasks/WTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Reservations" } } ] } ' )); $actual = $this->twilio->taskrouter->v1->workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->tasks->read(); $this->assertGreaterThan(0, count($actual)); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "meta": { "first_page_url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Tasks?PageSize=50&Page=0", "key": "tasks", "next_page_url": null, "page": 0, "page_size": 50, "previous_page_url": null, "url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Tasks?PageSize=50&Page=0" }, "tasks": [] } ' )); $actual = $this->twilio->taskrouter->v1->workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->tasks->read(); $this->assertNotNull($actual); } public function testReadAssignmentStatusMultipleResponse() { $this->holodeck->mock(new Response( 200, ' { "meta": { "first_page_url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Tasks?PageSize=50&Page=0", "key": "tasks", "next_page_url": null, "page": 0, "page_size": 50, "previous_page_url": null, "url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Tasks?PageSize=50&Page=0" }, "tasks": [] } ' )); $actual = $this->twilio->taskrouter->v1->workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->tasks->read(); $this->assertNotNull($actual); } public function testCreateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->taskrouter->v1->workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->tasks->create(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'post', 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Tasks' )); } public function testCreateResponse() { $this->holodeck->mock(new Response( 201, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "age": 25200, "assignment_status": "pending", "attributes": "{\\"body\\": \\"attributes\\"}", "date_created": "2014-05-14T18:50:02Z", "date_updated": "2014-05-15T07:26:06Z", "priority": 1, "reason": "Test Reason", "sid": "WTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "task_queue_sid": "WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "task_channel_sid": "TCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "task_channel_unique_name": "unique", "timeout": 60, "url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Tasks/WTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "workspace_sid": "WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "workflow_sid": "WFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "workflow_friendly_name": "Example Workflow", "task_queue_friendly_name": "Example Task Queue", "addons": "{}", "links": { "task_queue": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TaskQueues/WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "workflow": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workflows/WFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "workspace": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "reservations": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Tasks/WTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Reservations" } } ' )); $actual = $this->twilio->taskrouter->v1->workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->tasks->create(); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/Taskrouter/V1/Workspace/WorkspaceCumulativeStatisticsTest.php 0000604 00000006672 15174325133 0026204 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Taskrouter\V1\Workspace; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class WorkspaceCumulativeStatisticsTest extends HolodeckTestCase { public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->taskrouter->v1->workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->cumulativeStatistics()->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/CumulativeStatistics' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "reservations_accepted": 100, "tasks_completed": 100, "start_time": "2015-07-30T20:00:00Z", "reservations_rescinded": 100, "tasks_timed_out_in_workflow": 100, "end_time": "2015-07-30T20:00:00Z", "avg_task_acceptance_time": 100, "tasks_canceled": 100, "url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/CumulativeStatistics", "tasks_moved": 100, "tasks_deleted": 100, "tasks_created": 100, "reservations_canceled": 100, "reservations_timed_out": 100, "wait_duration_until_canceled": { "avg": 0, "min": 0, "max": 0, "total": 0 }, "wait_duration_until_accepted": { "avg": 0, "min": 0, "max": 0, "total": 0 }, "split_by_wait_time": { "5": { "above": { "tasks_canceled": 0, "reservations_accepted": 0 }, "below": { "tasks_canceled": 0, "reservations_accepted": 0 } }, "10": { "above": { "tasks_canceled": 0, "reservations_accepted": 0 }, "below": { "tasks_canceled": 0, "reservations_accepted": 0 } } }, "reservations_created": 100, "reservations_rejected": 100, "workspace_sid": "WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->taskrouter->v1->workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->cumulativeStatistics()->fetch(); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/Taskrouter/V1/Workspace/ActivityTest.php 0000604 00000022570 15174325133 0021723 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Taskrouter\V1\Workspace; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class ActivityTest extends HolodeckTestCase { public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->taskrouter->v1->workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->activities("WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Activities/WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "available": true, "date_created": "2014-05-14T10:50:02Z", "date_updated": "2014-05-14T23:26:06Z", "friendly_name": "New Activity", "sid": "WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Activities/WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "workspace_sid": "WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->taskrouter->v1->workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->activities("WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); $this->assertNotNull($actual); } public function testUpdateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->taskrouter->v1->workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->activities("WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'post', 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Activities/WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testUpdateResponse() { $this->holodeck->mock(new Response( 200, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "available": true, "date_created": "2014-05-14T10:50:02Z", "date_updated": "2014-05-14T23:26:06Z", "friendly_name": "New Activity", "sid": "WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Activities/WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "workspace_sid": "WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->taskrouter->v1->workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->activities("WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); $this->assertNotNull($actual); } public function testDeleteRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->taskrouter->v1->workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->activities("WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'delete', 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Activities/WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testDeleteResponse() { $this->holodeck->mock(new Response( 204, null )); $actual = $this->twilio->taskrouter->v1->workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->activities("WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); $this->assertTrue($actual); } public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->taskrouter->v1->workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->activities->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Activities' )); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "activities": [ { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "available": true, "date_created": "2014-05-14T10:50:02Z", "date_updated": "2014-05-14T23:26:06Z", "friendly_name": "New Activity", "sid": "WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Activities/WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "workspace_sid": "WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ], "meta": { "first_page_url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Activities?PageSize=50&Page=0", "key": "activities", "last_page_url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Activities?PageSize=50&Page=0", "next_page_url": null, "page": 0, "page_size": 50, "previous_page_url": null, "url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Activities?PageSize=50&Page=0" } } ' )); $actual = $this->twilio->taskrouter->v1->workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->activities->read(); $this->assertGreaterThan(0, count($actual)); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "activities": [], "meta": { "first_page_url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Activities?PageSize=50&Page=0", "key": "activities", "last_page_url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Activities?PageSize=50&Page=0", "next_page_url": null, "page": 0, "page_size": 50, "previous_page_url": null, "url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Activities?PageSize=50&Page=0" } } ' )); $actual = $this->twilio->taskrouter->v1->workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->activities->read(); $this->assertNotNull($actual); } public function testCreateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->taskrouter->v1->workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->activities->create("friendlyName"); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $values = array('FriendlyName' => "friendlyName", ); $this->assertRequest(new Request( 'post', 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Activities', null, $values )); } public function testCreateResponse() { $this->holodeck->mock(new Response( 201, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "available": true, "date_created": "2014-05-14T10:50:02Z", "date_updated": "2014-05-14T23:26:06Z", "friendly_name": "New Activity", "sid": "WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Activities/WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "workspace_sid": "WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->taskrouter->v1->workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->activities->create("friendlyName"); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/Taskrouter/V1/Workspace/WorkerTest.php 0000604 00000037163 15174325133 0021404 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Taskrouter\V1\Workspace; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class WorkerTest extends HolodeckTestCase { public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->taskrouter->v1->workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->workers->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers' )); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "meta": { "page": 0, "page_size": 50, "first_page_url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers?PageSize=50&Page=0", "previous_page_url": null, "url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers?PageSize=50&Page=0", "next_page_url": null, "key": "workers" }, "workers": [ { "sid": "WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "friendly_name": "testWorker", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "activity_sid": "WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "activity_name": "Offline", "workspace_sid": "WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "attributes": "{}", "available": false, "date_created": "2017-05-30T23:05:29Z", "date_updated": "2017-05-30T23:05:29Z", "date_status_changed": "2017-05-30T23:05:29Z", "url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers/WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "links": { "channels": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers/WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels", "activity": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Activities/WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "workspace": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "statistics": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers/Statistics", "real_time_statistics": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers/RealTimeStatistics", "cumulative_statistics": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers/CumulativeStatistics", "worker_statistics": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers/WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Statistics", "worker_channels": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers/WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels", "reservations": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers/WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Reservations" } } ] } ' )); $actual = $this->twilio->taskrouter->v1->workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->workers->read(); $this->assertGreaterThan(0, count($actual)); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "meta": { "first_page_url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers?PageSize=50&Page=0", "key": "workers", "next_page_url": null, "page": 0, "page_size": 50, "previous_page_url": null, "url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers?PageSize=50&Page=0" }, "workers": [] } ' )); $actual = $this->twilio->taskrouter->v1->workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->workers->read(); $this->assertNotNull($actual); } public function testCreateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->taskrouter->v1->workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->workers->create("friendlyName"); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $values = array('FriendlyName' => "friendlyName", ); $this->assertRequest(new Request( 'post', 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers', null, $values )); } public function testCreateResponse() { $this->holodeck->mock(new Response( 201, ' { "sid": "WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "friendly_name": "NewWorker", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "activity_sid": "WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "activity_name": "Offline", "workspace_sid": "WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "attributes": "{}", "available": false, "date_created": "2017-05-30T23:19:38Z", "date_updated": "2017-05-30T23:19:38Z", "date_status_changed": "2017-05-30T23:19:38Z", "url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers/WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "links": { "channels": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers/WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels", "activity": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Activities/WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "workspace": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "statistics": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers/Statistics", "real_time_statistics": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers/RealTimeStatistics", "cumulative_statistics": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers/CumulativeStatistics", "worker_statistics": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers/WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Statistics", "worker_channels": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers/WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels", "reservations": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers/WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Reservations" } } ' )); $actual = $this->twilio->taskrouter->v1->workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->workers->create("friendlyName"); $this->assertNotNull($actual); } public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->taskrouter->v1->workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->workers("WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers/WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "activity_name": "available", "activity_sid": "WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "attributes": "{}", "available": false, "date_created": "2017-05-30T23:32:39Z", "date_status_changed": "2017-05-30T23:32:39Z", "date_updated": "2017-05-30T23:32:39Z", "friendly_name": "NewWorker3", "sid": "WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers/WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "workspace_sid": "WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "links": { "channels": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers/WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels", "activity": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Activities/WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "workspace": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "statistics": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers/Statistics", "real_time_statistics": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers/RealTimeStatistics", "cumulative_statistics": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers/CumulativeStatistics", "worker_statistics": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers/WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Statistics", "worker_channels": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers/WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels", "reservations": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers/WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Reservations" } } ' )); $actual = $this->twilio->taskrouter->v1->workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->workers("WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); $this->assertNotNull($actual); } public function testUpdateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->taskrouter->v1->workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->workers("WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'post', 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers/WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testUpdateResponse() { $this->holodeck->mock(new Response( 200, ' { "sid": "WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "friendly_name": "blah", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "activity_sid": "WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "activity_name": "Offline", "workspace_sid": "WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "attributes": "{}", "available": false, "date_created": "2017-05-30T23:32:22Z", "date_updated": "2017-05-31T00:05:57Z", "date_status_changed": "2017-05-30T23:32:22Z", "url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers/WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "links": { "channels": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers/WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels", "activity": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Activities/WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "workspace": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "statistics": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers/Statistics", "real_time_statistics": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers/RealTimeStatistics", "cumulative_statistics": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers/CumulativeStatistics", "worker_statistics": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers/WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Statistics", "worker_channels": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers/WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels", "reservations": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers/WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Reservations" } } ' )); $actual = $this->twilio->taskrouter->v1->workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->workers("WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); $this->assertNotNull($actual); } public function testDeleteRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->taskrouter->v1->workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->workers("WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'delete', 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers/WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testDeleteResponse() { $this->holodeck->mock(new Response( 204, null )); $actual = $this->twilio->taskrouter->v1->workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->workers("WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); $this->assertTrue($actual); } } sdk/Twilio/Tests/Integration/Taskrouter/V1/Workspace/Worker/WorkerStatisticsTest.php 0000604 00000007344 15174325133 0024726 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Taskrouter\V1\Workspace\Worker; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class WorkerStatisticsTest extends HolodeckTestCase { public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->taskrouter->v1->workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->workers("WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->statistics()->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers/WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Statistics' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "cumulative": { "reservations_created": 100, "reservations_accepted": 100, "reservations_rejected": 100, "reservations_timed_out": 100, "reservations_canceled": 100, "reservations_rescinded": 100, "activity_durations": [ { "max": 0, "min": 900, "sid": "WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "friendly_name": "Offline", "avg": 1080, "total": 5400 }, { "max": 0, "min": 900, "sid": "WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "friendly_name": "Busy", "avg": 1012, "total": 8100 }, { "max": 0, "min": 0, "sid": "WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "friendly_name": "Idle", "avg": 0, "total": 0 }, { "max": 0, "min": 0, "sid": "WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "friendly_name": "Reserved", "avg": 0, "total": 0 } ], "start_time": "2008-01-02T00:00:00Z", "end_time": "2008-01-02T00:00:00Z" }, "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "workspace_sid": "WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "worker_sid": "WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers/WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Statistics" } ' )); $actual = $this->twilio->taskrouter->v1->workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->workers("WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->statistics()->fetch(); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/Taskrouter/V1/Workspace/Worker/WorkersStatisticsTest.php 0000604 00000011026 15174325133 0025101 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Taskrouter\V1\Workspace\Worker; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class WorkersStatisticsTest extends HolodeckTestCase { public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->taskrouter->v1->workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->workers ->statistics()->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers/Statistics' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "cumulative": { "reservations_created": 0, "reservations_accepted": 0, "reservations_rejected": 0, "reservations_timed_out": 0, "reservations_canceled": 0, "reservations_rescinded": 0, "activity_durations": [ { "max": 0, "min": 900, "sid": "WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "friendly_name": "Offline", "avg": 1080, "total": 5400 }, { "max": 0, "min": 900, "sid": "WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "friendly_name": "Busy", "avg": 1012, "total": 8100 }, { "max": 0, "min": 0, "sid": "WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "friendly_name": "Idle", "avg": 0, "total": 0 }, { "max": 0, "min": 0, "sid": "WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "friendly_name": "Reserved", "avg": 0, "total": 0 } ], "start_time": "2008-01-02T00:00:00Z", "end_time": "2008-01-02T00:00:00Z" }, "realtime": { "total_workers": 15, "activity_statistics": [ { "friendly_name": "Idle", "workers": 0, "sid": "WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" }, { "friendly_name": "Busy", "workers": 9, "sid": "WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" }, { "friendly_name": "Offline", "workers": 6, "sid": "WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" }, { "friendly_name": "Reserved", "workers": 0, "sid": "WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ] }, "workspace_sid": "WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers/Statistics" } ' )); $actual = $this->twilio->taskrouter->v1->workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->workers ->statistics()->fetch(); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/Taskrouter/V1/Workspace/Worker/ReservationTest.php 0000604 00000022733 15174325133 0023702 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Taskrouter\V1\Workspace\Worker; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class ReservationTest extends HolodeckTestCase { public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->taskrouter->v1->workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->workers("WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->reservations->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers/WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Reservations' )); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "meta": { "first_page_url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers/WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Reservations?PageSize=50&Page=0", "key": "reservations", "next_page_url": null, "page": 0, "page_size": 50, "previous_page_url": null, "url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers/WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Reservations?PageSize=50&Page=0" }, "reservations": [ { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "2014-05-14T10:50:02Z", "date_updated": "2014-05-15T16:03:42Z", "links": { "task": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Tasks/WTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "worker": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers/WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "workspace": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" }, "reservation_status": "accepted", "sid": "WRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "task_sid": "WTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers/WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Reservations/WRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "worker_name": "Doug", "worker_sid": "WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "workspace_sid": "WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ] } ' )); $actual = $this->twilio->taskrouter->v1->workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->workers("WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->reservations->read(); $this->assertGreaterThan(0, count($actual)); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "meta": { "first_page_url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers/WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Reservations?PageSize=50&Page=0", "key": "reservations", "next_page_url": null, "page": 0, "page_size": 50, "previous_page_url": null, "url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers/WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Reservations?PageSize=50&Page=0" }, "reservations": [] } ' )); $actual = $this->twilio->taskrouter->v1->workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->workers("WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->reservations->read(); $this->assertNotNull($actual); } public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->taskrouter->v1->workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->workers("WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->reservations("WRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers/WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Reservations/WRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "2014-05-14T10:50:02Z", "date_updated": "2014-05-15T16:03:42Z", "links": { "task": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Tasks/WTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "worker": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers/WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "workspace": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" }, "reservation_status": "accepted", "sid": "WRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "task_sid": "WTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers/WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Reservations/WRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "worker_name": "Doug", "worker_sid": "WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "workspace_sid": "WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->taskrouter->v1->workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->workers("WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->reservations("WRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); $this->assertNotNull($actual); } public function testUpdateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->taskrouter->v1->workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->workers("WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->reservations("WRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'post', 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers/WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Reservations/WRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testUpdateResponse() { $this->holodeck->mock(new Response( 200, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "2014-05-14T10:50:02Z", "date_updated": "2014-05-15T16:03:42Z", "links": { "task": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Tasks/WTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "worker": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers/WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "workspace": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" }, "reservation_status": "accepted", "sid": "WRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "task_sid": "WTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers/WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Reservations/WRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "worker_name": "Doug", "worker_sid": "WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "workspace_sid": "WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->taskrouter->v1->workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->workers("WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->reservations("WRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/Taskrouter/V1/Workspace/Worker/WorkersCumulativeStatisticsTest.php 0000604 00000006663 15174325133 0027153 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Taskrouter\V1\Workspace\Worker; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class WorkersCumulativeStatisticsTest extends HolodeckTestCase { public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->taskrouter->v1->workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->workers("WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->cumulativeStatistics()->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers/CumulativeStatistics' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "workspace_sid": "WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers/CumulativeStatistics", "reservations_created": 100, "reservations_accepted": 100, "reservations_rejected": 100, "reservations_timed_out": 100, "reservations_canceled": 100, "reservations_rescinded": 100, "activity_durations": [ { "max": 0, "min": 900, "sid": "WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "friendly_name": "Offline", "avg": 1080, "total": 5400 }, { "max": 0, "min": 900, "sid": "WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "friendly_name": "Busy", "avg": 1012, "total": 8100 }, { "max": 0, "min": 0, "sid": "WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "friendly_name": "Idle", "avg": 0, "total": 0 }, { "max": 0, "min": 0, "sid": "WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "friendly_name": "Reserved", "avg": 0, "total": 0 } ], "start_time": "2015-07-30T20:00:00Z", "end_time": "2015-07-30T20:00:00Z" } ' )); $actual = $this->twilio->taskrouter->v1->workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->workers("WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->cumulativeStatistics()->fetch(); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/Taskrouter/V1/Workspace/Worker/WorkerChannelTest.php 0000604 00000020657 15174325133 0024146 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Taskrouter\V1\Workspace\Worker; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class WorkerChannelTest extends HolodeckTestCase { public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->taskrouter->v1->workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->workers("WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->workerChannels->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers/WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels' )); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "meta": { "first_page_url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers/WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels?PageSize=50&Page=0", "key": "channels", "next_page_url": null, "page": 0, "page_size": 1, "previous_page_url": null, "url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers/WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels" }, "channels": [ { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "assigned_tasks": 0, "available": true, "available_capacity_percentage": 100, "configured_capacity": 1, "date_created": "2014-05-14T10:50:02Z", "date_updated": "2014-05-15T16:03:42Z", "sid": "WCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "task_channel_sid": "TCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "task_channel_unique_name": "default", "url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers/WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/WRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "worker_sid": "WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "workspace_sid": "WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ] } ' )); $actual = $this->twilio->taskrouter->v1->workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->workers("WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->workerChannels->read(); $this->assertGreaterThan(0, count($actual)); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "meta": { "first_page_url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers/WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels?PageSize=50&Page=0", "key": "channels", "next_page_url": null, "page": 0, "page_size": 1, "previous_page_url": null, "url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers/WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels" }, "channels": [] } ' )); $actual = $this->twilio->taskrouter->v1->workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->workers("WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->workerChannels->read(); $this->assertNotNull($actual); } public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->taskrouter->v1->workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->workers("WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->workerChannels("WCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers/WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/WCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "assigned_tasks": 0, "available": true, "available_capacity_percentage": 100, "configured_capacity": 1, "date_created": "2014-05-14T10:50:02Z", "date_updated": "2014-05-15T16:03:42Z", "sid": "WCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "task_channel_sid": "TCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "task_channel_unique_name": "default", "url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers/WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/WRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "worker_sid": "WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "workspace_sid": "WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->taskrouter->v1->workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->workers("WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->workerChannels("WCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); $this->assertNotNull($actual); } public function testUpdateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->taskrouter->v1->workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->workers("WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->workerChannels("WCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'post', 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers/WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/WCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testUpdateResponse() { $this->holodeck->mock(new Response( 200, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "assigned_tasks": 0, "available": true, "available_capacity_percentage": 100, "configured_capacity": 3, "date_created": "2014-05-14T10:50:02Z", "date_updated": "2014-05-15T16:03:42Z", "sid": "WCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "task_channel_sid": "TCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "task_channel_unique_name": "default", "url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers/WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/WRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "worker_sid": "WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "workspace_sid": "WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->taskrouter->v1->workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->workers("WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->workerChannels("WCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/Taskrouter/V1/Workspace/Worker/WorkersRealTimeStatisticsTest.php 0000604 00000005260 15174325133 0026527 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Taskrouter\V1\Workspace\Worker; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class WorkersRealTimeStatisticsTest extends HolodeckTestCase { public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->taskrouter->v1->workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->workers("WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->realTimeStatistics()->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers/RealTimeStatistics' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "workspace_sid": "WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers/RealTimeStatistics", "total_workers": 15, "activity_statistics": [ { "friendly_name": "Idle", "workers": 0, "sid": "WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" }, { "friendly_name": "Busy", "workers": 9, "sid": "WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" }, { "friendly_name": "Offline", "workers": 6, "sid": "WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" }, { "friendly_name": "Reserved", "workers": 0, "sid": "WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ] } ' )); $actual = $this->twilio->taskrouter->v1->workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->workers("WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->realTimeStatistics()->fetch(); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/Taskrouter/V1/Workspace/Task/ReservationTest.php 0000604 00000022667 15174325133 0023341 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Taskrouter\V1\Workspace\Task; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class ReservationTest extends HolodeckTestCase { public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->taskrouter->v1->workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->tasks("WTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->reservations->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Tasks/WTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Reservations' )); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "meta": { "first_page_url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Tasks/WTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Reservations?PageSize=50&Page=0", "key": "reservations", "next_page_url": null, "page": 0, "page_size": 50, "previous_page_url": null, "url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Tasks/WTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Reservations?PageSize=50&Page=0" }, "reservations": [ { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "2014-05-14T10:50:02Z", "date_updated": "2014-05-15T16:03:42Z", "links": { "task": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Tasks/WTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "worker": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers/WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "workspace": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" }, "reservation_status": "accepted", "sid": "WRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "task_sid": "WTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Tasks/WTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Reservations/WRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "worker_name": "Doug", "worker_sid": "WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "workspace_sid": "WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ] } ' )); $actual = $this->twilio->taskrouter->v1->workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->tasks("WTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->reservations->read(); $this->assertGreaterThan(0, count($actual)); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "meta": { "first_page_url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Tasks/WTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Reservations?PageSize=50&Page=0", "key": "reservations", "next_page_url": null, "page": 0, "page_size": 50, "previous_page_url": null, "url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Tasks/WTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Reservations?PageSize=50&Page=0" }, "reservations": [] } ' )); $actual = $this->twilio->taskrouter->v1->workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->tasks("WTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->reservations->read(); $this->assertNotNull($actual); } public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->taskrouter->v1->workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->tasks("WTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->reservations("WRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Tasks/WTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Reservations/WRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "2014-05-14T10:50:02Z", "date_updated": "2014-05-15T16:03:42Z", "links": { "task": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Tasks/WTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "worker": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers/WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "workspace": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" }, "reservation_status": "accepted", "sid": "WRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "task_sid": "WTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Tasks/WTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Reservations/WRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "worker_name": "Doug", "worker_sid": "WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "workspace_sid": "WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->taskrouter->v1->workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->tasks("WTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->reservations("WRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); $this->assertNotNull($actual); } public function testUpdateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->taskrouter->v1->workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->tasks("WTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->reservations("WRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'post', 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Tasks/WTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Reservations/WRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testUpdateResponse() { $this->holodeck->mock(new Response( 200, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "2014-05-14T10:50:02Z", "date_updated": "2014-05-15T16:03:42Z", "links": { "task": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Tasks/WTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "worker": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers/WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "workspace": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" }, "reservation_status": "accepted", "sid": "WRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "task_sid": "WTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Tasks/WTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Reservations/WRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "worker_name": "Doug", "worker_sid": "WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "workspace_sid": "WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->taskrouter->v1->workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->tasks("WTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->reservations("WRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/Taskrouter/V1/Workspace/Workflow/WorkflowRealTimeStatisticsTest.php 0000604 00000004400 15174325133 0027241 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Taskrouter\V1\Workspace\Workflow; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class WorkflowRealTimeStatisticsTest extends HolodeckTestCase { public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->taskrouter->v1->workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->workflows("WWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->realTimeStatistics()->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workflows/WWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/RealTimeStatistics' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "longest_task_waiting_age": 100, "url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workflows/WWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/RealTimeStatistics", "tasks_by_priority": {}, "workspace_sid": "WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "tasks_by_status": { "reserved": 0, "pending": 0, "assigned": 0, "wrapping": 0 }, "workflow_sid": "WWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "total_tasks": 100, "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->taskrouter->v1->workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->workflows("WWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->realTimeStatistics()->fetch(); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/Taskrouter/V1/Workspace/Workflow/WorkflowCumulativeStatisticsTest.php 0000604 00000007436 15174325133 0027671 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Taskrouter\V1\Workspace\Workflow; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class WorkflowCumulativeStatisticsTest extends HolodeckTestCase { public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->taskrouter->v1->workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->workflows("WWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->cumulativeStatistics()->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workflows/WWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/CumulativeStatistics' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "avg_task_acceptance_time": 100, "tasks_canceled": 100, "start_time": "2015-07-30T20:00:00Z", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "tasks_moved": 100, "tasks_entered": 100, "wait_duration_until_canceled": { "avg": 0, "min": 0, "max": 0, "total": 0 }, "wait_duration_until_accepted": { "avg": 0, "min": 0, "max": 0, "total": 0 }, "split_by_wait_time": { "5": { "above": { "tasks_canceled": 0, "reservations_accepted": 0 }, "below": { "tasks_canceled": 0, "reservations_accepted": 0 } }, "10": { "above": { "tasks_canceled": 0, "reservations_accepted": 0 }, "below": { "tasks_canceled": 0, "reservations_accepted": 0 } } }, "reservations_canceled": 100, "end_time": "2015-07-30T20:00:00Z", "workflow_sid": "WWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "reservations_created": 100, "reservations_accepted": 100, "reservations_rescinded": 100, "workspace_sid": "WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "reservations_rejected": 100, "url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workflows/WWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/CumulativeStatistics", "tasks_deleted": 100, "tasks_timed_out_in_workflow": 100, "tasks_completed": 100, "reservations_timed_out": 100 } ' )); $actual = $this->twilio->taskrouter->v1->workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->workflows("WWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->cumulativeStatistics()->fetch(); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/Taskrouter/V1/Workspace/Workflow/WorkflowStatisticsTest.php 0000604 00000005510 15174325133 0025621 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Taskrouter\V1\Workspace\Workflow; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class WorkflowStatisticsTest extends HolodeckTestCase { public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->taskrouter->v1->workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->workflows("WWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->statistics()->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workflows/WWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Statistics' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workflows/WWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Statistics", "cumulative": { "avg_task_acceptance_time": 0.0, "end_time": "2008-01-02T00:00:00Z", "reservations_accepted": 0, "reservations_rejected": 0, "reservations_timed_out": 0, "start_time": "2008-01-02T00:00:00Z", "tasks_canceled": 0, "tasks_entered": 0, "tasks_moved": 0, "tasks_timed_out_in_workflow": 0 }, "realtime": { "longest_task_waiting_age": 0, "longest_task_waiting_sid": null, "tasks_by_status": { "assigned": 1, "pending": 0, "reserved": 0, "wrapping": 0 }, "total_tasks": 1 }, "workflow_sid": "WWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "workspace_sid": "WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->taskrouter->v1->workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->workflows("WWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->statistics()->fetch(); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/Taskrouter/V1/Workspace/EventTest.php 0000604 00000016106 15174325133 0021206 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Taskrouter\V1\Workspace; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class EventTest extends HolodeckTestCase { public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->taskrouter->v1->workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->events("EVaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Events/EVaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "actor_sid": "WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "actor_type": "workspace", "actor_url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "description": "Worker JustinWorker updated to Idle Activity", "event_data": { "worker_activity_name": "Offline", "worker_activity_sid": "WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "worker_attributes": "{}", "worker_name": "JustinWorker", "worker_sid": "WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "worker_time_in_previous_activity": "26", "workspace_name": "WorkspaceName", "workspace_sid": "WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" }, "event_date": "2015-02-07T00:32:41Z", "event_type": "worker.activity", "resource_sid": "WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "resource_type": "worker", "resource_url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers/WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "sid": "EVaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "source": "twilio", "source_ip_address": "1.2.3.4", "url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Events/EVaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->taskrouter->v1->workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->events("EVaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); $this->assertNotNull($actual); } public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->taskrouter->v1->workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->events->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Events' )); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "events": [ { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "actor_sid": "WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "actor_type": "workspace", "actor_url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "description": "Worker JustinWorker updated to Idle Activity", "event_data": { "worker_activity_name": "Offline", "worker_activity_sid": "WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "worker_attributes": "{}", "worker_name": "JustinWorker", "worker_sid": "WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "worker_time_in_previous_activity": "26", "workspace_name": "WorkspaceName", "workspace_sid": "WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" }, "event_date": "2015-02-07T00:32:41Z", "event_type": "worker.activity", "resource_sid": "WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "resource_type": "worker", "resource_url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers/WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "sid": "EVaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "source": "twilio", "source_ip_address": "1.2.3.4", "url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Events/EVaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ], "meta": { "first_page_url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Events?PageSize=50&Page=0", "key": "events", "next_page_url": null, "page": 0, "page_size": 50, "previous_page_url": null, "url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Events?PageSize=50&Page=0" } } ' )); $actual = $this->twilio->taskrouter->v1->workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->events->read(); $this->assertGreaterThan(0, count($actual)); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "events": [], "meta": { "first_page_url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Events?PageSize=50&Page=0", "key": "events", "next_page_url": null, "page": 0, "page_size": 50, "previous_page_url": null, "url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Events?PageSize=50&Page=0" } } ' )); $actual = $this->twilio->taskrouter->v1->workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->events->read(); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/Taskrouter/V1/Workspace/TaskChannelTest.php 0000604 00000012467 15174325133 0022326 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Taskrouter\V1\Workspace; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class TaskChannelTest extends HolodeckTestCase { public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->taskrouter->v1->workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->taskChannels("TCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TaskChannels/TCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "2014-05-14T10:50:02Z", "date_updated": "2014-05-14T23:26:06Z", "friendly_name": "Default", "sid": "TCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "unique_name": "default", "url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TaskChannels/TCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "workspace_sid": "WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->taskrouter->v1->workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->taskChannels("TCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); $this->assertNotNull($actual); } public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->taskrouter->v1->workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->taskChannels->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TaskChannels' )); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "channels": [ { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "2014-05-14T10:50:02Z", "date_updated": "2014-05-14T23:26:06Z", "friendly_name": "Default", "sid": "TCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "unique_name": "default", "url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TaskChannels/TCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "workspace_sid": "WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ], "meta": { "first_page_url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TaskChannels?PageSize=50&Page=0", "key": "channels", "last_page_url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TaskChannels?PageSize=50&Page=0", "next_page_url": null, "page": 0, "page_size": 1, "previous_page_url": null, "url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TaskChannels?PageSize=50&Page=0" } } ' )); $actual = $this->twilio->taskrouter->v1->workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->taskChannels->read(); $this->assertGreaterThan(0, count($actual)); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "channels": [], "meta": { "first_page_url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TaskChannels?PageSize=50&Page=0", "key": "channels", "last_page_url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TaskChannels?PageSize=50&Page=0", "next_page_url": null, "page": 0, "page_size": 50, "previous_page_url": null, "url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TaskChannels?PageSize=50&Page=0" } } ' )); $actual = $this->twilio->taskrouter->v1->workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->taskChannels->read(); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/Taskrouter/V1/Workspace/TaskQueueTest.php 0000604 00000037713 15174325133 0022043 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Taskrouter\V1\Workspace; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class TaskQueueTest extends HolodeckTestCase { public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->taskrouter->v1->workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->taskQueues("WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TaskQueues/WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "assignment_activity_name": "817ca1c5-3a05-11e5-9292-98e0d9a1eb73", "assignment_activity_sid": "WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "2015-08-04T01:31:41Z", "date_updated": "2015-08-04T01:31:41Z", "friendly_name": "81f96435-3a05-11e5-9f81-98e0d9a1eb73", "max_reserved_workers": 1, "links": { "assignment_activity": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Activities/WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "reservation_activity": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Activities/WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "workspace": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "statistics": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TaskQueues/WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Statistics", "real_time_statistics": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TaskQueues/WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/RealTimeStatistics", "cumulative_statistics": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TaskQueues/WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/CumulativeStatistics", "list_statistics": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TaskQueues/Statistics" }, "reservation_activity_name": "80fa2beb-3a05-11e5-8fc8-98e0d9a1eb73", "reservation_activity_sid": "WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "sid": "WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "target_workers": null, "task_order": "FIFO", "url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TaskQueues/WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "workspace_sid": "WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->taskrouter->v1->workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->taskQueues("WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); $this->assertNotNull($actual); } public function testUpdateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->taskrouter->v1->workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->taskQueues("WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'post', 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TaskQueues/WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testUpdateResponse() { $this->holodeck->mock(new Response( 200, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "assignment_activity_name": "817ca1c5-3a05-11e5-9292-98e0d9a1eb73", "assignment_activity_sid": "WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "2015-08-04T01:31:41Z", "date_updated": "2015-08-04T01:31:41Z", "friendly_name": "81f96435-3a05-11e5-9f81-98e0d9a1eb73", "max_reserved_workers": 1, "links": { "assignment_activity": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Activities/WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "reservation_activity": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Activities/WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "workspace": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "statistics": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TaskQueues/WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Statistics", "real_time_statistics": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TaskQueues/WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/RealTimeStatistics", "cumulative_statistics": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TaskQueues/WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/CumulativeStatistics", "list_statistics": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TaskQueues/Statistics" }, "reservation_activity_name": "80fa2beb-3a05-11e5-8fc8-98e0d9a1eb73", "reservation_activity_sid": "WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "sid": "WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "target_workers": null, "task_order": "FIFO", "url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TaskQueues/WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "workspace_sid": "WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->taskrouter->v1->workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->taskQueues("WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); $this->assertNotNull($actual); } public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->taskrouter->v1->workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->taskQueues->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TaskQueues' )); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "meta": { "first_page_url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TaskQueues?PageSize=50&Page=0", "key": "task_queues", "next_page_url": null, "page": 0, "page_size": 50, "previous_page_url": null, "url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TaskQueues?PageSize=50&Page=0" }, "task_queues": [ { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "assignment_activity_name": "817ca1c5-3a05-11e5-9292-98e0d9a1eb73", "assignment_activity_sid": "WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "2015-08-04T01:31:41Z", "date_updated": "2015-08-04T01:31:41Z", "friendly_name": "81f96435-3a05-11e5-9f81-98e0d9a1eb73", "max_reserved_workers": 1, "links": { "assignment_activity": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Activities/WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "reservation_activity": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Activities/WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "workspace": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "statistics": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TaskQueues/WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Statistics", "real_time_statistics": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TaskQueues/WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/RealTimeStatistics", "cumulative_statistics": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TaskQueues/WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/CumulativeStatistics", "list_statistics": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TaskQueues/Statistics" }, "reservation_activity_name": "80fa2beb-3a05-11e5-8fc8-98e0d9a1eb73", "reservation_activity_sid": "WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "sid": "WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "target_workers": null, "task_order": "FIFO", "url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TaskQueues/WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "workspace_sid": "WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ] } ' )); $actual = $this->twilio->taskrouter->v1->workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->taskQueues->read(); $this->assertGreaterThan(0, count($actual)); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "meta": { "first_page_url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TaskQueues?PageSize=50&Page=0", "key": "task_queues", "next_page_url": null, "page": 0, "page_size": 50, "previous_page_url": null, "url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TaskQueues?PageSize=50&Page=0" }, "task_queues": [] } ' )); $actual = $this->twilio->taskrouter->v1->workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->taskQueues->read(); $this->assertNotNull($actual); } public function testCreateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->taskrouter->v1->workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->taskQueues->create("friendlyName", "WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $values = array( 'FriendlyName' => "friendlyName", 'ReservationActivitySid' => "WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", 'AssignmentActivitySid' => "WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", ); $this->assertRequest(new Request( 'post', 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TaskQueues', null, $values )); } public function testCreateResponse() { $this->holodeck->mock(new Response( 201, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "assignment_activity_name": "817ca1c5-3a05-11e5-9292-98e0d9a1eb73", "assignment_activity_sid": "WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "2015-08-04T01:31:41Z", "date_updated": "2015-08-04T01:31:41Z", "friendly_name": "81f96435-3a05-11e5-9f81-98e0d9a1eb73", "max_reserved_workers": 1, "links": { "assignment_activity": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Activities/WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "reservation_activity": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Activities/WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "workspace": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "statistics": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TaskQueues/WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Statistics", "real_time_statistics": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TaskQueues/WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/RealTimeStatistics", "cumulative_statistics": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TaskQueues/WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/CumulativeStatistics", "list_statistics": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TaskQueues/Statistics" }, "reservation_activity_name": "80fa2beb-3a05-11e5-8fc8-98e0d9a1eb73", "reservation_activity_sid": "WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "sid": "WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "target_workers": null, "task_order": "FIFO", "url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TaskQueues/WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "workspace_sid": "WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->taskrouter->v1->workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->taskQueues->create("friendlyName", "WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"); $this->assertNotNull($actual); } public function testDeleteRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->taskrouter->v1->workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->taskQueues("WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'delete', 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TaskQueues/WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testDeleteResponse() { $this->holodeck->mock(new Response( 204, null )); $actual = $this->twilio->taskrouter->v1->workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->taskQueues("WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); $this->assertTrue($actual); } } sdk/Twilio/Tests/Integration/Taskrouter/V1/Workspace/WorkflowTest.php 0000604 00000032510 15174325133 0021734 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Taskrouter\V1\Workspace; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class WorkflowTest extends HolodeckTestCase { public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->taskrouter->v1->workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->workflows("WWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workflows/WWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "assignment_callback_url": "http://example.com", "configuration": "task-routing:\\n - filter: \\n - 1 == 1\\n target:\\n - queue: WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\\n set-priority: 0\\n", "date_created": "2014-05-14T10:50:02Z", "date_updated": "2014-05-14T23:26:06Z", "document_content_type": "application/json", "fallback_assignment_callback_url": null, "friendly_name": "Default Fifo Workflow", "sid": "WFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "task_reservation_timeout": 120, "url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workflows/WFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "workspace_sid": "WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "links": { "statistics": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workflows/WFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Statistics", "real_time_statistics": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workflows/WFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/RealTimeStatistics", "cumulative_statistics": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workflows/WFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/CumulativeStatistics" } } ' )); $actual = $this->twilio->taskrouter->v1->workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->workflows("WWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); $this->assertNotNull($actual); } public function testUpdateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->taskrouter->v1->workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->workflows("WWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'post', 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workflows/WWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testUpdateResponse() { $this->holodeck->mock(new Response( 200, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "assignment_callback_url": "http://example.com", "configuration": "task-routing:\\n - filter: \\n - 1 == 1\\n target:\\n - queue: WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\\n set-priority: 0\\n", "date_created": "2014-05-14T10:50:02Z", "date_updated": "2014-05-14T23:26:06Z", "document_content_type": "application/json", "fallback_assignment_callback_url": null, "friendly_name": "Default Fifo Workflow", "sid": "WFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "task_reservation_timeout": 120, "url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workflows/WFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "links": { "statistics": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workflows/WFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Statistics", "real_time_statistics": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workflows/WFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/RealTimeStatistics", "cumulative_statistics": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workflows/WFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/CumulativeStatistics" }, "workspace_sid": "WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->taskrouter->v1->workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->workflows("WWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); $this->assertNotNull($actual); } public function testDeleteRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->taskrouter->v1->workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->workflows("WWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'delete', 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workflows/WWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testDeleteResponse() { $this->holodeck->mock(new Response( 204, null )); $actual = $this->twilio->taskrouter->v1->workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->workflows("WWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); $this->assertTrue($actual); } public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->taskrouter->v1->workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->workflows->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workflows' )); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "meta": { "first_page_url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workflows?PageSize=50&Page=0", "key": "workflows", "last_page_url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workflows?PageSize=50&Page=0", "next_page_url": null, "page": 0, "page_size": 50, "previous_page_url": null, "url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workflows?PageSize=50&Page=0" }, "workflows": [ { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "assignment_callback_url": "http://example.com", "configuration": "task-routing:\\n - filter: \\n - 1 == 1\\n target:\\n - queue: WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\\n set-priority: 0\\n", "date_created": "2014-05-14T10:50:02Z", "date_updated": "2014-05-15T16:47:51Z", "document_content_type": "application/json", "fallback_assignment_callback_url": null, "friendly_name": "Default Fifo Workflow", "sid": "WFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "task_reservation_timeout": 120, "url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workflows/WFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "links": { "statistics": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workflows/WFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Statistics", "real_time_statistics": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workflows/WFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/RealTimeStatistics", "cumulative_statistics": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workflows/WFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/CumulativeStatistics" }, "workspace_sid": "WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ] } ' )); $actual = $this->twilio->taskrouter->v1->workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->workflows->read(); $this->assertGreaterThan(0, count($actual)); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "meta": { "first_page_url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workflows?PageSize=50&Page=0", "key": "workflows", "last_page_url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workflows?PageSize=50&Page=0", "next_page_url": null, "page": 0, "page_size": 50, "previous_page_url": null, "url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workflows?PageSize=50&Page=0" }, "workflows": [] } ' )); $actual = $this->twilio->taskrouter->v1->workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->workflows->read(); $this->assertNotNull($actual); } public function testCreateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->taskrouter->v1->workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->workflows->create("friendlyName", "configuration"); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $values = array('FriendlyName' => "friendlyName", 'Configuration' => "configuration", ); $this->assertRequest(new Request( 'post', 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workflows', null, $values )); } public function testCreateResponse() { $this->holodeck->mock(new Response( 201, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "assignment_callback_url": "http://example.com", "configuration": "task-routing:\\n - filter: \\n - 1 == 1\\n target:\\n - queue: WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\\n set-priority: 0\\n", "date_created": "2014-05-14T10:50:02Z", "date_updated": "2014-05-14T23:26:06Z", "document_content_type": "application/json", "fallback_assignment_callback_url": null, "friendly_name": "Default Fifo Workflow", "sid": "WFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "task_reservation_timeout": 120, "url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workflows/WFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "workspace_sid": "WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "links": { "statistics": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workflows/WFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Statistics", "real_time_statistics": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workflows/WFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/RealTimeStatistics", "cumulative_statistics": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workflows/WFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/CumulativeStatistics" } } ' )); $actual = $this->twilio->taskrouter->v1->workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->workflows->create("friendlyName", "configuration"); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/Taskrouter/V1/Workspace/TaskQueue/TaskQueueStatisticsTest.php 0000604 00000010747 15174325133 0026023 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Taskrouter\V1\Workspace\TaskQueue; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class TaskQueueStatisticsTest extends HolodeckTestCase { public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->taskrouter->v1->workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->taskQueues("WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->statistics()->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TaskQueues/WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Statistics' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TaskQueues/WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Statistics", "cumulative": { "avg_task_acceptance_time": 0.0, "end_time": "2015-08-18T08:42:34Z", "reservations_accepted": 0, "reservations_canceled": 0, "reservations_created": 0, "reservations_rejected": 0, "reservations_rescinded": 0, "reservations_timed_out": 0, "start_time": "2015-08-18T08:27:34Z", "tasks_canceled": 0, "tasks_deleted": 0, "tasks_entered": 0, "tasks_moved": 0 }, "realtime": { "activity_statistics": [ { "friendly_name": "Offline", "sid": "WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "workers": 0 }, { "friendly_name": "Idle", "sid": "WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "workers": 0 }, { "friendly_name": "80fa2beb-3a05-11e5-8fc8-98e0d9a1eb73", "sid": "WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "workers": 0 }, { "friendly_name": "Reserved", "sid": "WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "workers": 0 }, { "friendly_name": "Busy", "sid": "WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "workers": 0 }, { "friendly_name": "817ca1c5-3a05-11e5-9292-98e0d9a1eb73", "sid": "WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "workers": 0 } ], "longest_task_waiting_age": 0, "longest_task_waiting_sid": null, "tasks_by_status": { "assigned": 0, "pending": 0, "reserved": 0, "wrapping": 0 }, "total_available_workers": 0, "total_eligible_workers": 0, "total_tasks": 0 }, "task_queue_sid": "WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "workspace_sid": "WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->taskrouter->v1->workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->taskQueues("WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->statistics()->fetch(); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/Taskrouter/V1/Workspace/TaskQueue/TaskQueueCumulativeStatisticsTest.php0000604 00000007362 15174325133 0030061 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Taskrouter\V1\Workspace\TaskQueue; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class TaskQueueCumulativeStatisticsTest extends HolodeckTestCase { public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->taskrouter->v1->workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->taskQueues("WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->cumulativeStatistics()->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TaskQueues/WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/CumulativeStatistics' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "reservations_created": 100, "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "reservations_rejected": 100, "tasks_completed": 100, "end_time": "2015-07-30T20:00:00Z", "tasks_entered": 100, "tasks_canceled": 100, "reservations_accepted": 100, "task_queue_sid": "WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "reservations_timed_out": 100, "url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TaskQueues/WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/CumulativeStatistics", "wait_duration_until_canceled": { "avg": 0, "min": 0, "max": 0, "total": 0 }, "wait_duration_until_accepted": { "avg": 0, "min": 0, "max": 0, "total": 0 }, "split_by_wait_time": { "5": { "above": { "tasks_canceled": 0, "reservations_accepted": 0 }, "below": { "tasks_canceled": 0, "reservations_accepted": 0 } }, "10": { "above": { "tasks_canceled": 0, "reservations_accepted": 0 }, "below": { "tasks_canceled": 0, "reservations_accepted": 0 } } }, "start_time": "2015-07-30T20:00:00Z", "tasks_moved": 100, "reservations_canceled": 100, "workspace_sid": "WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "tasks_deleted": 100, "reservations_rescinded": 100, "avg_task_acceptance_time": 100 } ' )); $actual = $this->twilio->taskrouter->v1->workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->taskQueues("WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->cumulativeStatistics()->fetch(); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/Taskrouter/V1/Workspace/TaskQueue/TaskQueuesStatisticsTest.php 0000604 00000014636 15174325133 0026207 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Taskrouter\V1\Workspace\TaskQueue; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class TaskQueuesStatisticsTest extends HolodeckTestCase { public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->taskrouter->v1->workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->taskQueues ->statistics->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TaskQueues/Statistics' )); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "meta": { "first_page_url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TaskQueues/Statistics?PageSize=50&Page=0", "key": "task_queues_statistics", "next_page_url": null, "page": 0, "page_size": 50, "previous_page_url": null, "url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TaskQueues/Statistics?PageSize=50&Page=0" }, "task_queues_statistics": [ { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "cumulative": { "avg_task_acceptance_time": 0.0, "end_time": "2015-08-18T08:46:15Z", "reservations_accepted": 0, "reservations_canceled": 0, "reservations_created": 0, "reservations_rejected": 0, "reservations_rescinded": 0, "reservations_timed_out": 0, "start_time": "2015-08-18T08:31:15Z", "tasks_canceled": 0, "tasks_deleted": 0, "tasks_entered": 0, "tasks_moved": 0 }, "realtime": { "activity_statistics": [ { "friendly_name": "Offline", "sid": "WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "workers": 0 }, { "friendly_name": "Idle", "sid": "WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "workers": 0 }, { "friendly_name": "80fa2beb-3a05-11e5-8fc8-98e0d9a1eb73", "sid": "WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "workers": 0 }, { "friendly_name": "Reserved", "sid": "WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "workers": 0 }, { "friendly_name": "Busy", "sid": "WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "workers": 0 }, { "friendly_name": "817ca1c5-3a05-11e5-9292-98e0d9a1eb73", "sid": "WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "workers": 0 } ], "longest_task_waiting_age": 0, "longest_task_waiting_sid": null, "tasks_by_status": { "assigned": 0, "pending": 0, "reserved": 0, "wrapping": 0 }, "total_available_workers": 0, "total_eligible_workers": 0, "total_tasks": 0 }, "task_queue_sid": "WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "workspace_sid": "WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ] } ' )); $actual = $this->twilio->taskrouter->v1->workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->taskQueues ->statistics->read(); $this->assertGreaterThan(0, count($actual)); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "meta": { "first_page_url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TaskQueues/Statistics?PageSize=50&Page=0", "key": "task_queues_statistics", "next_page_url": null, "page": 0, "page_size": 50, "previous_page_url": null, "url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TaskQueues/Statistics?PageSize=50&Page=0" }, "task_queues_statistics": [] } ' )); $actual = $this->twilio->taskrouter->v1->workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->taskQueues ->statistics->read(); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/Taskrouter/V1/Workspace/TaskQueue/TaskQueueRealTimeStatisticsTest.php 0000604 00000006311 15174325133 0027436 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Taskrouter\V1\Workspace\TaskQueue; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class TaskQueueRealTimeStatisticsTest extends HolodeckTestCase { public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->taskrouter->v1->workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->taskQueues("WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->realTimeStatistics()->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TaskQueues/WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/RealTimeStatistics' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "longest_task_waiting_age": 100, "task_queue_sid": "WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "tasks_by_status": { "reserved": 0, "pending": 0, "assigned": 0, "wrapping": 0 }, "total_eligible_workers": 100, "activity_statistics": [ { "friendly_name": "Idle", "workers": 0, "sid": "WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" }, { "friendly_name": "Busy", "workers": 9, "sid": "WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" }, { "friendly_name": "Offline", "workers": 6, "sid": "WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" }, { "friendly_name": "Reserved", "workers": 0, "sid": "WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ], "tasks_by_priority": {}, "total_tasks": 100, "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "workspace_sid": "WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "total_available_workers": 100, "url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TaskQueues/WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/RealTimeStatistics" } ' )); $actual = $this->twilio->taskrouter->v1->workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->taskQueues("WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->realTimeStatistics()->fetch(); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/Taskrouter/V1/Workspace/WorkspaceRealTimeStatisticsTest.php 0000604 00000005211 15174325133 0025554 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Taskrouter\V1\Workspace; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class WorkspaceRealTimeStatisticsTest extends HolodeckTestCase { public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->taskrouter->v1->workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->realTimeStatistics()->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/RealTimeStatistics' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/RealTimeStatistics", "tasks_by_priority": {}, "activity_statistics": [ { "friendly_name": "Idle", "workers": 0, "sid": "WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" }, { "friendly_name": "Busy", "workers": 9, "sid": "WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" }, { "friendly_name": "Offline", "workers": 6, "sid": "WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" }, { "friendly_name": "Reserved", "workers": 0, "sid": "WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ], "workspace_sid": "WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "longest_task_waiting_age": 100, "total_workers": 100, "total_tasks": 100, "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "tasks_by_status": {} } ' )); $actual = $this->twilio->taskrouter->v1->workspaces("WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->realTimeStatistics()->fetch(); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/Wireless/V1/Sim/DataSessionTest.php 0000604 00000006740 15174325133 0020571 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Wireless\V1\Sim; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class DataSessionTest extends HolodeckTestCase { public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->wireless->v1->sims("DEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->dataSessions->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://wireless.twilio.com/v1/Sims/DEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/DataSessions' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "data_sessions": [ { "sid": "WNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "sim_sid": "DEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "radio_link": "LTE", "operator_mcc": "", "operator_mnc": "", "operator_country": "", "operator_name": "", "cell_id": "", "cell_location_estimate": {}, "packets_uploaded": 0, "packets_downloaded": 0, "last_updated": "2015-07-30T20:00:00Z", "start": "2015-07-30T20:00:00Z", "end": null }, { "sid": "WNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "sim_sid": "DEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "radio_link": "3G", "operator_mcc": "", "operator_mnc": "", "operator_country": "", "operator_name": "", "cell_id": "", "cell_location_estimate": {}, "packets_uploaded": 0, "packets_downloaded": 0, "last_updated": "2015-07-30T20:00:00Z", "start": "2015-07-30T20:00:00Z", "end": "2015-07-30T20:00:00Z" } ], "meta": { "first_page_url": "https://wireless.twilio.com/v1/Sims/DEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/DataSessions?PageSize=50&Page=0", "key": "data_sessions", "next_page_url": null, "page": 0, "page_size": 50, "previous_page_url": null, "url": "https://wireless.twilio.com/v1/Sims/DEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/DataSessions?PageSize=50&Page=0" } } ' )); $actual = $this->twilio->wireless->v1->sims("DEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->dataSessions->read(); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/Wireless/V1/Sim/UsageRecordTest.php 0000604 00000004657 15174325133 0020564 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Wireless\V1\Sim; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class UsageRecordTest extends HolodeckTestCase { public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->wireless->v1->sims("DEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->usageRecords->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://wireless.twilio.com/v1/Sims/DEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/UsageRecords' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "usage_records": [ { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "commands": {}, "data": {}, "sim_sid": "DEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "period": {} }, { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "commands": {}, "data": {}, "sim_sid": "DEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "period": {} } ], "meta": { "first_page_url": "https://wireless.twilio.com/v1/Sims/DEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/UsageRecords?PageSize=50&Page=0", "key": "usage_records", "next_page_url": null, "page": 0, "page_size": 50, "previous_page_url": null, "url": "https://wireless.twilio.com/v1/Sims/DEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/UsageRecords?PageSize=50&Page=0" } } ' )); $actual = $this->twilio->wireless->v1->sims("DEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->usageRecords->read(); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/Sync/V1/Service/SyncStreamTest.php 0000604 00000023331 15174325133 0020426 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Sync\V1\Service; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class SyncStreamTest extends HolodeckTestCase { public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->sync->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncStreams("TOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Streams/TOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "created_by": "created_by", "date_expires": "2015-07-30T21:00:00Z", "date_created": "2015-07-30T20:00:00Z", "date_updated": "2015-07-30T20:00:00Z", "links": { "messages": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Streams/TOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages" }, "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "sid": "TOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "unique_name": "unique_name", "url": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Streams/TOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->sync->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncStreams("TOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); $this->assertNotNull($actual); } public function testDeleteRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->sync->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncStreams("TOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'delete', 'https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Streams/TOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testDeleteResponse() { $this->holodeck->mock(new Response( 204, null )); $actual = $this->twilio->sync->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncStreams("TOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); $this->assertTrue($actual); } public function testCreateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->sync->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncStreams->create(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'post', 'https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Streams' )); } public function testCreateResponse() { $this->holodeck->mock(new Response( 201, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "created_by": "created_by", "date_expires": "2015-07-30T21:00:00Z", "date_created": "2015-07-30T20:00:00Z", "date_updated": "2015-07-30T20:00:00Z", "links": { "messages": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Streams/TOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages" }, "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "sid": "TOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "unique_name": "unique_name", "url": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Streams/TOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->sync->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncStreams->create(); $this->assertNotNull($actual); } public function testUpdateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->sync->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncStreams("TOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'post', 'https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Streams/TOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testUpdateResponse() { $this->holodeck->mock(new Response( 200, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "created_by": "created_by", "date_expires": "2015-07-30T21:00:00Z", "date_created": "2015-07-30T20:00:00Z", "date_updated": "2015-07-30T20:00:00Z", "links": { "messages": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Streams/TOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages" }, "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "sid": "TOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "unique_name": "unique_name", "url": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Streams/TOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->sync->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncStreams("TOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); $this->assertNotNull($actual); } public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->sync->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncStreams->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Streams' )); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "streams": [], "meta": { "first_page_url": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Streams?PageSize=50&Page=0", "key": "streams", "next_page_url": null, "page": 0, "page_size": 50, "previous_page_url": null, "url": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Streams?PageSize=50&Page=0" } } ' )); $actual = $this->twilio->sync->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncStreams->read(); $this->assertNotNull($actual); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "streams": [ { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "created_by": "created_by", "date_expires": "2015-07-30T21:00:00Z", "date_created": "2015-07-30T20:00:00Z", "date_updated": "2015-07-30T20:00:00Z", "links": { "messages": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Streams/TOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages" }, "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "sid": "TOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "unique_name": "unique_name", "url": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Streams/TOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ], "meta": { "first_page_url": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Streams?PageSize=50&Page=0", "key": "streams", "next_page_url": null, "page": 0, "page_size": 50, "previous_page_url": null, "url": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Streams?PageSize=50&Page=0" } } ' )); $actual = $this->twilio->sync->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncStreams->read(); $this->assertGreaterThan(0, count($actual)); } } sdk/Twilio/Tests/Integration/Sync/V1/Service/DocumentTest.php 0000604 00000024043 15174325133 0020115 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Sync\V1\Service; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class DocumentTest extends HolodeckTestCase { public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->sync->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->documents("ETaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Documents/ETaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "created_by": "created_by", "data": {}, "date_expires": "2015-07-30T21:00:00Z", "date_created": "2015-07-30T20:00:00Z", "date_updated": "2015-07-30T20:00:00Z", "revision": "revision", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "sid": "ETaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "unique_name": "unique_name", "url": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Documents/ETaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "links": { "permissions": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Documents/ETaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Permissions" } } ' )); $actual = $this->twilio->sync->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->documents("ETaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); $this->assertNotNull($actual); } public function testDeleteRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->sync->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->documents("ETaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'delete', 'https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Documents/ETaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testDeleteResponse() { $this->holodeck->mock(new Response( 204, null )); $actual = $this->twilio->sync->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->documents("ETaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); $this->assertTrue($actual); } public function testCreateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->sync->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->documents->create(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'post', 'https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Documents' )); } public function testCreateResponse() { $this->holodeck->mock(new Response( 201, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "created_by": "created_by", "data": {}, "date_expires": "2015-07-30T21:00:00Z", "date_created": "2015-07-30T20:00:00Z", "date_updated": "2015-07-30T20:00:00Z", "revision": "revision", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "sid": "ETaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "unique_name": "unique_name", "url": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Documents/ETaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "links": { "permissions": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Documents/ETaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Permissions" } } ' )); $actual = $this->twilio->sync->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->documents->create(); $this->assertNotNull($actual); } public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->sync->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->documents->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Documents' )); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "documents": [], "meta": { "first_page_url": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Documents?PageSize=50&Page=0", "key": "documents", "next_page_url": null, "page": 0, "page_size": 50, "previous_page_url": null, "url": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Documents?PageSize=50&Page=0" } } ' )); $actual = $this->twilio->sync->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->documents->read(); $this->assertNotNull($actual); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "documents": [ { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "created_by": "created_by", "data": {}, "date_expires": "2015-07-30T21:00:00Z", "date_created": "2015-07-30T20:00:00Z", "date_updated": "2015-07-30T20:00:00Z", "revision": "revision", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "sid": "ETaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "unique_name": "unique_name", "url": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Documents/ETaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "links": { "permissions": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Documents/ETaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Permissions" } } ], "meta": { "first_page_url": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Documents?PageSize=50&Page=0", "key": "documents", "next_page_url": null, "page": 0, "page_size": 50, "previous_page_url": null, "url": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Documents?PageSize=50&Page=0" } } ' )); $actual = $this->twilio->sync->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->documents->read(); $this->assertGreaterThan(0, count($actual)); } public function testUpdateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->sync->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->documents("ETaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'post', 'https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Documents/ETaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testUpdateResponse() { $this->holodeck->mock(new Response( 200, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "created_by": "created_by", "data": {}, "date_expires": "2015-07-30T21:00:00Z", "date_created": "2015-07-30T20:00:00Z", "date_updated": "2015-07-30T20:00:00Z", "revision": "revision", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "sid": "ETaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "unique_name": "unique_name", "url": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Documents/ETaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "links": { "permissions": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Documents/ETaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Permissions" } } ' )); $actual = $this->twilio->sync->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->documents("ETaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/Sync/V1/Service/SyncMapTest.php 0000604 00000024622 15174325133 0017714 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Sync\V1\Service; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class SyncMapTest extends HolodeckTestCase { public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->sync->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncMaps("MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps/MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "created_by": "created_by", "date_expires": "2015-07-30T21:00:00Z", "date_created": "2015-07-30T20:00:00Z", "date_updated": "2015-07-30T20:00:00Z", "links": { "items": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps/MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Items", "permissions": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps/MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Permissions" }, "revision": "revision", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "sid": "MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "unique_name": "unique_name", "url": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps/MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->sync->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncMaps("MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); $this->assertNotNull($actual); } public function testDeleteRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->sync->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncMaps("MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'delete', 'https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps/MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testDeleteResponse() { $this->holodeck->mock(new Response( 204, null )); $actual = $this->twilio->sync->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncMaps("MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); $this->assertTrue($actual); } public function testCreateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->sync->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncMaps->create(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'post', 'https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps' )); } public function testCreateResponse() { $this->holodeck->mock(new Response( 201, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "created_by": "created_by", "date_expires": "2015-07-30T21:00:00Z", "date_created": "2015-07-30T20:00:00Z", "date_updated": "2015-07-30T20:00:00Z", "links": { "items": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps/MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Items", "permissions": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps/MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Permissions" }, "revision": "revision", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "sid": "MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "unique_name": "unique_name", "url": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps/MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->sync->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncMaps->create(); $this->assertNotNull($actual); } public function testUpdateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->sync->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncMaps("MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'post', 'https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps/MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testUpdateResponse() { $this->holodeck->mock(new Response( 200, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "created_by": "created_by", "date_expires": "2015-07-30T21:00:00Z", "date_created": "2015-07-30T20:00:00Z", "date_updated": "2015-07-30T20:00:00Z", "links": { "items": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps/MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Items", "permissions": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps/MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Permissions" }, "revision": "revision", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "sid": "MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "unique_name": "unique_name", "url": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps/MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->sync->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncMaps("MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); $this->assertNotNull($actual); } public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->sync->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncMaps->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps' )); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "maps": [], "meta": { "first_page_url": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps?PageSize=50&Page=0", "key": "maps", "next_page_url": null, "page": 0, "page_size": 50, "previous_page_url": null, "url": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps?PageSize=50&Page=0" } } ' )); $actual = $this->twilio->sync->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncMaps->read(); $this->assertNotNull($actual); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "maps": [ { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "created_by": "created_by", "date_expires": "2015-07-30T21:00:00Z", "date_created": "2015-07-30T20:00:00Z", "date_updated": "2015-07-30T20:00:00Z", "links": { "items": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps/MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Items", "permissions": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps/MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Permissions" }, "revision": "revision", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "sid": "MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "unique_name": "unique_name", "url": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps/MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ], "meta": { "first_page_url": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps?PageSize=50&Page=0", "key": "maps", "next_page_url": null, "page": 0, "page_size": 50, "previous_page_url": null, "url": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps?PageSize=50&Page=0" } } ' )); $actual = $this->twilio->sync->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncMaps->read(); $this->assertGreaterThan(0, count($actual)); } } sdk/Twilio/Tests/Integration/Sync/V1/Service/SyncStream/StreamMessageTest.php 0000604 00000003324 15174325133 0023166 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Sync\V1\Service\SyncStream; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Serialize; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class StreamMessageTest extends HolodeckTestCase { public function testCreateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->sync->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncStreams("TOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->streamMessages->create("{}"); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $values = array('Data' => Serialize::jsonObject("{}"), ); $this->assertRequest(new Request( 'post', 'https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Streams/TOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages', null, $values )); } public function testCreateResponse() { $this->holodeck->mock(new Response( 201, ' { "sid": "TZaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "data": {} } ' )); $actual = $this->twilio->sync->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncStreams("TOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->streamMessages->create("{}"); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/Sync/V1/Service/SyncListTest.php 0000604 00000024667 15174325133 0020123 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Sync\V1\Service; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class SyncListTest extends HolodeckTestCase { public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->sync->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncLists("ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists/ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "created_by": "created_by", "date_expires": "2015-07-30T21:00:00Z", "date_created": "2015-07-30T20:00:00Z", "date_updated": "2015-07-30T20:00:00Z", "links": { "items": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists/ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Items", "permissions": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists/ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Permissions" }, "revision": "revision", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "sid": "ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "unique_name": "unique_name", "url": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists/ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->sync->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncLists("ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); $this->assertNotNull($actual); } public function testDeleteRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->sync->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncLists("ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'delete', 'https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists/ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testDeleteResponse() { $this->holodeck->mock(new Response( 204, null )); $actual = $this->twilio->sync->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncLists("ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); $this->assertTrue($actual); } public function testCreateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->sync->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncLists->create(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'post', 'https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists' )); } public function testCreateResponse() { $this->holodeck->mock(new Response( 201, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "created_by": "created_by", "date_expires": "2015-07-30T21:00:00Z", "date_created": "2015-07-30T20:00:00Z", "date_updated": "2015-07-30T20:00:00Z", "links": { "items": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists/ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Items", "permissions": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists/ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Permissions" }, "revision": "revision", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "sid": "ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "unique_name": "unique_name", "url": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists/ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->sync->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncLists->create(); $this->assertNotNull($actual); } public function testUpdateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->sync->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncLists("ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'post', 'https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists/ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testUpdateResponse() { $this->holodeck->mock(new Response( 200, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "created_by": "created_by", "date_expires": "2015-07-30T21:00:00Z", "date_created": "2015-07-30T20:00:00Z", "date_updated": "2015-07-30T20:00:00Z", "links": { "items": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists/ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Items", "permissions": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists/ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Permissions" }, "revision": "revision", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "sid": "ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "unique_name": "unique_name", "url": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists/ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->sync->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncLists("ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); $this->assertNotNull($actual); } public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->sync->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncLists->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists' )); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "lists": [], "meta": { "first_page_url": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists?PageSize=50&Page=0", "key": "lists", "next_page_url": null, "page": 0, "page_size": 50, "previous_page_url": null, "url": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists?PageSize=50&Page=0" } } ' )); $actual = $this->twilio->sync->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncLists->read(); $this->assertNotNull($actual); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "lists": [ { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "created_by": "created_by", "date_expires": "2015-07-30T21:00:00Z", "date_created": "2015-07-30T20:00:00Z", "date_updated": "2015-07-30T20:00:00Z", "links": { "items": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists/ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Items", "permissions": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists/ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Permissions" }, "revision": "revision", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "sid": "ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "unique_name": "unique_name", "url": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists/ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ], "meta": { "first_page_url": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists?PageSize=50&Page=0", "key": "lists", "next_page_url": null, "page": 0, "page_size": 50, "previous_page_url": null, "url": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists?PageSize=50&Page=0" } } ' )); $actual = $this->twilio->sync->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncLists->read(); $this->assertGreaterThan(0, count($actual)); } } sdk/Twilio/Tests/Integration/Sync/V1/Service/SyncMap/SyncMapPermissionTest.php 0000604 00000020520 15174325133 0023330 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Sync\V1\Service\SyncMap; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Serialize; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class SyncMapPermissionTest extends HolodeckTestCase { public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->sync->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncMaps("MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncMapPermissions("identity")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps/MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Permissions/identity' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "map_sid": "MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "identity": "identity", "read": true, "write": true, "manage": true, "url": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps/MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Permissions/identity" } ' )); $actual = $this->twilio->sync->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncMaps("MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncMapPermissions("identity")->fetch(); $this->assertNotNull($actual); } public function testDeleteRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->sync->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncMaps("MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncMapPermissions("identity")->delete(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'delete', 'https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps/MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Permissions/identity' )); } public function testDeleteResponse() { $this->holodeck->mock(new Response( 204, null )); $actual = $this->twilio->sync->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncMaps("MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncMapPermissions("identity")->delete(); $this->assertTrue($actual); } public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->sync->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncMaps("MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncMapPermissions->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps/MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Permissions' )); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "permissions": [], "meta": { "first_page_url": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps/sidOrUniqueName/Permissions?PageSize=50&Page=0", "key": "permissions", "next_page_url": null, "page": 0, "page_size": 50, "previous_page_url": null, "url": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps/sidOrUniqueName/Permissions?PageSize=50&Page=0" } } ' )); $actual = $this->twilio->sync->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncMaps("MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncMapPermissions->read(); $this->assertNotNull($actual); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "permissions": [ { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "map_sid": "MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "identity": "identity", "read": true, "write": true, "manage": true, "url": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps/MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Permissions/identity" } ], "meta": { "first_page_url": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps/sidOrUniqueName/Permissions?PageSize=50&Page=0", "key": "permissions", "next_page_url": null, "page": 0, "page_size": 50, "previous_page_url": null, "url": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps/sidOrUniqueName/Permissions?PageSize=50&Page=0" } } ' )); $actual = $this->twilio->sync->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncMaps("MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncMapPermissions->read(); $this->assertGreaterThan(0, count($actual)); } public function testUpdateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->sync->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncMaps("MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncMapPermissions("identity")->update(True, True, True); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $values = array( 'Read' => Serialize::booleanToString(True), 'Write' => Serialize::booleanToString(True), 'Manage' => Serialize::booleanToString(True), ); $this->assertRequest(new Request( 'post', 'https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps/MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Permissions/identity', null, $values )); } public function testUpdateResponse() { $this->holodeck->mock(new Response( 200, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "map_sid": "MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "identity": "identity", "read": true, "write": true, "manage": true, "url": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps/MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Permissions/identity" } ' )); $actual = $this->twilio->sync->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncMaps("MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncMapPermissions("identity")->update(True, True, True); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/Sync/V1/Service/SyncMap/SyncMapItemTest.php 0000604 00000024522 15174325133 0022104 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Sync\V1\Service\SyncMap; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Serialize; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class SyncMapItemTest extends HolodeckTestCase { public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->sync->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncMaps("MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncMapItems("key")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps/MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Items/key' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "created_by": "created_by", "data": {}, "date_expires": "2015-07-30T21:00:00Z", "date_created": "2015-07-30T20:00:00Z", "date_updated": "2015-07-30T20:00:00Z", "key": "key", "map_sid": "MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "revision": "revision", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "url": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps/MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Items/key" } ' )); $actual = $this->twilio->sync->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncMaps("MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncMapItems("key")->fetch(); $this->assertNotNull($actual); } public function testDeleteRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->sync->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncMaps("MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncMapItems("key")->delete(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'delete', 'https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps/MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Items/key' )); } public function testDeleteResponse() { $this->holodeck->mock(new Response( 204, null )); $actual = $this->twilio->sync->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncMaps("MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncMapItems("key")->delete(); $this->assertTrue($actual); } public function testCreateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->sync->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncMaps("MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncMapItems->create("key", "{}"); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $values = array('Key' => "key", 'Data' => Serialize::jsonObject("{}"), ); $this->assertRequest(new Request( 'post', 'https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps/MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Items', null, $values )); } public function testCreateResponse() { $this->holodeck->mock(new Response( 201, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "created_by": "created_by", "data": {}, "date_expires": "2015-07-30T21:00:00Z", "date_created": "2015-07-30T20:00:00Z", "date_updated": "2015-07-30T20:00:00Z", "key": "key", "map_sid": "MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "revision": "revision", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "url": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps/MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Items/key" } ' )); $actual = $this->twilio->sync->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncMaps("MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncMapItems->create("key", "{}"); $this->assertNotNull($actual); } public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->sync->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncMaps("MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncMapItems->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps/MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Items' )); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "items": [], "meta": { "first_page_url": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps/MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Items?PageSize=50&Page=0", "key": "items", "next_page_url": null, "page": 0, "page_size": 50, "previous_page_url": null, "url": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps/MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Items?PageSize=50&Page=0" } } ' )); $actual = $this->twilio->sync->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncMaps("MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncMapItems->read(); $this->assertNotNull($actual); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "items": [ { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "created_by": "created_by", "data": {}, "date_expires": "2015-07-30T21:00:00Z", "date_created": "2015-07-30T20:00:00Z", "date_updated": "2015-07-30T20:00:00Z", "key": "key", "map_sid": "MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "revision": "revision", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "url": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps/MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Items/key" } ], "meta": { "first_page_url": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps/MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Items?PageSize=50&Page=0", "key": "items", "next_page_url": null, "page": 0, "page_size": 50, "previous_page_url": null, "url": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps/MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Items?PageSize=50&Page=0" } } ' )); $actual = $this->twilio->sync->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncMaps("MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncMapItems->read(); $this->assertGreaterThan(0, count($actual)); } public function testUpdateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->sync->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncMaps("MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncMapItems("key")->update(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'post', 'https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps/MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Items/key' )); } public function testUpdateResponse() { $this->holodeck->mock(new Response( 200, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "created_by": "created_by", "data": {}, "date_expires": "2015-07-30T21:00:00Z", "date_created": "2015-07-30T20:00:00Z", "date_updated": "2015-07-30T20:00:00Z", "key": "key", "map_sid": "MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "revision": "revision", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "url": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps/MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Items/key" } ' )); $actual = $this->twilio->sync->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncMaps("MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncMapItems("key")->update(); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/Sync/V1/Service/Document/DocumentPermissionTest.php 0000604 00000020652 15174325133 0023746 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Sync\V1\Service\Document; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Serialize; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class DocumentPermissionTest extends HolodeckTestCase { public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->sync->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->documents("ETaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->documentPermissions("identity")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Documents/ETaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Permissions/identity' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "document_sid": "ETaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "identity": "identity", "read": true, "write": true, "manage": true, "url": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Documents/ETaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Permissions/identity" } ' )); $actual = $this->twilio->sync->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->documents("ETaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->documentPermissions("identity")->fetch(); $this->assertNotNull($actual); } public function testDeleteRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->sync->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->documents("ETaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->documentPermissions("identity")->delete(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'delete', 'https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Documents/ETaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Permissions/identity' )); } public function testDeleteResponse() { $this->holodeck->mock(new Response( 204, null )); $actual = $this->twilio->sync->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->documents("ETaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->documentPermissions("identity")->delete(); $this->assertTrue($actual); } public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->sync->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->documents("ETaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->documentPermissions->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Documents/ETaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Permissions' )); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "permissions": [], "meta": { "first_page_url": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Documents/sidOrUniqueName/Permissions?PageSize=50&Page=0", "key": "permissions", "next_page_url": null, "page": 0, "page_size": 50, "previous_page_url": null, "url": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Documents/sidOrUniqueName/Permissions?PageSize=50&Page=0" } } ' )); $actual = $this->twilio->sync->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->documents("ETaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->documentPermissions->read(); $this->assertNotNull($actual); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "permissions": [ { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "document_sid": "ETaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "identity": "identity", "read": true, "write": true, "manage": true, "url": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Documents/ETaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Permissions/identity" } ], "meta": { "first_page_url": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Documents/sidOrUniqueName/Permissions?PageSize=50&Page=0", "key": "permissions", "next_page_url": null, "page": 0, "page_size": 50, "previous_page_url": null, "url": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Documents/sidOrUniqueName/Permissions?PageSize=50&Page=0" } } ' )); $actual = $this->twilio->sync->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->documents("ETaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->documentPermissions->read(); $this->assertGreaterThan(0, count($actual)); } public function testUpdateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->sync->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->documents("ETaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->documentPermissions("identity")->update(True, True, True); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $values = array( 'Read' => Serialize::booleanToString(True), 'Write' => Serialize::booleanToString(True), 'Manage' => Serialize::booleanToString(True), ); $this->assertRequest(new Request( 'post', 'https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Documents/ETaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Permissions/identity', null, $values )); } public function testUpdateResponse() { $this->holodeck->mock(new Response( 200, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "document_sid": "ETaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "identity": "identity", "read": true, "write": true, "manage": true, "url": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Documents/ETaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Permissions/identity" } ' )); $actual = $this->twilio->sync->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->documents("ETaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->documentPermissions("identity")->update(True, True, True); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/Sync/V1/Service/SyncList/SyncListItemTest.php 0000604 00000024477 15174325133 0022511 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Sync\V1\Service\SyncList; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Serialize; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class SyncListItemTest extends HolodeckTestCase { public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->sync->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncLists("ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncListItems(1)->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists/ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Items/1' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "created_by": "created_by", "data": {}, "date_expires": "2015-07-30T21:00:00Z", "date_created": "2015-07-30T20:00:00Z", "date_updated": "2015-07-30T20:00:00Z", "index": 100, "list_sid": "ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "revision": "revision", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "url": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists/ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Items/100" } ' )); $actual = $this->twilio->sync->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncLists("ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncListItems(1)->fetch(); $this->assertNotNull($actual); } public function testDeleteRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->sync->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncLists("ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncListItems(1)->delete(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'delete', 'https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists/ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Items/1' )); } public function testDeleteResponse() { $this->holodeck->mock(new Response( 204, null )); $actual = $this->twilio->sync->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncLists("ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncListItems(1)->delete(); $this->assertTrue($actual); } public function testCreateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->sync->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncLists("ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncListItems->create("{}"); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $values = array('Data' => Serialize::jsonObject("{}"), ); $this->assertRequest(new Request( 'post', 'https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists/ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Items', null, $values )); } public function testCreateResponse() { $this->holodeck->mock(new Response( 201, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "created_by": "created_by", "data": {}, "date_expires": "2015-07-30T21:00:00Z", "date_created": "2015-07-30T20:00:00Z", "date_updated": "2015-07-30T20:00:00Z", "index": 100, "list_sid": "ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "revision": "revision", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "url": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists/ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Items/100" } ' )); $actual = $this->twilio->sync->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncLists("ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncListItems->create("{}"); $this->assertNotNull($actual); } public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->sync->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncLists("ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncListItems->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists/ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Items' )); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "items": [], "meta": { "first_page_url": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists/ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Items?PageSize=50&Page=0", "key": "items", "next_page_url": null, "page": 0, "page_size": 50, "previous_page_url": null, "url": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists/ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Items?PageSize=50&Page=0" } } ' )); $actual = $this->twilio->sync->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncLists("ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncListItems->read(); $this->assertNotNull($actual); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "items": [ { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "created_by": "created_by", "data": {}, "date_expires": "2015-07-30T21:00:00Z", "date_created": "2015-07-30T20:00:00Z", "date_updated": "2015-07-30T20:00:00Z", "index": 100, "list_sid": "ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "revision": "revision", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "url": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists/ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Items/100" } ], "meta": { "first_page_url": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists/ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Items?PageSize=50&Page=0", "key": "items", "next_page_url": null, "page": 0, "page_size": 50, "previous_page_url": null, "url": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists/ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Items?PageSize=50&Page=0" } } ' )); $actual = $this->twilio->sync->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncLists("ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncListItems->read(); $this->assertGreaterThan(0, count($actual)); } public function testUpdateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->sync->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncLists("ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncListItems(1)->update(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'post', 'https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists/ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Items/1' )); } public function testUpdateResponse() { $this->holodeck->mock(new Response( 200, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "created_by": "created_by", "data": {}, "date_expires": "2015-07-30T21:00:00Z", "date_created": "2015-07-30T20:00:00Z", "date_updated": "2015-07-30T20:00:00Z", "index": 100, "list_sid": "ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "revision": "revision", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "url": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists/ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Items/100" } ' )); $actual = $this->twilio->sync->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncLists("ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncListItems(1)->update(); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/Sync/V1/Service/SyncList/SyncListPermissionTest.php 0000604 00000020562 15174325133 0023732 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Sync\V1\Service\SyncList; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Serialize; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class SyncListPermissionTest extends HolodeckTestCase { public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->sync->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncLists("ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncListPermissions("identity")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists/ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Permissions/identity' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "list_sid": "ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "identity": "identity", "read": true, "write": true, "manage": true, "url": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists/ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Permissions/identity" } ' )); $actual = $this->twilio->sync->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncLists("ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncListPermissions("identity")->fetch(); $this->assertNotNull($actual); } public function testDeleteRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->sync->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncLists("ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncListPermissions("identity")->delete(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'delete', 'https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists/ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Permissions/identity' )); } public function testDeleteResponse() { $this->holodeck->mock(new Response( 204, null )); $actual = $this->twilio->sync->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncLists("ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncListPermissions("identity")->delete(); $this->assertTrue($actual); } public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->sync->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncLists("ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncListPermissions->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists/ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Permissions' )); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "permissions": [], "meta": { "first_page_url": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists/sidOrUniqueName/Permissions?PageSize=50&Page=0", "key": "permissions", "next_page_url": null, "page": 0, "page_size": 50, "previous_page_url": null, "url": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists/sidOrUniqueName/Permissions?PageSize=50&Page=0" } } ' )); $actual = $this->twilio->sync->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncLists("ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncListPermissions->read(); $this->assertNotNull($actual); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "permissions": [ { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "list_sid": "ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "identity": "identity", "read": true, "write": true, "manage": true, "url": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists/ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Permissions/identity" } ], "meta": { "first_page_url": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists/sidOrUniqueName/Permissions?PageSize=50&Page=0", "key": "permissions", "next_page_url": null, "page": 0, "page_size": 50, "previous_page_url": null, "url": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists/sidOrUniqueName/Permissions?PageSize=50&Page=0" } } ' )); $actual = $this->twilio->sync->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncLists("ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncListPermissions->read(); $this->assertGreaterThan(0, count($actual)); } public function testUpdateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->sync->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncLists("ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncListPermissions("identity")->update(True, True, True); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $values = array( 'Read' => Serialize::booleanToString(True), 'Write' => Serialize::booleanToString(True), 'Manage' => Serialize::booleanToString(True), ); $this->assertRequest(new Request( 'post', 'https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists/ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Permissions/identity', null, $values )); } public function testUpdateResponse() { $this->holodeck->mock(new Response( 200, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "list_sid": "ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "identity": "identity", "read": true, "write": true, "manage": true, "url": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists/ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Permissions/identity" } ' )); $actual = $this->twilio->sync->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncLists("ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncListPermissions("identity")->update(True, True, True); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/Sync/V1/ServiceTest.php 0000604 00000022740 15174325133 0016341 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Sync\V1; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class ServiceTest extends HolodeckTestCase { public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->sync->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "2015-07-30T20:00:00Z", "date_updated": "2015-07-30T20:00:00Z", "friendly_name": "friendly_name", "links": { "documents": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Documents", "lists": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists", "maps": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps", "streams": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Streams" }, "sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "unique_name": "unique_name", "url": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "webhook_url": "http://www.example.com", "reachability_webhooks_enabled": false, "acl_enabled": false } ' )); $actual = $this->twilio->sync->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); $this->assertNotNull($actual); } public function testDeleteRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->sync->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'delete', 'https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testDeleteResponse() { $this->holodeck->mock(new Response( 204, null )); $actual = $this->twilio->sync->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); $this->assertTrue($actual); } public function testCreateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->sync->v1->services->create(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'post', 'https://sync.twilio.com/v1/Services' )); } public function testCreateResponse() { $this->holodeck->mock(new Response( 201, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "2015-07-30T20:00:00Z", "date_updated": "2015-07-30T20:00:00Z", "friendly_name": "friendly_name", "links": { "documents": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Documents", "lists": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists", "maps": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps", "streams": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Streams" }, "sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "unique_name": "unique_name", "url": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "webhook_url": "http://www.example.com", "reachability_webhooks_enabled": false, "acl_enabled": true } ' )); $actual = $this->twilio->sync->v1->services->create(); $this->assertNotNull($actual); } public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->sync->v1->services->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://sync.twilio.com/v1/Services' )); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "meta": { "first_page_url": "https://sync.twilio.com/v1/Services?PageSize=50&Page=0", "key": "services", "next_page_url": null, "page": 0, "page_size": 50, "previous_page_url": null, "url": "https://sync.twilio.com/v1/Services?PageSize=50&Page=0" }, "services": [] } ' )); $actual = $this->twilio->sync->v1->services->read(); $this->assertNotNull($actual); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "meta": { "first_page_url": "https://sync.twilio.com/v1/Services?PageSize=50&Page=0", "key": "services", "next_page_url": null, "page": 0, "page_size": 50, "previous_page_url": null, "url": "https://sync.twilio.com/v1/Services?PageSize=50&Page=0" }, "services": [ { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "2015-07-30T20:00:00Z", "date_updated": "2015-07-30T20:00:00Z", "friendly_name": "friendly_name", "links": { "documents": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Documents", "lists": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists", "maps": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps", "streams": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Streams" }, "sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "unique_name": "unique_name", "url": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "webhook_url": "http://www.example.com", "reachability_webhooks_enabled": false, "acl_enabled": false } ] } ' )); $actual = $this->twilio->sync->v1->services->read(); $this->assertGreaterThan(0, count($actual)); } public function testUpdateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->sync->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'post', 'https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testUpdateResponse() { $this->holodeck->mock(new Response( 200, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "2015-07-30T20:00:00Z", "date_updated": "2015-07-30T20:00:00Z", "friendly_name": "friendly_name", "links": { "documents": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Documents", "lists": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists", "maps": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps", "streams": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Streams" }, "sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "unique_name": "unique_name", "url": "https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "webhook_url": "http://www.example.com", "reachability_webhooks_enabled": false, "acl_enabled": true } ' )); $actual = $this->twilio->sync->v1->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/Accounts/V1/Credential/PublicKeyTest.php 0000604 00000017360 15174325133 0021547 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Accounts\V1\Credential; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class PublicKeyTest extends HolodeckTestCase { public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->accounts->v1->credentials ->publicKey->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://accounts.twilio.com/v1/Credentials/PublicKeys' )); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "credentials": [], "meta": { "first_page_url": "https://accounts.twilio.com/v1/Credentials/PublicKeys?PageSize=50&Page=0", "key": "credentials", "next_page_url": null, "page": 0, "page_size": 50, "previous_page_url": null, "url": "https://accounts.twilio.com/v1/Credentials/PublicKeys?PageSize=50&Page=0" } } ' )); $actual = $this->twilio->accounts->v1->credentials ->publicKey->read(); $this->assertNotNull($actual); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "credentials": [ { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "2015-07-31T04:00:00Z", "date_updated": "2015-07-31T04:00:00Z", "friendly_name": "friendly_name", "sid": "CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "url": "https://accounts.twilio.com/v1/Credentials/PublicKeys/CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ], "meta": { "first_page_url": "https://accounts.twilio.com/v1/Credentials/PublicKeys?PageSize=50&Page=0", "key": "credentials", "next_page_url": null, "page": 0, "page_size": 50, "previous_page_url": null, "url": "https://accounts.twilio.com/v1/Credentials/PublicKeys?PageSize=50&Page=0" } } ' )); $actual = $this->twilio->accounts->v1->credentials ->publicKey->read(); $this->assertGreaterThan(0, count($actual)); } public function testCreateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->accounts->v1->credentials ->publicKey->create("publickey"); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $values = array('PublicKey' => "publickey", ); $this->assertRequest(new Request( 'post', 'https://accounts.twilio.com/v1/Credentials/PublicKeys', null, $values )); } public function testCreateResponse() { $this->holodeck->mock(new Response( 201, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "2015-07-31T04:00:00Z", "date_updated": "2015-07-31T04:00:00Z", "friendly_name": "friendly_name", "sid": "CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "url": "https://accounts.twilio.com/v1/Credentials/PublicKeys/CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->accounts->v1->credentials ->publicKey->create("publickey"); $this->assertNotNull($actual); } public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->accounts->v1->credentials ->publicKey("CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://accounts.twilio.com/v1/Credentials/PublicKeys/CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "2015-07-31T04:00:00Z", "date_updated": "2015-07-31T04:00:00Z", "friendly_name": "friendly_name", "sid": "CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "url": "https://accounts.twilio.com/v1/Credentials/PublicKeys/CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->accounts->v1->credentials ->publicKey("CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); $this->assertNotNull($actual); } public function testUpdateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->accounts->v1->credentials ->publicKey("CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'post', 'https://accounts.twilio.com/v1/Credentials/PublicKeys/CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testUpdateResponse() { $this->holodeck->mock(new Response( 200, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "2015-07-31T04:00:00Z", "date_updated": "2015-07-31T04:00:00Z", "friendly_name": "friendly_name", "sid": "CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "url": "https://accounts.twilio.com/v1/Credentials/PublicKeys/CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->accounts->v1->credentials ->publicKey("CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); $this->assertNotNull($actual); } public function testDeleteRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->accounts->v1->credentials ->publicKey("CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'delete', 'https://accounts.twilio.com/v1/Credentials/PublicKeys/CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testDeleteResponse() { $this->holodeck->mock(new Response( 204, null )); $actual = $this->twilio->accounts->v1->credentials ->publicKey("CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); $this->assertTrue($actual); } } sdk/Twilio/Tests/Integration/Accounts/V1/Credential/AwsTest.php 0000604 00000017353 15174325133 0020414 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Accounts\V1\Credential; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class AwsTest extends HolodeckTestCase { public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->accounts->v1->credentials ->aws->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://accounts.twilio.com/v1/Credentials/AWS' )); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "credentials": [], "meta": { "first_page_url": "https://accounts.twilio.com/v1/Credentials/AWS?PageSize=50&Page=0", "key": "credentials", "next_page_url": null, "page": 0, "page_size": 50, "previous_page_url": null, "url": "https://accounts.twilio.com/v1/Credentials/AWS?PageSize=50&Page=0" } } ' )); $actual = $this->twilio->accounts->v1->credentials ->aws->read(); $this->assertNotNull($actual); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "credentials": [ { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "2015-07-31T04:00:00Z", "date_updated": "2015-07-31T04:00:00Z", "friendly_name": "friendly_name", "sid": "CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "url": "https://accounts.twilio.com/v1/Credentials/AWS/CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ], "meta": { "first_page_url": "https://accounts.twilio.com/v1/Credentials/AWS?PageSize=50&Page=0", "key": "credentials", "next_page_url": null, "page": 0, "page_size": 50, "previous_page_url": null, "url": "https://accounts.twilio.com/v1/Credentials/AWS?PageSize=50&Page=0" } } ' )); $actual = $this->twilio->accounts->v1->credentials ->aws->read(); $this->assertGreaterThan(0, count($actual)); } public function testCreateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->accounts->v1->credentials ->aws->create("AKIAIOSFODNN7EXAMPLE:wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $values = array('Credentials' => "AKIAIOSFODNN7EXAMPLE:wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY", ); $this->assertRequest(new Request( 'post', 'https://accounts.twilio.com/v1/Credentials/AWS', null, $values )); } public function testCreateResponse() { $this->holodeck->mock(new Response( 201, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "2015-07-31T04:00:00Z", "date_updated": "2015-07-31T04:00:00Z", "friendly_name": "friendly_name", "sid": "CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "url": "https://accounts.twilio.com/v1/Credentials/AWS/CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->accounts->v1->credentials ->aws->create("AKIAIOSFODNN7EXAMPLE:wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"); $this->assertNotNull($actual); } public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->accounts->v1->credentials ->aws("CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://accounts.twilio.com/v1/Credentials/AWS/CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "2015-07-31T04:00:00Z", "date_updated": "2015-07-31T04:00:00Z", "friendly_name": "friendly_name", "sid": "CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "url": "https://accounts.twilio.com/v1/Credentials/AWS/CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->accounts->v1->credentials ->aws("CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); $this->assertNotNull($actual); } public function testUpdateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->accounts->v1->credentials ->aws("CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'post', 'https://accounts.twilio.com/v1/Credentials/AWS/CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testUpdateResponse() { $this->holodeck->mock(new Response( 200, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "2015-07-31T04:00:00Z", "date_updated": "2015-07-31T04:00:00Z", "friendly_name": "friendly_name", "sid": "CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "url": "https://accounts.twilio.com/v1/Credentials/AWS/CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->accounts->v1->credentials ->aws("CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); $this->assertNotNull($actual); } public function testDeleteRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->accounts->v1->credentials ->aws("CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'delete', 'https://accounts.twilio.com/v1/Credentials/AWS/CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testDeleteResponse() { $this->holodeck->mock(new Response( 204, null )); $actual = $this->twilio->accounts->v1->credentials ->aws("CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); $this->assertTrue($actual); } } sdk/Twilio/Tests/Integration/Preview/Sync/ServiceTest.php 0000604 00000022015 15174325133 0017467 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Preview\Sync; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class ServiceTest extends HolodeckTestCase { public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->sync->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "2015-07-30T20:00:00Z", "date_updated": "2015-07-30T20:00:00Z", "friendly_name": "friendly_name", "links": { "documents": "https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Documents", "lists": "https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists", "maps": "https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps" }, "sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "url": "https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "webhook_url": "http://www.example.com", "reachability_webhooks_enabled": false, "acl_enabled": false } ' )); $actual = $this->twilio->preview->sync->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); $this->assertNotNull($actual); } public function testDeleteRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->sync->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'delete', 'https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testDeleteResponse() { $this->holodeck->mock(new Response( 204, null )); $actual = $this->twilio->preview->sync->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); $this->assertTrue($actual); } public function testCreateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->sync->services->create(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'post', 'https://preview.twilio.com/Sync/Services' )); } public function testCreateResponse() { $this->holodeck->mock(new Response( 201, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "2015-07-30T20:00:00Z", "date_updated": "2015-07-30T20:00:00Z", "friendly_name": "friendly_name", "links": { "documents": "https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Documents", "lists": "https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists", "maps": "https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps" }, "sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "url": "https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "webhook_url": "http://www.example.com", "reachability_webhooks_enabled": false, "acl_enabled": true } ' )); $actual = $this->twilio->preview->sync->services->create(); $this->assertNotNull($actual); } public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->sync->services->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://preview.twilio.com/Sync/Services' )); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "meta": { "first_page_url": "https://preview.twilio.com/Sync/Services?PageSize=50&Page=0", "key": "services", "next_page_url": null, "page": 0, "page_size": 50, "previous_page_url": null, "url": "https://preview.twilio.com/Sync/Services?PageSize=50&Page=0" }, "services": [] } ' )); $actual = $this->twilio->preview->sync->services->read(); $this->assertNotNull($actual); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "meta": { "first_page_url": "https://preview.twilio.com/Sync/Services?PageSize=50&Page=0", "key": "services", "next_page_url": null, "page": 0, "page_size": 50, "previous_page_url": null, "url": "https://preview.twilio.com/Sync/Services?PageSize=50&Page=0" }, "services": [ { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "2015-07-30T20:00:00Z", "date_updated": "2015-07-30T20:00:00Z", "friendly_name": "friendly_name", "links": { "documents": "https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Documents", "lists": "https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists", "maps": "https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps" }, "sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "url": "https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "webhook_url": "http://www.example.com", "reachability_webhooks_enabled": false, "acl_enabled": false } ] } ' )); $actual = $this->twilio->preview->sync->services->read(); $this->assertGreaterThan(0, count($actual)); } public function testUpdateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->sync->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'post', 'https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testUpdateResponse() { $this->holodeck->mock(new Response( 200, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "2015-07-30T20:00:00Z", "date_updated": "2015-07-30T20:00:00Z", "friendly_name": "friendly_name", "links": { "documents": "https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Documents", "lists": "https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists", "maps": "https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps" }, "sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "url": "https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "webhook_url": "http://www.example.com", "reachability_webhooks_enabled": false, "acl_enabled": true } ' )); $actual = $this->twilio->preview->sync->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/Preview/Sync/Service/DocumentTest.php 0000604 00000024213 15174325133 0021247 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Preview\Sync\Service; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Serialize; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class DocumentTest extends HolodeckTestCase { public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->sync->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->documents("ETaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Documents/ETaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "created_by": "created_by", "data": {}, "date_created": "2015-07-30T20:00:00Z", "date_updated": "2015-07-30T20:00:00Z", "revision": "revision", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "sid": "ETaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "unique_name": "unique_name", "url": "https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Documents/ETaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "links": { "permissions": "https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Documents/ETaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Permissions" } } ' )); $actual = $this->twilio->preview->sync->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->documents("ETaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); $this->assertNotNull($actual); } public function testDeleteRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->sync->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->documents("ETaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'delete', 'https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Documents/ETaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testDeleteResponse() { $this->holodeck->mock(new Response( 204, null )); $actual = $this->twilio->preview->sync->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->documents("ETaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); $this->assertTrue($actual); } public function testCreateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->sync->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->documents->create(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'post', 'https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Documents' )); } public function testCreateResponse() { $this->holodeck->mock(new Response( 201, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "created_by": "created_by", "data": {}, "date_created": "2015-07-30T20:00:00Z", "date_updated": "2015-07-30T20:00:00Z", "revision": "revision", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "sid": "ETaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "unique_name": "unique_name", "url": "https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Documents/ETaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "links": { "permissions": "https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Documents/ETaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Permissions" } } ' )); $actual = $this->twilio->preview->sync->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->documents->create(); $this->assertNotNull($actual); } public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->sync->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->documents->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Documents' )); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "documents": [], "meta": { "first_page_url": "https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Documents?PageSize=50&Page=0", "key": "documents", "next_page_url": null, "page": 0, "page_size": 50, "previous_page_url": null, "url": "https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Documents?PageSize=50&Page=0" } } ' )); $actual = $this->twilio->preview->sync->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->documents->read(); $this->assertNotNull($actual); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "documents": [ { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "created_by": "created_by", "data": {}, "date_created": "2015-07-30T20:00:00Z", "date_updated": "2015-07-30T20:00:00Z", "revision": "revision", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "sid": "ETaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "unique_name": "unique_name", "url": "https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Documents/ETaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "links": { "permissions": "https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Documents/ETaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Permissions" } } ], "meta": { "first_page_url": "https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Documents?PageSize=50&Page=0", "key": "documents", "next_page_url": null, "page": 0, "page_size": 50, "previous_page_url": null, "url": "https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Documents?PageSize=50&Page=0" } } ' )); $actual = $this->twilio->preview->sync->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->documents->read(); $this->assertGreaterThan(0, count($actual)); } public function testUpdateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->sync->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->documents("ETaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update("{}"); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $values = array('Data' => Serialize::jsonObject("{}"), ); $this->assertRequest(new Request( 'post', 'https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Documents/ETaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', null, $values )); } public function testUpdateResponse() { $this->holodeck->mock(new Response( 200, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "created_by": "created_by", "data": {}, "date_created": "2015-07-30T20:00:00Z", "date_updated": "2015-07-30T20:00:00Z", "revision": "revision", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "sid": "ETaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "unique_name": "unique_name", "url": "https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Documents/ETaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "links": { "permissions": "https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Documents/ETaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Permissions" } } ' )); $actual = $this->twilio->preview->sync->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->documents("ETaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update("{}"); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/Preview/Sync/Service/SyncMap/SyncMapItemTest.php 0000604 00000024707 15174325133 0023244 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Preview\Sync\Service\SyncMap; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Serialize; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class SyncMapItemTest extends HolodeckTestCase { public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->sync->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncMaps("MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncMapItems("key")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps/MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Items/key' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "created_by": "created_by", "data": {}, "date_created": "2015-07-30T20:00:00Z", "date_updated": "2015-07-30T20:00:00Z", "key": "key", "map_sid": "MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "revision": "revision", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "url": "https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps/MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Items/key" } ' )); $actual = $this->twilio->preview->sync->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncMaps("MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncMapItems("key")->fetch(); $this->assertNotNull($actual); } public function testDeleteRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->sync->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncMaps("MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncMapItems("key")->delete(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'delete', 'https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps/MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Items/key' )); } public function testDeleteResponse() { $this->holodeck->mock(new Response( 204, null )); $actual = $this->twilio->preview->sync->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncMaps("MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncMapItems("key")->delete(); $this->assertTrue($actual); } public function testCreateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->sync->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncMaps("MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncMapItems->create("key", "{}"); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $values = array('Key' => "key", 'Data' => Serialize::jsonObject("{}"), ); $this->assertRequest(new Request( 'post', 'https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps/MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Items', null, $values )); } public function testCreateResponse() { $this->holodeck->mock(new Response( 201, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "created_by": "created_by", "data": {}, "date_created": "2015-07-30T20:00:00Z", "date_updated": "2015-07-30T20:00:00Z", "key": "key", "map_sid": "MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "revision": "revision", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "url": "https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps/MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Items/key" } ' )); $actual = $this->twilio->preview->sync->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncMaps("MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncMapItems->create("key", "{}"); $this->assertNotNull($actual); } public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->sync->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncMaps("MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncMapItems->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps/MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Items' )); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "items": [], "meta": { "first_page_url": "https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps/MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Items?PageSize=50&Page=0", "key": "items", "next_page_url": null, "page": 0, "page_size": 50, "previous_page_url": null, "url": "https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps/MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Items?PageSize=50&Page=0" } } ' )); $actual = $this->twilio->preview->sync->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncMaps("MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncMapItems->read(); $this->assertNotNull($actual); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "items": [ { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "created_by": "created_by", "data": {}, "date_created": "2015-07-30T20:00:00Z", "date_updated": "2015-07-30T20:00:00Z", "key": "key", "map_sid": "MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "revision": "revision", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "url": "https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps/MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Items/key" } ], "meta": { "first_page_url": "https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps/MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Items?PageSize=50&Page=0", "key": "items", "next_page_url": null, "page": 0, "page_size": 50, "previous_page_url": null, "url": "https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps/MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Items?PageSize=50&Page=0" } } ' )); $actual = $this->twilio->preview->sync->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncMaps("MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncMapItems->read(); $this->assertGreaterThan(0, count($actual)); } public function testUpdateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->sync->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncMaps("MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncMapItems("key")->update("{}"); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $values = array('Data' => Serialize::jsonObject("{}"), ); $this->assertRequest(new Request( 'post', 'https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps/MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Items/key', null, $values )); } public function testUpdateResponse() { $this->holodeck->mock(new Response( 200, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "created_by": "created_by", "data": {}, "date_created": "2015-07-30T20:00:00Z", "date_updated": "2015-07-30T20:00:00Z", "key": "key", "map_sid": "MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "revision": "revision", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "url": "https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps/MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Items/key" } ' )); $actual = $this->twilio->preview->sync->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncMaps("MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncMapItems("key")->update("{}"); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/Preview/Sync/Service/SyncMap/SyncMapPermissionTest.php 0000604 00000021023 15174325133 0024462 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Preview\Sync\Service\SyncMap; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Serialize; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class SyncMapPermissionTest extends HolodeckTestCase { public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->sync->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncMaps("MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncMapPermissions("identity")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps/MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Permissions/identity' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "map_sid": "MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "identity": "identity", "read": true, "write": true, "manage": true, "url": "https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps/MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Permissions/identity" } ' )); $actual = $this->twilio->preview->sync->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncMaps("MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncMapPermissions("identity")->fetch(); $this->assertNotNull($actual); } public function testDeleteRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->sync->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncMaps("MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncMapPermissions("identity")->delete(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'delete', 'https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps/MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Permissions/identity' )); } public function testDeleteResponse() { $this->holodeck->mock(new Response( 204, null )); $actual = $this->twilio->preview->sync->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncMaps("MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncMapPermissions("identity")->delete(); $this->assertTrue($actual); } public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->sync->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncMaps("MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncMapPermissions->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps/MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Permissions' )); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "permissions": [], "meta": { "first_page_url": "https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps/sidOrUniqueName/Permissions?PageSize=50&Page=0", "key": "permissions", "next_page_url": null, "page": 0, "page_size": 50, "previous_page_url": null, "url": "https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps/sidOrUniqueName/Permissions?PageSize=50&Page=0" } } ' )); $actual = $this->twilio->preview->sync->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncMaps("MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncMapPermissions->read(); $this->assertNotNull($actual); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "permissions": [ { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "map_sid": "MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "identity": "identity", "read": true, "write": true, "manage": true, "url": "https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps/MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Permissions/identity" } ], "meta": { "first_page_url": "https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps/sidOrUniqueName/Permissions?PageSize=50&Page=0", "key": "permissions", "next_page_url": null, "page": 0, "page_size": 50, "previous_page_url": null, "url": "https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps/sidOrUniqueName/Permissions?PageSize=50&Page=0" } } ' )); $actual = $this->twilio->preview->sync->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncMaps("MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncMapPermissions->read(); $this->assertGreaterThan(0, count($actual)); } public function testUpdateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->sync->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncMaps("MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncMapPermissions("identity")->update(True, True, True); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $values = array( 'Read' => Serialize::booleanToString(True), 'Write' => Serialize::booleanToString(True), 'Manage' => Serialize::booleanToString(True), ); $this->assertRequest(new Request( 'post', 'https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps/MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Permissions/identity', null, $values )); } public function testUpdateResponse() { $this->holodeck->mock(new Response( 200, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "map_sid": "MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "identity": "identity", "read": true, "write": true, "manage": true, "url": "https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps/MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Permissions/identity" } ' )); $actual = $this->twilio->preview->sync->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncMaps("MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncMapPermissions("identity")->update(True, True, True); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/Preview/Sync/Service/Document/DocumentPermissionTest.php 0000604 00000021155 15174325133 0025100 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Preview\Sync\Service\Document; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Serialize; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class DocumentPermissionTest extends HolodeckTestCase { public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->sync->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->documents("ETaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->documentPermissions("identity")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Documents/ETaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Permissions/identity' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "document_sid": "ETaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "identity": "identity", "read": true, "write": true, "manage": true, "url": "https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Documents/ETaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Permissions/identity" } ' )); $actual = $this->twilio->preview->sync->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->documents("ETaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->documentPermissions("identity")->fetch(); $this->assertNotNull($actual); } public function testDeleteRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->sync->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->documents("ETaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->documentPermissions("identity")->delete(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'delete', 'https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Documents/ETaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Permissions/identity' )); } public function testDeleteResponse() { $this->holodeck->mock(new Response( 204, null )); $actual = $this->twilio->preview->sync->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->documents("ETaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->documentPermissions("identity")->delete(); $this->assertTrue($actual); } public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->sync->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->documents("ETaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->documentPermissions->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Documents/ETaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Permissions' )); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "permissions": [], "meta": { "first_page_url": "https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Documents/sidOrUniqueName/Permissions?PageSize=50&Page=0", "key": "permissions", "next_page_url": null, "page": 0, "page_size": 50, "previous_page_url": null, "url": "https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Documents/sidOrUniqueName/Permissions?PageSize=50&Page=0" } } ' )); $actual = $this->twilio->preview->sync->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->documents("ETaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->documentPermissions->read(); $this->assertNotNull($actual); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "permissions": [ { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "document_sid": "ETaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "identity": "identity", "read": true, "write": true, "manage": true, "url": "https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Documents/ETaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Permissions/identity" } ], "meta": { "first_page_url": "https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Documents/sidOrUniqueName/Permissions?PageSize=50&Page=0", "key": "permissions", "next_page_url": null, "page": 0, "page_size": 50, "previous_page_url": null, "url": "https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Documents/sidOrUniqueName/Permissions?PageSize=50&Page=0" } } ' )); $actual = $this->twilio->preview->sync->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->documents("ETaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->documentPermissions->read(); $this->assertGreaterThan(0, count($actual)); } public function testUpdateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->sync->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->documents("ETaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->documentPermissions("identity")->update(True, True, True); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $values = array( 'Read' => Serialize::booleanToString(True), 'Write' => Serialize::booleanToString(True), 'Manage' => Serialize::booleanToString(True), ); $this->assertRequest(new Request( 'post', 'https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Documents/ETaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Permissions/identity', null, $values )); } public function testUpdateResponse() { $this->holodeck->mock(new Response( 200, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "document_sid": "ETaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "identity": "identity", "read": true, "write": true, "manage": true, "url": "https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Documents/ETaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Permissions/identity" } ' )); $actual = $this->twilio->preview->sync->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->documents("ETaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->documentPermissions("identity")->update(True, True, True); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/Preview/Sync/Service/SyncListTest.php 0000604 00000020770 15174325133 0021245 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Preview\Sync\Service; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class SyncListTest extends HolodeckTestCase { public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->sync->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncLists("ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists/ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "created_by": "created_by", "date_created": "2015-07-30T20:00:00Z", "date_updated": "2015-07-30T20:00:00Z", "links": { "items": "https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists/ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Items", "permissions": "https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists/ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Permissions" }, "revision": "revision", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "sid": "ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "unique_name": "unique_name", "url": "https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists/ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->preview->sync->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncLists("ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); $this->assertNotNull($actual); } public function testDeleteRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->sync->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncLists("ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'delete', 'https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists/ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testDeleteResponse() { $this->holodeck->mock(new Response( 204, null )); $actual = $this->twilio->preview->sync->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncLists("ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); $this->assertTrue($actual); } public function testCreateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->sync->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncLists->create(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'post', 'https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists' )); } public function testCreateResponse() { $this->holodeck->mock(new Response( 201, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "created_by": "created_by", "date_created": "2015-07-30T20:00:00Z", "date_updated": "2015-07-30T20:00:00Z", "links": { "items": "https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists/ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Items", "permissions": "https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists/ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Permissions" }, "revision": "revision", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "sid": "ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "unique_name": "unique_name", "url": "https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists/ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->preview->sync->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncLists->create(); $this->assertNotNull($actual); } public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->sync->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncLists->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists' )); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "lists": [], "meta": { "first_page_url": "https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists?PageSize=50&Page=0", "key": "lists", "next_page_url": null, "page": 0, "page_size": 50, "previous_page_url": null, "url": "https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists?PageSize=50&Page=0" } } ' )); $actual = $this->twilio->preview->sync->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncLists->read(); $this->assertNotNull($actual); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "lists": [ { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "created_by": "created_by", "date_created": "2015-07-30T20:00:00Z", "date_updated": "2015-07-30T20:00:00Z", "links": { "items": "https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists/ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Items", "permissions": "https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists/ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Permissions" }, "revision": "revision", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "sid": "ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "unique_name": "unique_name", "url": "https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists/ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ], "meta": { "first_page_url": "https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists?PageSize=50&Page=0", "key": "lists", "next_page_url": null, "page": 0, "page_size": 50, "previous_page_url": null, "url": "https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists?PageSize=50&Page=0" } } ' )); $actual = $this->twilio->preview->sync->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncLists->read(); $this->assertGreaterThan(0, count($actual)); } } sdk/Twilio/Tests/Integration/Preview/Sync/Service/SyncMapTest.php 0000604 00000020731 15174325133 0021044 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Preview\Sync\Service; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class SyncMapTest extends HolodeckTestCase { public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->sync->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncMaps("MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps/MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "created_by": "created_by", "date_created": "2015-07-30T20:00:00Z", "date_updated": "2015-07-30T20:00:00Z", "links": { "items": "https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps/MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Items", "permissions": "https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps/MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Permissions" }, "revision": "revision", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "sid": "MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "unique_name": "unique_name", "url": "https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps/MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->preview->sync->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncMaps("MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); $this->assertNotNull($actual); } public function testDeleteRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->sync->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncMaps("MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'delete', 'https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps/MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testDeleteResponse() { $this->holodeck->mock(new Response( 204, null )); $actual = $this->twilio->preview->sync->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncMaps("MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); $this->assertTrue($actual); } public function testCreateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->sync->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncMaps->create(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'post', 'https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps' )); } public function testCreateResponse() { $this->holodeck->mock(new Response( 201, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "created_by": "created_by", "date_created": "2015-07-30T20:00:00Z", "date_updated": "2015-07-30T20:00:00Z", "links": { "items": "https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps/MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Items", "permissions": "https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps/MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Permissions" }, "revision": "revision", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "sid": "MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "unique_name": "unique_name", "url": "https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps/MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->preview->sync->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncMaps->create(); $this->assertNotNull($actual); } public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->sync->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncMaps->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps' )); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "maps": [], "meta": { "first_page_url": "https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps?PageSize=50&Page=0", "key": "maps", "next_page_url": null, "page": 0, "page_size": 50, "previous_page_url": null, "url": "https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps?PageSize=50&Page=0" } } ' )); $actual = $this->twilio->preview->sync->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncMaps->read(); $this->assertNotNull($actual); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "maps": [ { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "created_by": "created_by", "date_created": "2015-07-30T20:00:00Z", "date_updated": "2015-07-30T20:00:00Z", "links": { "items": "https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps/MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Items", "permissions": "https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps/MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Permissions" }, "revision": "revision", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "sid": "MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "unique_name": "unique_name", "url": "https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps/MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ], "meta": { "first_page_url": "https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps?PageSize=50&Page=0", "key": "maps", "next_page_url": null, "page": 0, "page_size": 50, "previous_page_url": null, "url": "https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps?PageSize=50&Page=0" } } ' )); $actual = $this->twilio->preview->sync->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncMaps->read(); $this->assertGreaterThan(0, count($actual)); } } sdk/Twilio/Tests/Integration/Preview/Sync/Service/SyncList/SyncListItemTest.php 0000604 00000024664 15174325133 0023642 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Preview\Sync\Service\SyncList; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Serialize; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class SyncListItemTest extends HolodeckTestCase { public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->sync->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncLists("ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncListItems(1)->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists/ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Items/1' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "created_by": "created_by", "data": {}, "date_created": "2015-07-30T20:00:00Z", "date_updated": "2015-07-30T20:00:00Z", "index": 100, "list_sid": "ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "revision": "revision", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "url": "https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists/ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Items/100" } ' )); $actual = $this->twilio->preview->sync->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncLists("ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncListItems(1)->fetch(); $this->assertNotNull($actual); } public function testDeleteRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->sync->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncLists("ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncListItems(1)->delete(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'delete', 'https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists/ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Items/1' )); } public function testDeleteResponse() { $this->holodeck->mock(new Response( 204, null )); $actual = $this->twilio->preview->sync->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncLists("ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncListItems(1)->delete(); $this->assertTrue($actual); } public function testCreateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->sync->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncLists("ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncListItems->create("{}"); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $values = array('Data' => Serialize::jsonObject("{}"), ); $this->assertRequest(new Request( 'post', 'https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists/ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Items', null, $values )); } public function testCreateResponse() { $this->holodeck->mock(new Response( 201, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "created_by": "created_by", "data": {}, "date_created": "2015-07-30T20:00:00Z", "date_updated": "2015-07-30T20:00:00Z", "index": 100, "list_sid": "ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "revision": "revision", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "url": "https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists/ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Items/100" } ' )); $actual = $this->twilio->preview->sync->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncLists("ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncListItems->create("{}"); $this->assertNotNull($actual); } public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->sync->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncLists("ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncListItems->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists/ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Items' )); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "items": [], "meta": { "first_page_url": "https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists/ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Items?PageSize=50&Page=0", "key": "items", "next_page_url": null, "page": 0, "page_size": 50, "previous_page_url": null, "url": "https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists/ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Items?PageSize=50&Page=0" } } ' )); $actual = $this->twilio->preview->sync->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncLists("ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncListItems->read(); $this->assertNotNull($actual); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "items": [ { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "created_by": "created_by", "data": {}, "date_created": "2015-07-30T20:00:00Z", "date_updated": "2015-07-30T20:00:00Z", "index": 100, "list_sid": "ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "revision": "revision", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "url": "https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists/ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Items/100" } ], "meta": { "first_page_url": "https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists/ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Items?PageSize=50&Page=0", "key": "items", "next_page_url": null, "page": 0, "page_size": 50, "previous_page_url": null, "url": "https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists/ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Items?PageSize=50&Page=0" } } ' )); $actual = $this->twilio->preview->sync->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncLists("ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncListItems->read(); $this->assertGreaterThan(0, count($actual)); } public function testUpdateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->sync->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncLists("ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncListItems(1)->update("{}"); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $values = array('Data' => Serialize::jsonObject("{}"), ); $this->assertRequest(new Request( 'post', 'https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists/ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Items/1', null, $values )); } public function testUpdateResponse() { $this->holodeck->mock(new Response( 200, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "created_by": "created_by", "data": {}, "date_created": "2015-07-30T20:00:00Z", "date_updated": "2015-07-30T20:00:00Z", "index": 100, "list_sid": "ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "revision": "revision", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "url": "https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists/ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Items/100" } ' )); $actual = $this->twilio->preview->sync->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncLists("ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncListItems(1)->update("{}"); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/Preview/Sync/Service/SyncList/SyncListPermissionTest.php 0000604 00000021065 15174325133 0025064 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Preview\Sync\Service\SyncList; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Serialize; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class SyncListPermissionTest extends HolodeckTestCase { public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->sync->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncLists("ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncListPermissions("identity")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists/ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Permissions/identity' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "list_sid": "ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "identity": "identity", "read": true, "write": true, "manage": true, "url": "https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists/ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Permissions/identity" } ' )); $actual = $this->twilio->preview->sync->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncLists("ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncListPermissions("identity")->fetch(); $this->assertNotNull($actual); } public function testDeleteRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->sync->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncLists("ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncListPermissions("identity")->delete(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'delete', 'https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists/ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Permissions/identity' )); } public function testDeleteResponse() { $this->holodeck->mock(new Response( 204, null )); $actual = $this->twilio->preview->sync->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncLists("ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncListPermissions("identity")->delete(); $this->assertTrue($actual); } public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->sync->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncLists("ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncListPermissions->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists/ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Permissions' )); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "permissions": [], "meta": { "first_page_url": "https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists/sidOrUniqueName/Permissions?PageSize=50&Page=0", "key": "permissions", "next_page_url": null, "page": 0, "page_size": 50, "previous_page_url": null, "url": "https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists/sidOrUniqueName/Permissions?PageSize=50&Page=0" } } ' )); $actual = $this->twilio->preview->sync->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncLists("ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncListPermissions->read(); $this->assertNotNull($actual); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "permissions": [ { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "list_sid": "ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "identity": "identity", "read": true, "write": true, "manage": true, "url": "https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists/ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Permissions/identity" } ], "meta": { "first_page_url": "https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists/sidOrUniqueName/Permissions?PageSize=50&Page=0", "key": "permissions", "next_page_url": null, "page": 0, "page_size": 50, "previous_page_url": null, "url": "https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists/sidOrUniqueName/Permissions?PageSize=50&Page=0" } } ' )); $actual = $this->twilio->preview->sync->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncLists("ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncListPermissions->read(); $this->assertGreaterThan(0, count($actual)); } public function testUpdateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->sync->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncLists("ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncListPermissions("identity")->update(True, True, True); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $values = array( 'Read' => Serialize::booleanToString(True), 'Write' => Serialize::booleanToString(True), 'Manage' => Serialize::booleanToString(True), ); $this->assertRequest(new Request( 'post', 'https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists/ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Permissions/identity', null, $values )); } public function testUpdateResponse() { $this->holodeck->mock(new Response( 200, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "list_sid": "ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "identity": "identity", "read": true, "write": true, "manage": true, "url": "https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists/ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Permissions/identity" } ' )); $actual = $this->twilio->preview->sync->services("ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncLists("ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->syncListPermissions("identity")->update(True, True, True); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/Preview/Bulkexports/ExportTest.php 0000604 00000002550 15174325133 0020760 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Preview\Bulkexports; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class ExportTest extends HolodeckTestCase { public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->bulkExports->exports("resourceType")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://preview.twilio.com/BulkExports/Exports/resourceType' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "resource_type": "Calls", "url": "https://preview.twilio.com/BulkExports/Exports/Calls", "links": { "days": "https://preview.twilio.com/BulkExports/Exports/Calls/Days" } } ' )); $actual = $this->twilio->preview->bulkExports->exports("resourceType")->fetch(); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/Preview/Bulkexports/Export/DayTest.php 0000604 00000003613 15174325133 0021476 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Preview\Bulkexports\Export; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class DayTest extends HolodeckTestCase { public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->bulkExports->exports("resourceType") ->days->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://preview.twilio.com/BulkExports/Exports/resourceType/Days' )); } public function testReadResponse() { $this->holodeck->mock(new Response( 200, ' { "days": [ { "day": "2017-05-01", "size": 1234, "resource_type": "Calls" } ], "meta": { "key": "days", "page_size": 50, "url": "https://preview.twilio.com/BulkExports/Exports/Calls/Days?PageSize=50&Page=0", "page": 0, "first_page_url": "https://preview.twilio.com/BulkExports/Exports/Calls/Days?PageSize=50&Page=0", "previous_page_url": null, "next_page_url": null } } ' )); $actual = $this->twilio->preview->bulkExports->exports("resourceType") ->days->read(); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/Preview/Deployeddevices/Fleet/DeviceTest.php 0000604 00000023707 15174325133 0022532 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Preview\Deployeddevices\Fleet; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class DeviceTest extends HolodeckTestCase { public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->deployedDevices->fleets("FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->devices("THaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://preview.twilio.com/DeployedDevices/Fleets/FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Devices/THaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "sid": "THaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "unique_name": "unique_name", "friendly_name": "friendly_name", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "fleet_sid": "FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "enabled": true, "deployment_sid": "DLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "identity": "bob@twilio.com", "date_created": "2016-07-30T20:00:00Z", "date_updated": "2016-07-30T20:00:00Z", "date_authenticated": null, "url": "https://preview.twilio.com/DeployedDevices/Fleets/FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Devices/THaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->preview->deployedDevices->fleets("FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->devices("THaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); $this->assertNotNull($actual); } public function testDeleteRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->deployedDevices->fleets("FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->devices("THaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'delete', 'https://preview.twilio.com/DeployedDevices/Fleets/FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Devices/THaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testDeleteResponse() { $this->holodeck->mock(new Response( 204, null )); $actual = $this->twilio->preview->deployedDevices->fleets("FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->devices("THaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); $this->assertTrue($actual); } public function testCreateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->deployedDevices->fleets("FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->devices->create(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'post', 'https://preview.twilio.com/DeployedDevices/Fleets/FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Devices' )); } public function testCreateResponse() { $this->holodeck->mock(new Response( 201, ' { "sid": "THaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "unique_name": "unique_name", "friendly_name": "friendly_name", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "fleet_sid": "FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "enabled": true, "deployment_sid": "DLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "identity": "bob@twilio.com", "date_created": "2016-07-30T20:00:00Z", "date_updated": "2016-07-30T20:00:00Z", "date_authenticated": null, "url": "https://preview.twilio.com/DeployedDevices/Fleets/FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Devices/THaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->preview->deployedDevices->fleets("FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->devices->create(); $this->assertNotNull($actual); } public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->deployedDevices->fleets("FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->devices->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://preview.twilio.com/DeployedDevices/Fleets/FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Devices' )); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "devices": [], "meta": { "first_page_url": "https://preview.twilio.com/DeployedDevices/Fleets/FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Devices?PageSize=50&Page=0", "key": "devices", "next_page_url": null, "page": 0, "page_size": 50, "previous_page_url": null, "url": "https://preview.twilio.com/DeployedDevices/Fleets/FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Devices?PageSize=50&Page=0" } } ' )); $actual = $this->twilio->preview->deployedDevices->fleets("FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->devices->read(); $this->assertNotNull($actual); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "devices": [ { "sid": "THaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "unique_name": "unique_name", "friendly_name": "friendly_name", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "enabled": true, "fleet_sid": "FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "deployment_sid": "DLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "identity": "bob@twilio.com", "date_created": "2016-07-30T20:00:00Z", "date_updated": "2016-07-30T20:00:00Z", "date_authenticated": null, "url": "https://preview.twilio.com/DeployedDevices/Fleets/FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Devices/THaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ], "meta": { "first_page_url": "https://preview.twilio.com/DeployedDevices/Fleets/FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Devices?PageSize=50&Page=0", "key": "devices", "next_page_url": null, "page": 0, "page_size": 50, "previous_page_url": null, "url": "https://preview.twilio.com/DeployedDevices/Fleets/FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Devices?PageSize=50&Page=0" } } ' )); $actual = $this->twilio->preview->deployedDevices->fleets("FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->devices->read(); $this->assertGreaterThan(0, count($actual)); } public function testUpdateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->deployedDevices->fleets("FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->devices("THaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'post', 'https://preview.twilio.com/DeployedDevices/Fleets/FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Devices/THaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testUpdateResponse() { $this->holodeck->mock(new Response( 200, ' { "sid": "THaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "unique_name": "unique_name", "friendly_name": "friendly_name", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "fleet_sid": "FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "enabled": true, "deployment_sid": "DLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "identity": "bob@twilio.com", "date_created": "2016-07-30T20:00:00Z", "date_updated": "2016-07-30T20:00:00Z", "date_authenticated": null, "url": "https://preview.twilio.com/DeployedDevices/Fleets/FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Devices/THaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->preview->deployedDevices->fleets("FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->devices("THaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/Preview/Deployeddevices/Fleet/KeyTest.php 0000604 00000022400 15174325133 0022050 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Preview\Deployeddevices\Fleet; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class KeyTest extends HolodeckTestCase { public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->deployedDevices->fleets("FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->keys("KYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://preview.twilio.com/DeployedDevices/Fleets/FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Keys/KYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "sid": "KYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "friendly_name": "friendly_name", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "fleet_sid": "FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "device_sid": "THaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "secret": null, "date_created": "2016-07-30T20:00:00Z", "date_updated": null, "url": "https://preview.twilio.com/DeployedDevices/Fleets/FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Keys/KYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->preview->deployedDevices->fleets("FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->keys("KYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); $this->assertNotNull($actual); } public function testDeleteRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->deployedDevices->fleets("FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->keys("KYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'delete', 'https://preview.twilio.com/DeployedDevices/Fleets/FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Keys/KYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testDeleteResponse() { $this->holodeck->mock(new Response( 204, null )); $actual = $this->twilio->preview->deployedDevices->fleets("FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->keys("KYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); $this->assertTrue($actual); } public function testCreateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->deployedDevices->fleets("FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->keys->create(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'post', 'https://preview.twilio.com/DeployedDevices/Fleets/FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Keys' )); } public function testCreateResponse() { $this->holodeck->mock(new Response( 201, ' { "sid": "KYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "friendly_name": "friendly_name", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "fleet_sid": "FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "device_sid": "THaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "secret": null, "date_created": "2016-07-30T20:00:00Z", "date_updated": null, "url": "https://preview.twilio.com/DeployedDevices/Fleets/FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Keys/KYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->preview->deployedDevices->fleets("FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->keys->create(); $this->assertNotNull($actual); } public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->deployedDevices->fleets("FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->keys->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://preview.twilio.com/DeployedDevices/Fleets/FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Keys' )); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "keys": [], "meta": { "first_page_url": "https://preview.twilio.com/DeployedDevices/Fleets/FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Keys?PageSize=50&Page=0", "key": "keys", "next_page_url": null, "page": 0, "page_size": 50, "previous_page_url": null, "url": "https://preview.twilio.com/DeployedDevices/Fleets/FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Keys?PageSize=50&Page=0" } } ' )); $actual = $this->twilio->preview->deployedDevices->fleets("FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->keys->read(); $this->assertNotNull($actual); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "keys": [ { "sid": "KYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "friendly_name": "friendly_name", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "fleet_sid": "FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "device_sid": "THaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "secret": null, "date_created": "2016-07-30T20:00:00Z", "date_updated": "2016-07-30T20:00:00Z", "url": "https://preview.twilio.com/DeployedDevices/Fleets/FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Keys/KYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ], "meta": { "first_page_url": "https://preview.twilio.com/DeployedDevices/Fleets/FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Keys?PageSize=50&Page=0", "key": "keys", "next_page_url": null, "page": 0, "page_size": 50, "previous_page_url": null, "url": "https://preview.twilio.com/DeployedDevices/Fleets/FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Keys?PageSize=50&Page=0" } } ' )); $actual = $this->twilio->preview->deployedDevices->fleets("FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->keys->read(); $this->assertGreaterThan(0, count($actual)); } public function testUpdateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->deployedDevices->fleets("FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->keys("KYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'post', 'https://preview.twilio.com/DeployedDevices/Fleets/FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Keys/KYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testUpdateResponse() { $this->holodeck->mock(new Response( 200, ' { "sid": "KYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "friendly_name": "friendly_name", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "fleet_sid": "FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "device_sid": "THaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "secret": null, "date_created": "2016-07-30T20:00:00Z", "date_updated": "2016-07-30T20:00:00Z", "url": "https://preview.twilio.com/DeployedDevices/Fleets/FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Keys/KYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->preview->deployedDevices->fleets("FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->keys("KYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/Preview/Deployeddevices/Fleet/DeploymentTest.php 0000604 00000022577 15174325133 0023457 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Preview\Deployeddevices\Fleet; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class DeploymentTest extends HolodeckTestCase { public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->deployedDevices->fleets("FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->deployments("DLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://preview.twilio.com/DeployedDevices/Fleets/FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Deployments/DLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "sid": "DLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "friendly_name": "friendly_name", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "fleet_sid": "FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "sync_service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "2016-07-30T20:00:00Z", "date_updated": "2016-07-30T20:00:00Z", "url": "https://preview.twilio.com/DeployedDevices/Fleets/FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Deployments/DLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->preview->deployedDevices->fleets("FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->deployments("DLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); $this->assertNotNull($actual); } public function testDeleteRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->deployedDevices->fleets("FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->deployments("DLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'delete', 'https://preview.twilio.com/DeployedDevices/Fleets/FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Deployments/DLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testDeleteResponse() { $this->holodeck->mock(new Response( 204, null )); $actual = $this->twilio->preview->deployedDevices->fleets("FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->deployments("DLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); $this->assertTrue($actual); } public function testCreateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->deployedDevices->fleets("FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->deployments->create(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'post', 'https://preview.twilio.com/DeployedDevices/Fleets/FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Deployments' )); } public function testCreateResponse() { $this->holodeck->mock(new Response( 201, ' { "sid": "DLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "friendly_name": "friendly_name", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "fleet_sid": "FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "sync_service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "2016-07-30T20:00:00Z", "date_updated": "2016-07-30T20:00:00Z", "url": "https://preview.twilio.com/DeployedDevices/Fleets/FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Deployments/DLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->preview->deployedDevices->fleets("FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->deployments->create(); $this->assertNotNull($actual); } public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->deployedDevices->fleets("FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->deployments->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://preview.twilio.com/DeployedDevices/Fleets/FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Deployments' )); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "deployments": [], "meta": { "first_page_url": "https://preview.twilio.com/DeployedDevices/Fleets/FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Deployments?PageSize=50&Page=0", "key": "deployments", "next_page_url": null, "page": 0, "page_size": 50, "previous_page_url": null, "url": "https://preview.twilio.com/DeployedDevices/Fleets/FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Deployments?PageSize=50&Page=0" } } ' )); $actual = $this->twilio->preview->deployedDevices->fleets("FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->deployments->read(); $this->assertNotNull($actual); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "deployments": [ { "sid": "DLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "friendly_name": "friendly_name", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "fleet_sid": "FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "sync_service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "2016-07-30T20:00:00Z", "date_updated": "2016-07-30T20:00:00Z", "url": "https://preview.twilio.com/DeployedDevices/Fleets/FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Deployments/DLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ], "meta": { "first_page_url": "https://preview.twilio.com/DeployedDevices/Fleets/FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Deployments?PageSize=50&Page=0", "key": "deployments", "next_page_url": null, "page": 0, "page_size": 50, "previous_page_url": null, "url": "https://preview.twilio.com/DeployedDevices/Fleets/FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Deployments?PageSize=50&Page=0" } } ' )); $actual = $this->twilio->preview->deployedDevices->fleets("FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->deployments->read(); $this->assertGreaterThan(0, count($actual)); } public function testUpdateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->deployedDevices->fleets("FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->deployments("DLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'post', 'https://preview.twilio.com/DeployedDevices/Fleets/FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Deployments/DLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testUpdateResponse() { $this->holodeck->mock(new Response( 200, ' { "sid": "DLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "friendly_name": "friendly_name", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "fleet_sid": "FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "sync_service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "2016-07-30T20:00:00Z", "date_updated": "2016-07-30T20:00:00Z", "url": "https://preview.twilio.com/DeployedDevices/Fleets/FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Deployments/DLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->preview->deployedDevices->fleets("FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->deployments("DLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/Preview/Deployeddevices/Fleet/CertificateTest.php 0000604 00000023223 15174325133 0023546 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Preview\Deployeddevices\Fleet; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class CertificateTest extends HolodeckTestCase { public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->deployedDevices->fleets("FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->certificates("CYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://preview.twilio.com/DeployedDevices/Fleets/FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Certificates/CYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "sid": "CYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "friendly_name": "friendly_name", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "fleet_sid": "FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "device_sid": "THaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "thumbprint": "1234567890", "date_created": "2016-07-30T20:00:00Z", "date_updated": null, "url": "https://preview.twilio.com/DeployedDevices/Fleets/FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Certificates/CYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->preview->deployedDevices->fleets("FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->certificates("CYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); $this->assertNotNull($actual); } public function testDeleteRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->deployedDevices->fleets("FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->certificates("CYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'delete', 'https://preview.twilio.com/DeployedDevices/Fleets/FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Certificates/CYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testDeleteResponse() { $this->holodeck->mock(new Response( 204, null )); $actual = $this->twilio->preview->deployedDevices->fleets("FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->certificates("CYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); $this->assertTrue($actual); } public function testCreateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->deployedDevices->fleets("FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->certificates->create("certificateData"); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $values = array('CertificateData' => "certificateData", ); $this->assertRequest(new Request( 'post', 'https://preview.twilio.com/DeployedDevices/Fleets/FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Certificates', null, $values )); } public function testCreateResponse() { $this->holodeck->mock(new Response( 201, ' { "sid": "CYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "friendly_name": "friendly_name", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "fleet_sid": "FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "device_sid": "THaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "thumbprint": "1234567890", "date_created": "2016-07-30T20:00:00Z", "date_updated": null, "url": "https://preview.twilio.com/DeployedDevices/Fleets/FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Certificates/CYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->preview->deployedDevices->fleets("FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->certificates->create("certificateData"); $this->assertNotNull($actual); } public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->deployedDevices->fleets("FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->certificates->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://preview.twilio.com/DeployedDevices/Fleets/FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Certificates' )); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "certificates": [], "meta": { "first_page_url": "https://preview.twilio.com/DeployedDevices/Fleets/FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Certificates?PageSize=50&Page=0", "key": "certificates", "next_page_url": null, "page": 0, "page_size": 50, "previous_page_url": null, "url": "https://preview.twilio.com/DeployedDevices/Fleets/FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Certificates?PageSize=50&Page=0" } } ' )); $actual = $this->twilio->preview->deployedDevices->fleets("FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->certificates->read(); $this->assertNotNull($actual); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "certificates": [ { "sid": "CYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "friendly_name": "friendly_name", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "fleet_sid": "FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "device_sid": "THaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "thumbprint": "1234567890", "date_created": "2016-07-30T20:00:00Z", "date_updated": null, "url": "https://preview.twilio.com/DeployedDevices/Fleets/FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Certificates/CYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ], "meta": { "first_page_url": "https://preview.twilio.com/DeployedDevices/Fleets/FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Certificates?PageSize=50&Page=0", "key": "certificates", "next_page_url": null, "page": 0, "page_size": 50, "previous_page_url": null, "url": "https://preview.twilio.com/DeployedDevices/Fleets/FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Certificates?PageSize=50&Page=0" } } ' )); $actual = $this->twilio->preview->deployedDevices->fleets("FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->certificates->read(); $this->assertGreaterThan(0, count($actual)); } public function testUpdateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->deployedDevices->fleets("FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->certificates("CYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'post', 'https://preview.twilio.com/DeployedDevices/Fleets/FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Certificates/CYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testUpdateResponse() { $this->holodeck->mock(new Response( 200, ' { "sid": "CYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "friendly_name": "friendly_name", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "fleet_sid": "FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "device_sid": "THaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "thumbprint": "1234567890", "date_created": "2016-07-30T20:00:00Z", "date_updated": "2016-07-30T20:00:00Z", "url": "https://preview.twilio.com/DeployedDevices/Fleets/FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Certificates/CYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->preview->deployedDevices->fleets("FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->certificates("CYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/Preview/Studio/FlowTest.php 0000604 00000007153 15174325133 0017337 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Preview\Studio; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class FlowTest extends HolodeckTestCase { public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->studio->flows->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://preview.twilio.com/Studio/Flows' )); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "meta": { "previous_page_url": null, "next_page_url": null, "url": "https://preview.twilio.com/Studio/Flows?PageSize=50&Page=0", "page": 0, "first_page_url": "https://preview.twilio.com/Studio/Flows?PageSize=50&Page=0", "page_size": 50, "key": "flows" }, "flows": [] } ' )); $actual = $this->twilio->preview->studio->flows->read(); $this->assertNotNull($actual); } public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->studio->flows("FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://preview.twilio.com/Studio/Flows/FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "sid": "FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "friendly_name": "Test Flow", "status": "published", "debug": false, "version": 1, "date_created": "2017-11-06T12:00:00Z", "date_updated": null, "url": "https://preview.twilio.com/Studio/Flows/FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "links": { "engagements": "https://preview.twilio.com/Studio/Flows/FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Engagements" } } ' )); $actual = $this->twilio->preview->studio->flows("FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); $this->assertNotNull($actual); } public function testDeleteRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->studio->flows("FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'delete', 'https://preview.twilio.com/Studio/Flows/FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testDeleteResponse() { $this->holodeck->mock(new Response( 204, null )); $actual = $this->twilio->preview->studio->flows("FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); $this->assertTrue($actual); } } sdk/Twilio/Tests/Integration/Preview/Studio/Flow/Engagement/StepTest.php 0000604 00000010047 15174325133 0022320 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Preview\Studio\Flow\Engagement; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class StepTest extends HolodeckTestCase { public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->studio->flows("FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->engagements("FNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->steps->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://preview.twilio.com/Studio/Flows/FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Engagements/FNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Steps' )); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "meta": { "previous_page_url": null, "next_page_url": null, "url": "https://preview.twilio.com/Studio/Flows/FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Engagements/FNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Steps?PageSize=50&Page=0", "page": 0, "first_page_url": "https://preview.twilio.com/Studio/Flows/FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Engagements/FNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Steps?PageSize=50&Page=0", "page_size": 50, "key": "steps" }, "steps": [] } ' )); $actual = $this->twilio->preview->studio->flows("FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->engagements("FNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->steps->read(); $this->assertNotNull($actual); } public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->studio->flows("FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->engagements("FNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->steps("FTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://preview.twilio.com/Studio/Flows/FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Engagements/FNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Steps/FTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "sid": "FTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "flow_sid": "FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "engagement_sid": "FNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "name": "incomingRequest", "context": {}, "transitioned_from": "Trigger", "transitioned_to": "Ended", "date_created": "2017-11-06T12:00:00Z", "date_updated": null, "url": "https://preview.twilio.com/Studio/Flows/FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Engagements/FNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Steps/FTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->preview->studio->flows("FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->engagements("FNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->steps("FTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/Preview/Studio/Flow/EngagementTest.php 0000604 00000013250 15174325133 0021404 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Preview\Studio\Flow; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class EngagementTest extends HolodeckTestCase { public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->studio->flows("FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->engagements->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://preview.twilio.com/Studio/Flows/FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Engagements' )); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "meta": { "previous_page_url": null, "next_page_url": null, "url": "https://preview.twilio.com/Studio/Flows/FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Engagements?PageSize=50&Page=0", "page": 0, "first_page_url": "https://preview.twilio.com/Studio/Flows/FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Engagements?PageSize=50&Page=0", "page_size": 50, "key": "engagements" }, "engagements": [] } ' )); $actual = $this->twilio->preview->studio->flows("FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->engagements->read(); $this->assertNotNull($actual); } public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->studio->flows("FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->engagements("FNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://preview.twilio.com/Studio/Flows/FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Engagements/FNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "sid": "FNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "flow_sid": "FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "contact_sid": "FCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "contact_channel_address": "+14155555555", "status": "ended", "context": {}, "date_created": "2017-11-06T12:00:00Z", "date_updated": null, "url": "https://preview.twilio.com/Studio/Flows/FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Engagements/FNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "links": { "steps": "https://preview.twilio.com/Studio/Flows/FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Engagements/FNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Steps" } } ' )); $actual = $this->twilio->preview->studio->flows("FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->engagements("FNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); $this->assertNotNull($actual); } public function testCreateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->studio->flows("FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->engagements->create("+15558675310", "+15017122661"); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $values = array('To' => "+15558675310", 'From' => "+15017122661", ); $this->assertRequest(new Request( 'post', 'https://preview.twilio.com/Studio/Flows/FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Engagements', null, $values )); } public function testCreateResponse() { $this->holodeck->mock(new Response( 201, ' { "url": "https://preview.twilio.com/Studio/Flows/FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Engagements/FNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "sid": "FNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "flow_sid": "FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "context": { "flow": { "first_name": "Foo" } }, "contact_sid": "FCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "contact_channel_address": "+18001234567", "status": "active", "date_created": "2015-07-30T20:00:00Z", "date_updated": "2015-07-30T20:00:00Z", "links": { "steps": "https://preview.twilio.com/Studio/Flows/FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Engagements/FNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Steps" } } ' )); $actual = $this->twilio->preview->studio->flows("FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->engagements->create("+15558675310", "+15017122661"); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/Preview/Hostednumbers/HostedNumberOrderTest.php 0000604 00000035746 15174325133 0023407 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Preview\Hostednumbers; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Serialize; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class HostedNumberOrderTest extends HolodeckTestCase { public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->hostedNumbers->hostedNumberOrders("HRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://preview.twilio.com/HostedNumbers/HostedNumberOrders/HRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "address_sid": "AD11111111111111111111111111111111", "call_delay": 15, "capabilities": { "sms": true, "voice": false }, "cc_emails": [ "aaa@twilio.com", "bbb@twilio.com" ], "date_created": "2017-03-28T20:06:39Z", "date_updated": "2017-03-28T20:06:39Z", "email": "test@twilio.com", "extension": "5105", "failure_reason": "", "friendly_name": "friendly_name", "incoming_phone_number_sid": "PN11111111111111111111111111111111", "phone_number": "+14153608311", "sid": "HRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "signing_document_sid": "PX11111111111111111111111111111111", "status": "received", "unique_name": "foobar", "url": "https://preview.twilio.com/HostedNumbers/HostedNumberOrders/HRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "verification_attempts": 0, "verification_call_sids": [ "CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab" ], "verification_code": "8794", "verification_document_sid": null, "verification_type": "phone-call" } ' )); $actual = $this->twilio->preview->hostedNumbers->hostedNumberOrders("HRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); $this->assertNotNull($actual); } public function testDeleteRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->hostedNumbers->hostedNumberOrders("HRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'delete', 'https://preview.twilio.com/HostedNumbers/HostedNumberOrders/HRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testDeleteResponse() { $this->holodeck->mock(new Response( 204, null )); $actual = $this->twilio->preview->hostedNumbers->hostedNumberOrders("HRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); $this->assertTrue($actual); } public function testUpdateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->hostedNumbers->hostedNumberOrders("HRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'post', 'https://preview.twilio.com/HostedNumbers/HostedNumberOrders/HRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testUpdateResponse() { $this->holodeck->mock(new Response( 200, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "address_sid": "AD11111111111111111111111111111111", "call_delay": 15, "capabilities": { "sms": true, "voice": false }, "cc_emails": [ "test1@twilio.com", "test2@twilio.com" ], "date_created": "2017-03-28T20:06:39Z", "date_updated": "2017-03-28T20:06:39Z", "email": "test+hosted@twilio.com", "extension": "1234", "failure_reason": "", "friendly_name": "new friendly name", "incoming_phone_number_sid": "PN11111111111111111111111111111111", "phone_number": "+14153608311", "sid": "HRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "signing_document_sid": "PX11111111111111111111111111111111", "status": "pending-loa", "unique_name": "new unique name", "url": "https://preview.twilio.com/HostedNumbers/HostedNumberOrders/HRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "verification_attempts": 1, "verification_call_sids": [ "CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab" ], "verification_code": "8794", "verification_document_sid": null, "verification_type": "phone-call" } ' )); $actual = $this->twilio->preview->hostedNumbers->hostedNumberOrders("HRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); $this->assertNotNull($actual); } public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->hostedNumbers->hostedNumberOrders->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://preview.twilio.com/HostedNumbers/HostedNumberOrders' )); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "meta": { "first_page_url": "https://preview.twilio.com/HostedNumbers/HostedNumberOrders?PageSize=50&Page=0", "key": "items", "next_page_url": null, "page": 0, "page_size": 50, "previous_page_url": null, "url": "https://preview.twilio.com/HostedNumbers/HostedNumberOrders?PageSize=50&Page=0" }, "items": [] } ' )); $actual = $this->twilio->preview->hostedNumbers->hostedNumberOrders->read(); $this->assertNotNull($actual); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "meta": { "first_page_url": "https://preview.twilio.com/HostedNumbers/HostedNumberOrders?PageSize=50&Page=0", "key": "items", "next_page_url": null, "page": 0, "page_size": 50, "previous_page_url": null, "url": "https://preview.twilio.com/HostedNumbers/HostedNumberOrders?PageSize=50&Page=0" }, "items": [ { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "address_sid": "AD11111111111111111111111111111111", "call_delay": 15, "capabilities": { "sms": true, "voice": false }, "cc_emails": [ "aaa@twilio.com", "bbb@twilio.com" ], "date_created": "2017-03-28T20:06:39Z", "date_updated": "2017-03-28T20:06:39Z", "email": "test@twilio.com", "extension": "1234", "failure_reason": "", "friendly_name": "friendly_name", "incoming_phone_number_sid": "PN11111111111111111111111111111111", "phone_number": "+14153608311", "sid": "HRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "signing_document_sid": "PX11111111111111111111111111111111", "status": "received", "unique_name": "foobar", "url": "https://preview.twilio.com/HostedNumbers/HostedNumberOrders/HRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "verification_attempts": 0, "verification_call_sids": [ "CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab" ], "verification_code": "8794", "verification_document_sid": null, "verification_type": "phone-call" } ] } ' )); $actual = $this->twilio->preview->hostedNumbers->hostedNumberOrders->read(); $this->assertGreaterThan(0, count($actual)); } public function testCreateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->hostedNumbers->hostedNumberOrders->create("+15017122661", True); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $values = array( 'PhoneNumber' => "+15017122661", 'SmsCapability' => Serialize::booleanToString(True), ); $this->assertRequest(new Request( 'post', 'https://preview.twilio.com/HostedNumbers/HostedNumberOrders', null, $values )); } public function testCreateResponse() { $this->holodeck->mock(new Response( 201, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "address_sid": "AD11111111111111111111111111111111", "call_delay": 0, "capabilities": { "sms": true, "voice": false }, "cc_emails": [], "date_created": "2017-03-28T20:06:39Z", "date_updated": "2017-03-28T20:06:39Z", "email": "test@twilio.com", "extension": null, "failure_reason": "", "friendly_name": null, "incoming_phone_number_sid": "PN11111111111111111111111111111111", "phone_number": "+14153608311", "sid": "HRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "signing_document_sid": null, "status": "received", "unique_name": null, "url": "https://preview.twilio.com/HostedNumbers/HostedNumberOrders/HRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "verification_attempts": 0, "verification_call_sids": null, "verification_code": null, "verification_document_sid": null, "verification_type": "phone-call" } ' )); $actual = $this->twilio->preview->hostedNumbers->hostedNumberOrders->create("+15017122661", True); $this->assertNotNull($actual); } public function testCreateWithoutOptionalLoaFieldsResponse() { $this->holodeck->mock(new Response( 201, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "address_sid": null, "call_delay": 0, "capabilities": { "sms": true, "voice": false }, "cc_emails": [], "date_created": "2017-03-28T20:06:39Z", "date_updated": "2017-03-28T20:06:39Z", "email": null, "extension": null, "failure_reason": "", "friendly_name": null, "incoming_phone_number_sid": "PN11111111111111111111111111111111", "phone_number": "+14153608311", "sid": "HRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "signing_document_sid": null, "status": "received", "unique_name": null, "url": "https://preview.twilio.com/HostedNumbers/HostedNumberOrders/HRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "verification_attempts": 0, "verification_call_sids": null, "verification_code": null, "verification_document_sid": null, "verification_type": "phone-call" } ' )); $actual = $this->twilio->preview->hostedNumbers->hostedNumberOrders->create("+15017122661", True); $this->assertNotNull($actual); } public function testCreateWithPhoneBillVerificationResponse() { $this->holodeck->mock(new Response( 201, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "address_sid": null, "call_delay": 0, "capabilities": { "sms": true, "voice": false }, "cc_emails": [], "date_created": "2017-03-28T20:06:39Z", "date_updated": "2017-03-28T20:06:39Z", "email": null, "extension": null, "failure_reason": "", "friendly_name": null, "incoming_phone_number_sid": "PN11111111111111111111111111111111", "phone_number": "+14153608311", "sid": "HRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "signing_document_sid": null, "status": "received", "unique_name": null, "url": "https://preview.twilio.com/HostedNumbers/HostedNumberOrders/HRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "verification_attempts": 0, "verification_call_sids": null, "verification_code": null, "verification_document_sid": "RIaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "verification_type": "phone-bill" } ' )); $actual = $this->twilio->preview->hostedNumbers->hostedNumberOrders->create("+15017122661", True); $this->assertNotNull($actual); } } Tests/Integration/Preview/Hostednumbers/AuthorizationDocument/DependentHostedNumberOrderTest.php 0000604 00000011463 15174325133 0031504 0 ustar 00 sdk/Twilio <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Preview\Hostednumbers\AuthorizationDocument; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class DependentHostedNumberOrderTest extends HolodeckTestCase { public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->hostedNumbers->authorizationDocuments("PXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->dependentHostedNumberOrders->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://preview.twilio.com/HostedNumbers/AuthorizationDocuments/PXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/DependentHostedNumberOrders' )); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "meta": { "first_page_url": "https://preview.twilio.com/HostedNumbers/AuthorizationDocuments/PXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/DependentHostedNumberOrders?PageSize=50&Page=0", "key": "items", "next_page_url": null, "page": 0, "page_size": 50, "previous_page_url": null, "url": "https://preview.twilio.com/HostedNumbers/AuthorizationDocuments/PXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/DependentHostedNumberOrders?PageSize=50&Page=0" }, "items": [] } ' )); $actual = $this->twilio->preview->hostedNumbers->authorizationDocuments("PXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->dependentHostedNumberOrders->read(); $this->assertNotNull($actual); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "meta": { "first_page_url": "https://preview.twilio.com/HostedNumbers/AuthorizationDocuments/PXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/DependentHostedNumberOrders?PageSize=50&Page=0", "key": "items", "next_page_url": null, "page": 0, "page_size": 50, "previous_page_url": null, "url": "https://preview.twilio.com/HostedNumbers/AuthorizationDocuments/PXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/DependentHostedNumberOrders?PageSize=50&Page=0" }, "items": [ { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "address_sid": "AD11111111111111111111111111111111", "call_delay": 15, "capabilities": { "sms": true, "voice": false }, "cc_emails": [ "aaa@twilio.com", "bbb@twilio.com" ], "date_created": "2017-03-28T20:06:39Z", "date_updated": "2017-03-28T20:06:39Z", "email": "test@twilio.com", "extension": "1234", "friendly_name": "friendly_name", "incoming_phone_number_sid": "PN11111111111111111111111111111111", "phone_number": "+14153608311", "sid": "HRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "signing_document_sid": "PX11111111111111111111111111111111", "status": "received", "failure_reason": "", "unique_name": "foobar", "verification_attempts": 0, "verification_call_sids": [ "CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab" ], "verification_code": "8794", "verification_document_sid": null, "verification_type": "phone-call" } ] } ' )); $actual = $this->twilio->preview->hostedNumbers->authorizationDocuments("PXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->dependentHostedNumberOrders->read(); $this->assertGreaterThan(0, count($actual)); } } sdk/Twilio/Tests/Integration/Preview/Hostednumbers/AuthorizationDocumentTest.php 0000604 00000021202 15174325133 0024331 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Preview\Hostednumbers; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Serialize; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class AuthorizationDocumentTest extends HolodeckTestCase { public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->hostedNumbers->authorizationDocuments("PXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://preview.twilio.com/HostedNumbers/AuthorizationDocuments/PXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "address_sid": "AD11111111111111111111111111111111", "cc_emails": [ "aaa@twilio.com", "bbb@twilio.com" ], "date_created": "2017-03-28T20:06:39Z", "date_updated": "2017-03-28T20:06:39Z", "email": "test@twilio.com", "links": { "dependent_hosted_number_orders": "https://preview.twilio.com/HostedNumbers/AuthorizationDocuments/PXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/DependentHostedNumberOrders" }, "sid": "PXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "status": "signing", "url": "https://preview.twilio.com/HostedNumbers/AuthorizationDocuments/PXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->preview->hostedNumbers->authorizationDocuments("PXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); $this->assertNotNull($actual); } public function testUpdateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->hostedNumbers->authorizationDocuments("PXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'post', 'https://preview.twilio.com/HostedNumbers/AuthorizationDocuments/PXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testUpdateResponse() { $this->holodeck->mock(new Response( 200, ' { "address_sid": "ADaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "cc_emails": [ "test1@twilio.com", "test2@twilio.com" ], "date_created": "2017-03-28T20:06:39Z", "date_updated": "2017-03-28T20:06:39Z", "email": "test+hosted@twilio.com", "links": { "dependent_hosted_number_orders": "https://preview.twilio.com/HostedNumbers/AuthorizationDocuments/PXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/DependentHostedNumberOrders" }, "sid": "PXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "status": "signing", "url": "https://preview.twilio.com/HostedNumbers/AuthorizationDocuments/PXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->preview->hostedNumbers->authorizationDocuments("PXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); $this->assertNotNull($actual); } public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->hostedNumbers->authorizationDocuments->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://preview.twilio.com/HostedNumbers/AuthorizationDocuments' )); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "meta": { "first_page_url": "https://preview.twilio.com/HostedNumbers/AuthorizationDocuments?PageSize=50&Page=0", "key": "items", "next_page_url": null, "page": 0, "page_size": 50, "previous_page_url": null, "url": "https://preview.twilio.com/HostedNumbers/AuthorizationDocuments?PageSize=50&Page=0" }, "items": [] } ' )); $actual = $this->twilio->preview->hostedNumbers->authorizationDocuments->read(); $this->assertNotNull($actual); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "meta": { "first_page_url": "https://preview.twilio.com/HostedNumbers/AuthorizationDocuments?PageSize=50&Page=0", "key": "items", "next_page_url": null, "page": 0, "page_size": 50, "previous_page_url": null, "url": "https://preview.twilio.com/HostedNumbers/AuthorizationDocuments?PageSize=50&Page=0" }, "items": [ { "address_sid": "ADaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "cc_emails": [ "test1@twilio.com", "test2@twilio.com" ], "date_created": "2017-03-28T20:06:39Z", "date_updated": "2017-03-28T20:06:39Z", "email": "test+hosted@twilio.com", "links": { "dependent_hosted_number_orders": "https://preview.twilio.com/HostedNumbers/AuthorizationDocuments/PXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/DependentHostedNumberOrders" }, "sid": "PXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "status": "signing", "url": "https://preview.twilio.com/HostedNumbers/AuthorizationDocuments/PXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ] } ' )); $actual = $this->twilio->preview->hostedNumbers->authorizationDocuments->read(); $this->assertGreaterThan(0, count($actual)); } public function testCreateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->hostedNumbers->authorizationDocuments->create(array('hostedNumberOrderSids'), "ADaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "email"); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $values = array( 'HostedNumberOrderSids' => Serialize::map(array('hostedNumberOrderSids'), function($e) { return $e; }), 'AddressSid' => "ADaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", 'Email' => "email", ); $this->assertRequest(new Request( 'post', 'https://preview.twilio.com/HostedNumbers/AuthorizationDocuments', null, $values )); } public function testCreateResponse() { $this->holodeck->mock(new Response( 201, ' { "address_sid": "ADaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "cc_emails": [ "test1@twilio.com", "test2@twilio.com" ], "date_created": "2017-03-28T20:06:39Z", "date_updated": "2017-03-28T20:06:39Z", "email": "test+hosted@twilio.com", "links": { "dependent_hosted_number_orders": "https://preview.twilio.com/HostedNumbers/AuthorizationDocuments/PXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/DependentHostedNumberOrders" }, "sid": "PXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "status": "signing", "url": "https://preview.twilio.com/HostedNumbers/AuthorizationDocuments/PXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->preview->hostedNumbers->authorizationDocuments->create(array('hostedNumberOrderSids'), "ADaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "email"); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/Preview/Marketplace/AvailableAddOn/AvailableAddOnExtensionTest.php 0000604 00000011742 15174325133 0026661 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Preview\Marketplace\AvailableAddOn; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class AvailableAddOnExtensionTest extends HolodeckTestCase { public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->marketplace->availableAddOns("XBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->extensions("XFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://preview.twilio.com/marketplace/AvailableAddOns/XBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Extensions/XFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "sid": "XFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "available_add_on_sid": "XBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "friendly_name": "Incoming Voice Call", "product_name": "Programmable Voice", "unique_name": "voice-incoming", "url": "https://preview.twilio.com/marketplace/AvailableAddOns/XBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Extensions/XFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->preview->marketplace->availableAddOns("XBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->extensions("XFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); $this->assertNotNull($actual); } public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->marketplace->availableAddOns("XBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->extensions->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://preview.twilio.com/marketplace/AvailableAddOns/XBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Extensions' )); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "extensions": [ { "sid": "XFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "available_add_on_sid": "XBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "friendly_name": "Incoming Voice Call", "product_name": "Programmable Voice", "unique_name": "voice-incoming", "url": "https://preview.twilio.com/marketplace/AvailableAddOns/XBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Extensions/XFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ], "meta": { "page": 0, "page_size": 50, "first_page_url": "https://preview.twilio.com/marketplace/AvailableAddOns/XBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Extensions?PageSize=50&Page=0", "previous_page_url": null, "url": "https://preview.twilio.com/marketplace/AvailableAddOns/XBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Extensions?PageSize=50&Page=0", "next_page_url": null, "key": "extensions" } } ' )); $actual = $this->twilio->preview->marketplace->availableAddOns("XBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->extensions->read(); $this->assertGreaterThan(0, count($actual)); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "extensions": [], "meta": { "page": 0, "page_size": 50, "first_page_url": "https://preview.twilio.com/marketplace/AvailableAddOns/XBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Extensions?PageSize=50&Page=0", "previous_page_url": null, "url": "https://preview.twilio.com/marketplace/AvailableAddOns/XBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Extensions?PageSize=50&Page=0", "next_page_url": null, "key": "extensions" } } ' )); $actual = $this->twilio->preview->marketplace->availableAddOns("XBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->extensions->read(); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/Preview/Understand/Service/ModelBuildTest.php 0000604 00000022151 15174325133 0022703 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Preview\Understand\Service; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class ModelBuildTest extends HolodeckTestCase { public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->understand->services("UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->modelBuilds("UGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ModelBuilds/UGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_updated": "2015-07-30T20:00:00Z", "url": "https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ModelBuilds/UGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "status": "enqueued", "service_sid": "UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "2015-07-30T20:00:00Z", "sid": "UGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "unique_name": "unique_name" } ' )); $actual = $this->twilio->preview->understand->services("UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->modelBuilds("UGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); $this->assertNotNull($actual); } public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->understand->services("UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->modelBuilds->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ModelBuilds' )); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "meta": { "page": 0, "key": "model_builds", "url": "https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ModelBuilds?PageSize=50&Page=0", "first_page_url": "https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ModelBuilds?PageSize=50&Page=0", "next_page_url": null, "previous_page_url": null, "page_size": 50 }, "model_builds": [] } ' )); $actual = $this->twilio->preview->understand->services("UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->modelBuilds->read(); $this->assertNotNull($actual); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "meta": { "page": 0, "key": "model_builds", "url": "https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ModelBuilds?PageSize=50&Page=0", "first_page_url": "https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ModelBuilds?PageSize=50&Page=0", "next_page_url": null, "previous_page_url": null, "page_size": 50 }, "model_builds": [ { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_updated": "2015-07-30T20:00:00Z", "url": "https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ModelBuilds/UGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "status": "enqueued", "service_sid": "UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "2015-07-30T20:00:00Z", "sid": "UGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "unique_name": "unique_name" } ] } ' )); $actual = $this->twilio->preview->understand->services("UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->modelBuilds->read(); $this->assertGreaterThan(0, count($actual)); } public function testCreateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->understand->services("UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->modelBuilds->create(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'post', 'https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ModelBuilds' )); } public function testCreateResponse() { $this->holodeck->mock(new Response( 201, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_updated": "2015-07-30T20:00:00Z", "url": "https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ModelBuilds/UGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "status": "enqueued", "service_sid": "UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "2015-07-30T20:00:00Z", "sid": "UGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "unique_name": "unique_name" } ' )); $actual = $this->twilio->preview->understand->services("UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->modelBuilds->create(); $this->assertNotNull($actual); } public function testUpdateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->understand->services("UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->modelBuilds("UGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'post', 'https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ModelBuilds/UGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testUpdateResponse() { $this->holodeck->mock(new Response( 200, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_updated": "2015-07-30T20:00:00Z", "url": "https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ModelBuilds/UGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "status": "enqueued", "service_sid": "UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "2015-07-30T20:00:00Z", "sid": "UGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "unique_name": "unique_name" } ' )); $actual = $this->twilio->preview->understand->services("UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->modelBuilds("UGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); $this->assertNotNull($actual); } public function testDeleteRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->understand->services("UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->modelBuilds("UGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'delete', 'https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ModelBuilds/UGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testDeleteResponse() { $this->holodeck->mock(new Response( 204, null )); $actual = $this->twilio->preview->understand->services("UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->modelBuilds("UGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); $this->assertTrue($actual); } } sdk/Twilio/Tests/Integration/Preview/Understand/Service/Intent/SampleTest.php 0000604 00000026040 15174325133 0023346 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Preview\Understand\Service\Intent; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class SampleTest extends HolodeckTestCase { public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->understand->services("UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->intents("UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->samples("UFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Intents/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Samples/UFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "url": "https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Intents/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Samples/UFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "intent_sid": "UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "sid": "UFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "2015-07-30T20:00:00Z", "language": "language", "tagged_text": "tagged_text", "date_updated": "2015-07-30T20:00:00Z" } ' )); $actual = $this->twilio->preview->understand->services("UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->intents("UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->samples("UFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); $this->assertNotNull($actual); } public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->understand->services("UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->intents("UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->samples->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Intents/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Samples' )); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "samples": [], "meta": { "first_page_url": "https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Intents/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Samples?PageSize=50&Page=0", "previous_page_url": null, "key": "samples", "next_page_url": null, "url": "https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Intents/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Samples?PageSize=50&Page=0", "page": 0, "page_size": 50 } } ' )); $actual = $this->twilio->preview->understand->services("UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->intents("UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->samples->read(); $this->assertNotNull($actual); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "samples": [ { "url": "https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Intents/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Samples/UFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "intent_sid": "UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "sid": "UFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "2015-07-30T20:00:00Z", "language": "language", "tagged_text": "tagged_text", "date_updated": "2015-07-30T20:00:00Z" } ], "meta": { "first_page_url": "https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Intents/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Samples?PageSize=50&Page=0", "previous_page_url": null, "key": "samples", "next_page_url": null, "url": "https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Intents/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Samples?PageSize=50&Page=0", "page": 0, "page_size": 50 } } ' )); $actual = $this->twilio->preview->understand->services("UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->intents("UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->samples->read(); $this->assertGreaterThan(0, count($actual)); } public function testCreateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->understand->services("UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->intents("UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->samples->create("language", "taggedText"); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $values = array('Language' => "language", 'TaggedText' => "taggedText", ); $this->assertRequest(new Request( 'post', 'https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Intents/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Samples', null, $values )); } public function testCreateResponse() { $this->holodeck->mock(new Response( 201, ' { "url": "https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Intents/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Samples/UFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "intent_sid": "UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "sid": "UFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "2015-07-30T20:00:00Z", "language": "language", "tagged_text": "tagged_text", "date_updated": "2015-07-30T20:00:00Z" } ' )); $actual = $this->twilio->preview->understand->services("UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->intents("UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->samples->create("language", "taggedText"); $this->assertNotNull($actual); } public function testUpdateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->understand->services("UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->intents("UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->samples("UFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'post', 'https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Intents/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Samples/UFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testUpdateResponse() { $this->holodeck->mock(new Response( 200, ' { "url": "https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Intents/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Samples/UFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "intent_sid": "UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "sid": "UFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "2015-07-30T20:00:00Z", "language": "language", "tagged_text": "tagged_text", "date_updated": "2015-07-30T20:00:00Z" } ' )); $actual = $this->twilio->preview->understand->services("UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->intents("UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->samples("UFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); $this->assertNotNull($actual); } public function testDeleteRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->understand->services("UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->intents("UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->samples("UFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'delete', 'https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Intents/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Samples/UFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testDeleteResponse() { $this->holodeck->mock(new Response( 204, null )); $actual = $this->twilio->preview->understand->services("UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->intents("UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->samples("UFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); $this->assertTrue($actual); } } sdk/Twilio/Tests/Integration/Preview/Understand/Service/Intent/FieldTest.php 0000604 00000022177 15174325133 0023157 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Preview\Understand\Service\Intent; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class FieldTest extends HolodeckTestCase { public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->understand->services("UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->intents("UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->fields("UEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Intents/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Fields/UEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "url": "https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Intents/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Fields/UEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "unique_name": "unique_name", "date_updated": "2015-07-30T20:00:00Z", "service_sid": "UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "intent_sid": "UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "2015-07-30T20:00:00Z", "sid": "UEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "field_type": "field_type" } ' )); $actual = $this->twilio->preview->understand->services("UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->intents("UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->fields("UEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); $this->assertNotNull($actual); } public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->understand->services("UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->intents("UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->fields->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Intents/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Fields' )); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "fields": [], "meta": { "page": 0, "first_page_url": "https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Intents/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Fields?PageSize=50&Page=0", "url": "https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Intents/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Fields?PageSize=50&Page=0", "key": "fields", "next_page_url": null, "previous_page_url": null, "page_size": 50 } } ' )); $actual = $this->twilio->preview->understand->services("UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->intents("UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->fields->read(); $this->assertNotNull($actual); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "fields": [ { "url": "https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Intents/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Fields/UEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "unique_name": "unique_name", "date_updated": "2015-07-30T20:00:00Z", "service_sid": "UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "intent_sid": "UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "2015-07-30T20:00:00Z", "sid": "UEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "field_type": "field_type" } ], "meta": { "page": 0, "first_page_url": "https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Intents/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Fields?PageSize=50&Page=0", "url": "https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Intents/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Fields?PageSize=50&Page=0", "key": "fields", "next_page_url": null, "previous_page_url": null, "page_size": 50 } } ' )); $actual = $this->twilio->preview->understand->services("UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->intents("UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->fields->read(); $this->assertGreaterThan(0, count($actual)); } public function testCreateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->understand->services("UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->intents("UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->fields->create("fieldType", "uniqueName"); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $values = array('FieldType' => "fieldType", 'UniqueName' => "uniqueName", ); $this->assertRequest(new Request( 'post', 'https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Intents/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Fields', null, $values )); } public function testCreateResponse() { $this->holodeck->mock(new Response( 201, ' { "url": "https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Intents/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Fields/UEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "unique_name": "unique_name", "date_updated": "2015-07-30T20:00:00Z", "service_sid": "UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "intent_sid": "UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "2015-07-30T20:00:00Z", "sid": "UEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "field_type": "field_type" } ' )); $actual = $this->twilio->preview->understand->services("UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->intents("UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->fields->create("fieldType", "uniqueName"); $this->assertNotNull($actual); } public function testDeleteRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->understand->services("UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->intents("UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->fields("UEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'delete', 'https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Intents/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Fields/UEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testDeleteResponse() { $this->holodeck->mock(new Response( 204, null )); $actual = $this->twilio->preview->understand->services("UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->intents("UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->fields("UEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); $this->assertTrue($actual); } } sdk/Twilio/Tests/Integration/Preview/Understand/Service/IntentTest.php 0000604 00000026566 15174325133 0022142 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Preview\Understand\Service; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class IntentTest extends HolodeckTestCase { public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->understand->services("UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->intents("UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Intents/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "unique_name": "unique_name", "links": { "fields": "https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Intents/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Fields", "named_entities": "https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Intents/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/NamedEntities", "samples": "https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Intents/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Samples" }, "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "friendly_name": "friendly_name", "url": "https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Intents/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "sid": "UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_updated": "2015-07-30T20:00:00Z", "service_sid": "UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "2015-07-30T20:00:00Z" } ' )); $actual = $this->twilio->preview->understand->services("UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->intents("UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); $this->assertNotNull($actual); } public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->understand->services("UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->intents->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Intents' )); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "meta": { "key": "intents", "page_size": 50, "next_page_url": null, "url": "https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Intents?PageSize=50&Page=0", "page": 0, "first_page_url": "https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Intents?PageSize=50&Page=0", "previous_page_url": null }, "intents": [] } ' )); $actual = $this->twilio->preview->understand->services("UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->intents->read(); $this->assertNotNull($actual); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "meta": { "key": "intents", "page_size": 50, "next_page_url": null, "url": "https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Intents?PageSize=50&Page=0", "page": 0, "first_page_url": "https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Intents?PageSize=50&Page=0", "previous_page_url": null }, "intents": [ { "unique_name": "unique_name", "links": { "fields": "https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Intents/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Fields", "named_entities": "https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Intents/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/NamedEntities", "samples": "https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Intents/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Samples" }, "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "friendly_name": "friendly_name", "url": "https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Intents/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "sid": "UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_updated": "2015-07-30T20:00:00Z", "service_sid": "UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "2015-07-30T20:00:00Z" } ] } ' )); $actual = $this->twilio->preview->understand->services("UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->intents->read(); $this->assertGreaterThan(0, count($actual)); } public function testCreateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->understand->services("UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->intents->create("uniqueName"); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $values = array('UniqueName' => "uniqueName", ); $this->assertRequest(new Request( 'post', 'https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Intents', null, $values )); } public function testCreateResponse() { $this->holodeck->mock(new Response( 201, ' { "unique_name": "unique_name", "links": { "fields": "https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Intents/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Fields", "named_entities": "https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Intents/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/NamedEntities", "samples": "https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Intents/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Samples" }, "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "friendly_name": "friendly_name", "url": "https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Intents/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "sid": "UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_updated": "2015-07-30T20:00:00Z", "service_sid": "UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "2015-07-30T20:00:00Z" } ' )); $actual = $this->twilio->preview->understand->services("UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->intents->create("uniqueName"); $this->assertNotNull($actual); } public function testUpdateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->understand->services("UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->intents("UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'post', 'https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Intents/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testUpdateResponse() { $this->holodeck->mock(new Response( 200, ' { "unique_name": "unique_name", "links": { "fields": "https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Intents/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Fields", "named_entities": "https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Intents/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/NamedEntities", "samples": "https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Intents/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Samples" }, "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "friendly_name": "friendly_name", "url": "https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Intents/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "sid": "UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_updated": "2015-07-30T20:00:00Z", "service_sid": "UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "2015-07-30T20:00:00Z" } ' )); $actual = $this->twilio->preview->understand->services("UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->intents("UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); $this->assertNotNull($actual); } public function testDeleteRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->understand->services("UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->intents("UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'delete', 'https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Intents/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testDeleteResponse() { $this->holodeck->mock(new Response( 204, null )); $actual = $this->twilio->preview->understand->services("UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->intents("UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); $this->assertTrue($actual); } } sdk/Twilio/Tests/Integration/Preview/Understand/Service/FieldTypeTest.php 0000604 00000024215 15174325133 0022553 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Preview\Understand\Service; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class FieldTypeTest extends HolodeckTestCase { public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->understand->services("UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->fieldTypes("UBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/FieldTypes/UBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "unique_name": "unique_name", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "2015-07-30T20:00:00Z", "friendly_name": "friendly_name", "url": "https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/FieldTypes/UBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_updated": "2015-07-30T20:00:00Z", "links": { "field_values": "https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/FieldTypes/UBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/FieldValues" }, "sid": "UBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->preview->understand->services("UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->fieldTypes("UBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); $this->assertNotNull($actual); } public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->understand->services("UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->fieldTypes->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/FieldTypes' )); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "meta": { "url": "https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/FieldTypes?PageSize=50&Page=0", "first_page_url": "https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/FieldTypes?PageSize=50&Page=0", "previous_page_url": null, "page": 0, "page_size": 50, "next_page_url": null, "key": "field_types" }, "field_types": [] } ' )); $actual = $this->twilio->preview->understand->services("UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->fieldTypes->read(); $this->assertNotNull($actual); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "meta": { "url": "https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/FieldTypes?PageSize=50&Page=0", "first_page_url": "https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/FieldTypes?PageSize=50&Page=0", "previous_page_url": null, "page": 0, "page_size": 50, "next_page_url": null, "key": "field_types" }, "field_types": [ { "unique_name": "unique_name", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "2015-07-30T20:00:00Z", "friendly_name": "friendly_name", "url": "https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/FieldTypes/UBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_updated": "2015-07-30T20:00:00Z", "links": { "field_values": "https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/FieldTypes/UBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/FieldValues" }, "sid": "UBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ] } ' )); $actual = $this->twilio->preview->understand->services("UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->fieldTypes->read(); $this->assertGreaterThan(0, count($actual)); } public function testCreateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->understand->services("UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->fieldTypes->create("uniqueName"); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $values = array('UniqueName' => "uniqueName", ); $this->assertRequest(new Request( 'post', 'https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/FieldTypes', null, $values )); } public function testCreateResponse() { $this->holodeck->mock(new Response( 201, ' { "unique_name": "unique_name", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "2015-07-30T20:00:00Z", "friendly_name": "friendly_name", "url": "https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/FieldTypes/UBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_updated": "2015-07-30T20:00:00Z", "links": { "field_values": "https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/FieldTypes/UBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/FieldValues" }, "sid": "UBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->preview->understand->services("UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->fieldTypes->create("uniqueName"); $this->assertNotNull($actual); } public function testUpdateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->understand->services("UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->fieldTypes("UBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'post', 'https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/FieldTypes/UBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testUpdateResponse() { $this->holodeck->mock(new Response( 200, ' { "unique_name": "unique_name", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "2015-07-30T20:00:00Z", "friendly_name": "friendly_name", "url": "https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/FieldTypes/UBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_updated": "2015-07-30T20:00:00Z", "links": { "field_values": "https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/FieldTypes/UBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/FieldValues" }, "sid": "UBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->preview->understand->services("UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->fieldTypes("UBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); $this->assertNotNull($actual); } public function testDeleteRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->understand->services("UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->fieldTypes("UBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'delete', 'https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/FieldTypes/UBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testDeleteResponse() { $this->holodeck->mock(new Response( 204, null )); $actual = $this->twilio->preview->understand->services("UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->fieldTypes("UBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); $this->assertTrue($actual); } } sdk/Twilio/Tests/Integration/Preview/Understand/Service/FieldType/FieldValueTest.php 0000604 00000022403 15174325134 0024571 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Preview\Understand\Service\FieldType; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class FieldValueTest extends HolodeckTestCase { public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->understand->services("UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->fieldTypes("UBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->fieldValues("UCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/FieldTypes/UBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/FieldValues/UCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "url": "https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/FieldTypes/UBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/FieldValues/UCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "field_type_sid": "UBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "language": "language", "service_sid": "UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "value": "value", "date_updated": "2015-07-30T20:00:00Z", "date_created": "2015-07-30T20:00:00Z", "sid": "UCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->preview->understand->services("UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->fieldTypes("UBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->fieldValues("UCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); $this->assertNotNull($actual); } public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->understand->services("UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->fieldTypes("UBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->fieldValues->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/FieldTypes/UBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/FieldValues' )); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "field_values": [], "meta": { "first_page_url": "https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/FieldTypes/UBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/FieldValues?PageSize=50&Page=0", "page_size": 50, "previous_page_url": null, "key": "field_values", "page": 0, "next_page_url": null, "url": "https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/FieldTypes/UBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/FieldValues?PageSize=50&Page=0" } } ' )); $actual = $this->twilio->preview->understand->services("UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->fieldTypes("UBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->fieldValues->read(); $this->assertNotNull($actual); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "field_values": [ { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "url": "https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/FieldTypes/UBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/FieldValues/UCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "field_type_sid": "UBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "language": "language", "service_sid": "UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "value": "value", "date_updated": "2015-07-30T20:00:00Z", "date_created": "2015-07-30T20:00:00Z", "sid": "UCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ], "meta": { "first_page_url": "https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/FieldTypes/UBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/FieldValues?PageSize=50&Page=0", "page_size": 50, "previous_page_url": null, "key": "field_values", "page": 0, "next_page_url": null, "url": "https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/FieldTypes/UBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/FieldValues?PageSize=50&Page=0" } } ' )); $actual = $this->twilio->preview->understand->services("UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->fieldTypes("UBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->fieldValues->read(); $this->assertGreaterThan(0, count($actual)); } public function testCreateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->understand->services("UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->fieldTypes("UBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->fieldValues->create("language", "value"); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $values = array('Language' => "language", 'Value' => "value", ); $this->assertRequest(new Request( 'post', 'https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/FieldTypes/UBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/FieldValues', null, $values )); } public function testCreateResponse() { $this->holodeck->mock(new Response( 201, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "url": "https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/FieldTypes/UBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/FieldValues/UCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "field_type_sid": "UBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "language": "language", "service_sid": "UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "value": "value", "date_updated": "2015-07-30T20:00:00Z", "date_created": "2015-07-30T20:00:00Z", "sid": "UCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->preview->understand->services("UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->fieldTypes("UBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->fieldValues->create("language", "value"); $this->assertNotNull($actual); } public function testDeleteRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->understand->services("UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->fieldTypes("UBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->fieldValues("UCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'delete', 'https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/FieldTypes/UBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/FieldValues/UCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testDeleteResponse() { $this->holodeck->mock(new Response( 204, null )); $actual = $this->twilio->preview->understand->services("UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->fieldTypes("UBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->fieldValues("UCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); $this->assertTrue($actual); } } sdk/Twilio/Tests/Integration/Preview/Understand/Service/QueryTest.php 0000604 00000027603 15174325134 0022000 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Preview\Understand\Service; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class QueryTest extends HolodeckTestCase { public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->understand->services("UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->queries("UHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Queries/UHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "language": "language", "date_created": "2015-07-30T20:00:00Z", "model_build_sid": "UGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "query": "query", "date_updated": "2015-07-30T20:00:00Z", "status": "status", "sample_sid": "UFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "results": { "intent": { "name": "name", "intent_sid": "UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "confidence": 0.9 }, "entities": [ { "name": "name", "value": "value", "type": "type" } ] }, "url": "https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Queries/UHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "sid": "UHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->preview->understand->services("UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->queries("UHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); $this->assertNotNull($actual); } public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->understand->services("UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->queries->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Queries' )); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "queries": [], "meta": { "previous_page_url": null, "next_page_url": null, "first_page_url": "https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Queries?PageSize=50&Page=0", "page": 0, "key": "queries", "url": "https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Queries?PageSize=50&Page=0", "page_size": 50 } } ' )); $actual = $this->twilio->preview->understand->services("UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->queries->read(); $this->assertNotNull($actual); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "queries": [ { "language": "language", "date_created": "2015-07-30T20:00:00Z", "model_build_sid": "UGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "query": "query", "date_updated": "2015-07-30T20:00:00Z", "status": "status", "sample_sid": "UFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "results": { "intent": { "name": "name", "intent_sid": "UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "confidence": 0.9 }, "entities": [ { "name": "name", "value": "value", "type": "type" } ] }, "url": "https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Queries/UHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "sid": "UHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ], "meta": { "previous_page_url": null, "next_page_url": null, "first_page_url": "https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Queries?PageSize=50&Page=0", "page": 0, "key": "queries", "url": "https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Queries?PageSize=50&Page=0", "page_size": 50 } } ' )); $actual = $this->twilio->preview->understand->services("UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->queries->read(); $this->assertGreaterThan(0, count($actual)); } public function testCreateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->understand->services("UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->queries->create("language", "query"); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $values = array('Language' => "language", 'Query' => "query", ); $this->assertRequest(new Request( 'post', 'https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Queries', null, $values )); } public function testCreateResponse() { $this->holodeck->mock(new Response( 201, ' { "language": "language", "date_created": "2015-07-30T20:00:00Z", "model_build_sid": "UGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "query": "query", "date_updated": "2015-07-30T20:00:00Z", "status": "status", "sample_sid": "UFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "results": { "intent": { "name": "name", "intent_sid": "UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "confidence": 0.9 }, "entities": [ { "name": "name", "value": "value", "type": "type" } ] }, "url": "https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Queries/UHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "sid": "UHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->preview->understand->services("UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->queries->create("language", "query"); $this->assertNotNull($actual); } public function testUpdateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->understand->services("UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->queries("UHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'post', 'https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Queries/UHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testUpdateResponse() { $this->holodeck->mock(new Response( 200, ' { "language": "language", "date_created": "2015-07-30T20:00:00Z", "model_build_sid": "UGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "query": "query", "date_updated": "2015-07-30T20:00:00Z", "status": "status", "sample_sid": "UFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "results": { "intent": { "name": "name", "intent_sid": "UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "confidence": 0.9 }, "entities": [ { "name": "name", "value": "value", "type": "type" } ] }, "url": "https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Queries/UHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "sid": "UHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->preview->understand->services("UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->queries("UHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); $this->assertNotNull($actual); } public function testDeleteRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->understand->services("UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->queries("UHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'delete', 'https://preview.twilio.com/understand/Services/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Queries/UHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testDeleteResponse() { $this->holodeck->mock(new Response( 204, null )); $actual = $this->twilio->preview->understand->services("UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->queries("UHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); $this->assertTrue($actual); } } sdk/Twilio/Tests/Integration/Preview/Proxy/ServiceTest.php 0000604 00000016203 15174325134 0017677 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Preview\Proxy; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class ServiceTest extends HolodeckTestCase { public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->proxy->services("KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://preview.twilio.com/Proxy/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "friendly_name": "friendly_name", "date_created": "2015-07-30T20:00:00Z", "url": "https://preview.twilio.com/Proxy/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_updated": "2015-07-30T20:00:00Z", "sid": "KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "links": { "sessions": "https://preview.twilio.com/Proxy/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sessions", "phone_numbers": "https://preview.twilio.com/Proxy/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/PhoneNumbers", "short_codes": "https://preview.twilio.com/Proxy/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ShortCodes" }, "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "callback_url": "http://www.example.com", "auto_create": false } ' )); $actual = $this->twilio->preview->proxy->services("KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); $this->assertNotNull($actual); } public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->proxy->services->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://preview.twilio.com/Proxy/Services' )); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "meta": { "previous_page_url": null, "next_page_url": null, "url": "https://preview.twilio.com/Proxy/Services?PageSize=50&Page=0", "page": 0, "first_page_url": "https://preview.twilio.com/Proxy/Services?PageSize=50&Page=0", "page_size": 50, "key": "services" }, "services": [] } ' )); $actual = $this->twilio->preview->proxy->services->read(); $this->assertNotNull($actual); } public function testCreateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->proxy->services->create(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'post', 'https://preview.twilio.com/Proxy/Services' )); } public function testCreateResponse() { $this->holodeck->mock(new Response( 201, ' { "friendly_name": "friendly_name", "date_created": "2015-07-30T20:00:00Z", "url": "https://preview.twilio.com/Proxy/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_updated": "2015-07-30T20:00:00Z", "sid": "KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "links": { "sessions": "https://preview.twilio.com/Proxy/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sessions", "phone_numbers": "https://preview.twilio.com/Proxy/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/PhoneNumbers", "short_codes": "https://preview.twilio.com/Proxy/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ShortCodes" }, "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "callback_url": "http://www.example.com", "auto_create": false } ' )); $actual = $this->twilio->preview->proxy->services->create(); $this->assertNotNull($actual); } public function testDeleteRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->proxy->services("KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'delete', 'https://preview.twilio.com/Proxy/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testDeleteResponse() { $this->holodeck->mock(new Response( 204, null )); $actual = $this->twilio->preview->proxy->services("KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); $this->assertTrue($actual); } public function testUpdateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->proxy->services("KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'post', 'https://preview.twilio.com/Proxy/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testUpdateResponse() { $this->holodeck->mock(new Response( 200, ' { "friendly_name": "friendly_name", "date_created": "2015-07-30T20:00:00Z", "url": "https://preview.twilio.com/Proxy/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_updated": "2015-07-30T20:00:00Z", "sid": "KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "links": { "sessions": "https://preview.twilio.com/Proxy/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sessions", "phone_numbers": "https://preview.twilio.com/Proxy/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/PhoneNumbers", "short_codes": "https://preview.twilio.com/Proxy/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ShortCodes" }, "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "callback_url": "http://www.example.com", "auto_create": false } ' )); $actual = $this->twilio->preview->proxy->services("KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/Preview/Proxy/Service/Session/InteractionTest.php 0000604 00000011211 15174325134 0023573 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Preview\Proxy\Service\Session; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class InteractionTest extends HolodeckTestCase { public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->proxy->services("KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->sessions("KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->interactions("KIaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://preview.twilio.com/Proxy/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sessions/KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Interactions/KIaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "service_sid": "KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "data": "data", "date_created": "2015-07-30T20:00:00Z", "date_updated": "2015-07-30T20:00:00Z", "inbound_participant_sid": "KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "inbound_resource_sid": "SMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "inbound_resource_status": "sent", "inbound_resource_type": "Message", "inbound_resource_url": null, "outbound_participant_sid": "KPbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb", "outbound_resource_sid": "SMbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb", "outbound_resource_status": "sent", "outbound_resource_type": "Message", "outbound_resource_url": null, "sid": "KIaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "status": "completed", "url": "https://preview.twilio.com/Proxy/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sessions/KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Interactions/KIaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "session_sid": "KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->preview->proxy->services("KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->sessions("KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->interactions("KIaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); $this->assertNotNull($actual); } public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->proxy->services("KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->sessions("KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->interactions->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://preview.twilio.com/Proxy/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sessions/KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Interactions' )); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "interactions": [], "meta": { "previous_page_url": null, "next_page_url": null, "url": "https://preview.twilio.com/Proxy/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sessions/KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Interactions?PageSize=50&Page=0", "page": 0, "first_page_url": "https://preview.twilio.com/Proxy/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sessions/KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Interactions?PageSize=50&Page=0", "page_size": 50, "key": "interactions" } } ' )); $actual = $this->twilio->preview->proxy->services("KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->sessions("KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->interactions->read(); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/Preview/Proxy/Service/Session/Participant/MessageInteractionTest.php 0000604 00000020011 15174325134 0027354 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Preview\Proxy\Service\Session\Participant; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class MessageInteractionTest extends HolodeckTestCase { public function testCreateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->proxy->services("KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->sessions("KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->participants("KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->messageInteractions->create(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'post', 'https://preview.twilio.com/Proxy/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sessions/KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/MessageInteractions' )); } public function testCreateResponse() { $this->holodeck->mock(new Response( 201, ' { "service_sid": "KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "data": "body", "date_created": "2015-07-30T20:00:00Z", "date_updated": "2015-07-30T20:00:00Z", "participant_sid": "KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "inbound_participant_sid": null, "inbound_resource_sid": null, "inbound_resource_status": null, "inbound_resource_type": null, "inbound_resource_url": null, "outbound_participant_sid": "KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "outbound_resource_sid": "SMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "outbound_resource_status": "sent", "outbound_resource_type": "Message", "outbound_resource_url": null, "sid": "KIaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "status": "completed", "url": "https://preview.twilio.com/Proxy/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sessions/KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/MessageInteractions/KIaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "session_sid": "KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->preview->proxy->services("KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->sessions("KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->participants("KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->messageInteractions->create(); $this->assertNotNull($actual); } public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->proxy->services("KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->sessions("KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->participants("KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->messageInteractions("KIaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://preview.twilio.com/Proxy/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sessions/KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/MessageInteractions/KIaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "service_sid": "KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "data": "data", "date_created": "2015-07-30T20:00:00Z", "date_updated": "2015-07-30T20:00:00Z", "participant_sid": "KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "inbound_participant_sid": null, "inbound_resource_sid": null, "inbound_resource_status": null, "inbound_resource_type": null, "inbound_resource_url": null, "outbound_participant_sid": "KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "outbound_resource_sid": "SMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "outbound_resource_status": "sent", "outbound_resource_type": "Message", "outbound_resource_url": null, "sid": "KIaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "status": "completed", "url": "https://preview.twilio.com/Proxy/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sessions/KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/MessageInteractions/KIaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "session_sid": "KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->preview->proxy->services("KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->sessions("KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->participants("KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->messageInteractions("KIaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); $this->assertNotNull($actual); } public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->proxy->services("KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->sessions("KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->participants("KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->messageInteractions->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://preview.twilio.com/Proxy/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sessions/KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/MessageInteractions' )); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "interactions": [], "meta": { "previous_page_url": null, "next_page_url": null, "url": "https://preview.twilio.com/Proxy/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sessions/KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/MessageInteractions?PageSize=50&Page=0", "page": 0, "first_page_url": "https://preview.twilio.com/Proxy/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sessions/KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/MessageInteractions?PageSize=50&Page=0", "page_size": 50, "key": "interactions" } } ' )); $actual = $this->twilio->preview->proxy->services("KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->sessions("KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->participants("KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->messageInteractions->read(); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/Preview/Proxy/Service/Session/ParticipantTest.php 0000604 00000024240 15174325134 0023600 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Preview\Proxy\Service\Session; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class ParticipantTest extends HolodeckTestCase { public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->proxy->services("KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->sessions("KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->participants("KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://preview.twilio.com/Proxy/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sessions/KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "service_sid": "KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "participant_type": "sms", "identifier": "identifier", "date_updated": "2015-07-30T20:00:00Z", "proxy_identifier": "proxy_identifier", "friendly_name": "friendly_name", "date_created": "2015-07-30T20:00:00Z", "url": "https://preview.twilio.com/Proxy/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sessions/KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "links": { "message_interactions": "https://preview.twilio.com/Proxy/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sessions/KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/MessageInteractions" }, "sid": "KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "session_sid": "KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->preview->proxy->services("KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->sessions("KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->participants("KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); $this->assertNotNull($actual); } public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->proxy->services("KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->sessions("KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->participants->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://preview.twilio.com/Proxy/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sessions/KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants' )); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "meta": { "previous_page_url": null, "next_page_url": null, "url": "https://preview.twilio.com/Proxy/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sessions/KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants?PageSize=50&Page=0", "page": 0, "first_page_url": "https://preview.twilio.com/Proxy/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sessions/KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants?PageSize=50&Page=0", "page_size": 50, "key": "participants" }, "participants": [] } ' )); $actual = $this->twilio->preview->proxy->services("KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->sessions("KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->participants->read(); $this->assertNotNull($actual); } public function testCreateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->proxy->services("KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->sessions("KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->participants->create("identifier"); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $values = array('Identifier' => "identifier", ); $this->assertRequest(new Request( 'post', 'https://preview.twilio.com/Proxy/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sessions/KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants', null, $values )); } public function testCreateResponse() { $this->holodeck->mock(new Response( 201, ' { "service_sid": "KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "participant_type": "sms", "identifier": "identifier", "date_updated": "2015-07-30T20:00:00Z", "proxy_identifier": "proxy_identifier", "friendly_name": "friendly_name", "date_created": "2015-07-30T20:00:00Z", "url": "https://preview.twilio.com/Proxy/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sessions/KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "links": { "message_interactions": "https://preview.twilio.com/Proxy/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sessions/KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/MessageInteractions" }, "sid": "KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "session_sid": "KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->preview->proxy->services("KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->sessions("KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->participants->create("identifier"); $this->assertNotNull($actual); } public function testDeleteRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->proxy->services("KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->sessions("KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->participants("KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'delete', 'https://preview.twilio.com/Proxy/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sessions/KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testDeleteResponse() { $this->holodeck->mock(new Response( 204, null )); $actual = $this->twilio->preview->proxy->services("KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->sessions("KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->participants("KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); $this->assertTrue($actual); } public function testUpdateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->proxy->services("KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->sessions("KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->participants("KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'post', 'https://preview.twilio.com/Proxy/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sessions/KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testUpdateResponse() { $this->holodeck->mock(new Response( 200, ' { "service_sid": "KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "participant_type": "sms", "identifier": "identifier", "date_updated": "2015-07-30T20:00:00Z", "proxy_identifier": "proxy_identifier", "friendly_name": "friendly_name", "date_created": "2015-07-30T20:00:00Z", "url": "https://preview.twilio.com/Proxy/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sessions/KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "links": { "message_interactions": "https://preview.twilio.com/Proxy/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sessions/KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/MessageInteractions" }, "sid": "KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "session_sid": "KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->preview->proxy->services("KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->sessions("KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->participants("KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/Preview/Proxy/Service/PhoneNumberTest.php 0000604 00000015412 15174325134 0022122 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Preview\Proxy\Service; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class PhoneNumberTest extends HolodeckTestCase { public function testCreateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->proxy->services("KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->phoneNumbers->create("PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $values = array('Sid' => "PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", ); $this->assertRequest(new Request( 'post', 'https://preview.twilio.com/Proxy/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/PhoneNumbers', null, $values )); } public function testCreateResponse() { $this->holodeck->mock(new Response( 201, ' { "sid": "PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "2015-07-30T20:00:00Z", "date_updated": "2015-07-30T20:00:00Z", "phone_number": "+987654321", "country_code": "US", "capabilities": [], "url": "https://preview.twilio.com/Proxy/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/PhoneNumbers/PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->preview->proxy->services("KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->phoneNumbers->create("PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"); $this->assertNotNull($actual); } public function testDeleteRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->proxy->services("KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->phoneNumbers("PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'delete', 'https://preview.twilio.com/Proxy/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/PhoneNumbers/PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testDeleteResponse() { $this->holodeck->mock(new Response( 204, null )); $actual = $this->twilio->preview->proxy->services("KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->phoneNumbers("PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); $this->assertTrue($actual); } public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->proxy->services("KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->phoneNumbers->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://preview.twilio.com/Proxy/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/PhoneNumbers' )); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "meta": { "page": 0, "page_size": 50, "first_page_url": "https://preview.twilio.com/Proxy/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/PhoneNumbers?PageSize=50&Page=0", "previous_page_url": null, "next_page_url": null, "key": "phone_numbers", "url": "https://preview.twilio.com/Proxy/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/PhoneNumbers?PageSize=50&Page=0" }, "phone_numbers": [ { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "sid": "PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "2015-07-30T20:00:00Z", "date_updated": "2015-07-30T20:00:00Z", "phone_number": "+987654321", "country_code": "US", "capabilities": [], "url": "https://preview.twilio.com/Proxy/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/PhoneNumbers/PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ] } ' )); $actual = $this->twilio->preview->proxy->services("KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->phoneNumbers->read(); $this->assertGreaterThan(0, count($actual)); } public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->proxy->services("KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->phoneNumbers("PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://preview.twilio.com/Proxy/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/PhoneNumbers/PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "sid": "PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "2015-07-30T20:00:00Z", "date_updated": "2015-07-30T20:00:00Z", "phone_number": "12345", "country_code": "US", "capabilities": [], "url": "https://preview.twilio.com/Proxy/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/PhoneNumbers/PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->preview->proxy->services("KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->phoneNumbers("PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/Preview/Proxy/Service/ShortCodeTest.php 0000604 00000015322 15174325134 0021572 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Preview\Proxy\Service; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class ShortCodeTest extends HolodeckTestCase { public function testCreateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->proxy->services("KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->shortCodes->create("SCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $values = array('Sid' => "SCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", ); $this->assertRequest(new Request( 'post', 'https://preview.twilio.com/Proxy/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ShortCodes', null, $values )); } public function testCreateResponse() { $this->holodeck->mock(new Response( 201, ' { "sid": "SCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "2015-07-30T20:00:00Z", "date_updated": "2015-07-30T20:00:00Z", "short_code": "12345", "country_code": "US", "capabilities": [], "url": "https://preview.twilio.com/Proxy/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ShortCodes/SCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->preview->proxy->services("KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->shortCodes->create("SCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"); $this->assertNotNull($actual); } public function testDeleteRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->proxy->services("KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->shortCodes("SCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'delete', 'https://preview.twilio.com/Proxy/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ShortCodes/SCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testDeleteResponse() { $this->holodeck->mock(new Response( 204, null )); $actual = $this->twilio->preview->proxy->services("KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->shortCodes("SCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); $this->assertTrue($actual); } public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->proxy->services("KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->shortCodes->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://preview.twilio.com/Proxy/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ShortCodes' )); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "meta": { "page": 0, "page_size": 50, "first_page_url": "https://preview.twilio.com/Proxy/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ShortCodes?PageSize=50&Page=0", "previous_page_url": null, "next_page_url": null, "key": "short_codes", "url": "https://preview.twilio.com/Proxy/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ShortCodes?PageSize=50&Page=0" }, "short_codes": [ { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "sid": "SCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "2015-07-30T20:00:00Z", "date_updated": "2015-07-30T20:00:00Z", "short_code": "12345", "country_code": "US", "capabilities": [], "url": "https://preview.twilio.com/Proxy/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ShortCodes/SCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ] } ' )); $actual = $this->twilio->preview->proxy->services("KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->shortCodes->read(); $this->assertGreaterThan(0, count($actual)); } public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->proxy->services("KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->shortCodes("SCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://preview.twilio.com/Proxy/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ShortCodes/SCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "sid": "SCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "2015-07-30T20:00:00Z", "date_updated": "2015-07-30T20:00:00Z", "short_code": "12345", "country_code": "US", "capabilities": [], "url": "https://preview.twilio.com/Proxy/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ShortCodes/SCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->preview->proxy->services("KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->shortCodes("SCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/Preview/Proxy/Service/SessionTest.php 0000604 00000021465 15174325134 0021330 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Preview\Proxy\Service; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class SessionTest extends HolodeckTestCase { public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->proxy->services("KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->sessions("KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://preview.twilio.com/Proxy/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sessions/KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "service_sid": "KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "status": "in-progess", "unique_name": "unique_name", "start_time": "2015-07-30T20:00:00Z", "links": { "interactions": "https://preview.twilio.com/Proxy/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sessions/KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Interactions", "participants": "https://preview.twilio.com/Proxy/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sessions/KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants" }, "ttl": 100, "date_updated": "2015-07-30T20:00:00Z", "date_created": "2015-07-30T20:00:00Z", "end_time": "2015-07-30T20:00:00Z", "url": "https://preview.twilio.com/Proxy/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sessions/KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "sid": "KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->preview->proxy->services("KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->sessions("KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); $this->assertNotNull($actual); } public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->proxy->services("KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->sessions->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://preview.twilio.com/Proxy/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sessions' )); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "sessions": [], "meta": { "previous_page_url": null, "next_page_url": null, "url": "https://preview.twilio.com/Proxy/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sessions?PageSize=50&Page=0", "page": 0, "first_page_url": "https://preview.twilio.com/Proxy/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sessions?PageSize=50&Page=0", "page_size": 50, "key": "sessions" } } ' )); $actual = $this->twilio->preview->proxy->services("KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->sessions->read(); $this->assertNotNull($actual); } public function testCreateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->proxy->services("KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->sessions->create(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'post', 'https://preview.twilio.com/Proxy/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sessions' )); } public function testCreateResponse() { $this->holodeck->mock(new Response( 201, ' { "service_sid": "KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "status": "in-progess", "unique_name": "unique_name", "start_time": "2015-07-30T20:00:00Z", "links": { "interactions": "https://preview.twilio.com/Proxy/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sessions/KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Interactions", "participants": "https://preview.twilio.com/Proxy/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sessions/KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants" }, "ttl": 100, "date_updated": "2015-07-30T20:00:00Z", "date_created": "2015-07-30T20:00:00Z", "end_time": "2015-07-30T20:00:00Z", "url": "https://preview.twilio.com/Proxy/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sessions/KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "sid": "KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->preview->proxy->services("KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->sessions->create(); $this->assertNotNull($actual); } public function testDeleteRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->proxy->services("KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->sessions("KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'delete', 'https://preview.twilio.com/Proxy/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sessions/KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testDeleteResponse() { $this->holodeck->mock(new Response( 204, null )); $actual = $this->twilio->preview->proxy->services("KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->sessions("KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); $this->assertTrue($actual); } public function testUpdateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->proxy->services("KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->sessions("KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'post', 'https://preview.twilio.com/Proxy/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sessions/KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testUpdateResponse() { $this->holodeck->mock(new Response( 200, ' { "service_sid": "KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "status": "in-progess", "unique_name": "unique_name", "start_time": "2015-07-30T20:00:00Z", "links": { "interactions": "https://preview.twilio.com/Proxy/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sessions/KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Interactions", "participants": "https://preview.twilio.com/Proxy/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sessions/KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants" }, "ttl": 100, "date_updated": "2015-07-30T20:00:00Z", "date_created": "2015-07-30T20:00:00Z", "end_time": "2015-07-30T20:00:00Z", "url": "https://preview.twilio.com/Proxy/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sessions/KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "sid": "KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->preview->proxy->services("KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->sessions("KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/Preview/Accsecurity/Service/VerificationCheckTest.php 0000604 00000003631 15174325134 0024415 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Preview\Accsecurity\Service; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class VerificationCheckTest extends HolodeckTestCase { public function testCreateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->accSecurity->services("VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->verificationChecks->create("code"); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $values = array('Code' => "code", ); $this->assertRequest(new Request( 'post', 'https://preview.twilio.com/Verification/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/VerificationCheck', null, $values )); } public function testVerificationChecksResponse() { $this->holodeck->mock(new Response( 201, ' { "sid": "VEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "to": "+14159373912", "channel": "sms", "status": "approved", "valid": false, "date_created": "2015-07-30T20:00:00Z", "date_updated": "2015-07-30T20:00:00Z" } ' )); $actual = $this->twilio->preview->accSecurity->services("VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->verificationChecks->create("code"); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/Preview/Accsecurity/Service/VerificationTest.php 0000604 00000003652 15174325134 0023462 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Preview\Accsecurity\Service; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class VerificationTest extends HolodeckTestCase { public function testCreateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->accSecurity->services("VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->verifications->create("to", "channel"); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $values = array('To' => "to", 'Channel' => "channel", ); $this->assertRequest(new Request( 'post', 'https://preview.twilio.com/Verification/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Verifications', null, $values )); } public function testCreateVerificationResponse() { $this->holodeck->mock(new Response( 201, ' { "sid": "VEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "service_sid": "VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "to": "+14159373912", "channel": "sms", "status": "pending", "valid": null, "date_created": "2015-07-30T20:00:00Z", "date_updated": "2015-07-30T20:00:00Z" } ' )); $actual = $this->twilio->preview->accSecurity->services("VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->verifications->create("to", "channel"); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/Preview/Wireless/Sim/UsageTest.php 0000604 00000003347 15174325134 0020554 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Preview\Wireless\Sim; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class UsageTest extends HolodeckTestCase { public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->wireless->sims("DEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->usage()->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://preview.twilio.com/wireless/Sims/DEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "commands_costs": {}, "commands_usage": {}, "data_costs": {}, "data_usage": {}, "sim_unique_name": "sim_unique_name", "sim_sid": "DEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "period": {}, "url": "https://preview.twilio.com/wireless/Sims/DEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage" } ' )); $actual = $this->twilio->preview->wireless->sims("DEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->usage()->fetch(); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/Preview/Wireless/RatePlanTest.php 0000604 00000021454 15174325134 0020465 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Preview\Wireless; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class RatePlanTest extends HolodeckTestCase { public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->wireless->ratePlans->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://preview.twilio.com/wireless/RatePlans' )); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "meta": { "first_page_url": "https://preview.twilio.com/wireless/RatePlans?PageSize=50&Page=0", "key": "rate_plans", "next_page_url": null, "page": 0, "page_size": 50, "previous_page_url": null, "url": "https://preview.twilio.com/wireless/RatePlans?PageSize=50&Page=0" }, "rate_plans": [] } ' )); $actual = $this->twilio->preview->wireless->ratePlans->read(); $this->assertNotNull($actual); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "meta": { "first_page_url": "https://preview.twilio.com/wireless/RatePlans?PageSize=50&Page=0", "key": "rate_plans", "next_page_url": null, "page": 0, "page_size": 50, "previous_page_url": null, "url": "https://preview.twilio.com/wireless/RatePlans?PageSize=50&Page=0" }, "rate_plans": [ { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "unique_name": "unique_name", "data_enabled": true, "data_limit": 1000, "data_metering": "pooled", "date_created": "2015-07-30T20:00:00Z", "date_updated": "2015-07-30T20:00:00Z", "friendly_name": "friendly_name", "messaging_enabled": true, "voice_enabled": true, "national_roaming_enabled": true, "international_roaming": [ "data", "messaging", "voice" ], "sid": "WPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "url": "https://preview.twilio.com/wireless/RatePlans/WPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ] } ' )); $actual = $this->twilio->preview->wireless->ratePlans->read(); $this->assertGreaterThan(0, count($actual)); } public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->wireless->ratePlans("WPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://preview.twilio.com/wireless/RatePlans/WPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "unique_name": "unique_name", "data_enabled": true, "data_limit": 1000, "data_metering": "pooled", "date_created": "2015-07-30T20:00:00Z", "date_updated": "2015-07-30T20:00:00Z", "friendly_name": "friendly_name", "messaging_enabled": true, "voice_enabled": true, "national_roaming_enabled": true, "international_roaming": [ "data", "messaging", "voice" ], "sid": "WPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "url": "https://preview.twilio.com/wireless/RatePlans/WPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->preview->wireless->ratePlans("WPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); $this->assertNotNull($actual); } public function testCreateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->wireless->ratePlans->create(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'post', 'https://preview.twilio.com/wireless/RatePlans' )); } public function testCreateResponse() { $this->holodeck->mock(new Response( 201, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "unique_name": "unique_name", "data_enabled": true, "data_limit": 1000, "data_metering": "pooled", "date_created": "2015-07-30T20:00:00Z", "date_updated": "2015-07-30T20:00:00Z", "friendly_name": "friendly_name", "messaging_enabled": true, "voice_enabled": true, "national_roaming_enabled": true, "international_roaming": [ "data", "messaging", "voice" ], "sid": "WPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "url": "https://preview.twilio.com/wireless/RatePlans/WPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->preview->wireless->ratePlans->create(); $this->assertNotNull($actual); } public function testUpdateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->wireless->ratePlans("WPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'post', 'https://preview.twilio.com/wireless/RatePlans/WPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testUpdateResponse() { $this->holodeck->mock(new Response( 200, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "unique_name": "unique_name", "data_enabled": true, "data_limit": 1000, "data_metering": "pooled", "date_created": "2015-07-30T20:00:00Z", "date_updated": "2015-07-30T20:00:00Z", "friendly_name": "friendly_name", "messaging_enabled": true, "voice_enabled": true, "national_roaming_enabled": true, "international_roaming": [ "data", "messaging", "voice" ], "sid": "WPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "url": "https://preview.twilio.com/wireless/RatePlans/WPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->preview->wireless->ratePlans("WPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); $this->assertNotNull($actual); } public function testDeleteRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->wireless->ratePlans("WPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'delete', 'https://preview.twilio.com/wireless/RatePlans/WPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testDeleteResponse() { $this->holodeck->mock(new Response( 204, null )); $actual = $this->twilio->preview->wireless->ratePlans("WPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); $this->assertTrue($actual); } } sdk/Twilio/Tests/Integration/Preview/Wireless/CommandTest.php 0000604 00000013574 15174325134 0020341 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Preview\Wireless; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class CommandTest extends HolodeckTestCase { public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->wireless->commands("DCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://preview.twilio.com/wireless/Commands/DCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "command": "command", "command_mode": "command_mode", "date_created": "2015-07-30T20:00:00Z", "date_updated": "2015-07-30T20:00:00Z", "device_sid": "DEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "sim_sid": "DEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "direction": "direction", "sid": "DCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "status": "status", "url": "https://preview.twilio.com/wireless/Commands/DCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->preview->wireless->commands("DCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); $this->assertNotNull($actual); } public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->wireless->commands->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://preview.twilio.com/wireless/Commands' )); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "commands": [], "meta": { "first_page_url": "https://preview.twilio.com/wireless/Commands?PageSize=50&Page=0", "key": "commands", "next_page_url": null, "page": 0, "page_size": 50, "previous_page_url": null, "url": "https://preview.twilio.com/wireless/Commands?PageSize=50&Page=0" } } ' )); $actual = $this->twilio->preview->wireless->commands->read(); $this->assertNotNull($actual); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "commands": [ { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "command": "command", "command_mode": "command_mode", "date_created": "2015-07-30T20:00:00Z", "date_updated": "2015-07-30T20:00:00Z", "device_sid": "DEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "sim_sid": "DEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "direction": "direction", "sid": "DCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "status": "status", "url": "https://preview.twilio.com/wireless/Commands/DCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ], "meta": { "first_page_url": "https://preview.twilio.com/wireless/Commands?PageSize=50&Page=0", "key": "commands", "next_page_url": null, "page": 0, "page_size": 50, "previous_page_url": null, "url": "https://preview.twilio.com/wireless/Commands?PageSize=50&Page=0" } } ' )); $actual = $this->twilio->preview->wireless->commands->read(); $this->assertGreaterThan(0, count($actual)); } public function testCreateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->preview->wireless->commands->create("command"); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $values = array('Command' => "command", ); $this->assertRequest(new Request( 'post', 'https://preview.twilio.com/wireless/Commands', null, $values )); } public function testCreateResponse() { $this->holodeck->mock(new Response( 201, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "command": "command", "command_mode": "command_mode", "date_created": "2015-07-30T20:00:00Z", "date_updated": "2015-07-30T20:00:00Z", "device_sid": "DEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "sim_sid": "DEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "direction": "direction", "sid": "DCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "status": "status", "url": "https://preview.twilio.com/wireless/Commands/DCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->preview->wireless->commands->create("command"); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/Pricing/V1/Messaging/CountryTest.php 0000604 00000010445 15174325134 0021000 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Pricing\V1\Messaging; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class CountryTest extends HolodeckTestCase { public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->pricing->v1->messaging ->countries->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://pricing.twilio.com/v1/Messaging/Countries' )); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "countries": [], "meta": { "first_page_url": "https://pricing.twilio.com/v1/Messaging/Countries?Page=0&PageSize=50", "key": "countries", "next_page_url": null, "page": 0, "page_size": 0, "previous_page_url": null, "url": "https://pricing.twilio.com/v1/Messaging/Countries" } } ' )); $actual = $this->twilio->pricing->v1->messaging ->countries->read(); $this->assertNotNull($actual); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "countries": [ { "country": "country", "iso_country": "US", "url": "http://www.example.com" } ], "meta": { "first_page_url": "https://pricing.twilio.com/v1/Messaging/Countries?Page=0&PageSize=50", "key": "countries", "next_page_url": null, "page": 0, "page_size": 1, "previous_page_url": null, "url": "https://pricing.twilio.com/v1/Messaging/Countries" } } ' )); $actual = $this->twilio->pricing->v1->messaging ->countries->read(); $this->assertGreaterThan(0, count($actual)); } public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->pricing->v1->messaging ->countries("US")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://pricing.twilio.com/v1/Messaging/Countries/US' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "country": "country", "inbound_sms_prices": [ { "base_price": 0.05, "current_price": 0.05, "number_type": "mobile" } ], "iso_country": "US", "outbound_sms_prices": [ { "carrier": "att", "mcc": "foo", "mnc": "bar", "prices": [ { "base_price": 0.05, "current_price": 0.05, "number_type": "mobile" } ] } ], "price_unit": "USD", "url": "http://www.example.com" } ' )); $actual = $this->twilio->pricing->v1->messaging ->countries("US")->fetch(); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/Pricing/V1/PhoneNumber/CountryTest.php 0000604 00000010132 15174325134 0021276 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Pricing\V1\PhoneNumber; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class CountryTest extends HolodeckTestCase { public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->pricing->v1->phoneNumbers ->countries->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://pricing.twilio.com/v1/PhoneNumbers/Countries' )); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "countries": [ { "country": "Austria", "iso_country": "AT", "url": "https://pricing.twilio.com/v1/PhoneNumbers/Countries/AT" } ], "meta": { "first_page_url": "https://pricing.twilio.com/v1/PhoneNumbers/Countries?PageSize=1&Page=0", "key": "countries", "next_page_url": null, "page": 0, "page_size": 1, "previous_page_url": null, "url": "https://pricing.twilio.com/v1/PhoneNumbers/Countries?PageSize=1&Page=0" } } ' )); $actual = $this->twilio->pricing->v1->phoneNumbers ->countries->read(); $this->assertGreaterThan(0, count($actual)); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "countries": [], "meta": { "first_page_url": "https://pricing.twilio.com/v1/PhoneNumbers/Countries?PageSize=1&Page=0", "key": "countries", "next_page_url": null, "page": 0, "page_size": 1, "previous_page_url": null, "url": "https://pricing.twilio.com/v1/PhoneNumbers/Countries?PageSize=1&Page=0" } } ' )); $actual = $this->twilio->pricing->v1->phoneNumbers ->countries->read(); $this->assertNotNull($actual); } public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->pricing->v1->phoneNumbers ->countries("US")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://pricing.twilio.com/v1/PhoneNumbers/Countries/US' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "country": "Estonia", "iso_country": "EE", "phone_number_prices": [ { "base_price": 3.0, "current_price": 3.0, "type": "mobile" }, { "base_price": 1.0, "current_price": 1.0, "type": "national" } ], "price_unit": "usd", "url": "https://pricing.twilio.com/v1/PhoneNumbers/Countries/US" } ' )); $actual = $this->twilio->pricing->v1->phoneNumbers ->countries("US")->fetch(); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/Api/V2010/AccountTest.php 0000604 00000030056 15174325134 0016354 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Api\V2010; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class AccountTest extends HolodeckTestCase { public function testCreateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts->create(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'post', 'https://api.twilio.com/2010-04-01/Accounts.json' )); } public function testCreateResponse() { $this->holodeck->mock(new Response( 201, ' { "auth_token": "AUTHTOKEN", "date_created": "Sun, 15 Mar 2009 02:08:47 +0000", "date_updated": "Wed, 25 Aug 2010 01:30:09 +0000", "friendly_name": "Test Account", "sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "owner_account_sid": "ACbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb", "status": "active", "subresource_uris": { "available_phone_numbers": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers.json", "calls": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls.json", "conferences": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Conferences.json", "incoming_phone_numbers": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers.json", "notifications": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Notifications.json", "outgoing_caller_ids": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/OutgoingCallerIds.json", "recordings": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings.json", "sms_messages": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SMS/Messages.json", "transcriptions": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Transcriptions.json" }, "type": "Full", "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json" } ' )); $actual = $this->twilio->api->v2010->accounts->create(); $this->assertNotNull($actual); } public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "auth_token": "AUTHTOKEN", "date_created": "Sun, 15 Mar 2009 02:08:47 +0000", "date_updated": "Wed, 25 Aug 2010 01:30:09 +0000", "friendly_name": "Test Account", "sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "owner_account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "status": "active", "subresource_uris": { "available_phone_numbers": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers.json", "calls": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls.json", "conferences": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Conferences.json", "incoming_phone_numbers": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers.json", "notifications": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Notifications.json", "outgoing_caller_ids": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/OutgoingCallerIds.json", "recordings": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings.json", "sms_messages": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SMS/Messages.json", "transcriptions": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Transcriptions.json" }, "type": "Full", "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); $this->assertNotNull($actual); } public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://api.twilio.com/2010-04-01/Accounts.json' )); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "accounts": [ { "auth_token": "foobar", "date_created": "Tue, 23 Aug 2011 20:58:45 +0000", "date_updated": "Fri, 04 Sep 2015 22:53:32 +0000", "friendly_name": "Sub account for testing requests authed with parent account", "owner_account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "status": "active", "subresource_uris": { "applications": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Applications.json", "authorized_connect_apps": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AuthorizedConnectApps.json", "available_phone_numbers": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers.json", "calls": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls.json", "conferences": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Conferences.json", "connect_apps": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ConnectApps.json", "incoming_phone_numbers": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers.json", "media": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Media.json", "messages": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages.json", "notifications": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Notifications.json", "outgoing_caller_ids": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/OutgoingCallerIds.json", "queues": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Queues.json", "recordings": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings.json", "sip": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP.json", "sms_messages": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SMS/Messages.json", "transcriptions": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Transcriptions.json", "usage": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage.json" }, "type": "Full", "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json" } ], "end": 0, "first_page_uri": "/2010-04-01/Accounts.json?PageSize=1&Page=0", "last_page_uri": "/2010-04-01/Accounts.json?PageSize=1&Page=4", "next_page_uri": null, "num_pages": 5, "page": 0, "page_size": 1, "previous_page_uri": null, "start": 0, "total": 5, "uri": "/2010-04-01/Accounts.json?PageSize=1" } ' )); $actual = $this->twilio->api->v2010->accounts->read(); $this->assertGreaterThan(0, count($actual)); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "accounts": [], "end": 0, "first_page_uri": "/2010-04-01/Accounts.json?PageSize=1&Page=0", "last_page_uri": "/2010-04-01/Accounts.json?PageSize=1&Page=4", "next_page_uri": null, "num_pages": 5, "page": 0, "page_size": 1, "previous_page_uri": null, "start": 0, "total": 5, "uri": "/2010-04-01/Accounts.json?PageSize=1" } ' )); $actual = $this->twilio->api->v2010->accounts->read(); $this->assertNotNull($actual); } public function testUpdateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'post', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json' )); } public function testUpdateResponse() { $this->holodeck->mock(new Response( 200, ' { "auth_token": "AUTHTOKEN", "date_created": "Sun, 15 Mar 2009 02:08:47 +0000", "date_updated": "Wed, 25 Aug 2010 01:30:09 +0000", "friendly_name": "Test Account", "sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "owner_account_sid": "ACbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb", "status": "active", "subresource_uris": { "available_phone_numbers": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers.json", "calls": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls.json", "conferences": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Conferences.json", "incoming_phone_numbers": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers.json", "notifications": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Notifications.json", "outgoing_caller_ids": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/OutgoingCallerIds.json", "recordings": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings.json", "sms_messages": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SMS/Messages.json", "transcriptions": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Transcriptions.json" }, "type": "Full", "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/Api/V2010/Account/SigningKeyTest.php 0000604 00000014520 15174325134 0020421 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Api\V2010\Account; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class SigningKeyTest extends HolodeckTestCase { public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->signingKeys("SKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SigningKeys/SKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "sid": "SKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "friendly_name": "foo", "date_created": "Mon, 13 Jun 2016 22:50:08 +0000", "date_updated": "Mon, 13 Jun 2016 22:50:08 +0000" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->signingKeys("SKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); $this->assertNotNull($actual); } public function testUpdateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->signingKeys("SKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'post', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SigningKeys/SKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json' )); } public function testUpdateResponse() { $this->holodeck->mock(new Response( 200, ' { "sid": "SKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "friendly_name": "foo", "date_created": "Mon, 13 Jun 2016 22:50:08 +0000", "date_updated": "Mon, 13 Jun 2016 22:50:08 +0000" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->signingKeys("SKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); $this->assertNotNull($actual); } public function testDeleteRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->signingKeys("SKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'delete', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SigningKeys/SKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json' )); } public function testDeleteResponse() { $this->holodeck->mock(new Response( 204, null )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->signingKeys("SKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); $this->assertTrue($actual); } public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->signingKeys->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SigningKeys.json' )); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "signing_keys": [ { "sid": "SKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "friendly_name": "foo", "date_created": "Mon, 13 Jun 2016 22:50:08 +0000", "date_updated": "Mon, 13 Jun 2016 22:50:08 +0000" } ], "first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SigningKeys.json?PageSize=50&Page=0", "end": 0, "previous_page_uri": null, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SigningKeys.json?PageSize=50&Page=0", "page_size": 50, "start": 0, "next_page_uri": null, "page": 0 } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->signingKeys->read(); $this->assertGreaterThan(0, count($actual)); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "signing_keys": [], "first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SigningKeys.json?PageSize=50&Page=0", "end": 0, "previous_page_uri": null, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SigningKeys.json?PageSize=50&Page=0", "page_size": 50, "start": 0, "next_page_uri": null, "page": 0 } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->signingKeys->read(); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/Api/V2010/Account/IncomingPhoneNumber/MobileTest.php 0000604 00000017322 15174325134 0023472 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Api\V2010\Account\IncomingPhoneNumber; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class MobileTest extends HolodeckTestCase { public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->incomingPhoneNumbers ->mobile->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/Mobile.json' )); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "end": 0, "first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/Mobile.json?Page=0&PageSize=50", "incoming_phone_numbers": [ { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "address_requirements": "none", "address_sid": "ADaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "api_version": "2010-04-01", "beta": null, "capabilities": { "mms": false, "sms": true, "voice": false }, "date_created": "Tue, 08 Sep 2015 16:21:16 +0000", "date_updated": "Tue, 08 Sep 2015 16:21:16 +0000", "friendly_name": "61429099450", "identity_sid": "RIaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "phone_number": "+61429099450", "origin": "origin", "sid": "PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "sms_application_sid": "", "sms_fallback_method": "POST", "sms_fallback_url": "", "sms_method": "POST", "sms_url": "", "status_callback": "", "status_callback_method": "POST", "trunk_sid": null, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json", "voice_application_sid": "", "voice_caller_id_lookup": false, "voice_fallback_method": "POST", "voice_fallback_url": null, "voice_method": "POST", "voice_url": null } ], "last_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/Mobile.json?Page=0&PageSize=50", "next_page_uri": null, "num_pages": 1, "page": 0, "page_size": 50, "previous_page_uri": null, "start": 0, "total": 1, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/Mobile.json" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->incomingPhoneNumbers ->mobile->read(); $this->assertGreaterThan(0, count($actual)); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "end": 0, "first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/Mobile.json?Page=0&PageSize=50", "incoming_phone_numbers": [], "last_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/Mobile.json?Page=0&PageSize=50", "next_page_uri": null, "num_pages": 1, "page": 0, "page_size": 50, "previous_page_uri": null, "start": 0, "total": 1, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/Mobile.json" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->incomingPhoneNumbers ->mobile->read(); $this->assertNotNull($actual); } public function testCreateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->incomingPhoneNumbers ->mobile->create("+15017122661"); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $values = array('PhoneNumber' => "+15017122661", ); $this->assertRequest(new Request( 'post', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/Mobile.json', null, $values )); } public function testCreateResponse() { $this->holodeck->mock(new Response( 201, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "address_requirements": "none", "address_sid": "ADaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "api_version": "2010-04-01", "beta": false, "capabilities": { "mms": true, "sms": false, "voice": true }, "date_created": "Thu, 30 Jul 2015 23:19:04 +0000", "date_updated": "Thu, 30 Jul 2015 23:19:04 +0000", "identity_sid": "RIaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "friendly_name": "(808) 925-5327", "phone_number": "+18089255327", "origin": "origin", "sid": "PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "sms_application_sid": "", "sms_fallback_method": "POST", "sms_fallback_url": "", "sms_method": "POST", "sms_url": "", "status_callback": "", "status_callback_method": "POST", "trunk_sid": null, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json", "voice_application_sid": "", "voice_caller_id_lookup": false, "voice_fallback_method": "POST", "voice_fallback_url": null, "voice_method": "POST", "voice_url": null } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->incomingPhoneNumbers ->mobile->create("+15017122661"); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/Api/V2010/Account/IncomingPhoneNumber/TollFreeTest.php 0000604 00000017400 15174325134 0023774 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Api\V2010\Account\IncomingPhoneNumber; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class TollFreeTest extends HolodeckTestCase { public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->incomingPhoneNumbers ->tollFree->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/TollFree.json' )); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "end": 0, "first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/TollFree.json?PageSize=1&Page=0", "incoming_phone_numbers": [ { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "address_requirements": "none", "address_sid": "ADaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "api_version": "2010-04-01", "beta": null, "capabilities": { "mms": true, "sms": false, "voice": true }, "date_created": "Thu, 30 Jul 2015 23:19:04 +0000", "date_updated": "Thu, 30 Jul 2015 23:19:04 +0000", "friendly_name": "(808) 925-5327", "identity_sid": "RIaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "phone_number": "+18089255327", "origin": "origin", "sid": "PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "sms_application_sid": "", "sms_fallback_method": "POST", "sms_fallback_url": "", "sms_method": "POST", "sms_url": "", "status_callback": "", "status_callback_method": "POST", "trunk_sid": null, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json", "voice_application_sid": "", "voice_caller_id_lookup": false, "voice_fallback_method": "POST", "voice_fallback_url": null, "voice_method": "POST", "voice_url": null } ], "last_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/TollFree.json?PageSize=1&Page=2", "next_page_uri": null, "num_pages": 3, "page": 0, "page_size": 1, "previous_page_uri": null, "start": 0, "total": 3, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/TollFree.json?PageSize=1" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->incomingPhoneNumbers ->tollFree->read(); $this->assertGreaterThan(0, count($actual)); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "end": 0, "first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/TollFree.json?PageSize=1&Page=0", "incoming_phone_numbers": [], "last_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/TollFree.json?PageSize=1&Page=2", "next_page_uri": null, "num_pages": 3, "page": 0, "page_size": 1, "previous_page_uri": null, "start": 0, "total": 3, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/TollFree.json?PageSize=1" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->incomingPhoneNumbers ->tollFree->read(); $this->assertNotNull($actual); } public function testCreateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->incomingPhoneNumbers ->tollFree->create("+15017122661"); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $values = array('PhoneNumber' => "+15017122661", ); $this->assertRequest(new Request( 'post', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/TollFree.json', null, $values )); } public function testCreateResponse() { $this->holodeck->mock(new Response( 201, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "address_requirements": "none", "address_sid": "ADaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "api_version": "2010-04-01", "beta": false, "capabilities": { "mms": true, "sms": false, "voice": true }, "date_created": "Thu, 30 Jul 2015 23:19:04 +0000", "date_updated": "Thu, 30 Jul 2015 23:19:04 +0000", "friendly_name": "(808) 925-5327", "identity_sid": "RIaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "phone_number": "+18089255327", "origin": "origin", "sid": "PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "sms_application_sid": "", "sms_fallback_method": "POST", "sms_fallback_url": "", "sms_method": "POST", "sms_url": "", "status_callback": "", "status_callback_method": "POST", "trunk_sid": null, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json", "voice_application_sid": "", "voice_caller_id_lookup": false, "voice_fallback_method": "POST", "voice_fallback_url": null, "voice_method": "POST", "voice_url": null } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->incomingPhoneNumbers ->tollFree->create("+15017122661"); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/Api/V2010/Account/IncomingPhoneNumber/AssignedAddOnTest.php 0000604 00000024771 15174325134 0024734 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Api\V2010\Account\IncomingPhoneNumber; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class AssignedAddOnTest extends HolodeckTestCase { public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->incomingPhoneNumbers("PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->assignedAddOns("XEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AssignedAddOns/XEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "sid": "XEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "resource_sid": "PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "friendly_name": "VoiceBase High Accuracy Transcription", "description": "Automatic Transcription and Keyword Extract...", "configuration": { "bad_words": true }, "unique_name": "voicebase_high_accuracy_transcription", "date_created": "Thu, 07 Apr 2016 23:52:28 +0000", "date_updated": "Thu, 07 Apr 2016 23:52:28 +0000", "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AssignedAddOns/XEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json", "subresource_uris": { "extensions": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AssignedAddOns/XEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Extensions.json" } } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->incomingPhoneNumbers("PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->assignedAddOns("XEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); $this->assertNotNull($actual); } public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->incomingPhoneNumbers("PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->assignedAddOns->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AssignedAddOns.json' )); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "end": 0, "first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AssignedAddOns.json?PageSize=50&Page=0", "next_page_uri": null, "page": 0, "page_size": 50, "previous_page_uri": null, "assigned_add_ons": [ { "sid": "XEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "resource_sid": "PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "friendly_name": "VoiceBase High Accuracy Transcription", "description": "Automatic Transcription and Keyword Extract...", "configuration": { "bad_words": true }, "unique_name": "voicebase_high_accuracy_transcription", "date_created": "Thu, 07 Apr 2016 23:52:28 +0000", "date_updated": "Thu, 07 Apr 2016 23:52:28 +0000", "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AssignedAddOns/XEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json", "subresource_uris": { "extensions": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AssignedAddOns/XEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Extensions.json" } } ], "start": 0, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AssignedAddOns.json?PageSize=50&Page=0" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->incomingPhoneNumbers("PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->assignedAddOns->read(); $this->assertGreaterThan(0, count($actual)); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "end": 0, "first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AssignedAddOns.json?PageSize=50&Page=0", "next_page_uri": null, "page": 0, "page_size": 50, "previous_page_uri": null, "assigned_add_ons": [], "start": 0, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AssignedAddOns.json?PageSize=50&Page=0" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->incomingPhoneNumbers("PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->assignedAddOns->read(); $this->assertNotNull($actual); } public function testCreateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->incomingPhoneNumbers("PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->assignedAddOns->create("XEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $values = array('InstalledAddOnSid' => "XEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", ); $this->assertRequest(new Request( 'post', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AssignedAddOns.json', null, $values )); } public function testCreateResponse() { $this->holodeck->mock(new Response( 201, ' { "sid": "XEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "resource_sid": "PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "friendly_name": "VoiceBase High Accuracy Transcription", "description": "Automatic Transcription and Keyword Extract...", "configuration": { "bad_words": true }, "unique_name": "voicebase_high_accuracy_transcription", "date_created": "Thu, 07 Apr 2016 23:52:28 +0000", "date_updated": "Thu, 07 Apr 2016 23:52:28 +0000", "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AssignedAddOns/XEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json", "subresource_uris": { "extensions": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AssignedAddOns/XEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Extensions.json" } } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->incomingPhoneNumbers("PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->assignedAddOns->create("XEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"); $this->assertNotNull($actual); } public function testDeleteRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->incomingPhoneNumbers("PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->assignedAddOns("XEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'delete', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AssignedAddOns/XEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json' )); } public function testDeleteResponse() { $this->holodeck->mock(new Response( 204, null )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->incomingPhoneNumbers("PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->assignedAddOns("XEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); $this->assertTrue($actual); } } sdk/Twilio/Tests/Integration/Api/V2010/Account/IncomingPhoneNumber/LocalTest.php 0000604 00000017326 15174325134 0023321 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Api\V2010\Account\IncomingPhoneNumber; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class LocalTest extends HolodeckTestCase { public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->incomingPhoneNumbers ->local->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/Local.json' )); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "end": 0, "first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/Local.json?PageSize=1&Page=0", "incoming_phone_numbers": [ { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "address_requirements": "none", "address_sid": "ADaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "api_version": "2010-04-01", "beta": null, "capabilities": { "mms": true, "sms": false, "voice": true }, "date_created": "Thu, 30 Jul 2015 23:19:04 +0000", "date_updated": "Thu, 30 Jul 2015 23:19:04 +0000", "friendly_name": "(808) 925-5327", "identity_sid": "RIaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "phone_number": "+18089255327", "origin": "origin", "sid": "PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "sms_application_sid": "", "sms_fallback_method": "POST", "sms_fallback_url": "", "sms_method": "POST", "sms_url": "", "status_callback": "", "status_callback_method": "POST", "trunk_sid": null, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json", "voice_application_sid": "", "voice_caller_id_lookup": false, "voice_fallback_method": "POST", "voice_fallback_url": null, "voice_method": "POST", "voice_url": null } ], "last_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/Local.json?PageSize=1&Page=2", "next_page_uri": null, "num_pages": 3, "page": 0, "page_size": 1, "previous_page_uri": null, "start": 0, "total": 3, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/Local.json?PageSize=1" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->incomingPhoneNumbers ->local->read(); $this->assertGreaterThan(0, count($actual)); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "end": 0, "first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/Local.json?PageSize=1&Page=0", "incoming_phone_numbers": [], "last_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/Local.json?PageSize=1&Page=2", "next_page_uri": null, "num_pages": 3, "page": 0, "page_size": 1, "previous_page_uri": null, "start": 0, "total": 3, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/Local.json?PageSize=1" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->incomingPhoneNumbers ->local->read(); $this->assertNotNull($actual); } public function testCreateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->incomingPhoneNumbers ->local->create("+15017122661"); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $values = array('PhoneNumber' => "+15017122661", ); $this->assertRequest(new Request( 'post', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/Local.json', null, $values )); } public function testCreateResponse() { $this->holodeck->mock(new Response( 201, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "address_requirements": "none", "address_sid": "ADaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "api_version": "2010-04-01", "beta": false, "capabilities": { "mms": true, "sms": false, "voice": true }, "date_created": "Thu, 30 Jul 2015 23:19:04 +0000", "date_updated": "Thu, 30 Jul 2015 23:19:04 +0000", "friendly_name": "(808) 925-5327", "identity_sid": "RIaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "phone_number": "+18089255327", "origin": "origin", "sid": "PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "sms_application_sid": "", "sms_fallback_method": "POST", "sms_fallback_url": "", "sms_method": "POST", "sms_url": "", "status_callback": "", "status_callback_method": "POST", "trunk_sid": null, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json", "voice_application_sid": "", "voice_caller_id_lookup": false, "voice_fallback_method": "POST", "voice_fallback_url": null, "voice_method": "POST", "voice_url": null } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->incomingPhoneNumbers ->local->create("+15017122661"); $this->assertNotNull($actual); } } Tests/Integration/Api/V2010/Account/IncomingPhoneNumber/AssignedAddOn/AssignedAddOnExtensionTest.php0000604 00000015331 15174325134 0031205 0 ustar 00 sdk/Twilio <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Api\V2010\Account\IncomingPhoneNumber\AssignedAddOn; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class AssignedAddOnExtensionTest extends HolodeckTestCase { public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->incomingPhoneNumbers("PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->assignedAddOns("XEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->extensions("XFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AssignedAddOns/XEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Extensions/XFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "sid": "XFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "assigned_add_on_sid": "XEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "resource_sid": "PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "friendly_name": "Incoming Voice Call", "product_name": "Programmable Voice", "unique_name": "voice-incoming", "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AssignedAddOns/XEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Extensions/XFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json", "enabled": true } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->incomingPhoneNumbers("PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->assignedAddOns("XEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->extensions("XFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); $this->assertNotNull($actual); } public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->incomingPhoneNumbers("PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->assignedAddOns("XEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->extensions->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AssignedAddOns/XEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Extensions.json' )); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "end": 0, "first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AssignedAddOns/XEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Extensions.json?PageSize=50&Page=0", "next_page_uri": null, "page": 0, "page_size": 50, "previous_page_uri": null, "extensions": [ { "sid": "XFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "assigned_add_on_sid": "XEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "resource_sid": "PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "friendly_name": "Incoming Voice Call", "product_name": "Programmable Voice", "unique_name": "voice-incoming", "enabled": true, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AssignedAddOns/XEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Extensions/XFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json" } ], "start": 0, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AssignedAddOns/XEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Extensions.json?PageSize=50&Page=0" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->incomingPhoneNumbers("PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->assignedAddOns("XEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->extensions->read(); $this->assertGreaterThan(0, count($actual)); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "end": 0, "first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AssignedAddOns/XEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Extensions.json?PageSize=50&Page=0", "next_page_uri": null, "page": 0, "page_size": 50, "previous_page_uri": null, "extensions": [], "start": 0, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AssignedAddOns/XEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Extensions.json?PageSize=50&Page=0" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->incomingPhoneNumbers("PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->assignedAddOns("XEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->extensions->read(); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/Api/V2010/Account/MessageTest.php 0000604 00000027736 15174325134 0017753 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Api\V2010\Account; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class MessageTest extends HolodeckTestCase { public function testCreateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->messages->create("+15558675310"); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $values = array('To' => "+15558675310", ); $this->assertRequest(new Request( 'post', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages.json', null, $values )); } public function testCreateResponse() { $this->holodeck->mock(new Response( 201, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "api_version": "2010-04-01", "body": "O Slash: \u00d8, PoP: \ud83d\udca9", "date_created": "Thu, 30 Jul 2015 20:12:31 +0000", "date_sent": "Thu, 30 Jul 2015 20:12:33 +0000", "date_updated": "Thu, 30 Jul 2015 20:12:33 +0000", "direction": "outbound-api", "error_code": null, "error_message": null, "from": "+14155552345", "messaging_service_sid": "MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "num_media": "0", "num_segments": "1", "price": "-0.00750", "price_unit": "USD", "sid": "SMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "status": "sent", "subresource_uris": { "media": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/SMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Media.json" }, "to": "+14155552345", "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/SMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->messages->create("+15558675310"); $this->assertNotNull($actual); } public function testDeleteRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->messages("MMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'delete', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/MMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json' )); } public function testDeleteResponse() { $this->holodeck->mock(new Response( 204, null )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->messages("MMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); $this->assertTrue($actual); } public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->messages("MMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/MMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "api_version": "2010-04-01", "body": "O Slash: \u00d8, PoP: \ud83d\udca9", "date_created": "Thu, 30 Jul 2015 20:12:31 +0000", "date_sent": "Thu, 30 Jul 2015 20:12:33 +0000", "date_updated": "Thu, 30 Jul 2015 20:12:33 +0000", "direction": "outbound-api", "error_code": null, "error_message": null, "from": "+14155552345", "messaging_service_sid": "MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "num_media": "0", "num_segments": "1", "price": "-0.00750", "price_unit": "USD", "sid": "SMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "status": "sent", "subresource_uris": { "media": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/SMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Media.json" }, "to": "+14155552345", "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/SMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->messages("MMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); $this->assertNotNull($actual); } public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->messages->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages.json' )); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "end": 0, "first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages.json?PageSize=1&Page=0", "last_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages.json?PageSize=1&Page=119771", "messages": [ { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "api_version": "2010-04-01", "body": "O Slash: \u00d8, PoP: \ud83d\udca9", "date_created": "Fri, 04 Sep 2015 22:54:39 +0000", "date_sent": "Fri, 04 Sep 2015 22:54:41 +0000", "date_updated": "Fri, 04 Sep 2015 22:54:41 +0000", "direction": "outbound-api", "error_code": null, "error_message": null, "from": "+14155552345", "messaging_service_sid": "MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "num_media": "0", "num_segments": "1", "price": "-0.00750", "price_unit": "USD", "sid": "SMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "status": "sent", "subresource_uris": { "media": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/SMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Media.json" }, "to": "+14155552345", "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/SMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json" } ], "next_page_uri": null, "num_pages": 119772, "page": 0, "page_size": 1, "previous_page_uri": null, "start": 0, "total": 119772, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages.json?PageSize=1&Page=0" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->messages->read(); $this->assertGreaterThan(0, count($actual)); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "end": 0, "first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages.json?PageSize=1&Page=0", "last_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages.json?PageSize=1&Page=119771", "messages": [], "next_page_uri": null, "num_pages": 119772, "page": 0, "page_size": 1, "previous_page_uri": null, "start": 0, "total": 119772, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages.json?PageSize=1&Page=0" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->messages->read(); $this->assertNotNull($actual); } public function testUpdateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->messages("MMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update("body"); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $values = array('Body' => "body", ); $this->assertRequest(new Request( 'post', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/MMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json', null, $values )); } public function testUpdateResponse() { $this->holodeck->mock(new Response( 200, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "api_version": "2010-04-01", "body": "O Slash: \u00d8, PoP: \ud83d\udca9", "date_created": "Thu, 30 Jul 2015 20:12:31 +0000", "date_sent": "Thu, 30 Jul 2015 20:12:33 +0000", "date_updated": "Thu, 30 Jul 2015 20:12:33 +0000", "direction": "outbound-api", "error_code": null, "error_message": null, "from": "+14155552345", "messaging_service_sid": "MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "num_media": "0", "num_segments": "1", "price": "-0.00750", "price_unit": "USD", "sid": "SMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "status": "sent", "subresource_uris": { "media": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/SMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Media.json" }, "to": "+14155552345", "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/SMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->messages("MMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update("body"); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/Api/V2010/Account/AvailablePhoneNumberCountryTest.php 0000604 00000011461 15174325134 0023762 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Api\V2010\Account; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class AvailablePhoneNumberCountryTest extends HolodeckTestCase { public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->availablePhoneNumbers->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers.json' )); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "countries": [ { "beta": false, "country": "Denmark", "country_code": "DK", "subresource_uris": { "local": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers/DK/Local.json" }, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers/DK.json" } ], "end": 1, "first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers/DK.json?PageSize=50&Page=0", "last_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers/DK.json?PageSize=50&Page=0", "next_page_uri": null, "num_pages": 1, "page": 0, "page_size": 50, "previous_page_uri": null, "start": 0, "total": 1, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers.json" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->availablePhoneNumbers->read(); $this->assertGreaterThan(0, count($actual)); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "countries": [], "end": 1, "first_page_uri": null, "last_page_uri": null, "next_page_uri": null, "num_pages": 1, "page": 0, "page_size": 50, "previous_page_uri": null, "start": 0, "total": 1, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers.json" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->availablePhoneNumbers->read(); $this->assertNotNull($actual); } public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->availablePhoneNumbers("US")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers/US.json' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "beta": null, "country": "United States", "country_code": "US", "subresource_uris": { "local": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers/US/Local.json", "toll_free": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers/US/TollFree.json" }, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers/US.json" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->availablePhoneNumbers("US")->fetch(); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/Api/V2010/Account/AvailablePhoneNumberCountry/VoipTest.php 0000604 00000010065 15174325134 0024676 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Api\V2010\Account\AvailablePhoneNumberCountry; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class VoipTest extends HolodeckTestCase { public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->availablePhoneNumbers("US") ->voip->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers/US/Voip.json' )); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "available_phone_numbers": [ { "address_requirements": "none", "beta": false, "capabilities": { "mms": false, "sms": true, "voice": false }, "friendly_name": "+4759440374", "iso_country": "NO", "lata": null, "latitude": null, "locality": null, "longitude": null, "phone_number": "+4759440374", "postal_code": null, "rate_center": null, "region": null } ], "end": 1, "first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers/US/Voip.json?PageSize=50&Page=0", "last_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers/US/Voip.json?PageSize=50&Page=0", "next_page_uri": null, "num_pages": 1, "page": 0, "page_size": 50, "previous_page_uri": null, "start": 0, "total": 1, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers/US/Voip.json?PageSize=1" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->availablePhoneNumbers("US") ->voip->read(); $this->assertGreaterThan(0, count($actual)); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "available_phone_numbers": [], "first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers/US/Voip.json?PageSize=50&Page=0", "last_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers/US/Voip.json?PageSize=50&Page=0", "next_page_uri": null, "num_pages": 1, "page": 0, "page_size": 50, "previous_page_uri": null, "start": 0, "total": 1, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers/US/Voip.json?PageSize=1" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->availablePhoneNumbers("US") ->voip->read(); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/Api/V2010/Account/AvailablePhoneNumberCountry/SharedCostTest.php 0000604 00000010167 15174325134 0026023 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Api\V2010\Account\AvailablePhoneNumberCountry; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class SharedCostTest extends HolodeckTestCase { public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->availablePhoneNumbers("US") ->sharedCost->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers/US/SharedCost.json' )); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "available_phone_numbers": [ { "address_requirements": "none", "beta": false, "capabilities": { "mms": false, "sms": true, "voice": false }, "friendly_name": "+4759440374", "iso_country": "NO", "lata": null, "latitude": null, "locality": null, "longitude": null, "phone_number": "+4759440374", "postal_code": null, "rate_center": null, "region": null } ], "end": 1, "first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers/US/SharedCost.json?PageSize=50&Page=0", "last_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers/US/SharedCost.json?PageSize=50&Page=0", "next_page_uri": null, "num_pages": 1, "page": 0, "page_size": 50, "previous_page_uri": null, "start": 0, "total": 1, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers/US/SharedCost.json?PageSize=1" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->availablePhoneNumbers("US") ->sharedCost->read(); $this->assertGreaterThan(0, count($actual)); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "available_phone_numbers": [], "first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers/US/SharedCost.json?PageSize=50&Page=0", "last_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers/US/SharedCost.json?PageSize=50&Page=0", "next_page_uri": null, "num_pages": 1, "page": 0, "page_size": 50, "previous_page_uri": null, "start": 0, "total": 1, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers/US/SharedCost.json?PageSize=1" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->availablePhoneNumbers("US") ->sharedCost->read(); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/Api/V2010/Account/AvailablePhoneNumberCountry/MobileTest.php 0000604 00000010061 15174325134 0025164 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Api\V2010\Account\AvailablePhoneNumberCountry; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class MobileTest extends HolodeckTestCase { public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->availablePhoneNumbers("US") ->mobile->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers/US/Mobile.json' )); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "available_phone_numbers": [ { "address_requirements": "none", "beta": false, "capabilities": { "mms": false, "sms": true, "voice": false }, "friendly_name": "+4759440374", "iso_country": "NO", "lata": null, "latitude": null, "locality": null, "longitude": null, "phone_number": "+4759440374", "postal_code": null, "rate_center": null, "region": null } ], "first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers/US/Mobile.json?PageSize=50&Page=0", "last_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers/US/Mobile.json?PageSize=50&Page=0", "next_page_uri": null, "num_pages": 1, "page": 0, "page_size": 50, "previous_page_uri": null, "start": 0, "total": 1, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers/US/Mobile.json?PageSize=1" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->availablePhoneNumbers("US") ->mobile->read(); $this->assertGreaterThan(0, count($actual)); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "available_phone_numbers": [], "first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers/US/Mobile.json?PageSize=50&Page=0", "last_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers/US/Mobile.json?PageSize=50&Page=0", "next_page_uri": null, "num_pages": 1, "page": 0, "page_size": 50, "previous_page_uri": null, "start": 0, "total": 1, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers/US/Mobile.json?PageSize=1" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->availablePhoneNumbers("US") ->mobile->read(); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/Api/V2010/Account/AvailablePhoneNumberCountry/TollFreeTest.php 0000604 00000010111 15174325134 0025465 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Api\V2010\Account\AvailablePhoneNumberCountry; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class TollFreeTest extends HolodeckTestCase { public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->availablePhoneNumbers("US") ->tollFree->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers/US/TollFree.json' )); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "available_phone_numbers": [ { "address_requirements": "none", "beta": false, "capabilities": { "mms": true, "sms": true, "voice": true }, "friendly_name": "(800) 100-0052", "iso_country": "US", "lata": null, "latitude": null, "locality": null, "longitude": null, "phone_number": "+18001000052", "postal_code": null, "rate_center": null, "region": null } ], "first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers/US/TollFree.json?PageSize=50&Page=0", "last_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers/US/TollFree.json?PageSize=50&Page=0", "next_page_uri": null, "num_pages": 1, "page": 0, "page_size": 50, "previous_page_uri": null, "start": 0, "total": 1, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers/US/TollFree.json?PageSize=1" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->availablePhoneNumbers("US") ->tollFree->read(); $this->assertGreaterThan(0, count($actual)); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "available_phone_numbers": [], "first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers/US/TollFree.json?PageSize=50&Page=0", "last_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers/US/TollFree.json?PageSize=50&Page=0", "next_page_uri": null, "num_pages": 1, "page": 0, "page_size": 50, "previous_page_uri": null, "start": 0, "total": 1, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers/US/TollFree.json?PageSize=1" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->availablePhoneNumbers("US") ->tollFree->read(); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/Api/V2010/Account/AvailablePhoneNumberCountry/NationalTest.php 0000604 00000010141 15174325134 0025521 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Api\V2010\Account\AvailablePhoneNumberCountry; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class NationalTest extends HolodeckTestCase { public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->availablePhoneNumbers("US") ->national->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers/US/National.json' )); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "available_phone_numbers": [ { "address_requirements": "none", "beta": false, "capabilities": { "mms": false, "sms": true, "voice": false }, "friendly_name": "+4759440374", "iso_country": "NO", "lata": null, "latitude": null, "locality": null, "longitude": null, "phone_number": "+4759440374", "postal_code": null, "rate_center": null, "region": null } ], "end": 1, "first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers/US/National.json?PageSize=50&Page=0", "last_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers/US/National.json?PageSize=50&Page=0", "next_page_uri": null, "num_pages": 1, "page": 0, "page_size": 50, "previous_page_uri": null, "start": 0, "total": 1, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers/US/National.json?PageSize=1" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->availablePhoneNumbers("US") ->national->read(); $this->assertGreaterThan(0, count($actual)); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "available_phone_numbers": [], "first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers/US/National.json?PageSize=50&Page=0", "last_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers/US/National.json?PageSize=50&Page=0", "next_page_uri": null, "num_pages": 1, "page": 0, "page_size": 50, "previous_page_uri": null, "start": 0, "total": 1, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers/US/National.json?PageSize=1" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->availablePhoneNumbers("US") ->national->read(); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/Api/V2010/Account/AvailablePhoneNumberCountry/MachineToMachineTest.php 0000604 00000010271 15174325134 0027114 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Api\V2010\Account\AvailablePhoneNumberCountry; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class MachineToMachineTest extends HolodeckTestCase { public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->availablePhoneNumbers("US") ->machineToMachine->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers/US/MachineToMachine.json' )); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "available_phone_numbers": [ { "address_requirements": "none", "beta": false, "capabilities": { "mms": false, "sms": true, "voice": false }, "friendly_name": "+4759440374", "iso_country": "NO", "lata": null, "latitude": null, "locality": null, "longitude": null, "phone_number": "+4759440374", "postal_code": null, "rate_center": null, "region": null } ], "end": 1, "first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers/US/MachineToMachine.json?PageSize=50&Page=0", "last_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers/US/MachineToMachine.json?PageSize=50&Page=0", "next_page_uri": null, "num_pages": 1, "page": 0, "page_size": 50, "previous_page_uri": null, "start": 0, "total": 1, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers/US/MachineToMachine.json?PageSize=1" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->availablePhoneNumbers("US") ->machineToMachine->read(); $this->assertGreaterThan(0, count($actual)); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "available_phone_numbers": [], "first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers/US/MachineToMachine.json?PageSize=50&Page=0", "last_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers/US/MachineToMachine.json?PageSize=50&Page=0", "next_page_uri": null, "num_pages": 1, "page": 0, "page_size": 50, "previous_page_uri": null, "start": 0, "total": 1, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers/US/MachineToMachine.json?PageSize=1" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->availablePhoneNumbers("US") ->machineToMachine->read(); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/Api/V2010/Account/AvailablePhoneNumberCountry/LocalTest.php 0000604 00000010133 15174325134 0025007 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Api\V2010\Account\AvailablePhoneNumberCountry; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class LocalTest extends HolodeckTestCase { public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->availablePhoneNumbers("US") ->local->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers/US/Local.json' )); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "available_phone_numbers": [ { "address_requirements": "none", "beta": false, "capabilities": { "mms": true, "sms": false, "voice": true }, "friendly_name": "(808) 925-1571", "iso_country": "US", "lata": "834", "latitude": "19.720000", "locality": "Hilo", "longitude": "-155.090000", "phone_number": "+18089251571", "postal_code": "96720", "rate_center": "HILO", "region": "HI" } ], "end": 1, "first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers/US/Local.json?PageSize=50&Page=0", "last_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers/US/Local.json?PageSize=50&Page=0", "next_page_uri": null, "num_pages": 1, "page": 0, "page_size": 50, "previous_page_uri": null, "start": 0, "total": 1, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers/US/Local.json?PageSize=1" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->availablePhoneNumbers("US") ->local->read(); $this->assertGreaterThan(0, count($actual)); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "available_phone_numbers": [], "first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers/US/Local.json?PageSize=50&Page=0", "last_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers/US/Local.json?PageSize=50&Page=0", "next_page_uri": null, "num_pages": 1, "page": 0, "page_size": 50, "previous_page_uri": null, "start": 0, "total": 1, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers/US/Local.json?PageSize=1" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->availablePhoneNumbers("US") ->local->read(); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/Api/V2010/Account/KeyTest.php 0000604 00000014302 15174325134 0017100 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Api\V2010\Account; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class KeyTest extends HolodeckTestCase { public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->keys("SKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Keys/SKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "sid": "SKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "friendly_name": "foo", "date_created": "Mon, 13 Jun 2016 22:50:08 +0000", "date_updated": "Mon, 13 Jun 2016 22:50:08 +0000" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->keys("SKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); $this->assertNotNull($actual); } public function testUpdateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->keys("SKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'post', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Keys/SKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json' )); } public function testUpdateResponse() { $this->holodeck->mock(new Response( 200, ' { "sid": "SKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "friendly_name": "foo", "date_created": "Mon, 13 Jun 2016 22:50:08 +0000", "date_updated": "Mon, 13 Jun 2016 22:50:08 +0000" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->keys("SKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); $this->assertNotNull($actual); } public function testDeleteRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->keys("SKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'delete', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Keys/SKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json' )); } public function testDeleteResponse() { $this->holodeck->mock(new Response( 204, null )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->keys("SKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); $this->assertTrue($actual); } public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->keys->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Keys.json' )); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "keys": [ { "sid": "SKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "friendly_name": "foo", "date_created": "Mon, 13 Jun 2016 22:50:08 +0000", "date_updated": "Mon, 13 Jun 2016 22:50:08 +0000" } ], "first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Keys.json?PageSize=50&Page=0", "end": 0, "previous_page_uri": null, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Keys.json?PageSize=50&Page=0", "page_size": 50, "start": 0, "next_page_uri": null, "page": 0 } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->keys->read(); $this->assertGreaterThan(0, count($actual)); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "keys": [], "first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Keys.json?PageSize=50&Page=0", "end": 0, "previous_page_uri": null, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Keys.json?PageSize=50&Page=0", "page_size": 50, "start": 0, "next_page_uri": null, "page": 0 } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->keys->read(); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/Api/V2010/Account/Address/DependentPhoneNumberTest.php 0000604 00000011374 15174325134 0024014 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Api\V2010\Account\Address; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class DependentPhoneNumberTest extends HolodeckTestCase { public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->addresses("ADaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->dependentPhoneNumbers->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Addresses/ADaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/DependentPhoneNumbers.json' )); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "dependent_phone_numbers": [ { "sid": "PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "friendly_name": "3197004499318", "phone_number": "+3197004499318", "voice_url": null, "voice_method": "POST", "voice_fallback_url": null, "voice_fallback_method": "POST", "voice_caller_id_lookup": false, "date_created": "Thu, 23 Feb 2017 10:26:31 -0800", "date_updated": "Thu, 23 Feb 2017 10:26:31 -0800", "sms_url": "", "sms_method": "POST", "sms_fallback_url": "", "sms_fallback_method": "POST", "address_requirements": "any", "capabilities": { "Voice": false, "SMS": true, "MMS": false }, "status_callback": "", "status_callback_method": "POST", "api_version": "2010-04-01", "voice_application_sid": null, "sms_application_sid": "", "trunk_sid": null, "emergency_status": "Inactive", "emergency_address_sid": null, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json" } ], "first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Addresses/ADaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/DependentPhoneNumbers.json?Page=0&PageSize=50", "next_page_uri": null, "page": 0, "page_size": 50, "previous_page_uri": null, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Addresses/ADaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/DependentPhoneNumbers.json" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->addresses("ADaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->dependentPhoneNumbers->read(); $this->assertGreaterThan(0, count($actual)); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "dependent_phone_numbers": [], "first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Addresses/ADaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/DependentPhoneNumbers.json?Page=0&PageSize=50", "next_page_uri": null, "page": 0, "page_size": 50, "previous_page_uri": null, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Addresses/ADaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/DependentPhoneNumbers.json" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->addresses("ADaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->dependentPhoneNumbers->read(); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/Api/V2010/Account/NewKeyTest.php 0000604 00000003025 15174325134 0017552 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Api\V2010\Account; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class NewKeyTest extends HolodeckTestCase { public function testCreateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->newKeys->create(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'post', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Keys.json' )); } public function testCreateResponse() { $this->holodeck->mock(new Response( 201, ' { "sid": "SKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "friendly_name": "foo", "date_created": "Mon, 13 Jun 2016 22:50:08 +0000", "date_updated": "Mon, 13 Jun 2016 22:50:08 +0000", "secret": "foobar" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->newKeys->create(); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/Api/V2010/Account/Message/MediaTest.php 0000604 00000016007 15174325134 0020757 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Api\V2010\Account\Message; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class MediaTest extends HolodeckTestCase { public function testDeleteRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->messages("MMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->media("MEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'delete', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/MMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Media/MEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json' )); } public function testDeleteResponse() { $this->holodeck->mock(new Response( 204, null )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->messages("MMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->media("MEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); $this->assertTrue($actual); } public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->messages("MMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->media("MEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/MMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Media/MEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "content_type": "image/jpeg", "date_created": "Sun, 16 Aug 2015 15:53:54 +0000", "date_updated": "Sun, 16 Aug 2015 15:53:55 +0000", "parent_sid": "SMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "sid": "MEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/SMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Media/MEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->messages("MMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->media("MEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); $this->assertNotNull($actual); } public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->messages("MMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->media->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/MMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Media.json' )); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "end": 0, "first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/SMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Media.json?PageSize=50&Page=0", "last_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/SMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Media.json?PageSize=50&Page=0", "media_list": [ { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "content_type": "image/jpeg", "date_created": "Sun, 16 Aug 2015 15:53:54 +0000", "date_updated": "Sun, 16 Aug 2015 15:53:55 +0000", "parent_sid": "SMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "sid": "MEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/SMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Media/MEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json" } ], "next_page_uri": null, "num_pages": 1, "page": 0, "page_size": 50, "previous_page_uri": null, "start": 0, "total": 1, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/SMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Media.json?PageSize=50&Page=0" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->messages("MMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->media->read(); $this->assertGreaterThan(0, count($actual)); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "end": 0, "first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/SMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Media.json?PageSize=50&Page=0", "last_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/SMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Media.json?PageSize=50&Page=0", "media_list": [], "next_page_uri": null, "num_pages": 1, "page": 0, "page_size": 50, "previous_page_uri": null, "start": 0, "total": 1, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/SMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Media.json?PageSize=50&Page=0" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->messages("MMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->media->read(); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/Api/V2010/Account/Message/FeedbackTest.php 0000604 00000003512 15174325134 0021421 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Api\V2010\Account\Message; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class FeedbackTest extends HolodeckTestCase { public function testCreateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->messages("MMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->feedback->create(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'post', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/MMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Feedback.json' )); } public function testCreateResponse() { $this->holodeck->mock(new Response( 201, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "Thu, 30 Jul 2015 20:00:00 +0000", "date_updated": "Thu, 30 Jul 2015 20:00:00 +0000", "message_sid": "MMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "outcome": "confirmed", "uri": "uri" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->messages("MMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->feedback->create(); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/Api/V2010/Account/Call/FeedbackTest.php 0000604 00000012127 15174325134 0020712 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Api\V2010\Account\Call; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class FeedbackTest extends HolodeckTestCase { public function testCreateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->calls("CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->feedback()->create(1); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $values = array('QualityScore' => 1, ); $this->assertRequest(new Request( 'post', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Feedback.json', null, $values )); } public function testCreateResponse() { $this->holodeck->mock(new Response( 201, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "Thu, 20 Aug 2015 21:45:46 +0000", "date_updated": "Thu, 20 Aug 2015 21:45:46 +0000", "issues": [ "imperfect-audio", "post-dial-delay" ], "quality_score": 5, "sid": "CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->calls("CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->feedback()->create(1); $this->assertNotNull($actual); } public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->calls("CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->feedback()->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Feedback.json' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "Thu, 20 Aug 2015 21:45:46 +0000", "date_updated": "Thu, 20 Aug 2015 21:45:46 +0000", "issues": [ "imperfect-audio", "post-dial-delay" ], "quality_score": 5, "sid": "CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->calls("CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->feedback()->fetch(); $this->assertNotNull($actual); } public function testUpdateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->calls("CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->feedback()->update(1); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $values = array('QualityScore' => 1, ); $this->assertRequest(new Request( 'post', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Feedback.json', null, $values )); } public function testUpdateResponse() { $this->holodeck->mock(new Response( 200, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "Thu, 20 Aug 2015 21:45:46 +0000", "date_updated": "Thu, 20 Aug 2015 21:45:46 +0000", "issues": [ "imperfect-audio", "post-dial-delay" ], "quality_score": 5, "sid": "CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->calls("CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->feedback()->update(1); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/Api/V2010/Account/Call/NotificationTest.php 0000604 00000020060 15174325134 0021647 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Api\V2010\Account\Call; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class NotificationTest extends HolodeckTestCase { public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->calls("CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->notifications("NOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Notifications/NOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "api_version": "2008-08-01", "call_sid": "CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "Tue, 18 Aug 2015 08:46:56 +0000", "date_updated": "Tue, 18 Aug 2015 08:46:57 +0000", "error_code": "15003", "log": "1", "message_date": "Tue, 18 Aug 2015 08:46:56 +0000", "message_text": "statusCallback=http%3A%2F%2Fexample.com%2Ffoo.xml&ErrorCode=15003&LogLevel=WARN&Msg=Got+HTTP+404+response+to+http%3A%2F%2Fexample.com%2Ffoo.xml", "more_info": "https://www.twilio.com/docs/errors/15003", "request_method": null, "request_url": "", "request_variables": "", "response_body": "", "response_headers": "", "sid": "NOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Notifications/NOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->calls("CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->notifications("NOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); $this->assertNotNull($actual); } public function testDeleteRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->calls("CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->notifications("NOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'delete', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Notifications/NOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json' )); } public function testDeleteResponse() { $this->holodeck->mock(new Response( 204, null )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->calls("CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->notifications("NOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); $this->assertTrue($actual); } public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->calls("CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->notifications->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Notifications.json' )); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "end": 0, "first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Notifications.json?PageSize=50&Page=0", "last_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Notifications.json?PageSize=50&Page=0", "next_page_uri": null, "notifications": [ { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "api_version": "2008-08-01", "call_sid": "CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "Tue, 18 Aug 2015 08:46:56 +0000", "date_updated": "Tue, 18 Aug 2015 08:46:57 +0000", "error_code": "15003", "log": "1", "message_date": "Tue, 18 Aug 2015 08:46:56 +0000", "message_text": "statusCallback=http%3A%2F%2Fexample.com%2Ffoo.xml&ErrorCode=15003&LogLevel=WARN&Msg=Got+HTTP+404+response+to+http%3A%2F%2Fexample.com%2Ffoo.xml", "more_info": "https://www.twilio.com/docs/errors/15003", "request_method": null, "request_url": "", "sid": "NOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Notifications/NOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ], "num_pages": 1, "page": 0, "page_size": 50, "previous_page_uri": null, "start": 0, "total": 1, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Notifications.json" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->calls("CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->notifications->read(); $this->assertGreaterThan(0, count($actual)); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "end": 0, "first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Notifications.json?PageSize=50&Page=0", "last_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Notifications.json?PageSize=50&Page=0", "next_page_uri": null, "notifications": [], "num_pages": 1, "page": 0, "page_size": 50, "previous_page_uri": null, "start": 0, "total": 1, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Notifications.json" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->calls("CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->notifications->read(); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/Api/V2010/Account/Call/FeedbackSummaryTest.php 0000604 00000013341 15174325134 0022267 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Api\V2010\Account\Call; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Serialize; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class FeedbackSummaryTest extends HolodeckTestCase { public function testCreateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->calls ->feedbackSummaries->create(new \DateTime('2008-01-02'), new \DateTime('2008-01-02')); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $values = array( 'StartDate' => Serialize::iso8601Date(new \DateTime('2008-01-02')), 'EndDate' => Serialize::iso8601Date(new \DateTime('2008-01-02')), ); $this->assertRequest(new Request( 'post', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/FeedbackSummary.json', null, $values )); } public function testCreateResponse() { $this->holodeck->mock(new Response( 201, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "call_count": 10200, "call_feedback_count": 729, "end_date": "2011-01-01", "include_subaccounts": false, "issues": [ { "count": 45, "description": "imperfect-audio", "percentage_of_total_calls": "0.04%" } ], "quality_score_average": 4.5, "quality_score_median": 4, "quality_score_standard_deviation": 1, "sid": "FSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "start_date": "2011-01-01", "status": "completed", "date_created": "Tue, 31 Aug 2010 20:36:28 +0000", "date_updated": "Tue, 31 Aug 2010 20:36:44 +0000" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->calls ->feedbackSummaries->create(new \DateTime('2008-01-02'), new \DateTime('2008-01-02')); $this->assertNotNull($actual); } public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->calls ->feedbackSummaries("FSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/FeedbackSummary/FSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "call_count": 10200, "call_feedback_count": 729, "end_date": "2011-01-01", "include_subaccounts": false, "issues": [ { "count": 45, "description": "imperfect-audio", "percentage_of_total_calls": "0.04%" } ], "quality_score_average": 4.5, "quality_score_median": 4, "quality_score_standard_deviation": 1, "sid": "FSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "start_date": "2011-01-01", "status": "completed", "date_created": "Tue, 31 Aug 2010 20:36:28 +0000", "date_updated": "Tue, 31 Aug 2010 20:36:44 +0000" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->calls ->feedbackSummaries("FSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); $this->assertNotNull($actual); } public function testDeleteRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->calls ->feedbackSummaries("FSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'delete', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/FeedbackSummary/FSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json' )); } public function testDeleteResponse() { $this->holodeck->mock(new Response( 204, null )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->calls ->feedbackSummaries("FSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); $this->assertTrue($actual); } } sdk/Twilio/Tests/Integration/Api/V2010/Account/Call/RecordingTest.php 0000604 00000021314 15174325134 0021140 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Api\V2010\Account\Call; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class RecordingTest extends HolodeckTestCase { public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->calls("CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->recordings("REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings/REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "api_version": "2010-04-01", "call_sid": "CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "conference_sid": null, "channels": 2, "date_created": "Fri, 14 Oct 2016 21:56:34 +0000", "date_updated": "Fri, 14 Oct 2016 21:56:38 +0000", "start_time": "Fri, 14 Oct 2016 21:56:34 +0000", "end_time": "Fri, 14 Oct 2016 21:56:38 +0000", "price": "-0.0025", "price_unit": "USD", "duration": "4", "sid": "REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "encryption_details": { "encryption_public_key_sid": "CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "encryption_cek": "OV4h6zrsxMIW7h0Zfqwfn6TI2GCNl54KALlg8wn8YB8KYZhXt6HlgvBWAmQTlfYVeLWydMiCewY0YkDDT1xmNe5huEo9vjuKBS5OmYK4CZkSx1NVv3XOGrZHpd2Pl/5WJHVhUK//AUO87uh5qnUP2E0KoLh1nyCLeGcEkXU0RfpPn/6nxjof/n6m6OzZOyeIRK4Oed5+rEtjqFDfqT0EVKjs6JAxv+f0DCc1xYRHl2yV8bahUPVKs+bHYdy4PVszFKa76M/Uae4jFA9Lv233JqWcxj+K2UoghuGhAFbV/JQIIswY2CBYI8JlVSifSqNEl9vvsTJ8bkVMm3MKbG2P7Q==", "encryption_iv": "8I2hhNIYNTrwxfHk" }, "source": "StartCallRecordingAPI", "status": "completed", "error_code": null, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings/REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->calls("CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->recordings("REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); $this->assertNotNull($actual); } public function testDeleteRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->calls("CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->recordings("REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'delete', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings/REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json' )); } public function testDeleteResponse() { $this->holodeck->mock(new Response( 204, null )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->calls("CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->recordings("REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); $this->assertTrue($actual); } public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->calls("CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->recordings->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings.json' )); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "end": 0, "first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings.json?PageSize=50&Page=0", "next_page_uri": null, "page": 0, "page_size": 50, "previous_page_uri": null, "recordings": [ { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "api_version": "2010-04-01", "call_sid": "CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "conference_sid": null, "channels": 2, "date_created": "Fri, 14 Oct 2016 21:56:34 +0000", "date_updated": "Fri, 14 Oct 2016 21:56:38 +0000", "start_time": "Fri, 14 Oct 2016 21:56:34 +0000", "end_time": "Fri, 14 Oct 2016 21:56:38 +0000", "price": "-0.0025", "price_unit": "USD", "duration": "4", "sid": "REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "encryption_details": { "encryption_public_key_sid": "CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "encryption_cek": "OV4h6zrsxMIW7h0Zfqwfn6TI2GCNl54KALlg8wn8YB8KYZhXt6HlgvBWAmQTlfYVeLWydMiCewY0YkDDT1xmNe5huEo9vjuKBS5OmYK4CZkSx1NVv3XOGrZHpd2Pl/5WJHVhUK//AUO87uh5qnUP2E0KoLh1nyCLeGcEkXU0RfpPn/6nxjof/n6m6OzZOyeIRK4Oed5+rEtjqFDfqT0EVKjs6JAxv+f0DCc1xYRHl2yV8bahUPVKs+bHYdy4PVszFKa76M/Uae4jFA9Lv233JqWcxj+K2UoghuGhAFbV/JQIIswY2CBYI8JlVSifSqNEl9vvsTJ8bkVMm3MKbG2P7Q==", "encryption_iv": "8I2hhNIYNTrwxfHk" }, "source": "StartCallRecordingAPI", "status": "completed", "error_code": null, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings/REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json" } ], "start": 0, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings.json?PageSize=50&Page=0" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->calls("CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->recordings->read(); $this->assertGreaterThan(0, count($actual)); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "end": 0, "first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings.json?PageSize=50&Page=0", "next_page_uri": null, "page": 0, "page_size": 50, "previous_page_uri": null, "recordings": [], "start": 0, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings.json?PageSize=50&Page=0" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->calls("CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->recordings->read(); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/Api/V2010/Account/CallTest.php 0000604 00000032362 15174325134 0017231 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Api\V2010\Account; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class CallTest extends HolodeckTestCase { public function testCreateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->calls->create("+15558675310", "+15017122661"); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $values = array('To' => "+15558675310", 'From' => "+15017122661", ); $this->assertRequest(new Request( 'post', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls.json', null, $values )); } public function testCreateResponse() { $this->holodeck->mock(new Response( 201, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "annotation": null, "answered_by": null, "api_version": "2010-04-01", "caller_name": null, "date_created": "Tue, 31 Aug 2010 20:36:28 +0000", "date_updated": "Tue, 31 Aug 2010 20:36:44 +0000", "direction": "inbound", "duration": "15", "end_time": "Tue, 31 Aug 2010 20:36:44 +0000", "forwarded_from": "+141586753093", "from": "+14158675308", "from_formatted": "(415) 867-5308", "group_sid": null, "parent_call_sid": null, "phone_number_sid": "PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "price": "-0.03000", "price_unit": "USD", "sid": "CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "start_time": "Tue, 31 Aug 2010 20:36:29 +0000", "status": "completed", "subresource_uris": { "notifications": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Notifications.json", "recordings": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings.json", "feedback": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Feedback.json", "feedback_summaries": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/FeedbackSummary.json" }, "to": "+14158675309", "to_formatted": "(415) 867-5309", "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->calls->create("+15558675310", "+15017122661"); $this->assertNotNull($actual); } public function testDeleteRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->calls("CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'delete', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json' )); } public function testDeleteResponse() { $this->holodeck->mock(new Response( 204, null )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->calls("CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); $this->assertTrue($actual); } public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->calls("CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "annotation": null, "answered_by": null, "api_version": "2010-04-01", "caller_name": null, "date_created": "Tue, 31 Aug 2010 20:36:28 +0000", "date_updated": "Tue, 31 Aug 2010 20:36:44 +0000", "direction": "inbound", "duration": "15", "end_time": "Tue, 31 Aug 2010 20:36:44 +0000", "forwarded_from": "+141586753093", "from": "+14158675308", "from_formatted": "(415) 867-5308", "group_sid": null, "parent_call_sid": null, "phone_number_sid": "PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "price": "-0.03000", "price_unit": "USD", "sid": "CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "start_time": "Tue, 31 Aug 2010 20:36:29 +0000", "status": "completed", "subresource_uris": { "notifications": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Notifications.json", "recordings": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings.json" }, "to": "+14158675309", "to_formatted": "(415) 867-5309", "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->calls("CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); $this->assertNotNull($actual); } public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->calls->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls.json' )); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "calls": [ { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "annotation": null, "answered_by": null, "api_version": "2010-04-01", "caller_name": "", "date_created": "Fri, 04 Sep 2015 22:48:30 +0000", "date_updated": "Fri, 04 Sep 2015 22:48:35 +0000", "direction": "outbound-api", "duration": "0", "end_time": "Fri, 04 Sep 2015 22:48:35 +0000", "forwarded_from": null, "from": "kevin", "from_formatted": "kevin", "group_sid": null, "parent_call_sid": null, "phone_number_sid": "", "price": null, "price_unit": "USD", "sid": "CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "start_time": "Fri, 04 Sep 2015 22:48:31 +0000", "status": "failed", "subresource_uris": { "notifications": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Notifications.json", "recordings": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings.json" }, "to": "sip:kevin@example.com", "to_formatted": "sip:kevin@example.com", "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json" } ], "end": 0, "first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls.json?PageSize=1&Page=0", "next_page_uri": null, "page": 0, "page_size": 1, "previous_page_uri": null, "start": 0, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls.json?PageSize=1&Page=0" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->calls->read(); $this->assertGreaterThan(0, count($actual)); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "calls": [], "end": 0, "first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls.json?PageSize=1&Page=0", "next_page_uri": null, "page": 0, "page_size": 1, "previous_page_uri": null, "start": 0, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls.json?PageSize=1&Page=0" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->calls->read(); $this->assertNotNull($actual); } public function testUpdateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->calls("CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'post', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json' )); } public function testUpdateResponse() { $this->holodeck->mock(new Response( 200, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "annotation": null, "answered_by": null, "api_version": "2010-04-01", "caller_name": null, "date_created": "Tue, 31 Aug 2010 20:36:28 +0000", "date_updated": "Tue, 31 Aug 2010 20:36:44 +0000", "direction": "inbound", "duration": "15", "end_time": "Tue, 31 Aug 2010 20:36:44 +0000", "forwarded_from": "+141586753093", "from": "+14158675308", "from_formatted": "(415) 867-5308", "group_sid": null, "parent_call_sid": null, "phone_number_sid": "PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "price": "-0.03000", "price_unit": "USD", "sid": "CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "start_time": "Tue, 31 Aug 2010 20:36:29 +0000", "status": "completed", "subresource_uris": { "notifications": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Notifications.json", "recordings": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings.json" }, "to": "+14158675309", "to_formatted": "(415) 867-5309", "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->calls("CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/Api/V2010/Account/QueueTest.php 0000604 00000022177 15174325134 0017445 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Api\V2010\Account; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class QueueTest extends HolodeckTestCase { public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->queues("QUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Queues/QUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "average_wait_time": 0, "current_size": 0, "date_created": "Tue, 04 Aug 2015 18:39:09 +0000", "date_updated": "Tue, 04 Aug 2015 18:39:09 +0000", "friendly_name": "0.361280134646222", "max_size": 100, "sid": "QUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Queues/QUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->queues("QUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); $this->assertNotNull($actual); } public function testUpdateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->queues("QUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'post', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Queues/QUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json' )); } public function testUpdateResponse() { $this->holodeck->mock(new Response( 200, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "average_wait_time": 0, "current_size": 0, "date_created": "Tue, 04 Aug 2015 18:39:09 +0000", "date_updated": "Tue, 04 Aug 2015 18:39:09 +0000", "friendly_name": "0.361280134646222", "max_size": 100, "sid": "QUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Queues/QUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->queues("QUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); $this->assertNotNull($actual); } public function testDeleteRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->queues("QUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'delete', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Queues/QUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json' )); } public function testDeleteResponse() { $this->holodeck->mock(new Response( 204, null )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->queues("QUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); $this->assertTrue($actual); } public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->queues->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Queues.json' )); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "end": 0, "first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Queues.json?PageSize=1&Page=0", "last_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Queues.json?PageSize=1&Page=12857", "next_page_uri": null, "num_pages": 12858, "page": 0, "page_size": 1, "previous_page_uri": null, "queues": [ { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "average_wait_time": 0, "current_size": 0, "date_created": "Tue, 04 Aug 2015 18:39:09 +0000", "date_updated": "Tue, 04 Aug 2015 18:39:09 +0000", "friendly_name": "0.361280134646222", "max_size": 100, "sid": "QUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Queues/QUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json" } ], "start": 0, "total": 12858, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Queues.json?PageSize=1&Page=0" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->queues->read(); $this->assertGreaterThan(0, count($actual)); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "end": 0, "first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Queues.json?PageSize=1&Page=0", "last_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Queues.json?PageSize=1&Page=12857", "next_page_uri": null, "num_pages": 12858, "page": 0, "page_size": 1, "previous_page_uri": null, "queues": [], "start": 0, "total": 12858, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Queues.json?PageSize=1&Page=0" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->queues->read(); $this->assertNotNull($actual); } public function testCreateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->queues->create("friendlyName"); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $values = array('FriendlyName' => "friendlyName", ); $this->assertRequest(new Request( 'post', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Queues.json', null, $values )); } public function testCreateResponse() { $this->holodeck->mock(new Response( 201, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "average_wait_time": 0, "current_size": 0, "date_created": "Tue, 04 Aug 2015 18:39:09 +0000", "date_updated": "Tue, 04 Aug 2015 18:39:09 +0000", "friendly_name": "0.361280134646222", "max_size": 100, "sid": "QUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Queues/QUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->queues->create("friendlyName"); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/Api/V2010/Account/TranscriptionTest.php 0000604 00000015105 15174325134 0021211 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Api\V2010\Account; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class TranscriptionTest extends HolodeckTestCase { public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->transcriptions("TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Transcriptions/TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "api_version": "2008-08-01", "date_created": "Sun, 13 Feb 2011 02:12:08 +0000", "date_updated": "Sun, 13 Feb 2011 02:30:01 +0000", "duration": "1", "price": "-0.05000", "price_unit": "USD", "recording_sid": "REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "sid": "TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "status": "failed", "transcription_text": "(blank)", "type": "fast", "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Transcriptions/TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->transcriptions("TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); $this->assertNotNull($actual); } public function testDeleteRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->transcriptions("TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'delete', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Transcriptions/TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json' )); } public function testDeleteResponse() { $this->holodeck->mock(new Response( 204, null )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->transcriptions("TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); $this->assertTrue($actual); } public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->transcriptions->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Transcriptions.json' )); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "end": 0, "first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Transcriptions.json?PageSize=1&Page=0", "last_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Transcriptions.json?PageSize=1&Page=3", "next_page_uri": null, "num_pages": 4, "page": 0, "page_size": 1, "previous_page_uri": null, "start": 0, "total": 4, "transcriptions": [ { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "api_version": "2008-08-01", "date_created": "Thu, 25 Aug 2011 20:59:45 +0000", "date_updated": "Thu, 25 Aug 2011 20:59:45 +0000", "duration": "10", "price": "0.00000", "price_unit": "USD", "recording_sid": "REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "sid": "TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "status": "completed", "transcription_text": null, "type": "fast", "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Transcriptions/TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json" } ], "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Transcriptions.json?PageSize=1&Page=0" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->transcriptions->read(); $this->assertGreaterThan(0, count($actual)); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "end": 0, "first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Transcriptions.json?PageSize=1&Page=0", "last_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Transcriptions.json?PageSize=1&Page=3", "next_page_uri": null, "num_pages": 4, "page": 0, "page_size": 1, "previous_page_uri": null, "start": 0, "total": 4, "transcriptions": [], "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Transcriptions.json?PageSize=1&Page=0" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->transcriptions->read(); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/Api/V2010/Account/TokenTest.php 0000604 00000004161 15174325134 0017432 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Api\V2010\Account; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class TokenTest extends HolodeckTestCase { public function testCreateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->tokens->create(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'post', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Tokens.json' )); } public function testCreateResponse() { $this->holodeck->mock(new Response( 201, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "Fri, 24 Jul 2015 18:43:58 +0000", "date_updated": "Fri, 24 Jul 2015 18:43:58 +0000", "ice_servers": [ { "url": "stun:global.stun:3478?transport=udp" }, { "credential": "5SR2x8mZK1lTFJW3NVgLGw6UM9C0dja4jI/Hdw3xr+w=", "url": "turn:global.turn:3478?transport=udp", "username": "cda92e5006c7810494639fc466ecc80182cef8183fdf400f84c4126f3b59d0bb" } ], "password": "5SR2x8mZK1lTFJW3NVgLGw6UM9C0dja4jI/Hdw3xr+w=", "ttl": "86400", "username": "cda92e5006c7810494639fc466ecc80182cef8183fdf400f84c4126f3b59d0bb" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->tokens->create(); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/Api/V2010/Account/AddressTest.php 0000604 00000024270 15174325134 0017742 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Api\V2010\Account; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class AddressTest extends HolodeckTestCase { public function testCreateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->addresses->create("customerName", "street", "city", "region", "postalCode", "US"); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $values = array( 'CustomerName' => "customerName", 'Street' => "street", 'City' => "city", 'Region' => "region", 'PostalCode' => "postalCode", 'IsoCountry' => "US", ); $this->assertRequest(new Request( 'post', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Addresses.json', null, $values )); } public function testCreateResponse() { $this->holodeck->mock(new Response( 201, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "city": "SF", "customer_name": "name", "date_created": "Tue, 18 Aug 2015 17:07:30 +0000", "date_updated": "Tue, 18 Aug 2015 17:07:30 +0000", "emergency_enabled": false, "friendly_name": null, "iso_country": "US", "postal_code": "94019", "region": "CA", "sid": "ADaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "street": "4th", "validated": false, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Addresses/ADaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->addresses->create("customerName", "street", "city", "region", "postalCode", "US"); $this->assertNotNull($actual); } public function testDeleteRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->addresses("ADaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'delete', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Addresses/ADaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json' )); } public function testDeleteResponse() { $this->holodeck->mock(new Response( 204, null )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->addresses("ADaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); $this->assertTrue($actual); } public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->addresses("ADaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Addresses/ADaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "city": "SF", "customer_name": "name", "date_created": "Tue, 18 Aug 2015 17:07:30 +0000", "date_updated": "Tue, 18 Aug 2015 17:07:30 +0000", "emergency_enabled": false, "friendly_name": null, "iso_country": "US", "postal_code": "94019", "region": "CA", "sid": "ADaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "street": "4th", "validated": false, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Addresses/ADaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->addresses("ADaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); $this->assertNotNull($actual); } public function testUpdateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->addresses("ADaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'post', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Addresses/ADaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json' )); } public function testUpdateResponse() { $this->holodeck->mock(new Response( 200, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "city": "SF", "customer_name": "name", "date_created": "Tue, 18 Aug 2015 17:07:30 +0000", "date_updated": "Tue, 18 Aug 2015 17:07:30 +0000", "emergency_enabled": false, "friendly_name": null, "iso_country": "US", "postal_code": "94019", "region": "CA", "sid": "ADaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "street": "4th", "validated": false, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Addresses/ADaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->addresses("ADaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); $this->assertNotNull($actual); } public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->addresses->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Addresses.json' )); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "addresses": [ { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "city": "SF", "customer_name": "name", "date_created": "Tue, 18 Aug 2015 17:07:30 +0000", "date_updated": "Tue, 18 Aug 2015 17:07:30 +0000", "emergency_enabled": false, "friendly_name": null, "iso_country": "US", "postal_code": "94019", "region": "CA", "sid": "ADaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "street": "4th", "validated": false, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Addresses/ADaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json" } ], "end": 0, "first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Addresses.json?PageSize=50&Page=0", "last_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Addresses.json?PageSize=50&Page=0", "next_page_uri": null, "num_pages": 1, "page": 0, "page_size": 50, "previous_page_uri": null, "start": 0, "total": 1, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Addresses.json?PageSize=50&Page=0" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->addresses->read(); $this->assertGreaterThan(0, count($actual)); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "addresses": [], "end": 0, "first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Addresses.json?PageSize=50&Page=0", "last_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Addresses.json?PageSize=50&Page=0", "next_page_uri": null, "num_pages": 1, "page": 0, "page_size": 50, "previous_page_uri": null, "start": 0, "total": 1, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Addresses.json?PageSize=50&Page=0" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->addresses->read(); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/Api/V2010/Account/RecordingTest.php 0000604 00000021125 15174325134 0020265 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Api\V2010\Account; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class RecordingTest extends HolodeckTestCase { public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->recordings("REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings/REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "api_version": "2010-04-01", "call_sid": "CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "conference_sid": "CFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "channels": 1, "date_created": "Fri, 14 Oct 2016 21:56:34 +0000", "date_updated": "Fri, 14 Oct 2016 21:56:38 +0000", "start_time": "Fri, 14 Oct 2016 21:56:34 +0000", "end_time": "Fri, 14 Oct 2016 21:56:38 +0000", "price": "-0.00250", "price_unit": "USD", "duration": "4", "sid": "REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "source": "StartConferenceRecordingAPI", "status": "completed", "error_code": null, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings/REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json", "subresource_uris": { "add_on_results": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings/REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AddOnResults.json", "transcriptions": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings/REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Transcriptions.json" }, "encryption_details": { "encryption_public_key_sid": "CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "encryption_cek": "OV4h6zrsxMIW7h0Zfqwfn6TI2GCNl54KALlg8wn8YB8KYZhXt6HlgvBWAmQTlfYVeLWydMiCewY0YkDDT1xmNe5huEo9vjuKBS5OmYK4CZkSx1NVv3XOGrZHpd2Pl/5WJHVhUK//AUO87uh5qnUP2E0KoLh1nyCLeGcEkXU0RfpPn/6nxjof/n6m6OzZOyeIRK4Oed5+rEtjqFDfqT0EVKjs6JAxv+f0DCc1xYRHl2yV8bahUPVKs+bHYdy4PVszFKa76M/Uae4jFA9Lv233JqWcxj+K2UoghuGhAFbV/JQIIswY2CBYI8JlVSifSqNEl9vvsTJ8bkVMm3MKbG2P7Q==", "encryption_iv": "8I2hhNIYNTrwxfHk" } } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->recordings("REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); $this->assertNotNull($actual); } public function testDeleteRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->recordings("REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'delete', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings/REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json' )); } public function testDeleteResponse() { $this->holodeck->mock(new Response( 204, null )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->recordings("REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); $this->assertTrue($actual); } public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->recordings->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings.json' )); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "end": 0, "first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings.json?PageSize=1&Page=0", "next_page_uri": null, "page": 0, "page_size": 1, "previous_page_uri": null, "recordings": [ { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "api_version": "2010-04-01", "call_sid": "CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "conference_sid": "CFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "channels": 1, "date_created": "Fri, 14 Oct 2016 21:56:34 +0000", "date_updated": "Fri, 14 Oct 2016 21:56:38 +0000", "start_time": "Fri, 14 Oct 2016 21:56:34 +0000", "end_time": "Fri, 14 Oct 2016 21:56:38 +0000", "price": "0.04", "price_unit": "USD", "duration": "4", "sid": "REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "source": "StartConferenceRecordingAPI", "status": "completed", "error_code": null, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings/REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json", "subresource_uris": { "add_on_results": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings/REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AddOnResults.json", "transcriptions": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings/REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Transcriptions.json" }, "encryption_details": { "encryption_public_key_sid": "CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "encryption_cek": "OV4h6zrsxMIW7h0Zfqwfn6TI2GCNl54KALlg8wn8YB8KYZhXt6HlgvBWAmQTlfYVeLWydMiCewY0YkDDT1xmNe5huEo9vjuKBS5OmYK4CZkSx1NVv3XOGrZHpd2Pl/5WJHVhUK//AUO87uh5qnUP2E0KoLh1nyCLeGcEkXU0RfpPn/6nxjof/n6m6OzZOyeIRK4Oed5+rEtjqFDfqT0EVKjs6JAxv+f0DCc1xYRHl2yV8bahUPVKs+bHYdy4PVszFKa76M/Uae4jFA9Lv233JqWcxj+K2UoghuGhAFbV/JQIIswY2CBYI8JlVSifSqNEl9vvsTJ8bkVMm3MKbG2P7Q==", "encryption_iv": "8I2hhNIYNTrwxfHk" } } ], "start": 0, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings.json?PageSize=1&Page=0" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->recordings->read(); $this->assertGreaterThan(0, count($actual)); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "end": 0, "first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings.json?PageSize=1&Page=0", "next_page_uri": null, "page": 0, "page_size": 1, "previous_page_uri": null, "recordings": [], "start": 0, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings.json?PageSize=1&Page=0" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->recordings->read(); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/Api/V2010/Account/Queue/MemberTest.php 0000604 00000016270 15174325134 0020651 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Api\V2010\Account\Queue; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class MemberTest extends HolodeckTestCase { public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->queues("QUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->members("CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Queues/QUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "call_sid": "CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_enqueued": "Tue, 07 Aug 2012 22:57:41 +0000", "position": 1, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Queues/QUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json", "wait_time": 143 } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->queues("QUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->members("CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); $this->assertNotNull($actual); } public function testUpdateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->queues("QUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->members("CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update("https://example.com", "GET"); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $values = array('Url' => "https://example.com", 'Method' => "GET", ); $this->assertRequest(new Request( 'post', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Queues/QUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json', null, $values )); } public function testUpdateResponse() { $this->holodeck->mock(new Response( 200, ' { "call_sid": "CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_enqueued": "Tue, 07 Aug 2012 22:57:41 +0000", "position": 1, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Queues/QUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json", "wait_time": 143 } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->queues("QUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->members("CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update("https://example.com", "GET"); $this->assertNotNull($actual); } public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->queues("QUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->members->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Queues/QUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members.json' )); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "end": 0, "first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Queues/QUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members.json?Page=0&PageSize=50", "last_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Queues/QUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members.json?Page=0&PageSize=50", "next_page_uri": null, "num_pages": 1, "page": 0, "page_size": 50, "previous_page_uri": null, "queue_members": [ { "call_sid": "CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_enqueued": "Tue, 07 Aug 2012 22:57:41 +0000", "position": 1, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Queues/QUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json", "wait_time": 124 } ], "start": 0, "total": 1, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Queues/QUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members.json" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->queues("QUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->members->read(); $this->assertGreaterThan(0, count($actual)); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "end": 0, "first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Queues/QUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members.json?Page=0&PageSize=50", "last_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Queues/QUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members.json?Page=0&PageSize=50", "next_page_uri": null, "num_pages": 1, "page": 0, "page_size": 50, "previous_page_uri": null, "queue_members": [], "start": 0, "total": 1, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Queues/QUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members.json" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->queues("QUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->members->read(); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/Api/V2010/Account/NotificationTest.php 0000604 00000017311 15174325134 0021001 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Api\V2010\Account; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class NotificationTest extends HolodeckTestCase { public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->notifications("NOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Notifications/NOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "api_version": "2008-08-01", "call_sid": "CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "Mon, 13 Sep 2010 20:02:01 +0000", "date_updated": "Mon, 13 Sep 2010 20:02:01 +0000", "error_code": "11200", "log": "0", "message_date": "Mon, 13 Sep 2010 20:02:00 +0000", "message_text": "EmailNotification=false&LogLevel=ERROR&sourceComponent=12000&Msg=&httpResponse=500&ErrorCode=11200&url=http%3A%2F%2Fvoiceforms4000.appspot.com%2Ftwiml", "more_info": "http://www.twilio.com/docs/errors/11200", "request_method": "get", "request_url": "https://voiceforms4000.appspot.com/twiml/9436/question/0", "request_variables": "AccountSid=ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&CallStatus=in-progress&ToZip=94937&ToCity=INVERNESS&ToState=CA&Called=%2B14156694923&To=%2B14156694923&ToCountry=US&CalledZip=94937&Direction=inbound&ApiVersion=2010-04-01&Caller=%2B17378742833&CalledCity=INVERNESS&CalledCountry=US&CallSid=CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&CalledState=CA&From=%2B17378742833", "response_body": "blah blah", "response_headers": "Date=Mon%2C+13+Sep+2010+20%3A02%3A00+GMT&Content-Length=466&Connection=close&Content-Type=text%2Fhtml%3B+charset%3DUTF-8&Server=Google+Frontend", "sid": "NOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Notifications/NOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->notifications("NOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); $this->assertNotNull($actual); } public function testDeleteRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->notifications("NOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'delete', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Notifications/NOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json' )); } public function testDeleteResponse() { $this->holodeck->mock(new Response( 204, null )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->notifications("NOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); $this->assertTrue($actual); } public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->notifications->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Notifications.json' )); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "end": 0, "first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Notifications.json?PageSize=1&Page=0", "last_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Notifications.json?PageSize=1&Page=100", "next_page_uri": null, "notifications": [ { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "api_version": "2008-08-01", "call_sid": "CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "Thu, 30 Apr 2015 16:47:33 +0000", "date_updated": "Thu, 30 Apr 2015 16:47:35 +0000", "error_code": "21609", "log": "1", "message_date": "Thu, 30 Apr 2015 16:47:32 +0000", "message_text": "LogLevel=WARN&invalidStatusCallbackUrl=&Msg=Invalid+Url+for+callSid%3A+CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa+invalid+statusCallbackUrl%3A+&ErrorCode=21609", "more_info": "https://www.twilio.com/docs/errors/21609", "request_method": null, "request_url": "", "sid": "NOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Notifications/NOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ], "num_pages": 101, "page": 0, "page_size": 1, "previous_page_uri": null, "start": 0, "total": 101, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Notifications.json?PageSize=1&Page=0" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->notifications->read(); $this->assertGreaterThan(0, count($actual)); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "end": 0, "first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Notifications.json?PageSize=1&Page=0", "last_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Notifications.json?PageSize=1&Page=100", "next_page_uri": null, "notifications": [], "num_pages": 101, "page": 0, "page_size": 1, "previous_page_uri": null, "start": 0, "total": 101, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Notifications.json?PageSize=1&Page=0" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->notifications->read(); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/Api/V2010/Account/Sip/CredentialListTest.php 0000604 00000023750 15174325134 0022020 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Api\V2010\Account\Sip; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class CredentialListTest extends HolodeckTestCase { public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->sip ->credentialLists->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/CredentialLists.json' )); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "credential_lists": [ { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "Wed, 11 Sep 2013 17:51:38 -0000", "date_updated": "Wed, 11 Sep 2013 17:51:38 -0000", "friendly_name": "Low Rises", "sid": "CLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "subresource_uris": { "credentials": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/CredentialLists/CLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Credentials.json" }, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/CredentialLists/CLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json" } ], "first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/CredentialLists.json?PageSize=50&Page=0", "next_page_uri": null, "page": 0, "page_size": 50, "previous_page_uri": null, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/CredentialLists.json?PageSize=50&Page=0" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->sip ->credentialLists->read(); $this->assertGreaterThan(0, count($actual)); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "credential_lists": [], "first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/CredentialLists.json?PageSize=50&Page=0", "next_page_uri": null, "page": 0, "page_size": 50, "previous_page_uri": null, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/CredentialLists.json?PageSize=50&Page=0" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->sip ->credentialLists->read(); $this->assertNotNull($actual); } public function testCreateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->sip ->credentialLists->create("friendlyName"); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $values = array('FriendlyName' => "friendlyName", ); $this->assertRequest(new Request( 'post', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/CredentialLists.json', null, $values )); } public function testCreateResponse() { $this->holodeck->mock(new Response( 201, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "Wed, 11 Sep 2013 17:51:38 -0000", "date_updated": "Wed, 11 Sep 2013 17:51:38 -0000", "friendly_name": "Low Rises", "sid": "CLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "subresource_uris": { "credentials": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/CredentialLists/CLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Credentials.json" }, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/CredentialLists/CLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->sip ->credentialLists->create("friendlyName"); $this->assertNotNull($actual); } public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->sip ->credentialLists("CLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/CredentialLists/CLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "Wed, 11 Sep 2013 17:51:38 -0000", "date_updated": "Wed, 11 Sep 2013 17:51:38 -0000", "friendly_name": "Low Rises", "sid": "CLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "subresource_uris": { "credentials": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/CredentialLists/CLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Credentials.json" }, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/CredentialLists/CLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->sip ->credentialLists("CLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); $this->assertNotNull($actual); } public function testUpdateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->sip ->credentialLists("CLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update("friendlyName"); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $values = array('FriendlyName' => "friendlyName", ); $this->assertRequest(new Request( 'post', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/CredentialLists/CLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json', null, $values )); } public function testUpdateResponse() { $this->holodeck->mock(new Response( 200, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "Wed, 11 Sep 2013 17:51:38 -0000", "date_updated": "Wed, 11 Sep 2013 17:51:38 -0000", "friendly_name": "Low Rises", "sid": "CLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "subresource_uris": { "credentials": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/CredentialLists/CLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Credentials.json" }, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/CredentialLists/CLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->sip ->credentialLists("CLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update("friendlyName"); $this->assertNotNull($actual); } public function testDeleteRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->sip ->credentialLists("CLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'delete', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/CredentialLists/CLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json' )); } public function testDeleteResponse() { $this->holodeck->mock(new Response( 204, null )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->sip ->credentialLists("CLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); $this->assertTrue($actual); } } sdk/Twilio/Tests/Integration/Api/V2010/Account/Sip/IpAccessControlListTest.php 0000604 00000025165 15174325134 0023003 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Api\V2010\Account\Sip; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class IpAccessControlListTest extends HolodeckTestCase { public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->sip ->ipAccessControlLists->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/IpAccessControlLists.json' )); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "end": 0, "first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/IpAccessControlLists.json?PageSize=50&Page=0", "ip_access_control_lists": [ { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "Fri, 17 Jul 2015 21:25:15 +0000", "date_updated": "Fri, 17 Jul 2015 21:25:15 +0000", "friendly_name": "aaaa", "sid": "ALaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "subresource_uris": { "ip_addresses": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/IpAccessControlLists/ALaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IpAddresses.json" }, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/IpAccessControlLists/ALaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json" } ], "last_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/IpAccessControlLists.json?PageSize=50&Page=0", "next_page_uri": null, "num_pages": 1, "page": 0, "page_size": 50, "previous_page_uri": null, "start": 0, "total": 1, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/IpAccessControlLists.json?PageSize=50&Page=0" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->sip ->ipAccessControlLists->read(); $this->assertGreaterThan(0, count($actual)); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "end": 0, "first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/IpAccessControlLists.json?PageSize=50&Page=0", "ip_access_control_lists": [], "last_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/IpAccessControlLists.json?PageSize=50&Page=0", "next_page_uri": null, "num_pages": 1, "page": 0, "page_size": 50, "previous_page_uri": null, "start": 0, "total": 1, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/IpAccessControlLists.json?PageSize=50&Page=0" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->sip ->ipAccessControlLists->read(); $this->assertNotNull($actual); } public function testCreateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->sip ->ipAccessControlLists->create("friendlyName"); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $values = array('FriendlyName' => "friendlyName", ); $this->assertRequest(new Request( 'post', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/IpAccessControlLists.json', null, $values )); } public function testCreateResponse() { $this->holodeck->mock(new Response( 201, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "Fri, 17 Jul 2015 21:25:15 +0000", "date_updated": "Fri, 17 Jul 2015 21:25:15 +0000", "friendly_name": "aaaa", "sid": "ALaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "subresource_uris": { "ip_addresses": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/IpAccessControlLists/ALaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IpAddresses.json" }, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/IpAccessControlLists/ALaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->sip ->ipAccessControlLists->create("friendlyName"); $this->assertNotNull($actual); } public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->sip ->ipAccessControlLists("ALaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/IpAccessControlLists/ALaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "Fri, 17 Jul 2015 21:25:15 +0000", "date_updated": "Fri, 17 Jul 2015 21:25:15 +0000", "friendly_name": "aaaa", "sid": "ALaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "subresource_uris": { "ip_addresses": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/IpAccessControlLists/ALaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IpAddresses.json" }, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/IpAccessControlLists/ALaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->sip ->ipAccessControlLists("ALaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); $this->assertNotNull($actual); } public function testUpdateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->sip ->ipAccessControlLists("ALaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update("friendlyName"); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $values = array('FriendlyName' => "friendlyName", ); $this->assertRequest(new Request( 'post', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/IpAccessControlLists/ALaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json', null, $values )); } public function testUpdateResponse() { $this->holodeck->mock(new Response( 200, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "Fri, 17 Jul 2015 21:25:15 +0000", "date_updated": "Fri, 17 Jul 2015 21:25:15 +0000", "friendly_name": "aaaa", "sid": "ALaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "subresource_uris": { "ip_addresses": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/IpAccessControlLists/ALaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IpAddresses.json" }, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/IpAccessControlLists/ALaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->sip ->ipAccessControlLists("ALaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update("friendlyName"); $this->assertNotNull($actual); } public function testDeleteRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->sip ->ipAccessControlLists("ALaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'delete', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/IpAccessControlLists/ALaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json' )); } public function testDeleteResponse() { $this->holodeck->mock(new Response( 204, null )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->sip ->ipAccessControlLists("ALaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); $this->assertTrue($actual); } } sdk/Twilio/Tests/Integration/Api/V2010/Account/Sip/Domain/CredentialListMappingTest.php 0000604 00000023135 15174325134 0024540 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Api\V2010\Account\Sip\Domain; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class CredentialListMappingTest extends HolodeckTestCase { public function testCreateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->sip ->domains("SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->credentialListMappings->create("CLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $values = array('CredentialListSid' => "CLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", ); $this->assertRequest(new Request( 'post', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/Domains/SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/CredentialListMappings.json', null, $values )); } public function testCreateResponse() { $this->holodeck->mock(new Response( 201, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "Wed, 11 Sep 2013 17:51:38 -0000", "date_updated": "Wed, 11 Sep 2013 17:51:38 -0000", "friendly_name": "Production Gateways IP Address - Scranton", "sid": "CLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "subresource_uris": { "credentials": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/CredentialLists/CLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Credentials.json" }, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/Domains/SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/CredentialLists/CLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->sip ->domains("SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->credentialListMappings->create("CLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"); $this->assertNotNull($actual); } public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->sip ->domains("SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->credentialListMappings->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/Domains/SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/CredentialListMappings.json' )); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "credential_list_mappings": [ { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "Wed, 11 Sep 2013 17:51:38 -0000", "date_updated": "Wed, 11 Sep 2013 17:51:38 -0000", "friendly_name": "Production Gateways IP Address - Scranton", "sid": "CLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "subresource_uris": { "credentials": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/CredentialLists/CLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Credentials.json" }, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/CredentialLists/CLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json" } ], "first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/Domains/SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/CredentialListMappings.json?PageSize=50&Page=0", "next_page_uri": null, "page": 0, "page_size": 50, "previous_page_uri": null, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/Domains/SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/CredentialListMappings.json?PageSize=50&Page=0" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->sip ->domains("SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->credentialListMappings->read(); $this->assertGreaterThan(0, count($actual)); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "credential_list_mappings": [], "first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/Domains/SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/CredentialListMappings.json?PageSize=50&Page=0", "next_page_uri": null, "page": 0, "page_size": 50, "previous_page_uri": null, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/Domains/SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/CredentialListMappings.json?PageSize=50&Page=0" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->sip ->domains("SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->credentialListMappings->read(); $this->assertNotNull($actual); } public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->sip ->domains("SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->credentialListMappings("CLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/Domains/SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/CredentialListMappings/CLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "Wed, 11 Sep 2013 17:51:38 -0000", "date_updated": "Wed, 11 Sep 2013 17:51:38 -0000", "friendly_name": "Production Gateways IP Address - Scranton", "sid": "CLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "subresource_uris": { "credentials": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/CredentialLists/CLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Credentials.json" }, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/Domains/SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/CredentialLists/CLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->sip ->domains("SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->credentialListMappings("CLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); $this->assertNotNull($actual); } public function testDeleteRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->sip ->domains("SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->credentialListMappings("CLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'delete', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/Domains/SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/CredentialListMappings/CLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json' )); } public function testDeleteResponse() { $this->holodeck->mock(new Response( 204, null )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->sip ->domains("SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->credentialListMappings("CLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); $this->assertTrue($actual); } } sdk/Twilio/Tests/Integration/Api/V2010/Account/Sip/Domain/IpAccessControlListMappingTest.php 0000604 00000024606 15174325134 0025525 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Api\V2010\Account\Sip\Domain; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class IpAccessControlListMappingTest extends HolodeckTestCase { public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->sip ->domains("SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->ipAccessControlListMappings("ALaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/Domains/SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IpAccessControlListMappings/ALaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "Fri, 17 Jul 2015 21:25:15 +0000", "date_updated": "Fri, 17 Jul 2015 21:25:15 +0000", "friendly_name": "aaaa", "sid": "ALaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "subresource_uris": { "ip_addresses": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/IpAccessControlLists/ALaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IpAddresses.json" }, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/Domains/SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IpAccessControlListMappings/ALaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->sip ->domains("SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->ipAccessControlListMappings("ALaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); $this->assertNotNull($actual); } public function testCreateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->sip ->domains("SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->ipAccessControlListMappings->create("ALaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $values = array('IpAccessControlListSid' => "ALaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", ); $this->assertRequest(new Request( 'post', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/Domains/SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IpAccessControlListMappings.json', null, $values )); } public function testCreateResponse() { $this->holodeck->mock(new Response( 201, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "Fri, 17 Jul 2015 21:25:15 +0000", "date_updated": "Fri, 17 Jul 2015 21:25:15 +0000", "friendly_name": "aaaa", "sid": "ALaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "subresource_uris": { "ip_addresses": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/IpAccessControlLists/ALaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IpAddresses.json" }, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/Domains/SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IpAccessControlListMappings/ALaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->sip ->domains("SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->ipAccessControlListMappings->create("ALaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"); $this->assertNotNull($actual); } public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->sip ->domains("SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->ipAccessControlListMappings->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/Domains/SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IpAccessControlListMappings.json' )); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "end": 0, "first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/Domains/SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IpAccessControlListMappings.json?SipDomainSid=SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&PageSize=50&Page=0", "ip_access_control_list_mappings": [ { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "Fri, 17 Jul 2015 21:25:15 +0000", "date_updated": "Fri, 17 Jul 2015 21:25:15 +0000", "friendly_name": "aaaa", "sid": "ALaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "subresource_uris": { "ip_addresses": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/IpAccessControlLists/ALaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IpAddresses.json" }, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/IpAccessControlLists/ALaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json" } ], "last_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/Domains/SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IpAccessControlListMappings.json?SipDomainSid=SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&PageSize=50&Page=0", "next_page_uri": null, "num_pages": 1, "page": 0, "page_size": 50, "previous_page_uri": null, "start": 0, "total": 1, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/Domains/SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IpAccessControlListMappings.json" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->sip ->domains("SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->ipAccessControlListMappings->read(); $this->assertGreaterThan(0, count($actual)); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "end": 0, "first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/Domains/SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IpAccessControlListMappings.json?SipDomainSid=SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&PageSize=50&Page=0", "ip_access_control_list_mappings": [], "last_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/Domains/SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IpAccessControlListMappings.json?SipDomainSid=SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&PageSize=50&Page=0", "next_page_uri": null, "num_pages": 1, "page": 0, "page_size": 50, "previous_page_uri": null, "start": 0, "total": 1, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/Domains/SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IpAccessControlListMappings.json" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->sip ->domains("SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->ipAccessControlListMappings->read(); $this->assertNotNull($actual); } public function testDeleteRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->sip ->domains("SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->ipAccessControlListMappings("ALaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'delete', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/Domains/SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IpAccessControlListMappings/ALaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json' )); } public function testDeleteResponse() { $this->holodeck->mock(new Response( 204, null )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->sip ->domains("SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->ipAccessControlListMappings("ALaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); $this->assertTrue($actual); } } sdk/Twilio/Tests/Integration/Api/V2010/Account/Sip/DomainTest.php 0000604 00000031130 15174325134 0020310 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Api\V2010\Account\Sip; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class DomainTest extends HolodeckTestCase { public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->sip ->domains->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/Domains.json' )); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "domains": [ { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "api_version": "2010-04-01", "auth_type": "", "date_created": "Fri, 06 Sep 2013 18:48:50 -0000", "date_updated": "Fri, 06 Sep 2013 18:48:50 -0000", "domain_name": "dunder-mifflin-scranton.api.twilio.com", "friendly_name": "Scranton Office", "sip_registration": true, "sid": "SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "subresource_uris": { "credential_list_mappings": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/Domains/SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/CredentialListMappings.json", "ip_access_control_list_mappings": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/Domains/SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IpAccessControlListMappings.json" }, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/Domains/SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json", "voice_fallback_method": "POST", "voice_fallback_url": null, "voice_method": "POST", "voice_status_callback_method": "POST", "voice_status_callback_url": null, "voice_url": "https://dundermifflin.example.com/twilio/app.php" } ], "first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/Domains.json?PageSize=50&Page=0", "next_page_uri": null, "page": 0, "page_size": 50, "previous_page_uri": null, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/Domains.json?PageSize=50&Page=0" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->sip ->domains->read(); $this->assertGreaterThan(0, count($actual)); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "domains": [], "first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/Domains.json?PageSize=50&Page=0", "next_page_uri": null, "page": 0, "page_size": 50, "previous_page_uri": null, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/Domains.json?PageSize=50&Page=0" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->sip ->domains->read(); $this->assertNotNull($actual); } public function testCreateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->sip ->domains->create("domainName"); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $values = array('DomainName' => "domainName", ); $this->assertRequest(new Request( 'post', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/Domains.json', null, $values )); } public function testCreateResponse() { $this->holodeck->mock(new Response( 201, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "api_version": "2010-04-01", "auth_type": "IP_ACL", "date_created": "Fri, 06 Sep 2013 19:18:30 -0000", "date_updated": "Fri, 06 Sep 2013 19:18:30 -0000", "domain_name": "dunder-mifflin-scranton.sip.twilio.com", "friendly_name": "Scranton Office", "sip_registration": true, "sid": "SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "subresource_uris": { "credential_list_mappings": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/Domains/SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/CredentialListMappings.json", "ip_access_control_list_mappings": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/Domains/SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IpAccessControlListMappings.json" }, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/Domains/SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json", "voice_fallback_method": "POST", "voice_fallback_url": null, "voice_method": "POST", "voice_status_callback_method": "POST", "voice_status_callback_url": null, "voice_url": "https://dundermifflin.example.com/twilio/app.php" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->sip ->domains->create("domainName"); $this->assertNotNull($actual); } public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->sip ->domains("SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/Domains/SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "api_version": "2010-04-01", "auth_type": "IP_ACL", "date_created": "Fri, 06 Sep 2013 19:18:30 -0000", "date_updated": "Fri, 06 Sep 2013 19:18:30 -0000", "domain_name": "dunder-mifflin-scranton.sip.twilio.com", "friendly_name": "Scranton Office", "sip_registration": true, "sid": "SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "subresource_uris": { "credential_list_mappings": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/Domains/SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/CredentialListMappings.json", "ip_access_control_list_mappings": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/Domains/SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IpAccessControlListMappings.json" }, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/Domains/SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json", "voice_fallback_method": "POST", "voice_fallback_url": null, "voice_method": "POST", "voice_status_callback_method": "POST", "voice_status_callback_url": null, "voice_url": "https://dundermifflin.example.com/twilio/app.php" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->sip ->domains("SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); $this->assertNotNull($actual); } public function testUpdateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->sip ->domains("SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'post', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/Domains/SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json' )); } public function testUpdateResponse() { $this->holodeck->mock(new Response( 200, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "api_version": "2010-04-01", "auth_type": "IP_ACL", "date_created": "Fri, 06 Sep 2013 19:18:30 -0000", "date_updated": "Fri, 06 Sep 2013 19:18:30 -0000", "domain_name": "dunder-mifflin-scranton.sip.twilio.com", "friendly_name": "Scranton Office", "sip_registration": false, "sid": "SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "subresource_uris": { "credential_list_mappings": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/Domains/SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/CredentialListMappings.json", "ip_access_control_list_mappings": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/Domains/SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IpAccessControlListMappings.json" }, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/Domains/SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json", "voice_fallback_method": "POST", "voice_fallback_url": null, "voice_method": "POST", "voice_status_callback_method": "POST", "voice_status_callback_url": null, "voice_url": "https://dundermifflin.example.com/twilio/app.php" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->sip ->domains("SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); $this->assertNotNull($actual); } public function testDeleteRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->sip ->domains("SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'delete', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/Domains/SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json' )); } public function testDeleteResponse() { $this->holodeck->mock(new Response( 204, null )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->sip ->domains("SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); $this->assertTrue($actual); } } sdk/Twilio/Tests/Integration/Api/V2010/Account/Sip/CredentialList/CredentialTest.php 0000604 00000026736 15174325134 0024101 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Api\V2010\Account\Sip\CredentialList; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class CredentialTest extends HolodeckTestCase { public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->sip ->credentialLists("CLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->credentials->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/CredentialLists/CLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Credentials.json' )); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "credentials": [ { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "credential_list_sid": "CLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "Wed, 19 Aug 2015 19:48:45 +0000", "date_updated": "Wed, 19 Aug 2015 19:48:45 +0000", "sid": "CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/CredentialLists/CLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Credentials/CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json", "username": "1440013725.28" } ], "end": 0, "first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/CredentialLists/CLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Credentials.json?PageSize=50&Page=0", "last_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/CredentialLists/CLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Credentials.json?PageSize=50&Page=0", "next_page_uri": null, "num_pages": 1, "page": 0, "page_size": 50, "previous_page_uri": null, "start": 0, "total": 1, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/CredentialLists/CLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Credentials.json?PageSize=50&Page=0" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->sip ->credentialLists("CLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->credentials->read(); $this->assertGreaterThan(0, count($actual)); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "credentials": [], "end": 0, "first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/CredentialLists/CLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Credentials.json?PageSize=50&Page=0", "last_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/CredentialLists/CLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Credentials.json?PageSize=50&Page=0", "next_page_uri": null, "num_pages": 1, "page": 0, "page_size": 50, "previous_page_uri": null, "start": 0, "total": 1, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/CredentialLists/CLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Credentials.json?PageSize=50&Page=0" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->sip ->credentialLists("CLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->credentials->read(); $this->assertNotNull($actual); } public function testCreateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->sip ->credentialLists("CLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->credentials->create("username", "password"); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $values = array('Username' => "username", 'Password' => "password", ); $this->assertRequest(new Request( 'post', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/CredentialLists/CLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Credentials.json', null, $values )); } public function testCreateResponse() { $this->holodeck->mock(new Response( 201, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "credential_list_sid": "CLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "Wed, 19 Aug 2015 19:48:45 +0000", "date_updated": "Wed, 19 Aug 2015 19:48:45 +0000", "sid": "CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/CredentialLists/CLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Credentials/CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json", "username": "1440013725.28" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->sip ->credentialLists("CLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->credentials->create("username", "password"); $this->assertNotNull($actual); } public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->sip ->credentialLists("CLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->credentials("CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/CredentialLists/CLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Credentials/CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "credential_list_sid": "CLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "Wed, 19 Aug 2015 19:48:45 +0000", "date_updated": "Wed, 19 Aug 2015 19:48:45 +0000", "sid": "CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/CredentialLists/CLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Credentials/CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json", "username": "1440013725.28" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->sip ->credentialLists("CLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->credentials("CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); $this->assertNotNull($actual); } public function testUpdateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->sip ->credentialLists("CLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->credentials("CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'post', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/CredentialLists/CLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Credentials/CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json' )); } public function testUpdateResponse() { $this->holodeck->mock(new Response( 200, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "credential_list_sid": "CLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "Wed, 19 Aug 2015 19:48:45 +0000", "date_updated": "Wed, 19 Aug 2015 19:48:45 +0000", "sid": "CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/CredentialLists/CLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Credentials/CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json", "username": "1440013725.28" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->sip ->credentialLists("CLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->credentials("CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); $this->assertNotNull($actual); } public function testDeleteRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->sip ->credentialLists("CLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->credentials("CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'delete', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/CredentialLists/CLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Credentials/CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json' )); } public function testDeleteResponse() { $this->holodeck->mock(new Response( 204, null )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->sip ->credentialLists("CLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->credentials("CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); $this->assertTrue($actual); } } sdk/Twilio/Tests/Integration/Api/V2010/Account/Sip/IpAccessControlList/IpAddressTest.php 0000604 00000027466 15174325134 0024667 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Api\V2010\Account\Sip\IpAccessControlList; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class IpAddressTest extends HolodeckTestCase { public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->sip ->ipAccessControlLists("ALaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->ipAddresses->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/IpAccessControlLists/ALaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IpAddresses.json' )); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "end": 0, "first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/IpAccessControlLists/ALaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IpAddresses.json?PageSize=50&Page=0", "ip_addresses": [ { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "Mon, 20 Jul 2015 17:27:10 +0000", "date_updated": "Mon, 20 Jul 2015 17:27:10 +0000", "friendly_name": "aaa", "ip_access_control_list_sid": "ALaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "ip_address": "192.1.1.2", "sid": "IPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/IpAccessControlLists/ALaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IpAddresses/IPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json" } ], "last_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/IpAccessControlLists/ALaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IpAddresses.json?PageSize=50&Page=0", "next_page_uri": null, "num_pages": 1, "page": 0, "page_size": 50, "previous_page_uri": null, "start": 0, "total": 1, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/IpAccessControlLists/ALaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IpAddresses.json?PageSize=50&Page=0" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->sip ->ipAccessControlLists("ALaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->ipAddresses->read(); $this->assertGreaterThan(0, count($actual)); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "end": 0, "first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/IpAccessControlLists/ALaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IpAddresses.json?PageSize=50&Page=0", "ip_addresses": [], "last_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/IpAccessControlLists/ALaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IpAddresses.json?PageSize=50&Page=0", "next_page_uri": null, "num_pages": 1, "page": 0, "page_size": 50, "previous_page_uri": null, "start": 0, "total": 1, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/IpAccessControlLists/ALaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IpAddresses.json?PageSize=50&Page=0" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->sip ->ipAccessControlLists("ALaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->ipAddresses->read(); $this->assertNotNull($actual); } public function testCreateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->sip ->ipAccessControlLists("ALaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->ipAddresses->create("friendlyName", "ipAddress"); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $values = array('FriendlyName' => "friendlyName", 'IpAddress' => "ipAddress", ); $this->assertRequest(new Request( 'post', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/IpAccessControlLists/ALaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IpAddresses.json', null, $values )); } public function testCreateResponse() { $this->holodeck->mock(new Response( 201, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "Mon, 20 Jul 2015 17:27:10 +0000", "date_updated": "Mon, 20 Jul 2015 17:27:10 +0000", "friendly_name": "aaa", "ip_access_control_list_sid": "ALaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "ip_address": "192.1.1.2", "sid": "IPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/IpAccessControlLists/ALaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IpAddresses/IPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->sip ->ipAccessControlLists("ALaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->ipAddresses->create("friendlyName", "ipAddress"); $this->assertNotNull($actual); } public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->sip ->ipAccessControlLists("ALaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->ipAddresses("IPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/IpAccessControlLists/ALaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IpAddresses/IPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "Mon, 20 Jul 2015 17:27:10 +0000", "date_updated": "Mon, 20 Jul 2015 17:27:10 +0000", "friendly_name": "aaa", "ip_access_control_list_sid": "ALaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "ip_address": "192.1.1.2", "sid": "IPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/IpAccessControlLists/ALaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IpAddresses/IPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->sip ->ipAccessControlLists("ALaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->ipAddresses("IPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); $this->assertNotNull($actual); } public function testUpdateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->sip ->ipAccessControlLists("ALaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->ipAddresses("IPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'post', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/IpAccessControlLists/ALaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IpAddresses/IPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json' )); } public function testUpdateResponse() { $this->holodeck->mock(new Response( 200, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "Mon, 20 Jul 2015 17:27:10 +0000", "date_updated": "Mon, 20 Jul 2015 17:27:10 +0000", "friendly_name": "aaa", "ip_access_control_list_sid": "ALaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "ip_address": "192.1.1.2", "sid": "IPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/IpAccessControlLists/ALaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IpAddresses/IPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->sip ->ipAccessControlLists("ALaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->ipAddresses("IPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); $this->assertNotNull($actual); } public function testDeleteRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->sip ->ipAccessControlLists("ALaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->ipAddresses("IPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'delete', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/IpAccessControlLists/ALaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IpAddresses/IPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json' )); } public function testDeleteResponse() { $this->holodeck->mock(new Response( 204, null )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->sip ->ipAccessControlLists("ALaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->ipAddresses("IPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); $this->assertTrue($actual); } } sdk/Twilio/Tests/Integration/Api/V2010/Account/IncomingPhoneNumberTest.php 0000604 00000033553 15174325134 0022267 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Api\V2010\Account; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class IncomingPhoneNumberTest extends HolodeckTestCase { public function testUpdateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->incomingPhoneNumbers("PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'post', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json' )); } public function testUpdateResponse() { $this->holodeck->mock(new Response( 200, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "address_requirements": "none", "address_sid": "ADaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "api_version": "2010-04-01", "beta": false, "capabilities": { "mms": true, "sms": false, "voice": true }, "date_created": "Thu, 30 Jul 2015 23:19:04 +0000", "date_updated": "Thu, 30 Jul 2015 23:19:04 +0000", "emergency_status": "Inactive", "emergency_address_sid": "ADaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "friendly_name": "(808) 925-5327", "identity_sid": "RIaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "origin": "origin", "phone_number": "+18089255327", "sid": "PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "sms_application_sid": "", "sms_fallback_method": "POST", "sms_fallback_url": "", "sms_method": "POST", "sms_url": "", "status_callback": "", "status_callback_method": "POST", "trunk_sid": null, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json", "voice_application_sid": "", "voice_caller_id_lookup": false, "voice_fallback_method": "POST", "voice_fallback_url": null, "voice_method": "POST", "voice_url": null } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->incomingPhoneNumbers("PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); $this->assertNotNull($actual); } public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->incomingPhoneNumbers("PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "address_requirements": "none", "address_sid": "ADaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "api_version": "2010-04-01", "beta": false, "capabilities": { "mms": true, "sms": false, "voice": true }, "date_created": "Thu, 30 Jul 2015 23:19:04 +0000", "date_updated": "Thu, 30 Jul 2015 23:19:04 +0000", "emergency_status": "Active", "emergency_address_sid": "ADaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "friendly_name": "(808) 925-5327", "identity_sid": "RIaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "origin": "origin", "phone_number": "+18089255327", "sid": "PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "sms_application_sid": "", "sms_fallback_method": "POST", "sms_fallback_url": "", "sms_method": "POST", "sms_url": "", "status_callback": "", "status_callback_method": "POST", "trunk_sid": null, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json", "voice_application_sid": "", "voice_caller_id_lookup": false, "voice_fallback_method": "POST", "voice_fallback_url": null, "voice_method": "POST", "voice_url": null } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->incomingPhoneNumbers("PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); $this->assertNotNull($actual); } public function testDeleteRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->incomingPhoneNumbers("PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'delete', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json' )); } public function testDeleteResponse() { $this->holodeck->mock(new Response( 204, null )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->incomingPhoneNumbers("PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); $this->assertTrue($actual); } public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->incomingPhoneNumbers->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers.json' )); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "end": 0, "first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers.json?PageSize=1&Page=0", "incoming_phone_numbers": [ { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "address_requirements": "none", "address_sid": "ADaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "api_version": "2010-04-01", "beta": null, "capabilities": { "mms": true, "sms": false, "voice": true }, "date_created": "Thu, 30 Jul 2015 23:19:04 +0000", "date_updated": "Thu, 30 Jul 2015 23:19:04 +0000", "emergency_status": "Active", "emergency_address_sid": "ADaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "friendly_name": "(808) 925-5327", "identity_sid": "RIaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "origin": "origin", "phone_number": "+18089255327", "sid": "PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "sms_application_sid": "", "sms_fallback_method": "POST", "sms_fallback_url": "", "sms_method": "POST", "sms_url": "", "status_callback": "", "status_callback_method": "POST", "trunk_sid": null, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json", "voice_application_sid": "", "voice_caller_id_lookup": false, "voice_fallback_method": "POST", "voice_fallback_url": null, "voice_method": "POST", "voice_url": null } ], "last_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers.json?PageSize=1&Page=2", "next_page_uri": null, "num_pages": 3, "page": 0, "page_size": 1, "previous_page_uri": null, "start": 0, "total": 3, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers.json?PageSize=1" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->incomingPhoneNumbers->read(); $this->assertGreaterThan(0, count($actual)); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "end": 0, "first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers.json?PageSize=1&Page=0", "incoming_phone_numbers": [], "last_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers.json?PageSize=1&Page=2", "next_page_uri": null, "num_pages": 3, "page": 0, "page_size": 1, "previous_page_uri": null, "start": 0, "total": 3, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers.json?PageSize=1" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->incomingPhoneNumbers->read(); $this->assertNotNull($actual); } public function testCreateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->incomingPhoneNumbers->create(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'post', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers.json' )); } public function testCreateResponse() { $this->holodeck->mock(new Response( 201, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "address_requirements": "none", "address_sid": "ADaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "api_version": "2010-04-01", "beta": false, "capabilities": { "mms": true, "sms": false, "voice": true }, "date_created": "Thu, 30 Jul 2015 23:19:04 +0000", "date_updated": "Thu, 30 Jul 2015 23:19:04 +0000", "emergency_status": "Active", "emergency_address_sid": "ADaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "friendly_name": "(808) 925-5327", "identity_sid": "RIaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "origin": "origin", "phone_number": "+18089255327", "sid": "PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "sms_application_sid": "", "sms_fallback_method": "POST", "sms_fallback_url": "", "sms_method": "POST", "sms_url": "", "status_callback": "", "status_callback_method": "POST", "trunk_sid": null, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json", "voice_application_sid": "", "voice_caller_id_lookup": false, "voice_fallback_method": "POST", "voice_fallback_url": null, "voice_method": "POST", "voice_url": null } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->incomingPhoneNumbers->create(); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/Api/V2010/Account/ConferenceTest.php 0000604 00000016726 15174325134 0020433 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Api\V2010\Account; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class ConferenceTest extends HolodeckTestCase { public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->conferences("CFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Conferences/CFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "api_version": "2008-08-01", "date_created": "Fri, 18 Feb 2011 19:26:50 +0000", "date_updated": "Fri, 18 Feb 2011 19:27:33 +0000", "friendly_name": "AHH YEAH", "sid": "CFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "region": "us1", "status": "completed", "subresource_uris": { "participants": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Conferences/CFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants.json", "recordings": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Conferences/CFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings.json" }, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Conferences/CFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->conferences("CFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); $this->assertNotNull($actual); } public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->conferences->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Conferences.json' )); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "conferences": [ { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "api_version": "2010-04-01", "date_created": "Mon, 22 Aug 2011 20:58:45 +0000", "date_updated": "Mon, 22 Aug 2011 20:58:46 +0000", "friendly_name": null, "region": "us1", "sid": "CFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "status": "in-progress", "subresource_uris": { "participants": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Conferences/CFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants.json", "recordings": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Conferences/CFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings.json" }, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Conferences/CFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json" } ], "end": 0, "first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Conferences.json?PageSize=1&Page=0", "next_page_uri": null, "page": 0, "page_size": 1, "previous_page_uri": null, "start": 0, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Conferences.json?PageSize=1" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->conferences->read(); $this->assertGreaterThan(0, count($actual)); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "conferences": [], "end": 0, "first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Conferences.json?PageSize=1&Page=0", "next_page_uri": null, "page": 0, "page_size": 1, "previous_page_uri": null, "start": 0, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Conferences.json?PageSize=1" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->conferences->read(); $this->assertNotNull($actual); } public function testUpdateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->conferences("CFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'post', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Conferences/CFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json' )); } public function testUpdateEndConferenceResponse() { $this->holodeck->mock(new Response( 200, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "api_version": "2010-04-01", "date_created": "Mon, 22 Aug 2011 20:58:45 +0000", "date_updated": "Mon, 22 Aug 2011 20:58:46 +0000", "friendly_name": null, "region": "us1", "sid": "CFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "status": "completed", "subresource_uris": { "participants": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Conferences/CFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants.json", "recordings": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Conferences/CFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings.json" }, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Conferences/CFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->conferences("CFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/Api/V2010/Account/Usage/TriggerTest.php 0000604 00000027225 15174325134 0021027 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Api\V2010\Account\Usage; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class TriggerTest extends HolodeckTestCase { public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->usage ->triggers("UTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Triggers/UTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "api_version": "2010-04-01", "callback_method": "GET", "callback_url": "http://cap.com/streetfight", "current_value": "0", "date_created": "Sun, 06 Sep 2015 12:58:45 +0000", "date_fired": null, "date_updated": "Sun, 06 Sep 2015 12:58:45 +0000", "friendly_name": "raphael-cluster-1441544325.86", "recurring": "yearly", "sid": "UTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "trigger_by": "price", "trigger_value": "50", "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Triggers/UTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "usage_category": "totalprice", "usage_record_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records?Category=totalprice" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->usage ->triggers("UTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); $this->assertNotNull($actual); } public function testUpdateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->usage ->triggers("UTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'post', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Triggers/UTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json' )); } public function testUpdateResponse() { $this->holodeck->mock(new Response( 200, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "api_version": "2010-04-01", "callback_method": "GET", "callback_url": "http://cap.com/streetfight", "current_value": "0", "date_created": "Sun, 06 Sep 2015 12:58:45 +0000", "date_fired": null, "date_updated": "Sun, 06 Sep 2015 12:58:45 +0000", "friendly_name": "raphael-cluster-1441544325.86", "recurring": "yearly", "sid": "UTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "trigger_by": "price", "trigger_value": "50", "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Triggers/UTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "usage_category": "totalprice", "usage_record_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records?Category=totalprice" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->usage ->triggers("UTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); $this->assertNotNull($actual); } public function testDeleteRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->usage ->triggers("UTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'delete', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Triggers/UTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json' )); } public function testDeleteResponse() { $this->holodeck->mock(new Response( 204, null )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->usage ->triggers("UTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); $this->assertTrue($actual); } public function testCreateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->usage ->triggers->create("https://example.com", "triggerValue", "answering-machine-detection"); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $values = array( 'CallbackUrl' => "https://example.com", 'TriggerValue' => "triggerValue", 'UsageCategory' => "answering-machine-detection", ); $this->assertRequest(new Request( 'post', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Triggers.json', null, $values )); } public function testCreateResponse() { $this->holodeck->mock(new Response( 201, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "api_version": "2010-04-01", "callback_method": "GET", "callback_url": "http://cap.com/streetfight", "current_value": "0", "date_created": "Sun, 06 Sep 2015 12:58:45 +0000", "date_fired": null, "date_updated": "Sun, 06 Sep 2015 12:58:45 +0000", "friendly_name": "raphael-cluster-1441544325.86", "recurring": "yearly", "sid": "UTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "trigger_by": "price", "trigger_value": "50", "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Triggers/UTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "usage_category": "totalprice", "usage_record_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records?Category=totalprice" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->usage ->triggers->create("https://example.com", "triggerValue", "answering-machine-detection"); $this->assertNotNull($actual); } public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->usage ->triggers->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Triggers.json' )); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "end": 0, "first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Triggers?PageSize=1&Page=0", "last_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Triggers?PageSize=1&Page=626", "next_page_uri": null, "num_pages": 627, "page": 0, "page_size": 1, "previous_page_uri": null, "start": 0, "total": 627, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Triggers", "usage_triggers": [ { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "api_version": "2010-04-01", "callback_method": "GET", "callback_url": "http://cap.com/streetfight", "current_value": "0", "date_created": "Sun, 06 Sep 2015 12:58:45 +0000", "date_fired": null, "date_updated": "Sun, 06 Sep 2015 12:58:45 +0000", "friendly_name": "raphael-cluster-1441544325.86", "recurring": "yearly", "sid": "UTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "trigger_by": "price", "trigger_value": "50", "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Triggers/UTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "usage_category": "totalprice", "usage_record_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records?Category=totalprice" } ] } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->usage ->triggers->read(); $this->assertGreaterThan(0, count($actual)); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "end": 0, "first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Triggers?PageSize=1&Page=0", "last_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Triggers?PageSize=1&Page=626", "next_page_uri": null, "num_pages": 627, "page": 0, "page_size": 1, "previous_page_uri": null, "start": 0, "total": 627, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Triggers", "usage_triggers": [] } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->usage ->triggers->read(); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/Api/V2010/Account/Usage/Record/MonthlyTest.php 0000604 00000012627 15174325134 0022274 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Api\V2010\Account\Usage\Record; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class MonthlyTest extends HolodeckTestCase { public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->usage ->records ->monthly->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/Monthly.json' )); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "end": 0, "first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/Monthly?Page=0&PageSize=1", "last_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/Monthly?Page=3449&PageSize=1", "next_page_uri": null, "num_pages": 3450, "page": 0, "page_size": 1, "previous_page_uri": null, "start": 0, "total": 3450, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/Monthly", "usage_records": [ { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "api_version": "2010-04-01", "category": "sms-inbound-shortcode", "count": "0", "count_unit": "messages", "description": "Short Code Inbound SMS", "end_date": "2015-09-04", "price": "0", "price_unit": "usd", "start_date": "2015-09-01", "subresource_uris": { "all_time": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/AllTime.json?Category=sms-inbound-shortcode", "daily": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/Daily.json?Category=sms-inbound-shortcode", "last_month": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/LastMonth.json?Category=sms-inbound-shortcode", "monthly": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/Monthly.json?Category=sms-inbound-shortcode", "this_month": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/ThisMonth.json?Category=sms-inbound-shortcode", "today": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/Today.json?Category=sms-inbound-shortcode", "yearly": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/Yearly.json?Category=sms-inbound-shortcode", "yesterday": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/Yesterday.json?Category=sms-inbound-shortcode" }, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/Monthly?Category=sms-inbound-shortcode&StartDate=2015-09-01&EndDate=2015-09-04", "usage": "0", "usage_unit": "messages" } ] } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->usage ->records ->monthly->read(); $this->assertGreaterThan(0, count($actual)); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "end": 0, "first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/Monthly?Page=0&PageSize=1", "last_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/Monthly?Page=3449&PageSize=1", "next_page_uri": null, "num_pages": 3450, "page": 0, "page_size": 1, "previous_page_uri": null, "start": 0, "total": 3450, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/Monthly", "usage_records": [] } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->usage ->records ->monthly->read(); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/Api/V2010/Account/Usage/Record/YearlyTest.php 0000604 00000012605 15174325134 0022103 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Api\V2010\Account\Usage\Record; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class YearlyTest extends HolodeckTestCase { public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->usage ->records ->yearly->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/Yearly.json' )); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "end": 0, "first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/Yearly?Page=0&PageSize=1", "last_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/Yearly?Page=344&PageSize=1", "next_page_uri": null, "num_pages": 345, "page": 0, "page_size": 1, "previous_page_uri": null, "start": 0, "total": 345, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/Yearly", "usage_records": [ { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "api_version": "2010-04-01", "category": "sms-inbound-shortcode", "count": "0", "count_unit": "messages", "description": "Short Code Inbound SMS", "end_date": "2015-09-04", "price": "0", "price_unit": "usd", "start_date": "2015-01-01", "subresource_uris": { "all_time": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/AllTime.json?Category=sms-inbound-shortcode", "daily": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/Daily.json?Category=sms-inbound-shortcode", "last_month": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/LastMonth.json?Category=sms-inbound-shortcode", "monthly": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/Monthly.json?Category=sms-inbound-shortcode", "this_month": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/ThisMonth.json?Category=sms-inbound-shortcode", "today": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/Today.json?Category=sms-inbound-shortcode", "yearly": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/Yearly.json?Category=sms-inbound-shortcode", "yesterday": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/Yesterday.json?Category=sms-inbound-shortcode" }, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/Yearly?Category=sms-inbound-shortcode&StartDate=2015-01-01&EndDate=2015-09-04", "usage": "0", "usage_unit": "messages" } ] } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->usage ->records ->yearly->read(); $this->assertGreaterThan(0, count($actual)); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "end": 0, "first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/Yearly?Page=0&PageSize=1", "last_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/Yearly?Page=344&PageSize=1", "next_page_uri": null, "num_pages": 345, "page": 0, "page_size": 1, "previous_page_uri": null, "start": 0, "total": 345, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/Yearly", "usage_records": [] } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->usage ->records ->yearly->read(); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/Api/V2010/Account/Usage/Record/AllTimeTest.php 0000604 00000012613 15174325134 0022164 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Api\V2010\Account\Usage\Record; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class AllTimeTest extends HolodeckTestCase { public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->usage ->records ->allTime->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/AllTime.json' )); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "end": 0, "first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/AllTime?Page=0&PageSize=1", "last_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/AllTime?Page=68&PageSize=1", "next_page_uri": null, "num_pages": 69, "page": 0, "page_size": 1, "previous_page_uri": null, "start": 0, "total": 69, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/AllTime", "usage_records": [ { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "api_version": "2010-04-01", "category": "sms-inbound-shortcode", "count": "0", "count_unit": "messages", "description": "Short Code Inbound SMS", "end_date": "2015-09-04", "price": "0", "price_unit": "usd", "start_date": "2011-08-23", "subresource_uris": { "all_time": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/AllTime.json?Category=sms-inbound-shortcode", "daily": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/Daily.json?Category=sms-inbound-shortcode", "last_month": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/LastMonth.json?Category=sms-inbound-shortcode", "monthly": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/Monthly.json?Category=sms-inbound-shortcode", "this_month": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/ThisMonth.json?Category=sms-inbound-shortcode", "today": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/Today.json?Category=sms-inbound-shortcode", "yearly": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/Yearly.json?Category=sms-inbound-shortcode", "yesterday": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/Yesterday.json?Category=sms-inbound-shortcode" }, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/AllTime?Category=sms-inbound-shortcode&StartDate=2011-08-23&EndDate=2015-09-04", "usage": "0", "usage_unit": "messages" } ] } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->usage ->records ->allTime->read(); $this->assertGreaterThan(0, count($actual)); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "end": 0, "first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/AllTime?Page=0&PageSize=1", "last_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/AllTime?Page=68&PageSize=1", "next_page_uri": null, "num_pages": 69, "page": 0, "page_size": 1, "previous_page_uri": null, "start": 0, "total": 69, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/AllTime", "usage_records": [] } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->usage ->records ->allTime->read(); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/Api/V2010/Account/Usage/Record/TodayTest.php 0000604 00000012563 15174325134 0021721 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Api\V2010\Account\Usage\Record; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class TodayTest extends HolodeckTestCase { public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->usage ->records ->today->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/Today.json' )); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "end": 0, "first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/Today?Page=0&PageSize=1", "last_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/Today?Page=68&PageSize=1", "next_page_uri": null, "num_pages": 69, "page": 0, "page_size": 1, "previous_page_uri": null, "start": 0, "total": 69, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/Today", "usage_records": [ { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "api_version": "2010-04-01", "category": "sms-inbound-shortcode", "count": "0", "count_unit": "messages", "description": "Short Code Inbound SMS", "end_date": "2015-09-04", "price": "0", "price_unit": "usd", "start_date": "2015-09-04", "subresource_uris": { "all_time": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/AllTime.json?Category=sms-inbound-shortcode", "daily": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/Daily.json?Category=sms-inbound-shortcode", "last_month": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/LastMonth.json?Category=sms-inbound-shortcode", "monthly": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/Monthly.json?Category=sms-inbound-shortcode", "this_month": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/ThisMonth.json?Category=sms-inbound-shortcode", "today": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/Today.json?Category=sms-inbound-shortcode", "yearly": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/Yearly.json?Category=sms-inbound-shortcode", "yesterday": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/Yesterday.json?Category=sms-inbound-shortcode" }, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/Today?Category=sms-inbound-shortcode&StartDate=2015-09-04&EndDate=2015-09-04", "usage": "0", "usage_unit": "messages" } ] } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->usage ->records ->today->read(); $this->assertGreaterThan(0, count($actual)); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "end": 0, "first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/Today?Page=0&PageSize=1", "last_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/Today?Page=68&PageSize=1", "next_page_uri": null, "num_pages": 69, "page": 0, "page_size": 1, "previous_page_uri": null, "start": 0, "total": 69, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/Today", "usage_records": [] } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->usage ->records ->today->read(); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/Api/V2010/Account/Usage/Record/ThisMonthTest.php 0000604 00000012643 15174325134 0022555 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Api\V2010\Account\Usage\Record; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class ThisMonthTest extends HolodeckTestCase { public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->usage ->records ->thisMonth->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/ThisMonth.json' )); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "end": 0, "first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/ThisMonth?Page=0&PageSize=1", "last_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/ThisMonth?Page=68&PageSize=1", "next_page_uri": null, "num_pages": 69, "page": 0, "page_size": 1, "previous_page_uri": null, "start": 0, "total": 69, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/ThisMonth", "usage_records": [ { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "api_version": "2010-04-01", "category": "sms-inbound-shortcode", "count": "0", "count_unit": "messages", "description": "Short Code Inbound SMS", "end_date": "2015-09-04", "price": "0", "price_unit": "usd", "start_date": "2015-09-01", "subresource_uris": { "all_time": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/AllTime.json?Category=sms-inbound-shortcode", "daily": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/Daily.json?Category=sms-inbound-shortcode", "last_month": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/LastMonth.json?Category=sms-inbound-shortcode", "monthly": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/Monthly.json?Category=sms-inbound-shortcode", "this_month": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/ThisMonth.json?Category=sms-inbound-shortcode", "today": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/Today.json?Category=sms-inbound-shortcode", "yearly": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/Yearly.json?Category=sms-inbound-shortcode", "yesterday": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/Yesterday.json?Category=sms-inbound-shortcode" }, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/ThisMonth?Category=sms-inbound-shortcode&StartDate=2015-09-01&EndDate=2015-09-04", "usage": "0", "usage_unit": "messages" } ] } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->usage ->records ->thisMonth->read(); $this->assertGreaterThan(0, count($actual)); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "end": 0, "first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/ThisMonth?Page=0&PageSize=1", "last_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/ThisMonth?Page=68&PageSize=1", "next_page_uri": null, "num_pages": 69, "page": 0, "page_size": 1, "previous_page_uri": null, "start": 0, "total": 69, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/ThisMonth", "usage_records": [] } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->usage ->records ->thisMonth->read(); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/Api/V2010/Account/Usage/Record/YesterdayTest.php 0000604 00000012643 15174325134 0022611 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Api\V2010\Account\Usage\Record; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class YesterdayTest extends HolodeckTestCase { public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->usage ->records ->yesterday->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/Yesterday.json' )); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "end": 0, "first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/Yesterday?Page=0&PageSize=1", "last_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/Yesterday?Page=68&PageSize=1", "next_page_uri": null, "num_pages": 69, "page": 0, "page_size": 1, "previous_page_uri": null, "start": 0, "total": 69, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/Yesterday", "usage_records": [ { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "api_version": "2010-04-01", "category": "sms-inbound-shortcode", "count": "0", "count_unit": "messages", "description": "Short Code Inbound SMS", "end_date": "2015-09-03", "price": "0", "price_unit": "usd", "start_date": "2015-09-03", "subresource_uris": { "all_time": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/AllTime.json?Category=sms-inbound-shortcode", "daily": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/Daily.json?Category=sms-inbound-shortcode", "last_month": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/LastMonth.json?Category=sms-inbound-shortcode", "monthly": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/Monthly.json?Category=sms-inbound-shortcode", "this_month": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/ThisMonth.json?Category=sms-inbound-shortcode", "today": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/Today.json?Category=sms-inbound-shortcode", "yearly": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/Yearly.json?Category=sms-inbound-shortcode", "yesterday": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/Yesterday.json?Category=sms-inbound-shortcode" }, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/Yesterday?Category=sms-inbound-shortcode&StartDate=2015-09-03&EndDate=2015-09-03", "usage": "0", "usage_unit": "messages" } ] } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->usage ->records ->yesterday->read(); $this->assertGreaterThan(0, count($actual)); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "end": 0, "first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/Yesterday?Page=0&PageSize=1", "last_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/Yesterday?Page=68&PageSize=1", "next_page_uri": null, "num_pages": 69, "page": 0, "page_size": 1, "previous_page_uri": null, "start": 0, "total": 69, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/Yesterday", "usage_records": [] } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->usage ->records ->yesterday->read(); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/Api/V2010/Account/Usage/Record/LastMonthTest.php 0000604 00000012643 15174325134 0022551 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Api\V2010\Account\Usage\Record; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class LastMonthTest extends HolodeckTestCase { public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->usage ->records ->lastMonth->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/LastMonth.json' )); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "end": 0, "first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/LastMonth?Page=0&PageSize=1", "last_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/LastMonth?Page=68&PageSize=1", "next_page_uri": null, "num_pages": 69, "page": 0, "page_size": 1, "previous_page_uri": null, "start": 0, "total": 69, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/LastMonth", "usage_records": [ { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "api_version": "2010-04-01", "category": "sms-inbound-shortcode", "count": "0", "count_unit": "messages", "description": "Short Code Inbound SMS", "end_date": "2015-08-31", "price": "0", "price_unit": "usd", "start_date": "2015-08-01", "subresource_uris": { "all_time": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/AllTime.json?Category=sms-inbound-shortcode", "daily": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/Daily.json?Category=sms-inbound-shortcode", "last_month": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/LastMonth.json?Category=sms-inbound-shortcode", "monthly": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/Monthly.json?Category=sms-inbound-shortcode", "this_month": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/ThisMonth.json?Category=sms-inbound-shortcode", "today": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/Today.json?Category=sms-inbound-shortcode", "yearly": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/Yearly.json?Category=sms-inbound-shortcode", "yesterday": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/Yesterday.json?Category=sms-inbound-shortcode" }, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/LastMonth?Category=sms-inbound-shortcode&StartDate=2015-08-01&EndDate=2015-08-31", "usage": "0", "usage_unit": "messages" } ] } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->usage ->records ->lastMonth->read(); $this->assertGreaterThan(0, count($actual)); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "end": 0, "first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/LastMonth?Page=0&PageSize=1", "last_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/LastMonth?Page=68&PageSize=1", "next_page_uri": null, "num_pages": 69, "page": 0, "page_size": 1, "previous_page_uri": null, "start": 0, "total": 69, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/LastMonth", "usage_records": [] } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->usage ->records ->lastMonth->read(); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/Api/V2010/Account/Usage/Record/DailyTest.php 0000604 00000012613 15174325134 0021677 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Api\V2010\Account\Usage\Record; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class DailyTest extends HolodeckTestCase { public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->usage ->records ->daily->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/Daily.json' )); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "end": 0, "first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/Daily?Page=0&PageSize=1", "last_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/Daily?Page=101843&PageSize=1", "next_page_uri": null, "num_pages": 101844, "page": 0, "page_size": 1, "previous_page_uri": null, "start": 0, "total": 101844, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/Daily", "usage_records": [ { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "api_version": "2010-04-01", "category": "sms-inbound-shortcode", "count": "0", "count_unit": "messages", "description": "Short Code Inbound SMS", "end_date": "2015-09-06", "price": "0", "price_unit": "usd", "start_date": "2015-09-06", "subresource_uris": { "all_time": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/AllTime.json?Category=sms-inbound-shortcode", "daily": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/Daily.json?Category=sms-inbound-shortcode", "last_month": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/LastMonth.json?Category=sms-inbound-shortcode", "monthly": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/Monthly.json?Category=sms-inbound-shortcode", "this_month": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/ThisMonth.json?Category=sms-inbound-shortcode", "today": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/Today.json?Category=sms-inbound-shortcode", "yearly": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/Yearly.json?Category=sms-inbound-shortcode", "yesterday": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/Yesterday.json?Category=sms-inbound-shortcode" }, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/Daily?Category=sms-inbound-shortcode&StartDate=2015-09-06&EndDate=2015-09-06", "usage": "0", "usage_unit": "messages" } ] } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->usage ->records ->daily->read(); $this->assertGreaterThan(0, count($actual)); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "end": 0, "first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/Daily?Page=0&PageSize=1", "last_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/Daily?Page=101843&PageSize=1", "next_page_uri": null, "num_pages": 101844, "page": 0, "page_size": 1, "previous_page_uri": null, "start": 0, "total": 101844, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/Daily", "usage_records": [] } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->usage ->records ->daily->read(); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/Api/V2010/Account/Usage/RecordTest.php 0000604 00000012067 15174325134 0020640 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Api\V2010\Account\Usage; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class RecordTest extends HolodeckTestCase { public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->usage ->records->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records.json' )); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "end": 0, "first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records?Page=0&PageSize=1", "last_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records?Page=68&PageSize=1", "next_page_uri": null, "num_pages": 69, "page": 0, "page_size": 1, "previous_page_uri": null, "start": 0, "total": 69, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records", "usage_records": [ { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "api_version": "2010-04-01", "category": "totalprice", "count": null, "count_unit": "", "description": "Total Price", "end_date": "2015-09-04", "price": "2192.84855", "price_unit": "usd", "start_date": "2011-08-23", "subresource_uris": { "all_time": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/AllTime.json?Category=totalprice", "daily": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/Daily.json?Category=totalprice", "last_month": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/LastMonth.json?Category=totalprice", "monthly": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/Monthly.json?Category=totalprice", "this_month": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/ThisMonth.json?Category=totalprice", "today": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/Today.json?Category=totalprice", "yearly": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/Yearly.json?Category=totalprice", "yesterday": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/Yesterday.json?Category=totalprice" }, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records?Category=totalprice&StartDate=2011-08-23&EndDate=2015-09-04", "usage": "2192.84855", "usage_unit": "usd" } ] } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->usage ->records->read(); $this->assertGreaterThan(0, count($actual)); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "end": 0, "first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records?Page=0&PageSize=1", "last_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records?Page=68&PageSize=1", "next_page_uri": null, "num_pages": 69, "page": 0, "page_size": 1, "previous_page_uri": null, "start": 0, "total": 69, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records", "usage_records": [] } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->usage ->records->read(); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/Api/V2010/Account/Conference/ParticipantTest.php 0000604 00000030326 15174325134 0022701 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Api\V2010\Account\Conference; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class ParticipantTest extends HolodeckTestCase { public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->conferences("CFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->participants("CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Conferences/CFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "call_sid": "CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "conference_sid": "CFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "Fri, 18 Feb 2011 21:07:19 +0000", "date_updated": "Fri, 18 Feb 2011 21:07:19 +0000", "end_conference_on_exit": false, "muted": false, "hold": false, "status": "complete", "start_conference_on_enter": true, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Conferences/CFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->conferences("CFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->participants("CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); $this->assertNotNull($actual); } public function testUpdateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->conferences("CFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->participants("CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'post', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Conferences/CFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json' )); } public function testUpdateResponse() { $this->holodeck->mock(new Response( 200, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "call_sid": "CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "conference_sid": "CFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "Fri, 18 Feb 2011 21:07:19 +0000", "date_updated": "Fri, 18 Feb 2011 21:07:19 +0000", "end_conference_on_exit": false, "muted": false, "hold": false, "status": "complete", "start_conference_on_enter": true, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Conferences/CFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->conferences("CFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->participants("CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); $this->assertNotNull($actual); } public function testCreateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->conferences("CFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->participants->create("+15017122661", "+15558675310"); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $values = array('From' => "+15017122661", 'To' => "+15558675310", ); $this->assertRequest(new Request( 'post', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Conferences/CFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants.json', null, $values )); } public function testCreateWithSidResponse() { $this->holodeck->mock(new Response( 201, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "call_sid": "CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "conference_sid": "CFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "Fri, 18 Feb 2011 21:07:19 +0000", "date_updated": "Fri, 18 Feb 2011 21:07:19 +0000", "end_conference_on_exit": false, "muted": false, "hold": false, "status": "complete", "start_conference_on_enter": true, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Conferences/CFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->conferences("CFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->participants->create("+15017122661", "+15558675310"); $this->assertNotNull($actual); } public function testCreateWithFriendlyNameResponse() { $this->holodeck->mock(new Response( 201, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "call_sid": "CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "conference_sid": "CFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "Fri, 18 Feb 2011 21:07:19 +0000", "date_updated": "Fri, 18 Feb 2011 21:07:19 +0000", "end_conference_on_exit": false, "muted": false, "hold": false, "status": "complete", "start_conference_on_enter": true, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Conferences/CFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->conferences("CFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->participants->create("+15017122661", "+15558675310"); $this->assertNotNull($actual); } public function testDeleteRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->conferences("CFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->participants("CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'delete', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Conferences/CFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json' )); } public function testDeleteResponse() { $this->holodeck->mock(new Response( 204, null )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->conferences("CFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->participants("CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); $this->assertTrue($actual); } public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->conferences("CFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->participants->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Conferences/CFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants.json' )); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "end": 0, "first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Conferences/CFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants.json?Page=0&PageSize=50", "next_page_uri": null, "page": 0, "page_size": 50, "participants": [ { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "call_sid": "CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "conference_sid": "CFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "Fri, 18 Feb 2011 21:07:19 +0000", "date_updated": "Fri, 18 Feb 2011 21:07:19 +0000", "end_conference_on_exit": false, "muted": false, "hold": false, "status": "complete", "start_conference_on_enter": true, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Conferences/CFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json" } ], "previous_page_uri": null, "start": 0, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Conferences/CFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants.json" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->conferences("CFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->participants->read(); $this->assertGreaterThan(0, count($actual)); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "end": 0, "first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Conferences/CFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants.json?Page=0&PageSize=50", "next_page_uri": null, "page": 0, "page_size": 50, "participants": [], "previous_page_uri": null, "start": 0, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Conferences/CFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants.json" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->conferences("CFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->participants->read(); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/Api/V2010/Account/AuthorizedConnectAppTest.php 0000604 00000013370 15174325134 0022445 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Api\V2010\Account; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class AuthorizedConnectAppTest extends HolodeckTestCase { public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->authorizedConnectApps("CNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AuthorizedConnectApps/CNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "connect_app_company_name": "aaa", "connect_app_description": "alksjdfl;ajseifj;alsijfl;ajself;jasjfjas;lejflj", "connect_app_friendly_name": "aaa", "connect_app_homepage_url": "http://www.google.com", "connect_app_sid": "CNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "Tue, 31 Aug 2010 20:36:28 +0000", "date_updated": "Tue, 31 Aug 2010 20:36:44 +0000", "permissions": [ "get-all" ], "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AuthorizedConnectApps/CNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->authorizedConnectApps("CNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); $this->assertNotNull($actual); } public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->authorizedConnectApps->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AuthorizedConnectApps.json' )); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "authorized_connect_apps": [ { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "connect_app_company_name": "YOUR OTHER MOM", "connect_app_description": "alksjdfl;ajseifj;alsijfl;ajself;jasjfjas;lejflj", "connect_app_friendly_name": "YOUR MOM", "connect_app_homepage_url": "http://www.google.com", "connect_app_sid": "CNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "Tue, 31 Aug 2010 20:36:28 +0000", "date_updated": "Tue, 31 Aug 2010 20:36:44 +0000", "permissions": [ "get-all" ], "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AuthorizedConnectApps/CNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json" } ], "end": 0, "first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AuthorizedConnectApps.json?Page=0&PageSize=50", "last_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AuthorizedConnectApps.json?Page=0&PageSize=50", "next_page_uri": null, "num_pages": 1, "page": 0, "page_size": 50, "previous_page_uri": null, "start": 0, "total": 1, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AuthorizedConnectApps.json" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->authorizedConnectApps->read(); $this->assertGreaterThan(0, count($actual)); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "authorized_connect_apps": [], "end": 0, "first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AuthorizedConnectApps.json?Page=0&PageSize=50", "last_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AuthorizedConnectApps.json?Page=0&PageSize=50", "next_page_uri": null, "num_pages": 1, "page": 0, "page_size": 50, "previous_page_uri": null, "start": 0, "total": 1, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AuthorizedConnectApps.json" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->authorizedConnectApps->read(); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/Api/V2010/Account/OutgoingCallerIdTest.php 0000604 00000017147 15174325134 0021555 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Api\V2010\Account; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class OutgoingCallerIdTest extends HolodeckTestCase { public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->outgoingCallerIds("PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/OutgoingCallerIds/PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "Fri, 21 Aug 2009 00:11:24 +0000", "date_updated": "Fri, 21 Aug 2009 00:11:24 +0000", "friendly_name": "(415) 867-5309", "phone_number": "+141586753096", "sid": "PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/OutgoingCallerIds/PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->outgoingCallerIds("PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); $this->assertNotNull($actual); } public function testUpdateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->outgoingCallerIds("PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'post', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/OutgoingCallerIds/PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json' )); } public function testUpdateResponse() { $this->holodeck->mock(new Response( 200, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "Fri, 21 Aug 2009 00:11:24 +0000", "date_updated": "Fri, 21 Aug 2009 00:11:24 +0000", "friendly_name": "(415) 867-5309", "phone_number": "+141586753096", "sid": "PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/OutgoingCallerIds/PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->outgoingCallerIds("PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); $this->assertNotNull($actual); } public function testDeleteRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->outgoingCallerIds("PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'delete', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/OutgoingCallerIds/PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json' )); } public function testDeleteResponse() { $this->holodeck->mock(new Response( 204, null )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->outgoingCallerIds("PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); $this->assertTrue($actual); } public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->outgoingCallerIds->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/OutgoingCallerIds.json' )); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "end": 0, "first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/OutgoingCallerIds.json?Page=0&PageSize=50", "last_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/OutgoingCallerIds.json?Page=0&PageSize=50", "next_page_uri": null, "num_pages": 1, "outgoing_caller_ids": [ { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "Fri, 21 Aug 2009 00:11:24 +0000", "date_updated": "Fri, 21 Aug 2009 00:11:24 +0000", "friendly_name": "(415) 867-5309", "phone_number": "+141586753096", "sid": "PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/OutgoingCallerIds/PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json" } ], "page": 0, "page_size": 50, "previous_page_uri": null, "start": 0, "total": 1, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/OutgoingCallerIds.json" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->outgoingCallerIds->read(); $this->assertGreaterThan(0, count($actual)); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "end": 0, "first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/OutgoingCallerIds.json?Page=0&PageSize=50", "last_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/OutgoingCallerIds.json?Page=0&PageSize=50", "next_page_uri": null, "num_pages": 1, "outgoing_caller_ids": [], "page": 0, "page_size": 50, "previous_page_uri": null, "start": 0, "total": 1, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/OutgoingCallerIds.json" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->outgoingCallerIds->read(); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/Api/V2010/Account/Recording/AddOnResult/PayloadTest.php 0000604 00000020743 15174325134 0024047 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Api\V2010\Account\Recording\AddOnResult; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class PayloadTest extends HolodeckTestCase { public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->recordings("REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->addOnResults("XRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->payloads("XHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings/REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AddOnResults/XRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Payloads/XHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "sid": "XHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "reference_sid": "REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "add_on_sid": "XBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "add_on_configuration_sid": "XEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "add_on_result_sid": "XRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "label": "XHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "content_type": "application/json", "date_created": "Wed, 01 Sep 2010 15:15:41 +0000", "date_updated": "Wed, 01 Sep 2010 15:15:41 +0000", "subresource_uris": { "data": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings/REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AddOnResults/XRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Payloads/XHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Data.json" } } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->recordings("REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->addOnResults("XRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->payloads("XHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); $this->assertNotNull($actual); } public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->recordings("REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->addOnResults("XRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->payloads->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings/REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AddOnResults/XRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Payloads.json' )); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "end": 0, "first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings/REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AddOnResults/XRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Payloads.json?PageSize=50&Page=0", "next_page_uri": null, "page": 0, "page_size": 50, "previous_page_uri": null, "payloads": [ { "sid": "XHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "reference_sid": "REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "add_on_sid": "XBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "add_on_configuration_sid": "XEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "add_on_result_sid": "XRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "label": "XHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "content_type": "application/json", "date_created": "Wed, 01 Sep 2010 15:15:41 +0000", "date_updated": "Wed, 01 Sep 2010 15:15:41 +0000", "subresource_uris": { "data": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings/REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AddOnResults/XRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Payloads/XHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Data.json" } } ], "start": 0, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings/REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AddOnResults/XRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Payloads.json?PageSize=50&Page=0" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->recordings("REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->addOnResults("XRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->payloads->read(); $this->assertGreaterThan(0, count($actual)); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "end": 0, "first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings/REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AddOnResults/XRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Payloads.json?PageSize=50&Page=0", "next_page_uri": null, "page": 0, "page_size": 50, "previous_page_uri": null, "payloads": [], "start": 0, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings/REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AddOnResults/XRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Payloads.json?PageSize=50&Page=0" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->recordings("REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->addOnResults("XRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->payloads->read(); $this->assertNotNull($actual); } public function testDeleteRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->recordings("REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->addOnResults("XRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->payloads("XHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'delete', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings/REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AddOnResults/XRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Payloads/XHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json' )); } public function testDeleteResponse() { $this->holodeck->mock(new Response( 204, null )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->recordings("REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->addOnResults("XRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->payloads("XHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); $this->assertTrue($actual); } } sdk/Twilio/Tests/Integration/Api/V2010/Account/Recording/TranscriptionTest.php 0000604 00000017217 15174325134 0023133 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Api\V2010\Account\Recording; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class TranscriptionTest extends HolodeckTestCase { public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->recordings("REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->transcriptions("TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings/REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Transcriptions/TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "api_version": "2008-08-01", "date_created": "Mon, 22 Aug 2011 20:58:44 +0000", "date_updated": "Mon, 22 Aug 2011 20:58:44 +0000", "duration": "10", "price": "0.00000", "price_unit": "USD", "recording_sid": "REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "sid": "TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "status": "in-progress", "transcription_text": "THIS IS A TEST", "type": "fast", "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Transcriptions/TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->recordings("REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->transcriptions("TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); $this->assertNotNull($actual); } public function testDeleteRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->recordings("REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->transcriptions("TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'delete', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings/REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Transcriptions/TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json' )); } public function testDeleteResponse() { $this->holodeck->mock(new Response( 204, null )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->recordings("REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->transcriptions("TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); $this->assertTrue($actual); } public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->recordings("REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->transcriptions->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings/REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Transcriptions.json' )); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "end": 0, "first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings/REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Transcriptions.json?PageSize=50&Page=0", "last_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings/REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Transcriptions.json?PageSize=50&Page=0", "next_page_uri": null, "num_pages": 1, "page": 0, "page_size": 50, "previous_page_uri": null, "start": 0, "total": 1, "transcriptions": [ { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "api_version": "2008-08-01", "date_created": "Mon, 22 Aug 2011 20:58:44 +0000", "date_updated": "Mon, 22 Aug 2011 20:58:44 +0000", "duration": "10", "price": "0.00000", "price_unit": "USD", "recording_sid": "REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "sid": "TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "status": "in-progress", "transcription_text": "THIS IS A TEST", "type": "fast", "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Transcriptions/TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json" } ], "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings/REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Transcriptions.json?PageSize=50&Page=0" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->recordings("REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->transcriptions->read(); $this->assertGreaterThan(0, count($actual)); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "end": 0, "first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings/REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Transcriptions.json?PageSize=50&Page=0", "last_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings/REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Transcriptions.json?PageSize=50&Page=0", "next_page_uri": null, "num_pages": 1, "page": 0, "page_size": 50, "previous_page_uri": null, "start": 0, "total": 1, "transcriptions": [], "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings/REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Transcriptions.json?PageSize=50&Page=0" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->recordings("REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->transcriptions->read(); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/Api/V2010/Account/Recording/AddOnResultTest.php 0000604 00000016515 15174325134 0022460 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Api\V2010\Account\Recording; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class AddOnResultTest extends HolodeckTestCase { public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->recordings("REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->addOnResults("XRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings/REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AddOnResults/XRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "sid": "XRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "reference_sid": "REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "status": "completed", "add_on_sid": "XBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "add_on_configuration_sid": "XEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "Wed, 01 Sep 2010 15:15:41 +0000", "date_updated": "Wed, 01 Sep 2010 15:15:41 +0000", "date_completed": "Wed, 01 Sep 2010 15:15:41 +0000", "subresource_uris": { "payloads": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings/REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AddOnResults/XRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Payloads.json" } } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->recordings("REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->addOnResults("XRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); $this->assertNotNull($actual); } public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->recordings("REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->addOnResults->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings/REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AddOnResults.json' )); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "end": 0, "first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings/REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AddOnResults.json?PageSize=50&Page=0", "next_page_uri": null, "page": 0, "page_size": 50, "previous_page_uri": null, "add_on_results": [ { "sid": "XRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "reference_sid": "REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "status": "completed", "add_on_sid": "XBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "add_on_configuration_sid": "XEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "Wed, 01 Sep 2010 15:15:41 +0000", "date_updated": "Wed, 01 Sep 2010 15:15:41 +0000", "date_completed": "Wed, 01 Sep 2010 15:15:41 +0000", "subresource_uris": { "payloads": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings/REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AddOnResults/XRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Payloads.json" } } ], "start": 0, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings/REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AddOnResults.json?PageSize=50&Page=0" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->recordings("REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->addOnResults->read(); $this->assertGreaterThan(0, count($actual)); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "end": 0, "first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings/REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AddOnResults.json?PageSize=50&Page=0", "next_page_uri": null, "page": 0, "page_size": 50, "previous_page_uri": null, "add_on_results": [], "start": 0, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings/REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AddOnResults.json?PageSize=50&Page=0" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->recordings("REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->addOnResults->read(); $this->assertNotNull($actual); } public function testDeleteRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->recordings("REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->addOnResults("XRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'delete', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings/REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AddOnResults/XRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json' )); } public function testDeleteResponse() { $this->holodeck->mock(new Response( 204, null )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->recordings("REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->addOnResults("XRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); $this->assertTrue($actual); } } sdk/Twilio/Tests/Integration/Api/V2010/Account/NewSigningKeyTest.php 0000604 00000003061 15174325134 0021071 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Api\V2010\Account; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class NewSigningKeyTest extends HolodeckTestCase { public function testCreateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->newSigningKeys->create(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'post', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SigningKeys.json' )); } public function testCreateResponse() { $this->holodeck->mock(new Response( 201, ' { "sid": "SKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "friendly_name": "foo", "date_created": "Mon, 13 Jun 2016 22:50:08 +0000", "date_updated": "Mon, 13 Jun 2016 22:50:08 +0000", "secret": "foobar" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->newSigningKeys->create(); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/Api/V2010/Account/ShortCodeTest.php 0000604 00000015771 15174325134 0020255 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Api\V2010\Account; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class ShortCodeTest extends HolodeckTestCase { public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->shortCodes("SCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SMS/ShortCodes/SCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "api_version": "2010-04-01", "date_created": null, "date_updated": null, "friendly_name": "API_CLUSTER_TEST_SHORT_CODE", "short_code": "99990", "sid": "SCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "sms_fallback_method": "POST", "sms_fallback_url": null, "sms_method": "POST", "sms_url": null, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SMS/ShortCodes/SCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->shortCodes("SCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); $this->assertNotNull($actual); } public function testUpdateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->shortCodes("SCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'post', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SMS/ShortCodes/SCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json' )); } public function testUpdateResponse() { $this->holodeck->mock(new Response( 200, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "api_version": "2010-04-01", "date_created": null, "date_updated": null, "friendly_name": "API_CLUSTER_TEST_SHORT_CODE", "short_code": "99990", "sid": "SCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "sms_fallback_method": "POST", "sms_fallback_url": null, "sms_method": "POST", "sms_url": null, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SMS/ShortCodes/SCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->shortCodes("SCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); $this->assertNotNull($actual); } public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->shortCodes->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SMS/ShortCodes.json' )); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "end": 0, "first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SMS/ShortCodes.json?Page=0&PageSize=50", "last_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SMS/ShortCodes.json?Page=0&PageSize=50", "next_page_uri": null, "num_pages": 1, "page": 0, "page_size": 50, "previous_page_uri": null, "short_codes": [ { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "api_version": "2010-04-01", "date_created": null, "date_updated": null, "friendly_name": "API_CLUSTER_TEST_SHORT_CODE", "short_code": "99990", "sid": "SCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "sms_fallback_method": "POST", "sms_fallback_url": null, "sms_method": "POST", "sms_url": null, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SMS/ShortCodes/SCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json" } ], "start": 0, "total": 1, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SMS/ShortCodes.json" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->shortCodes->read(); $this->assertGreaterThan(0, count($actual)); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "end": 0, "first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SMS/ShortCodes.json?Page=0&PageSize=50", "last_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SMS/ShortCodes.json?Page=0&PageSize=50", "next_page_uri": null, "num_pages": 1, "page": 0, "page_size": 50, "previous_page_uri": null, "short_codes": [], "start": 0, "total": 1, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SMS/ShortCodes.json" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->shortCodes->read(); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/Api/V2010/Account/ValidationRequestTest.php 0000604 00000003305 15174325134 0022014 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Api\V2010\Account; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class ValidationRequestTest extends HolodeckTestCase { public function testCreateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->validationRequests->create("+15017122661"); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $values = array('PhoneNumber' => "+15017122661", ); $this->assertRequest(new Request( 'post', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/OutgoingCallerIds.json', null, $values )); } public function testCreateResponse() { $this->holodeck->mock(new Response( 201, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "call_sid": "CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "friendly_name": "friendly_name", "phone_number": "+18001234567", "validation_code": 100 } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->validationRequests->create("+15017122661"); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/Api/V2010/Account/ConnectAppTest.php 0000604 00000016155 15174325134 0020412 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Api\V2010\Account; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class ConnectAppTest extends HolodeckTestCase { public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->connectApps("CNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ConnectApps/CNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "authorize_redirect_url": "http://example.com/redirect", "company_name": "Twilio", "deauthorize_callback_method": "GET", "deauthorize_callback_url": "http://example.com/deauth", "description": null, "friendly_name": "Connect app for deletion", "homepage_url": "http://example.com/home", "permissions": [], "sid": "CNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ConnectApps/CNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->connectApps("CNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); $this->assertNotNull($actual); } public function testUpdateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->connectApps("CNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'post', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ConnectApps/CNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json' )); } public function testUpdateResponse() { $this->holodeck->mock(new Response( 200, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "authorize_redirect_url": "http://example.com/redirect", "company_name": "Twilio", "deauthorize_callback_method": "GET", "deauthorize_callback_url": "http://example.com/deauth", "description": null, "friendly_name": "Connect app for deletion", "homepage_url": "http://example.com/home", "permissions": [], "sid": "CNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ConnectApps/CNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->connectApps("CNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); $this->assertNotNull($actual); } public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->connectApps->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ConnectApps.json' )); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "connect_apps": [ { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "authorize_redirect_url": "http://example.com/redirect", "company_name": "Twilio", "deauthorize_callback_method": "GET", "deauthorize_callback_url": "http://example.com/deauth", "description": null, "friendly_name": "Connect app for deletion", "homepage_url": "http://example.com/home", "permissions": [], "sid": "CNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ConnectApps/CNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json" } ], "end": 0, "first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ConnectApps.json?Page=0&PageSize=50", "last_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ConnectApps.json?Page=0&PageSize=50", "next_page_uri": null, "num_pages": 1, "page": 0, "page_size": 50, "previous_page_uri": null, "start": 0, "total": 1, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ConnectApps.json" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->connectApps->read(); $this->assertGreaterThan(0, count($actual)); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "connect_apps": [], "end": 0, "first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ConnectApps.json?Page=0&PageSize=50", "last_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ConnectApps.json?Page=0&PageSize=50", "next_page_uri": null, "num_pages": 1, "page": 0, "page_size": 50, "previous_page_uri": null, "start": 0, "total": 1, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ConnectApps.json" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->connectApps->read(); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/Api/V2010/Account/ApplicationTest.php 0000604 00000027647 15174325134 0020633 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Api\V2010\Account; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class ApplicationTest extends HolodeckTestCase { public function testCreateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->applications->create("friendlyName"); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $values = array('FriendlyName' => "friendlyName", ); $this->assertRequest(new Request( 'post', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Applications.json', null, $values )); } public function testCreateResponse() { $this->holodeck->mock(new Response( 201, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "api_version": "2010-04-01", "date_created": "Mon, 22 Aug 2011 20:59:45 +0000", "date_updated": "Tue, 18 Aug 2015 16:48:57 +0000", "friendly_name": "Application Friendly Name", "message_status_callback": "http://www.example.com/sms-status-callback", "sid": "APaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "sms_fallback_method": "GET", "sms_fallback_url": "http://www.example.com/sms-fallback", "sms_method": "GET", "sms_status_callback": "http://www.example.com/sms-status-callback", "sms_url": "http://example.com", "status_callback": "http://example.com", "status_callback_method": "GET", "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Applications/APaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json", "voice_caller_id_lookup": false, "voice_fallback_method": "GET", "voice_fallback_url": "http://www.example.com/voice-callback", "voice_method": "GET", "voice_url": "http://example.com" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->applications->create("friendlyName"); $this->assertNotNull($actual); } public function testDeleteRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->applications("APaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'delete', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Applications/APaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json' )); } public function testDeleteResponse() { $this->holodeck->mock(new Response( 204, null )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->applications("APaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); $this->assertTrue($actual); } public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->applications("APaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Applications/APaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "api_version": "2010-04-01", "date_created": "Mon, 22 Aug 2011 20:59:45 +0000", "date_updated": "Tue, 18 Aug 2015 16:48:57 +0000", "friendly_name": "Application Friendly Name", "message_status_callback": "http://www.example.com/sms-status-callback", "sid": "APaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "sms_fallback_method": "GET", "sms_fallback_url": "http://www.example.com/sms-fallback", "sms_method": "GET", "sms_status_callback": "http://www.example.com/sms-status-callback", "sms_url": "http://example.com", "status_callback": "http://example.com", "status_callback_method": "GET", "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Applications/APaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json", "voice_caller_id_lookup": false, "voice_fallback_method": "GET", "voice_fallback_url": "http://www.example.com/voice-callback", "voice_method": "GET", "voice_url": "http://example.com" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->applications("APaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); $this->assertNotNull($actual); } public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->applications->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Applications.json' )); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "applications": [ { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "api_version": "2010-04-01", "date_created": "Fri, 21 Aug 2015 00:07:25 +0000", "date_updated": "Fri, 21 Aug 2015 00:07:25 +0000", "friendly_name": "d8821fb7-4d01-48b2-bdc5-34e46252b90b", "message_status_callback": null, "sid": "APaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "sms_fallback_method": "POST", "sms_fallback_url": null, "sms_method": "POST", "sms_status_callback": null, "sms_url": null, "status_callback": null, "status_callback_method": "POST", "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Applications/APaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json", "voice_caller_id_lookup": false, "voice_fallback_method": "POST", "voice_fallback_url": null, "voice_method": "POST", "voice_url": null } ], "end": 0, "first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Applications.json?PageSize=1&Page=0", "last_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Applications.json?PageSize=1&Page=35", "next_page_uri": null, "num_pages": 36, "page": 0, "page_size": 1, "previous_page_uri": null, "start": 0, "total": 36, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Applications.json?PageSize=1&Page=0" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->applications->read(); $this->assertGreaterThan(0, count($actual)); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "applications": [], "end": 0, "first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Applications.json?PageSize=1&Page=0", "last_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Applications.json?PageSize=1&Page=35", "next_page_uri": null, "num_pages": 36, "page": 0, "page_size": 1, "previous_page_uri": null, "start": 0, "total": 36, "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Applications.json?PageSize=1&Page=0" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->applications->read(); $this->assertNotNull($actual); } public function testUpdateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->applications("APaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'post', 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Applications/APaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json' )); } public function testUpdateResponse() { $this->holodeck->mock(new Response( 200, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "api_version": "2010-04-01", "date_created": "Mon, 22 Aug 2011 20:59:45 +0000", "date_updated": "Tue, 18 Aug 2015 16:48:57 +0000", "friendly_name": "Application Friendly Name", "message_status_callback": "http://www.example.com/sms-status-callback", "sid": "APaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "sms_fallback_method": "GET", "sms_fallback_url": "http://www.example.com/sms-fallback", "sms_method": "GET", "sms_status_callback": "http://www.example.com/sms-status-callback", "sms_url": "http://example.com", "status_callback": "http://example.com", "status_callback_method": "GET", "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Applications/APaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json", "voice_caller_id_lookup": false, "voice_fallback_method": "GET", "voice_fallback_url": "http://www.example.com/voice-callback", "voice_method": "GET", "voice_url": "http://example.com" } ' )); $actual = $this->twilio->api->v2010->accounts("ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->applications("APaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/Fax/V1/FaxTest.php 0000604 00000022114 15174325134 0015255 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Fax\V1; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class FaxTest extends HolodeckTestCase { public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->fax->v1->faxes("FXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://fax.twilio.com/v1/Faxes/FXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "api_version": "v1", "date_created": "2015-07-30T20:00:00Z", "date_updated": "2015-07-30T20:00:00Z", "direction": "outbound", "from": "+14155551234", "media_url": "https://www.example.com/fax.pdf", "media_sid": "MEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "num_pages": null, "price": null, "price_unit": null, "quality": null, "sid": "FXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "status": "queued", "to": "+14155554321", "duration": null, "links": { "media": "https://fax.twilio.com/v1/Faxes/FXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Media" }, "url": "https://fax.twilio.com/v1/Faxes/FXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->fax->v1->faxes("FXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); $this->assertNotNull($actual); } public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->fax->v1->faxes->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://fax.twilio.com/v1/Faxes' )); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "faxes": [], "meta": { "first_page_url": "https://fax.twilio.com/v1/Faxes?PageSize=50&Page=0", "key": "faxes", "next_page_url": null, "page": 0, "page_size": 50, "previous_page_url": null, "url": "https://fax.twilio.com/v1/Faxes?PageSize=50&Page=0" } } ' )); $actual = $this->twilio->fax->v1->faxes->read(); $this->assertNotNull($actual); } public function testReadFullResponse() { $this->holodeck->mock(new Response( 200, ' { "faxes": [ { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "api_version": "v1", "date_created": "2015-07-30T20:00:00Z", "date_updated": "2015-07-30T20:00:00Z", "direction": "outbound", "from": "+14155551234", "media_url": "https://www.example.com/fax.pdf", "media_sid": "MEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "num_pages": null, "price": null, "price_unit": null, "quality": null, "sid": "FXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "status": "queued", "to": "+14155554321", "duration": null, "links": { "media": "https://fax.twilio.com/v1/Faxes/FXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Media" }, "url": "https://fax.twilio.com/v1/Faxes/FXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ], "meta": { "first_page_url": "https://fax.twilio.com/v1/Faxes?PageSize=50&Page=0", "key": "faxes", "next_page_url": null, "page": 0, "page_size": 50, "previous_page_url": null, "url": "https://fax.twilio.com/v1/Faxes?PageSize=50&Page=0" } } ' )); $actual = $this->twilio->fax->v1->faxes->read(); $this->assertGreaterThan(0, count($actual)); } public function testCreateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->fax->v1->faxes->create("to", "https://example.com"); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $values = array('To' => "to", 'MediaUrl' => "https://example.com", ); $this->assertRequest(new Request( 'post', 'https://fax.twilio.com/v1/Faxes', null, $values )); } public function testCreateResponse() { $this->holodeck->mock(new Response( 201, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "api_version": "v1", "date_created": "2015-07-30T20:00:00Z", "date_updated": "2015-07-30T20:00:00Z", "direction": "outbound", "from": "+14155551234", "media_url": null, "media_sid": null, "num_pages": null, "price": null, "price_unit": null, "quality": "superfine", "sid": "FXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "status": "queued", "to": "+14155554321", "duration": null, "links": { "media": "https://fax.twilio.com/v1/Faxes/FXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Media" }, "url": "https://fax.twilio.com/v1/Faxes/FXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->fax->v1->faxes->create("to", "https://example.com"); $this->assertNotNull($actual); } public function testUpdateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->fax->v1->faxes("FXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'post', 'https://fax.twilio.com/v1/Faxes/FXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testUpdateResponse() { $this->holodeck->mock(new Response( 200, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "api_version": "v1", "date_created": "2015-07-30T20:00:00Z", "date_updated": "2015-07-30T20:00:00Z", "direction": "outbound", "from": "+14155551234", "media_url": null, "media_sid": null, "num_pages": null, "price": null, "price_unit": null, "quality": null, "sid": "FXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "status": "canceled", "to": "+14155554321", "duration": null, "links": { "media": "https://fax.twilio.com/v1/Faxes/FXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Media" }, "url": "https://fax.twilio.com/v1/Faxes/FXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->fax->v1->faxes("FXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); $this->assertNotNull($actual); } public function testDeleteRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->fax->v1->faxes("FXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'delete', 'https://fax.twilio.com/v1/Faxes/FXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testDeleteResponse() { $this->holodeck->mock(new Response( 204, null )); $actual = $this->twilio->fax->v1->faxes("FXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); $this->assertTrue($actual); } } sdk/Twilio/Tests/Integration/Fax/V1/Fax/FaxMediaTest.php 0000604 00000011227 15174325134 0016736 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Fax\V1\Fax; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class FaxMediaTest extends HolodeckTestCase { public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->fax->v1->faxes("FXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->media("MEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://fax.twilio.com/v1/Faxes/FXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Media/MEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "content_type": "application/pdf", "date_created": "2015-07-30T20:00:00Z", "date_updated": "2015-07-30T20:00:00Z", "fax_sid": "FXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "sid": "MEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "url": "https://fax.twilio.com/v1/Faxes/FXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Media/MEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->fax->v1->faxes("FXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->media("MEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); $this->assertNotNull($actual); } public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->fax->v1->faxes("FXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->media->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://fax.twilio.com/v1/Faxes/FXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Media' )); } public function testReadResponse() { $this->holodeck->mock(new Response( 200, ' { "media": [ { "sid": "MEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "fax_sid": "FXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "content_type": "application/pdf", "date_created": "2015-07-30T20:00:00Z", "date_updated": "2015-07-30T20:00:00Z", "url": "https://fax.twilio.com/v1/Faxes/FXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Media/MEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ], "meta": { "first_page_url": "https://fax.twilio.com/v1/Faxes/FXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Media?PageSize=50&Page=0", "key": "media", "next_page_url": null, "page": 0, "page_size": 50, "previous_page_url": null, "url": "https://fax.twilio.com/v1/Faxes/FXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Media?PageSize=50&Page=0" } } ' )); $actual = $this->twilio->fax->v1->faxes("FXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->media->read(); $this->assertNotNull($actual); } public function testDeleteRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->fax->v1->faxes("FXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->media("MEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'delete', 'https://fax.twilio.com/v1/Faxes/FXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Media/MEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testDeleteResponse() { $this->holodeck->mock(new Response( 204, null )); $actual = $this->twilio->fax->v1->faxes("FXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->media("MEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->delete(); $this->assertTrue($actual); } } sdk/Twilio/Tests/Integration/Video/V1/Room/RoomRecordingTest.php 0000604 00000013562 15174325134 0020563 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Video\V1\Room; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class RoomRecordingTest extends HolodeckTestCase { public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->video->v1->rooms("RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->recordings("RTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://video.twilio.com/v1/Rooms/RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings/RTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "status": "processing", "date_created": "2015-07-30T20:00:00Z", "sid": "RTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "source_sid": "MTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "size": 0, "type": "audio", "duration": 0, "container_format": "mka", "codec": "OPUS", "grouping_sids": { "room_sid": "RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" }, "room_sid": "RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "url": "https://video.twilio.com/v1/Rooms/RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings/RTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "links": { "media": "https://video.twilio.com/v1/Rooms/RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings/RTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Media" } } ' )); $actual = $this->twilio->video->v1->rooms("RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->recordings("RTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); $this->assertNotNull($actual); } public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->video->v1->rooms("RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->recordings->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://video.twilio.com/v1/Rooms/RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings' )); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "recordings": [], "meta": { "page": 0, "page_size": 50, "first_page_url": "https://video.twilio.com/v1/Rooms/RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings?PageSize=50&Page=0", "previous_page_url": null, "url": "https://video.twilio.com/v1/Rooms/RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings?PageSize=50&Page=0", "next_page_url": null, "key": "recordings" } } ' )); $actual = $this->twilio->video->v1->rooms("RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->recordings->read(); $this->assertNotNull($actual); } public function testReadResultsResponse() { $this->holodeck->mock(new Response( 200, ' { "recordings": [ { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "status": "completed", "date_created": "2015-07-30T20:00:00Z", "sid": "RTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "source_sid": "MTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "size": 23, "type": "audio", "duration": 10, "container_format": "mka", "codec": "OPUS", "grouping_sids": { "room_sid": "RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "participant_sid": "PAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" }, "room_sid": "RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "url": "https://video.twilio.com/v1/Rooms/RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings/RTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "links": { "media": "https://video.twilio.com/v1/Rooms/RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings/RTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Media" } } ], "meta": { "page": 0, "page_size": 50, "first_page_url": "https://video.twilio.com/v1/Rooms/RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings?PageSize=50&Page=0", "previous_page_url": null, "url": "https://video.twilio.com/v1/Rooms/RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings?PageSize=50&Page=0", "next_page_url": null, "key": "recordings" } } ' )); $actual = $this->twilio->video->v1->rooms("RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->recordings->read(); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/Video/V1/Room/ParticipantTest.php 0000604 00000017674 15174325134 0020300 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Video\V1\Room; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class ParticipantTest extends HolodeckTestCase { public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->video->v1->rooms("RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->participants("PAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://video.twilio.com/v1/Rooms/RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/PAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "room_sid": "RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "2015-07-30T20:00:00Z", "date_updated": "2015-07-30T20:00:00Z", "start_time": "2015-07-30T20:00:00Z", "end_time": null, "sid": "PAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "identity": "bob", "status": "connected", "url": "https://video.twilio.com/v1/Rooms/RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/PAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "duration": null, "links": { "published_tracks": "https://video.twilio.com/v1/Rooms/RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/PAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/PublishedTracks", "subscribed_tracks": "https://video.twilio.com/v1/Rooms/RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/PAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SubscribedTracks" } } ' )); $actual = $this->twilio->video->v1->rooms("RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->participants("PAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); $this->assertNotNull($actual); } public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->video->v1->rooms("RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->participants->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://video.twilio.com/v1/Rooms/RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants' )); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "participants": [], "meta": { "page": 0, "page_size": 50, "first_page_url": "https://video.twilio.com/v1/Rooms/RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants?PageSize=50&Page=0", "previous_page_url": null, "url": "https://video.twilio.com/v1/Rooms/RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants?PageSize=50&Page=0", "next_page_url": null, "key": "participants" } } ' )); $actual = $this->twilio->video->v1->rooms("RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->participants->read(); $this->assertNotNull($actual); } public function testReadFiltersResponse() { $this->holodeck->mock(new Response( 200, ' { "participants": [ { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "room_sid": "RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "2017-07-30T20:00:00Z", "date_updated": "2017-07-30T20:00:00Z", "start_time": "2017-07-30T20:00:00Z", "end_time": "2017-07-30T20:00:01Z", "sid": "PAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "identity": "alice", "status": "disconnected", "url": "https://video.twilio.com/v1/Rooms/RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/PAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "duration": 1, "links": { "published_tracks": "https://video.twilio.com/v1/Rooms/RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/PAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/PublishedTracks", "subscribed_tracks": "https://video.twilio.com/v1/Rooms/RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/PAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SubscribedTracks" } } ], "meta": { "page": 0, "page_size": 50, "first_page_url": "https://video.twilio.com/v1/Rooms/RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants?PageSize=50&Page=0", "previous_page_url": null, "url": "https://video.twilio.com/v1/Rooms/RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants?PageSize=50&Page=0", "next_page_url": null, "key": "participants" } } ' )); $actual = $this->twilio->video->v1->rooms("RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->participants->read(); $this->assertNotNull($actual); } public function testUpdateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->video->v1->rooms("RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->participants("PAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'post', 'https://video.twilio.com/v1/Rooms/RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/PAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testUpdateResponse() { $this->holodeck->mock(new Response( 200, ' { "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "room_sid": "RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "2017-07-30T20:00:00Z", "date_updated": "2017-07-30T20:00:00Z", "start_time": "2017-07-30T20:00:00Z", "end_time": "2017-07-30T20:00:01Z", "sid": "PAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "identity": "alice", "status": "disconnected", "url": "https://video.twilio.com/v1/Rooms/RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/PAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "duration": 1, "links": { "published_tracks": "https://video.twilio.com/v1/Rooms/RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/PAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/PublishedTracks", "subscribed_tracks": "https://video.twilio.com/v1/Rooms/RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/PAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SubscribedTracks" } } ' )); $actual = $this->twilio->video->v1->rooms("RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->participants("PAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->update(); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/Video/V1/Room/Participant/PublishedTrackTest.php 0000604 00000007715 15174325134 0023177 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Video\V1\Room\Participant; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class PublishedTrackTest extends HolodeckTestCase { public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->video->v1->rooms("RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->participants("PAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->publishedTracks("MTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://video.twilio.com/v1/Rooms/RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/PAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/PublishedTracks/MTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "room_sid": "RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "2015-07-30T20:00:00Z", "date_updated": "2015-07-30T20:00:00Z", "participant_sid": "PAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "sid": "MTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "name": "bob-track", "kind": "data", "enabled": true, "url": "https://video.twilio.com/v1/Rooms/RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/PAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/PublishedTracks/MTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" } ' )); $actual = $this->twilio->video->v1->rooms("RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->participants("PAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->publishedTracks("MTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")->fetch(); $this->assertNotNull($actual); } public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->video->v1->rooms("RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->participants("PAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->publishedTracks->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://video.twilio.com/v1/Rooms/RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/PAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/PublishedTracks' )); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "published_tracks": [], "meta": { "page": 0, "page_size": 50, "first_page_url": "https://video.twilio.com/v1/Rooms/RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/PAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/PublishedTracks?PageSize=50&Page=0", "previous_page_url": null, "url": "https://video.twilio.com/v1/Rooms/RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/PAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/PublishedTracks?PageSize=50&Page=0", "next_page_url": null, "key": "published_tracks" } } ' )); $actual = $this->twilio->video->v1->rooms("RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->participants("PAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->publishedTracks->read(); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/Video/V1/Room/Participant/SubscribedTrackTest.php 0000604 00000012566 15174325134 0023345 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Video\V1\Room\Participant; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class SubscribedTrackTest extends HolodeckTestCase { public function testReadRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->video->v1->rooms("RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->participants("PAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->subscribedTracks->read(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://video.twilio.com/v1/Rooms/RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/PAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SubscribedTracks' )); } public function testReadEmptyResponse() { $this->holodeck->mock(new Response( 200, ' { "subscribed_tracks": [], "meta": { "page": 0, "page_size": 50, "first_page_url": "https://video.twilio.com/v1/Rooms/RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/PAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SubscribedTracks?PageSize=50&Page=0", "previous_page_url": null, "url": "https://video.twilio.com/v1/Rooms/RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/PAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SubscribedTracks?PageSize=50&Page=0", "next_page_url": null, "key": "subscribed_tracks" } } ' )); $actual = $this->twilio->video->v1->rooms("RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->participants("PAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->subscribedTracks->read(); $this->assertNotNull($actual); } public function testReadFiltersResponse() { $this->holodeck->mock(new Response( 200, ' { "subscribed_tracks": [ { "publisher_sid": "PAbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb", "subscriber_sid": "PAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "room_sid": "RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": "2015-07-30T20:00:00Z", "date_updated": "2015-07-30T20:00:00Z", "sid": "MTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "name": "bob-track", "kind": "data", "enabled": true } ], "meta": { "page": 0, "page_size": 50, "first_page_url": "https://video.twilio.com/v1/Rooms/RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/PAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SubscribedTracks?PageSize=50&Page=0", "previous_page_url": null, "url": "https://video.twilio.com/v1/Rooms/RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/PAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SubscribedTracks?PageSize=50&Page=0", "next_page_url": null, "key": "subscribed_tracks" } } ' )); $actual = $this->twilio->video->v1->rooms("RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->participants("PAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->subscribedTracks->read(); $this->assertNotNull($actual); } public function testUpdateRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->video->v1->rooms("RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->participants("PAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->subscribedTracks->update(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'post', 'https://video.twilio.com/v1/Rooms/RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/PAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SubscribedTracks' )); } public function testUpdateFiltersResponse() { $this->holodeck->mock(new Response( 202, ' { "publisher_sid": null, "subscriber_sid": "PAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "room_sid": "RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "date_created": null, "date_updated": null, "sid": null, "name": "bob-track", "kind": "data", "enabled": null } ' )); $actual = $this->twilio->video->v1->rooms("RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->participants("PAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") ->subscribedTracks->update(); $this->assertNotNull($actual); } } sdk/Twilio/Tests/Integration/Lookups/V1/PhoneNumberTest.php 0000604 00000003713 15174325134 0017703 0 ustar 00 <?php /** * This code was generated by * \ / _ _ _| _ _ * | (_)\/(_)(_|\/| |(/_ v1.0.0 * / / */ namespace Twilio\Tests\Integration\Lookups\V1; use Twilio\Exceptions\DeserializeException; use Twilio\Exceptions\TwilioException; use Twilio\Http\Response; use Twilio\Tests\HolodeckTestCase; use Twilio\Tests\Request; class PhoneNumberTest extends HolodeckTestCase { public function testFetchRequest() { $this->holodeck->mock(new Response(500, '')); try { $this->twilio->lookups->v1->phoneNumbers("+15017122661")->fetch(); } catch (DeserializeException $e) {} catch (TwilioException $e) {} $this->assertRequest(new Request( 'get', 'https://lookups.twilio.com/v1/PhoneNumbers/%2B15017122661' )); } public function testFetchResponse() { $this->holodeck->mock(new Response( 200, ' { "caller_name": { "caller_name": "Delicious Cheese Cake", "caller_type": "CONSUMER", "error_code": null }, "carrier": { "error_code": null, "mobile_country_code": "310", "mobile_network_code": "456", "name": "verizon", "type": "mobile" }, "country_code": "US", "national_format": "(510) 867-5309", "phone_number": "+15108675309", "add_ons": { "status": "successful", "message": null, "code": null, "results": {} }, "url": "https://lookups.twilio.com/v1/PhoneNumbers/phone_number" } ' )); $actual = $this->twilio->lookups->v1->phoneNumbers("+15017122661")->fetch(); $this->assertNotNull($actual); } } sdk/Twilio/Values.php 0000604 00000004600 15174325134 0010545 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/Twilio/TaskRouter/WorkflowRule.php 0000604 00000001460 15174325134 0014054 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/Twilio/TaskRouter/WorkflowConfiguration.php 0000604 00000002572 15174325134 0015761 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/Twilio/TaskRouter/WorkflowRuleTarget.php 0000604 00000001762 15174325134 0015230 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/Twilio/Twiml.php 0000604 00000010675 15174325134 0010413 0 ustar 00 <?php namespace Twilio; use Twilio\Exceptions\TwimlException; /** * Twiml response generator. */ 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); } } sdk/Twilio/Options.php 0000604 00000000324 15174325134 0010740 0 ustar 00 <?php namespace Twilio; abstract class Options implements \IteratorAggregate { protected $options = array(); public function getIterator() { return new \ArrayIterator($this->options); } } sdk/README.md 0000604 00000007042 15174325134 0006610 0 ustar 00 # twilio-php [](http://travis-ci.org/twilio/twilio-php) [](https://packagist.org/packages/twilio/sdk) [](https://packagist.org/packages/twilio/sdk) ## Recent Update As of release 5.13.0, Beta and Developer Preview products are now exposed via the main `twilio-php` artifact. Releases of the `alpha` branch have been discontinued. If you were using the `alpha` release line, you should be able to switch back to the normal release line without issue. If you were using the normal release line, you should now see several new product lines that were historically hidden from you due to their Beta or Developer Preview status. Such products are explicitly documented as Beta/Developer Preview both in the Twilio docs and console, as well as through in-line code documentation here in the library. ## Installation You can install **twilio-php** via composer or by downloading the source. #### Via Composer: **twilio-php** is available on Packagist as the [`twilio/sdk`](http://packagist.org/packages/twilio/sdk) package. ## Quickstart ### Send an SMS ```php // Send an SMS using Twilio's REST API and PHP <?php $sid = "ACXXXXXX"; // Your Account SID from www.twilio.com/console $token = "YYYYYY"; // Your Auth Token from www.twilio.com/console $client = new Twilio\Rest\Client($sid, $token); $message = $client->messages->create( '8881231234', // Text this number array( 'from' => '9991231234', // From a valid Twilio number 'body' => 'Hello from Twilio!' ) ); print $message->sid; ``` ### Make a Call ```php <?php $sid = "ACXXXXXX"; // Your Account SID from www.twilio.com/console $token = "YYYYYY"; // Your Auth Token from www.twilio.com/console $client = new Twilio\Rest\Client($sid, $token); // Read TwiML at this URL when a call connects (hold music) $call = $client->calls->create( '8881231234', // Call this number '9991231234', // From a valid Twilio number array( 'url' => 'https://twimlets.com/holdmusic?Bucket=com.twilio.music.ambient' ) ); ``` ### Generating TwiML To control phone calls, your application needs to output [TwiML](https://www.twilio.com/docs/api/twiml/ "Twilio Markup Language"). Use `Twilio\Twiml` to easily create such responses. ```php <?php $response = new Twilio\Twiml(); $response->say('Hello'); $response->play('https://api.twilio.com/cowbell.mp3', array("loop" => 5)); print $response; ``` That will output XML that looks like this: ```xml <?xml version="1.0" encoding="utf-8"?> <Response> <Say>Hello</Say> <Play loop="5">https://api.twilio.com/cowbell.mp3</Play> <Response> ``` ## Documentation The documentation for the Twilio API is located [here][apidocs]. The PHP library documentation can be found [here][documentation]. ## Versions `twilio-php`'s versioning strategy can be found [here][versioning]. ## Prerequisites * PHP >= 5.3 * The PHP JSON extension # Getting help If you need help installing or using the library, please contact Twilio Support at help@twilio.com first. Twilio's Support staff are well-versed in all of the Twilio Helper Libraries, and usually reply within 24 hours. If you've instead found a bug in the library or would like new features added, go ahead and open issues or pull requests against this repo! [apidocs]: https://www.twilio.com/docs/api [documentation]: https://twilio.github.io/twilio-php/ [versioning]: https://github.com/twilio/twilio-php/blob/master/VERSIONS.md sdk/VERSIONS.md 0000604 00000003411 15174325134 0007117 0 ustar 00 # Versioning Strategy `twilio-php` uses a modified version of [Semantic Versioning][semver] for all changes to the helper library. It is strongly encouraged that you pin at least the major version and potentially the minor version to avoid pulling in breaking changes. Semantic Versions take the form of `MAJOR`.`MINOR`.`PATCH` When bugs are fixed in the library in a backwards compatible way, the `PATCH` level will be incremented by one. When new features are added to the library in a backwards compatible way, the `PATCH` level will be incremented by one. `PATCH` changes should _not_ break your code and are generally safe for upgrade. When a new large feature set comes online or a small breaking change is introduced, the `MINOR` version will be incremented by one and the `PATCH` version reset to zero. `MINOR` changes _may_ require some amount of manual code change for upgrade. These backwards-incompatible changes will generally be limited to a small number of function signature changes. The `MAJOR` version is used to indicate the family of technology represented by the helper library. Breaking changes that requires extensive reworking of code will case the `MAJOR` version to be incremented by one, and the `MINOR` and `PATCH` versions will be reset to zero. Twilio understands that this can be very disruptive, so we will only introduce this type of breaking change when absolutely necessary. New `MAJOR` versions will be communicated in advance with `Release Candidates` and a schedule. ## Supported Versions `twilio-php` follows an evergreen model of support. New features and functionality will only be added to the current version. The current version - 1 will continue to be supported with bug fixes and security updates, but no new features. [semver]: http://semver.org/ sdk/AUTHORS.md 0000604 00000001763 15174325134 0007004 0 ustar 00 Authors ======= A huge thanks to all of our contributors: - =noloh - Adam Ballai - Alex Chan - Alex Rowley - Alexandre Payment - Andres Jaan Tack - Andrew Nicols - Andrew Ryno - Andrew T. Baker - Ben Paster - Brett Gerry - Bulat Shakirzyanov - Carlos Diaz-Padron - Chris Barr - D Keith Casey Jr - D. Keith Casey, Jr. - Doug Black - Elliot Lings - Evan Fossier - Jarod Reyes - Jen Li - Jeremy McEntire - Jingming Niu - John Britton - John Wolthuis - Jordi Boggiano - Jozsef Vass - Justin Witz - Keith Casey - Kevin Burke - Kevin Whinnery - Kyle - Kyle Conroy - Luke Waite - Mario Celi - Matt Nowack - Matthew Nowack - Maxime Horcholle - Mitch Friedman - Neuman - Neuman Vong - Patrick Labbett - Peter Meth - Ragil Prasetya - Ryan Brideau - Sam Kimbrel - Shawn Parker - Stuart Langley - Taichiro Yoshida - Tom Connors - Trenton McManus - Wanjun Li - Zack Pitts - aaronfoss - alexw23 - gramanathaiah - matt - sashalaundy - tacman - till - vassjozsef sdk/composer.json 0000604 00000001102 15174325134 0010042 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.3.0" }, "require-dev": { "phpunit/phpunit": "4.5.*", "apigen/apigen": "^4.1" }, "autoload": { "psr-4": { "Twilio\\": "Twilio/" } } } sdk/ISSUE_TEMPLATE.md 0000604 00000000714 15174325134 0010035 0 ustar 00 *Note: These issues are for bugs and feature requests for the helper libraries. If you need help or support, please email help@twilio.com and one of our experts will assist you!* **Version:** ### Code Snippet ```php # paste code here ``` ### Exception/Log ``` <place exception/log here> ``` ### Steps to Reproduce 1. 2. 3. ### Feature Request _If this is a feature request, make sure you search Issues for an existing request before creating a new one!_ sdk/CONTRIBUTING.md 0000604 00000013307 15174325134 0007563 0 ustar 00 # Contributing to `twilio-php` We'd love for you to contribute to our source code and to make `twilio-php` even better than it is today! Here are the guidelines we'd like you to follow: - [Code of Conduct](#coc) - [Question or Problem?](#question) - [Issues and Bugs](#issue) - [Feature Requests](#feature) - [Documentation fixes](#docs) - [Submission Guidelines](#submit) - [Coding Rules](#rules) ## <a name="coc"></a> Code of Conduct Help us keep `twilio-php` open and inclusive. Please be kind to and considerate of other developers, as we all have the same goal: make `twilio-php` as good as it can be. ## <a name="question"></a> Got an API/Product Question or Problem? If you have questions about how to use `twilio-php`, please see our [docs][docs-link], and if you don't find the answer there, please contact [help@twilio.com](mailto:help@twilio.com) with any issues you have. ## <a name="issue"></a> Found an Issue? If you find a bug in the source code or a mistake in the documentation, you can help us by submitting [an issue][issue-link]. If the file in which the error exists has this header: ``` """ This code was generated by \ / _ _ _| _ _ | (_)\/(_)(_|\/| |(/_ v1.0.0 / / """ ``` then it is a generated file and the change will need to be made by us, but submitting an issue will help us track it and keep you up-to-date. If the file isn't generated, you can help us out even more by submitting a Pull Request with a fix. **Please see the [Submission Guidelines](#submit) below.** ## <a name="feature"></a> Want a Feature? You can request a new feature by submitting an issue to our [GitHub Repository][github]. If you would like to implement a new feature then consider what kind of change it is: * **Major Changes** that you wish to contribute to the project should be discussed first with `twilio-php` contributors in an issue or pull request so that we can develop a proper solution and better coordinate our efforts, prevent duplication of work, and help you to craft the change so that it is successfully accepted into the project. * **Small Changes** can be crafted and submitted to the [GitHub Repository][github] as a Pull Request. ## <a name="docs"></a> Want a Doc Fix? If you want to help improve the docs in the helper library, it's a good idea to let others know what you're working on to minimize duplication of effort. Create a new issue (or comment on a related existing one) to let others know what you're working on. For large fixes, please build and test the documentation before submitting the PR to be sure you haven't accidentally introduced layout or formatting issues. If you want to help improve the docs at [https://www.twilio.com/docs/libraries/php][docs-link], please contact [help@twilio.com](mailto:help@twilio.com). ## <a name="submit"></a> Submission Guidelines ### Submitting an Issue Before you submit your issue search the archive, maybe your question was already answered. If your issue appears to be a bug, and hasn't been reported, open a new issue. Help us to maximize the effort we can spend fixing issues and adding new features by not reporting duplicate issues. Providing the following information will increase the chances of your issue being dealt with quickly: * **Overview of the Issue** - if an error is being thrown a non-minified stack trace helps * **Motivation for or Use Case** - explain why this is a bug for you * **`twilio-php` Version(s)** - is it a regression? * **Operating System (if relevant)** - is this a problem with all systems or only specific ones? * **Reproduce the Error** - provide an isolated code snippet or an unambiguous set of steps. * **Related Issues** - has a similar issue been reported before? * **Suggest a Fix** - if you can't fix the bug yourself, perhaps you can point to what might be causing the problem (line of code or commit) **If you get help, help others. Good karma rules!** ### Submitting a Pull Request Before you submit your pull request consider the following guidelines: * Search [GitHub][github] for an open or closed Pull Request that relates to your submission. You don't want to duplicate effort. * Make your changes in a new git branch: ```shell git checkout -b my-fix-branch master ``` * Create your patch, **including appropriate test cases**. * Follow our [Coding Rules](#rules). * Run the full `twilio-php` test suite (aliased by `make test`), and ensure that all tests pass. * Commit your changes using a descriptive commit message. ```shell git commit -a ``` Note: the optional commit `-a` command line option will automatically "add" and "rm" edited files. * Build your changes locally to ensure all the tests pass: ```shell make test ``` * Push your branch to GitHub: ```shell git push origin my-fix-branch ``` In GitHub, send a pull request to `twilio-php:master`. If we suggest changes, then: * Make the required updates. * Re-run the `twilio-php` test suite to ensure tests are still passing. * Commit your changes to your branch (e.g. `my-fix-branch`). * Push the changes to your GitHub repository (this will update your Pull Request). That's it! Thank you for your contribution! #### After your pull request is merged After your pull request is merged, you can safely delete your branch and pull the changes from the main (upstream) repository. ## <a name="rules"></a> Coding Rules To ensure consistency throughout the source code, keep these rules in mind as you are working: * All features or bug fixes **must be tested** by one or more tests. * All classes and methods **must be documented**. [docs-link]: https://www.twilio.com/docs/libraries/php [issue-link]: https://github.com/twilio/twilio-php/issues/new [github]: https://github.com/twilio/twilio-php sdk/CHANGES.md 0000604 00000075376 15174325134 0006742 0 ustar 00 twilio-php Changelog ==================== [2018-01-30] Version 5.16.4 ---------------------------- **Api** - Add `studio-engagements` usage key **Preview** - Remove Studio Engagement Deletion **Studio** - Initial Release **Video** - [omit] Beta: Allow updates to `SubscribedTracks`. - Add `SubscribedTracks`. - Add track name to Video Recording resource - Add Composition and Composition Media resources [2018-01-19] Version 5.16.3 ---------------------------- **Api** - Add `conference_sid` property on Recordings - Add proxy and sms usage key **Chat** - Make user channels accessible by identity - Add notifications logs flag parameter **Fax** - Added `ttl` parameter `ttl` is the number of minutes a fax is considered valid. **Preview** - Add `call_delay`, `extension`, `verification_code`, and `verification_call_sids`. - Add `failure_reason` to HostedNumberOrders. - Add DependentHostedNumberOrders endpoint for AuthorizationDocuments preview API. **Taskrouter** - Less verbose naming of cumulative and real time statistics *(breaking change)* [2017-12-15] Version 5.16.2 ---------------------------- **Api** - Add `voip`, `national`, `shared_cost`, and `machine_to_machine` sub-resources to `/2010-04-01/Accounts/{AccountSid}/AvailablePhoneNumbers/{IsoCountryCode}/` - Add programmable video keys **Preview** - Add `verification_type` and `verification_document_sid` to HostedNumberOrders. **Proxy** - Fixed typo in session status enum value **Twiml** - Fix Dial record property incorrectly typed as accepting TrimEnum values when it actually has its own enum of values. *(breaking change)* - Add `priority` and `timeout` properties to Task TwiML. - Add support for `recording_status_callback_event` for Dial verb and for Conference [2017-12-01] Version 5.16.1 ---------------------------- **Api** - Use the correct properties for Dependent Phone Numbers of an Address *(breaking change)* - Update Call Recordings with the correct properties **Preview** - Add `status` and `email` query param filters for AuthorizationDocument list endpoint **Proxy** - Added DELETE support to Interaction - Standardized enum values to dash-case - Rename Service#friendly_name to Service#unique_name **Video** - Remove beta flag from `media_region` and `video_codecs` **Wireless** - Bug fix: Changed `operator_mcc` and `operator_mnc` in `DataSessions` subresource from `integer` to `string` [2017-11-17] Version 5.16.0 ---------------------------- **Sync** - Add TTL support for Sync objects *(breaking change)* - The required `data` parameter on the following actions is now optional: "Update Document", "Update Map Item", "Update List Item" - New actions available for updating TTL of Sync objects: "Update List", "Update Map", "Update Stream" **Video** - [bi] Rename `RoomParticipant` to `Participant` - Add Recording Settings resource - Expose EncryptionKey and MediaExternalLocation properties in Recording resource [2017-11-10] Version 5.15.6 ---------------------------- **Accounts** - Add AWS credential type **Preview** - Removed `iso_country` as required field for creating a HostedNumberOrder. **Proxy** - Added new fields to Service: geo_match_level, number_selection_behavior, intercept_callback_url, out_of_session_callback_url [2017-11-03] Version 5.15.5 ---------------------------- **Library** - Issue 451: Do not set CURLOPT_INFILESIZE by default - PR #454: Fix the JsonSerializable. Thanks @vinu! **Api** - Add programmable video keys **Video** - Add `Participants` [2017-10-27] Version 5.15.4 ---------------------------- **Chat** - Add Binding resource - Add UserBinding resource [2017-10-20] Version 5.15.3 ---------------------------- **Api** - Add `address_sid` param to IncomingPhoneNumbers create and update - Add 'fax_enabled' option for Phone Number Search [2017-10-13] Version 5.15.2 ---------------------------- **Api** - Add `smart_encoded` param for Messages - Add `identity_sid` param to IncomingPhoneNumbers create and update **Preview** - Make 'address_sid' and 'email' optional fields when creating a HostedNumberOrder - Add AuthorizationDocuments preview API. **Proxy** - Initial Release **Wireless** - Added `ip_address` to sim resource [2017-10-06] Version 5.15.1 ---------------------------- **Preview** - Add `acc_security` (authy-phone-verification) initial api-definitions **Taskrouter** - [bi] Less verbose naming of cumulative and real time statistics [2017-09-28] Version 5.15.0 ---------------------------- **Library** - Add warnings when trying to import/use objects from legacy versions of the library. **Chat** - Make member accessible through identity - Make channel subresources accessible by channel unique name - Set get list 'max_page_size' parameter to 100 - Add service instance webhook retry configuration - Add media message capability - Make `body` an optional parameter on Message creation. *(breaking change)* **Notify** - `data`, `apn`, `gcm`, `fcm`, `sms` parameters in `Notifications` create resource now accept objects instead of strings. Passing manually stringified json objects will continue to work. **Taskrouter** - Add new query ability by TaskChannelSid or TaskChannelUniqueName - Move Events, Worker, Workers endpoint over to CPR - Add new RealTime and Cumulative Statistics endpoints **Video** - Create should allow an array of video_codecs. - Add video_codecs as a property of room to make it externally visible. [2017-09-15] Version 5.14.1 ---------------------------- **Api** - Add `sip_registration` property on SIP Domains - Add new video and market usage category keys [2017-09-01] Version 5.14.0 ---------------------------- **TwiML** - Add classes for all TwiML verbs. [2017-09-01] Version 5.13.4 ---------------------------- **Sync** - Add support for Streams **Wireless** - Added DataSessions sub-resource to Sims. [2017-08-25] Version 5.13.3 ---------------------------- **Library** - Add `lastRequest` and `lastResponse` properties to `CurlClient` to help debugging. **Api** - Update `status` enum for Recordings to include 'failed' - Add `errorCode` property on Recordings **Chat** - Add mutable parameters for channel, members and messages **Video** - New `media_region` parameter when creating a room, which controls which region media will be served out of. [2017-08-18] Version 5.13.2 ---------------------------- **Api** - Add VoiceReceiveMode {'voice', 'fax'} option to IncomingPhoneNumber UPDATE requests **Chat** - Add channel message media information - Add service instance message media information **Preview** - Removed 'email' from bulk_exports configuration api [bi]. No migration plan needed because api has not been used yet. - Add DeployedDevices. **Sync** - Add support for Service Instance unique names [2017-08-10] Version 5.13.1 ---------------------------- **Api** - Add New wireless usage keys added - Add `auto_correct_address` param for Addresses create and update - Add ChatGrant to Grants and deprecate IpMessagingGrant **Video** - Add `video_codec` enum and `video_codecs` parameter, which can be set to either `VP8` or `H264` during room creation. - Restrict recordings page size to 100 [2017-07-27] Version 5.13.0 ---------------------------- This release adds Beta and Preview products to main artifact. Previously, Beta and Preview products were only included in the `alpha` artifact. They are now being included in the main artifact to ease product discoverability and the collective operational overhead of maintaining multiple artifacts per library. **Api** - Remove unused `encryption_type` property on Recordings *(breaking change)* - Update `status` enum for Messages to include 'accepted' **Messaging** - Fix incorrectly typed capabilities property for PhoneNumbers. **Notify** - Add `ToBinding` optional parameter on Notifications resource creation. Accepted values are json strings. **Preview** - Add `sms_application_sid` to HostedNumberOrders. **Taskrouter** - Fully support conference functionality in reservations. [2017-07-13] Version 5.12.1 --------------------------- - This release drops official support for PHP 5.3 and PHP 5.4, which were EOL'd in 2014 and 2015 respectively. - Reinstate `getPage` functionality. [2017-07-13] Version 5.12.0 ---------------------------- **Api** - Update `AnnounceMethod` parameter naming for consistency **Notify** - Add `ToBinding` optional parameter on Notifications resource creation. Accepted values are json strings. **Preview** - Add `verification_attempts` to HostedNumberOrders. - Add `status_callback_url` and `status_callback_method` to HostedNumberOrders. **Video** - Filter recordings by date using the parameters `DateCreatedAfter` and `DateCreatedBefore`. - Override the default time-to-live of a recording's media URL through the `Ttl` parameter (in seconds, default value is 3600). - Add query parameters `SourceSid`, `Status`, `DateCreatedAfter` and `DateCreatedBefore` to the convenience method for retrieving Room recordings. **Wireless** - Added national and international data limits to the RatePlans resource. [2017-06-16] Version 5.11.0 --------------------------- - Add `locality` field to `AvailablePhoneNumbers`. - Add `origin` field to `IncomingPhoneNumbers`. - Add `in_locality` parameter to `AvailablePhoneNumbers`. - Add `origin` parameter to `IncomingPhoneNumbers`. - Add `announce_url` parameter to `Participants`. - Add `announce_url_method` parameter to `Participants`. - Add `getPage()` methods to lists to begin paging starting from a given url. [2017-05-24] Version 5.10.0 -------------------------- - Rename room `Recordings` resource to `RoomRecordings` to avoid class name conflict (backwards incompatible). [2017-05-19] Version 5.9.0 -------------------------- - Add support for video.twilio.com. [2017-04-27] Version 5.8.0 -------------------------- - Add support for Twilio Chat v2 - Add `recordingChannels`, `recordingStatusCallback`, `recordingStatusCallbackMethod`, `sipAuthUsername`, `sipAuthPassword`, `region`, `conferenceRecordingStatusCallback`, `conferenceRecordingStatusCallbackMethod` optional parameters to conference participant resource. - Add support for setting `DEBUG_HTTP_TRAFFIC=true` environment varibale to dump request and response information. Thanks @kevinburke, PR #394. - Add deprecation warning to `ConversationsGrant`, it is being replaced by `VideoGrant`. [2017-04-12] Version 5.7.3 -------------------------- - Add TaskRouterGrant. - Update VideoGrant. - Add `room` as preferred grant granularity. - Deprecate setting `configurationProfileSid` on grant. [2017-04-04] Version 5.7.2 -------------------------- - Add `validityPeriod` parameter to Message creation [2017-03-22] Version 5.7.1 -------------------------- - Add Answering Machine Detection to Call creation - Add `WRAPPING` entry to Status for Task - **Twilio Chat** - Add `limits` map to Service - Add `limitsChannelMembers` and `limitsUserChannels` field to ServiceUpdater [2017-03-13] Version 5.7.0 -------------------------- Breaking Changes, refer to [Upgrade Guide][upgrade] - Restore ability to transfer IncomingPhoneNumbers between accounts. [2017-03-03] Version 5.6.0 ------------------------- Breaking Changes, refer to [Upgrade Guide][upgrade] - Remove end of life Sandbox resource (backwards incompatible). - Support new `accounts.twilio.com` subdomain and products. - `client->accounts` now references `accounts.twilio.com` instead of Accounts resource (backwards incompatible). - Fix resources throwing error on instantiation when response is missing a field. - Chat: - Add `order` as filter when listing Messages. - Messages `.read()`, `.stream()`, `.page()` now accept options array as first parameter (backwards incompatible). [2017-02-01] Version 5.5.0 ------------------------- Breaking Changes, refer to [Upgrade Guide][upgrade] - Fix broken default page size for all reads, thanks @rtek! Issue [#388] (https://github.com/twilio/twilio-php/issues/388) - Credential List Mappings, IP ACL Mappings, SIP Domains. - Fix incorrect types documentation of `links`/`subresourceUri` fields on various resources. Was incorrectly documented as string, actual type was an array. - Fix some properties incorrectly documented as `string` when actually were `array` types. - Fix boolean parameters did not accept boolean values, now accept both boolean and strings for backwards compatibility. - Add `emergencyEnabled` field to Addresses. - Add `price` and `callSid` fields to Recordings. - Allow filtering recordings list by call sid. - Add `trunkSid`, `emergencyStatus`, and `emergencyAddressSid` fields to IncomingPhoneNumbers. - Add `messagingServiceSid` field to Messages. - Add `url` and/or `links` fields to various resources which were missing them. - Lookups PhoneNumber, Monitor Events. - Add `subresourceUri` fields to resources where missing. - Accept DateTime inputs for date parameters for various resources, previously expected strings. - Remove `uri` field from Pricing Phone Number Countries resource (backwards incompatible). - Properly deserialize date times for various resources (backwards incompatible). - Remove library support for date inquality for resources that don't support them (backwards incompatible). - Message `body` parameter now required on update (backwards incompatible). - Require `friendlyName` on Queue creation (backwards incompatible). - Taskrouter - Add `url` and/or `links` fields to resources where missing. - Activities, Reservations, TaskQueue Statistics, WorkerStatistics, WorkersStatistics, Worker, Workflow, WorkflowStatistics, WorkspaceStatistics, Tasks, TaskQueues, Workspaces. - Add `addons`, `taskQueueFriendlyName`, `workflowFriendlyName` fields to Tasks. - Add `taskOrder` field to TaskQueues, allow updating `taskOrder`. - Add `prioritizeQueueOrder` field to Workspace. - Allow filtering Tasks list by `evaluateTaskAttributes`, `ordering`, `hasAddons`. - Disallow filtering Tasks list by `taskChannel`, was never supported. - Allow filtering TaskQueues list by `workerSid` and `taskOrder`. - Allow updating `prioritizeQueueOrder` on Workspaces. - Demote `friendlyName` to optional parameter when updating Activities (backwards incompatible). - Demote `available` to optional parameter when creating Activities (backwards incompatible). - Demote `workflowSid` and `attributes` to optional parameters when creating a Task (backwards incompatible). - Remove `friendlyName` as optional parameter when fetching Task Queue Statistics (backwards incompatible). - WorkspaceStatistics now take `DateTime` objects when filtering by `startDate` and `endDate` (backwards incompatible). - Chat - Add `Secret` field to Chat credentials and allow setting on create and update. - Add Channel Invite resource. - Add `lastConsumedMessageIndex` and `lastConsumptionTimestamp` fields to Channel Members. - `Body` parameter no longer required for updating a message. - Add `attributes` and `index` fields to Messages. - Add `membersCount` and `messagesCount` to Channels. - Add UserChannel resource. - Add `attributes`, `friendlyName`, `isOnline`, `isNotifiable`, `links` to Users. - Add `reachabilityEnabled`, `preWebhookUrl`, `postWebhookUrl`, `webhookMethod`, `webhookFilters`, `notifications` to Services. - Fix webhooks, notifications updating on Service by separating into individual parameters. - Remove ability to update `type` on Channels, was never supported by api (backwards incompatible). - Demote update Message `body` to optional parameter (backwards incompatible). - Conferences - Add `status` field to Participants. - Add ability to add/remove Participants via the API. - Add ability to end Conferences via the API. - Add `region` and `subresourceUri` fields to Conference. - Marketplace - Add resources for Recording AddOns. - AddOnResults. - AddOnResultPayloads. - Add `getAddOnResults` helper to Recordings. [2016-10-12] Version 5.4.2 -------------------------- - Add `InstanceResource::toArray()` Thanks to @johnpaulmedina for this suggestion. [2016-09-19] Version 5.4.1 -------------------------- - Add Video Grant [2016-09-15] Version 5.4.0 -------------------------- **Breaking Changes, refer to [Upgrade Guide][upgrade]** - Remove required parameter `friendlyName` on IP Messaging/Chat Role update. - Alphabetize domain mounts - Better exceptions when an error is encountered loading a page of records, the exception class has been corrected from `DeserializeException` to `RestException`. [2016-08-30] Version 5.3.0 -------------------------- **Breaking Changes, refer to [Upgrade Guide][upgrade]** - Demote `password` to optional and remove unsupported `username` on SIP Credential Update - Demote `RoleSid` to optional and add optional `attributes`, `friendlyName` parameters on IP Messaging/Chat User creation - Add optional `attributes` parameter on IP Messaging/Chat message creation [2016-08-29] Version 5.2.0 -------------------------- **Breaking Changes, refer to [Upgrade Guide][upgrade]** - New options for Conference Participant management. - Adds support for `hold`, `holdUrl`, `holdMethod` - Mount `ip-messaging` under the new `chat` domain - Demote `assignmentCallbackUrl` from a required argument to optional for Taskrouter Workflows to better support client managed reservations. [2016-08-29] Version 5.1.1 -------------------------- Changes the way that `uri`s are constructed to make sure that they are always `rawurlencode()`d by the `twilio-php` library Updates the output of the unit tests on failure introducing a new method, `assertRequest()`, that will output a friendlier error message when a request is missing in the `Holodeck` network mock. [2016-08-19] Version 5.1.0 -------------------------- Optional arguments are handled in the `twilio-php` by accepting an associative array of optional keys and values to pass to the API. This makes it easy to support all the optional parameters, but lessens developer ergonomics, since it doesn't provide any inline documentation or autocomplete for optional arguments. This change introduces new Options builders that support 2 new ways for specifying optional arguments that provide better usability. ```php <?php use Twilio\Values; use Twilio\Rest\Client; use Twilio\Rest\Api\V2010\Account\CallOptions; $client = new Client(); // Original Way (5.0.x) $client->calls->create( '+14155551234', '+14155557890', array( 'applicationSid' => 'AP123', 'method' => 'POST', ) ); // Options Factory $client->calls->create( '+14155551234', '+14155557890', CallOptions::create( Values::NONE, 'AP123', 'POST' ) ); // Options Builder $client->calls->create( '+14155551234', '+14155557890', CallOptions::create()->setApplicationSid('AP123') ->setMethod('POST') ); ``` The `Options Factory` provides fully documented optional arguments for every optional argument supported by the Resource's Action. This is a fast way to handle endpoints that have a few optional arguments. The `Options Builder` provides fully documented setters for every optional arguments, this is great for actions that support a large number of optional arguments, so that you don't need to provided tons of default values. Both of these options work well with autocompleting IDEs. [2016-08-18] Version 5.0.3 -------------------------- - Adds the ability to pass options into `Twilio\Http\CurlClient`. This feature brings `CurlClient` closer to parity with `Services_Twilio_TinyHttp`. [2016-08-16] Version 5.0.2 -------------------------- - Fixes a bug where reading lists with a `$limit` and no `$pageSize` would cause a divide by zero error. - Sanity check in the `Twiml` generator - Better tests for `Twiml` and `Version` [2016-08-15] Version 5.0.1 -------------------------- Add the VERSIONS.md to explain the versioning strategy, first alpha release. [2016-08-15] Version 5.0.0 -------------------------- **New Major Version** The newest version of the `twilio-php` helper library, supporting PHP 5.3+ This version brings a host of changes to update and modernize the `twilio-php` helper library. It is auto-generated to produce a more consistent and correct product. - [Migration Guide](https://www.twilio.com/docs/libraries/php/migration-guide) - [Full API Documentation](https://twilio.github.io/twilio-php/) - [General Documentation](https://www.twilio.com/docs/libraries/php) Version 4.11.0 -------------- Released August 9, 2016 - Add `synchronize` method to InstanceResoure Version 4.10.0 ------------- Released January 28, 2016 - Add support for filter_friendly_name in WorkflowConfig - Load reservations by default in TaskRouter Version 4.9.2 ------------- Released January 22, 2016 - Fix Address instance reference Version 4.9.1 ------------- Released January 19, 2016 - Add missing create/delete methods on Address Version 4.9.0 ------------- Released December 18, 2015 - Add IP Messaging capability Version 4.8.1 ------------- Released December 8, 2015 - Fix issue with empty grant encoding Version 4.8.0 ------------- Released December 8, 2015 - Update access tokens to support optional NBF Version 4.7.0 ------------- Released December 3, 2015 - Add access tokens Version 4.6.1 ------------- Released November 9, 2015 - Secured Signature header validation from timing attack Version 4.6.0 ------------- Released October 30, 2015 - Add support for Keys Version 4.4.0 ------------- Released September 21, 2015 - Add support for messaging in Twilio Pricing API - Add support for Elastic SIP Trunking API Version 4.3.0 ------------- Released August 11, 2015 - Add support for new Taskrouter JWT Functionality, JWTs now grant access to - Workspace - Worker - TaskQueue Version 4.2.1 ------------- Released June 9, 2015 - Update install documentation Version 4.2.0 ------------- Released May 19, 2015 - Add support for the beta field in IncomingPhoneNumbers and AvailablePhoneNumbers Version 4.1.0 ------------- Released May 7, 2015 - Add support for Twilio Monitor Events and Alerts Version 4.0.4 ------------- Released May 6, 2015 - Add support for the new Pricing API. Version 4.0.3 ------------- Released on April 29, 2015 - Fix to add rawurlencoding to phone number lookups to support spaces Version 4.0.2 ------------- Released on April 27, 2015 - Fix the autoloading so that Lookups_Services_Twilio and TaskRouter_Services_Twilio are available independently of Services_Twilio Version 4.0.1 ------------- Released on April 22, 2015 - Make Lookups_Services_Twilio and TaskRouter_Services_Twilio available through Composer. Version 4.0.0 ------------- Released on April 16, 2015 - Removes counts from ListResource - Change Services_Twilio::getRequestUri() from a static method to an instance method. Version 3.13.1 -------------- Released on March 31, 2015 - Add new Lookups API client Version 3.13.0 -------------- Released on February 18, 2015 - Add new TaskRouter API client - Miscellaneous doc fixes Version 3.12.8 -------------- Released on December 4, 2014 - Add support for the new Addresses endpoints. Version 3.12.7 -------------- Released on November 21, 2014 - Add support for the new Tokens endpoint Version 3.12.6 -------------- Released on November 13, 2014 - Add support for redacting Messages and deleting Messages or Calls - Remove pinned SSL certificates Version 3.12.5 -------------- Released on July 15, 2014 - Changed the naming of the SIP class to comply with PSR-0 Version 3.12.4 -------------- Released on January 30, 2014 - Fix incorrect use of static:: which broke compatibility with PHP 5.2. Version 3.12.3 -------------- Released on January 28, 2014 - Add link from recordings to associated transcriptions. - Document how to debug requests, improve TwiML generation docs. Version 3.12.2 -------------- Released on January 5, 2014 - Fixes string representation of resources - Support PHP 5.5 Version 3.12.1 -------------- Released on October 21, 2013 - Add support for filtering by type for IncomingPhoneNumbers. - Add support for searching for mobile numbers for both IncomingPhoneNumbers and AvailablePhoneNumbers. Version 3.12.0 -------------- Released on September 18, 2013 - Support MMS - Support SIP In - $params arrays will now turn lists into multiple HTTP keys with the same name, array("Twilio" => array('foo', 'bar')) will turn into Twilio=foo&Twilio=bar when sent to the API. - Update the documentation to use php-autodoc and Sphinx. Version 3.11.0 -------------- Released on June 13 - Support Streams when curl is not available for PHP installations Version 3.10.0 -------------- Released on February 2, 2013 - Uses the [HTTP status code for error reporting][http], instead of the `status` attribute of the JSON response. (Reporter: [Ruud Kamphuis](/ruudk)) [http]: https://github.com/twilio/twilio-php/pull/116 Version 3.9.1 ------------- Released on December 30, 2012 - Adds a `$last_response` parameter to the `$client` object that can be used to [retrieve the raw API response][last-response]. (Reporter: [David Jones](/dxjones)) [last-response]: https://github.com/twilio/twilio-php/pull/112/files Version 3.9.0 ------------- Released on December 20, 2012 - [Fixes TwiML generation to handle non-ASCII characters properly][utf-8]. Note that as of version 3.9.0, **the library requires PHP version 5.2.3, at least for TwiML generation**. (Reporter: [Walker Hamilton](/walker)) [utf-8]: https://github.com/twilio/twilio-php/pull/111 Version 3.8.3 ------------- Released on December 15, 2012 - [Fixes the ShortCode resource][shortcode] so it is queryable via the PHP library. [shortcode]: https://github.com/twilio/twilio-php/pull/108 Version 3.8.2 ------------- Released on November 26, 2012 - Fixes an issue where you [could not iterate over the members in a queue][queue-members]. (Reporter: [Alex Chan](/alexcchan)) [queue-members]: https://github.com/twilio/twilio-php/pull/107 Version 3.8.1 ------------- Released on November 23, 2012 - [Implements the Countable interface on the ListResource][countable], so you can call count() on any resource. - [Adds a convenience method for retrieving a phone number object][get-number], so you can retrieve all of a number's properties by its E.164 representation. Internally: - Adds [unit tests for url encoding of Unicode characters][unicode-tests]. - Updates [Travis CI configuration to use Composer][travis-composer], shortening build time from 83 seconds to 21 seconds. [countable]: https://twilio-php.readthedocs.org/en/latest/usage/rest.html#retrieving-the-total-number-of-resources [get-number]: https://twilio-php.readthedocs.org/en/latest/usage/rest/phonenumbers.html#retrieving-all-of-a-number-s-properties [unicode-tests]: https://github.com/twilio/twilio-php/commit/6f8aa57885796691858e460c8cea748e241c47e3 [travis-composer]: https://github.com/twilio/twilio-php/commit/a732358e90e1ae9a5a3348ad77dda8cc8b5ec6bc Version 3.8.0 ------------- Released on October 17, 2012 - Support the new Usage API, with Usage Records and Usage Triggers. Read the PHP documentation for [usage records][records] or [usage triggers][triggers] [records]: https://twilio-php.readthedocs.org/en/latest/usage/rest/usage-records.html [triggers]: https://twilio-php.readthedocs.org/en/latest/usage/rest/usage-triggers.html Version 3.7.2 ------------- - The library will now [use a standard CA cert whitelist][whitelist] for SSL validation, replacing a file that contained only Twilio's SSL certificate. (Reporter: [Andrew Benton](/andrewmbenton)) [whitelist]: https://github.com/twilio/twilio-php/issues/88 Version 3.7.1 ------------- Released on August 16, 2012 - Fix a bug in the 3.5.0 release where [updating an instance resource would cause subsequent updates to request an incorrect URI](/twilio/twilio-php/pull/82). (Reporter: [Dan Bowen](/crucialwebstudio)) Version 3.7.0 ------------- Released on August 6, 2012 - Add retry support for idempotent HTTP requests that result in a 500 server error (default is 1 attempt, however this can be configured). - Throw a Services_Twilio_RestException instead of a DomainException if the response content cannot be parsed as JSON (usually indicates a 500 error) Version 3.6.0 ------------- Released on August 5, 2012 - Add support for Queues and Members. Includes tests and documentation for the new functionality. Version 3.5.2 ------------- Released on July 23, 2012 - Fix an issue introduced in the 3.5.0 release where updating or muting a participant would [throw an exception instead of muting the participant][mute-request]. (Reporter: [Alex Chan](/alexcchan)) - Fix an issue introduced in the 3.5.0 release where [filtering an iterator with parameters would not work properly][paging-request] on subsequent HTTP requests. (Reporters: [Alex Chan](/alexcchan), Ivor O'Connor) [mute-request]: /twilio/twilio-php/pull/74 [paging-request]: /twilio/twilio-php/pull/75 Version 3.5.1 ------------- Released on July 2, 2012 - Fix an issue introduced in the 3.5.0 release that would cause a second HTTP request for an instance resource [to request an incorrect URI][issue-71]. [issue-71]: https://github.com/twilio/twilio-php/pull/71 Version 3.5.0 ------------- Released on June 30, 2012 - Support paging through resources using the `next_page_uri` parameter instead of manually constructing parameters using the `Page` and `PageSize` parameters. Specifically, this allows the library to use the `AfterSid` parameter, which leads to improved performance when paging deep into your resource list. This involved a major refactor of the library. The documented interface to twilio-php will not change. However, some undocumented public methods are no longer supported. Specifically, the following classes are no longer available: - `Services/Twilio/ArrayDataProxy.php` - `Services/Twilio/CachingDataProxy.php` - `Services/Twilio/DataProxy.php` In addition, the following public methods have been removed: - `setProxy`, in `Services/Twilio/InstanceResource.php` - `getSchema`, in `Services/Twilio/ListResource.php`, `Services/Twilio/Rest/AvailablePhoneNumbers.php`, `Services/Twilio/Rest/SMSMessages.php` - `retrieveData`, in `Services/Twilio/Resource.php` - `deleteData`, in `Services/Twilio/Resource.php` - `addSubresource`, in `Services/Twilio/Resource.php` Please check your own code for compatibility before upgrading. Version 3.3.2 ------------- Released on May 3, 2012 - If you pass booleans in as TwiML (ex transcribe="true"), convert them to the strings "true" and "false" instead of outputting the incorrect values 1 and "". Version 3.3.1 ------------- Released on May 1, 2012 - Use the 'Accept-Charset' header to specify we want to receive UTF-8 encoded data from the Twilio API. Remove unused XML parsing logic, as the library never requests XML data. Version 3.2.4 ------------- Released on March 14, 2012 - If no version is passed to the Services_Twilio constructor, the library will default to the most recent API version. [upgrade]: https://github.com/twilio/twilio-php/blob/master/UPGRADE.md sdk/LICENSE.md 0000604 00000002077 15174325134 0006740 0 ustar 00 MIT License Copyright (C) 2018, Twilio, Inc. <help@twilio.com> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. sdk/Services/Twilio.php 0000604 00000004142 15174325134 0011072 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/Services/Tests/TwilioTest.php 0000604 00000000657 15174325134 0013043 0 ustar 00 <?php require 'Services/Twilio.php'; class TwilioTest extends PHPUnit_Framework_TestCase { public function testClient() { $this->setExpectedException('PHPUnit_Framework_Error_Warning'); new Services_Twilio('AC123', 'DEF'); } public function testTrunkingClient() { $this->setExpectedException('PHPUnit_Framework_Error_Warning'); new Trunking_Services_Twilio('AC123', 'DEF'); } } sdk/.gitignore 0000604 00000000561 15174325134 0007320 0 ustar 00 vendor/* composer.phar composer.lock coverage package.xml *.tgz # Both the RTD docs and the API autogenerated docs docs/read_the_docs/_build/ docs/api # You should be keeping these in a global gitignore, see for example # https://help.github.com/articles/ignoring-files#global-gitignore .DS_Store .idea nbproject # This is used by the documentation generator venv sdk/.travis.yml 0000604 00000000414 15174325134 0007436 0 ustar 00 language: php dist: trusty sudo: false php: - '5.5' - '5.6' - '7.0' - '7.1' - hhvm # on Trusty only - nightly script: "make test" before_install: "composer install --dev" matrix: fast_finish: true allow_failures: - php: nightly sdk/UPGRADE.md 0000604 00000043036 15174325134 0006745 0 ustar 00 # Upgrade Guide _After `5.1.1` all `MINOR` and `MAJOR` version bumps will have upgrade notes posted here._ [2017-09-28] 5.1x.x to 5.15.x --------------------------- ### CHANGED - `Body` parameter on Chat `Message` creation is no longer required. #### Rationale This was changed to add support for sending media in Chat messages, users can now either provide a `body` or a `media_sid`. #### 5.1x.x ```php <?php use Twilio\Rest\Client; $client = new Client(); $client->chat->v2->service('IS123')->channel('CH123')->message->create("this is the body"); ``` #### 5.15.x ```php <?php use Twilio\Rest\Client; $client = new Client(); $client->chat->v2->service('IS123')->channel('CH123')->message->create(array("body"=>"this is the body")); ``` [2017-05-22] 5.9.x to 5.10.x --------------------------- ### CHANGED - Rename room `Recordings` resource to `RoomRecordings` to avoid class name conflict (backwards incompatible). [2017-03-03] 5.5.x to 5.6.x --------------------------- ### CHANGED - Removed end of life Sandbox Resource #### 5.5.x ```php <?php use Twilio\Rest\Client; $client = new Client(); $client->api->v2010->sandbox->read(); ``` #### 5.6.x Not Supported. #### Rationale The Sandbox resource has been removed from the API and is no longer supported. ### CHANGED - Accounts property on Client now references Accounts subdomain #### 5.5.x ```php <?php use Twilio\Rest\Client; $client = new Client(); // Access api.twilio.com/2010-04-01/Accounts $client->accounts->read(); ``` #### 5.6.x ```php <?php use Twilio\Rest\Client; $client = new Client(); // Access accounts.twilio.com/v1 $client->accounts; // Access new PublicKeys resource $client->accounts->credentials->publicKey->read(); // Access api.twilio.com/2010-04-01/Accounts $client->api->v2010->accounts->read(); ``` #### Rationale `accounts.twilio.com` is now publicly available, following our convention of accessing subdomains of twilio via `client->{subdomain}` we replaced the shortcut to 2010 Accounts with a reference to the new Accounts subdomain. 2010 Accounts are still accessible the long way `client->api->v2010->accounts` or `client->api->accounts`. ### CHANGED - Chat Messages listing methods now take options array as first parameter #### 5.5.x ```php <?php use Twilio\Rest\Client; $client = new Client(); $client->chat->messages->read(10); // limit to 10 messages ``` #### 5.6.x ```php <?php use Twilio\Rest\Client; $client = new Client(); $client->chat->messages->read(array(), 10); // limit to 10 messages $client->chat->messages->read(array( "order" => "asc" ), 10); // limit to 10 messages and filter by order ``` #### Rationale Options arrays are placed at the beginning of the function signature if the resource accepts optional params and is ommited if the resource does not accept any. Chat messages previously did not accept any optional params and now do. [2017-02-01] 5.4.x to 5.5.x --------------------------- ### CHANGED - Removed uri field from Pricing Phone Number Countries resource - the `uri` property on this object has been removed and is no longer returned by the api. - the `url` property is still present and unchanged and should be used instead of the `uri` property. #### Rationale This corrects a oversight in our code generation, new style resources such as this use `url` and `links` properties while legacy resources use `uri` and `subresource_uris`. Previously we were incorrectly returning both `uri` and `url`. ### CHANGED - Use DateTime objects for dates and remove unsupported date query param filters - Listing some resources and filtering by `StartDate<`, `StartDate>`, `EndDate<`, and `EndDate>` will no longer work. - Filtering by `StartDate` and `EndDate` will continue to work, these dates are inclusive. - `StartDate` and `EndDate` params are now `DateTime` objects rather than `strings`. They will automcatically be converted to UTC timezone, the original DateTime object will not be modified. #### Affected Resources - All Account Usage Record Resources (Last Month, This Month, Yesterday, All Time, Monthly, Yearly, Today, Daily). - Monitor Alerts, Events. - Taskrouter All Statistics endpoints (Workspace, TaskQueues, Workers...), Workspace Events. - Call Feedback Summaries. #### 5.4.x ```php <?php use Twilio\Rest\Client; $client = new Client(); $client->usage->records->read(array( "StartDate" => "1999-09-07", "EndDate<" => "2000-01-01" // Allowed but would have had no effect. )); ``` #### 5.5.x ```php <?php use Twilio\Rest\Client; $startDate = new DateTime("now", new DateTimeZone("America/Los_Angeles")); $endDate = clone $startDate; $endDate->add(new DateInterval("P2D")); // Add 2 days $client = new Client(); $client->usage->records->read(array( "StartDate" => $startDate, "EndDate" => $endDate )); // Passing strings will still work $client->usage->records->read(array( "StartDate" => "1999-09-07" // OK )); ``` #### Rationale Not serializing API Dates into DateTimes was an oversight initially, removing library support for date inequality filters (ie `StartDate>` etc) brings the library into alignment with the API behavior. Only select resources on our 2010 API support date inequalities, date inequalities were included on unsupported resources mistakenly and that functionality would never have worked anyways. ### CHANGED - Chat Members and Channels List Takes Optional Parameters - Reading members of channel and listing channels now takes an array of options as is its first argument. - Affects the `read`, `stream`, and `page` methods of MemberList. #### 5.4.x ```php <?php use Twilio\Rest\Client; $client = new Client(); $client->chat->v1->services('IS123')->channels('CH123')->members->read(10); $client->chat->v1->services('IS123')->channels->read(10); ``` #### 5.5.x ```php <?php use Twilio\Rest\Client; $client = new Client(); $client->chat->v1->services('IS123')->channels('CH123')->members->read(array(), 10); $client->chat->v1->services('IS123')->channels->read(array(), 10); $client->chat->v1->services('IS123')->channels('CH123')->members->read(array('type' => 'public'), 10); ``` ### CHANGED - Remove ability to update type on Twilio Chat Channels #### 5.5.x ```php <?php use Twilio\Rest\Client; $client = new Client(); $client->chat->v1->services('IS123')->channels('CH123')->update(array('type'=>'public')); ``` #### 5.5.x Not Supported #### Rationale Make library consistent with public API, changing channel type was never supported and wouldnt have worked in previous versions anyways. ### CHANGED - Chat Message Body parameter is no longer required on updates - Updating a message body no longer requires passing the body directly and is not required. #### 5.4.x ```php <?php use Twilio\Rest\Client; $client = new Client(); $client->chat->v1->services('IS123')->channels('CH123')->messages('IM123')->update('new body', array()); ``` #### 5.5.x ```php <?php use Twilio\Rest\Client; $client = new Client(); $client->chat->v1->services('IS123')->channels('CH123')->messages('IM123')->update(array('body' => 'new body')); ``` #### Rationale This is a correction for what the API actually expects. ### CHANGED - Taskrouter Activity demote some parameters to be optional - Updating a taskrouter activity now optionally takes a `friendlyName` parameter (was previously required). - Creating a taskrouter activity now optionally takes a `available` parameter (was previously required). - Creating a taskrouter task now optional takes `workflowSid` and `attributes` (were both previously required). #### 5.4.x ```php <?php use Twilio\Rest\Client; $client = new Client(); $client->taskrouter->v1->workspaces('WS123')->activities('WA123')->update('new friendly name'); $client->taskrouter->v1->workspaces('WS123')->activities->create('new friendly name', true); $client->taskrouter->v1->workspaces('WS123')->tasks->create('attributes', 'WW123', array('timeout' => 10)); ``` #### 5.5.x ```php <?php use Twilio\Rest\Client; $client = new Client(); $client->taskrouter->v1->workspaces('WS123')->activities('WA123')->update(array('friendlyName' => 'new friendly name')); $client->taskrouter->v1->workspaces('WS123')->activities->create('new friendly name', array('available' => true)); $client->taskrouter->v1->workspaces('WS123')->tasks->create(array( 'attributes' => 'attributes', 'workflowSid' => 'WW123', 'timeout' => 10 )); ``` #### Rationale This is a correction for what the API actually expects. ### CHANGED - Taskrouter Task list no longer filterable by TaskChannel - Previous version incorrectly allowed setting a `taskChannel` on a `TaskReadOptions` object, this is no longer supported. #### Rationale This is a correction for what the API actually allows. Previous versions allowed this to be set but it would not have had any effect. ### CHANGED - Rename getStatistics to getTaskQueueStatistics method on Taskrouter TaskQueues #### 5.4.x ```php <?php use Twilio\Rest\Client; $client = new Client(); // Get statistics for a single task queue $taskQueue = $client->taskrouter->v1->workspaces('WS123')->taskQueues('WQ123')->fetch(); $taskQueueStatistics = $taskQueue->getStatistics(); // Get statistics for all task queues $client->taskrouter->v1->workspaces('WS123')->taskQueues->getStatistics(); ``` #### 5.5.x ```php <?php use Twilio\Rest\Client; $client = new Client(); // Get statistics for a single task queue $taskQueue = $client->taskrouter->v1->workspaces('WS123')->taskQueues('WQ123')->fetch(); $taskQueueStatistics = $taskQueue->getTaskQueueStatistics(); // Get statistics for all task queues $client->taskrouter->v1->workspaces('WS123')->taskQueues->getTaskQueuesStatistics(); ``` #### Rationale There was a naming conflict between TaskQueueStatistics and TaskQueuesStatistics. Both were trying to generate methods named `getStatistics`. ### CHANGED - MMS Message Body parameter is now required on updates - Updating a message body now requires passing the body directly and is required. #### 5.4.x ```php <?php use Twilio\Rest\Client; $client = new Client(); $client->api->v2010->accounts('AC123')->messages('MM123')->update(array('body' => '')); ``` #### 5.5.x ```php <?php use Twilio\Rest\Client; $client = new Client(); $client->api->v2010->accounts('AC123')->messages('MM123')->update(''); ``` #### Rationale This is used to redact a message body and the api expects the body parameter to be present, allowing this to be an optional parameter was an oversight. ### CHANGED - Queues now require friendlyName parameter on creation - Updating a message body now requires passing the body directly and is required. #### 5.4.x ```php <?php use Twilio\Rest\Client; $client = new Client(); $client->api->v2010->accounts('AC123')->queues('QU123')->create(array('friendlyName' => 'Test')); ``` #### 5.5.x ```php <?php use Twilio\Rest\Client; $client = new Client(); $client->api->v2010->accounts('AC123')->queues('QU123')->create('Test', array()); ``` #### Rationale This was made to enforce consistency with the API, the API will return a 400 if a friendlyName is not provided. [2016-09-15] 5.3.x to 5.4.x --------------------------- ### CHANGED - IP Messaging / Chat Roles Update - `RoleInstance::update(string $friendlyName, string[] $permission)` to `RoleInstance::update(string[] $permission)` - `RoleContext::update(string $friendlyName, string[] $permission)` to `RoleContext::update(string[] $permission)` #### 5.3.x ```php <?php use Twilio\Rest\Client; $client = new Client(); $client->chat->services('IS123')->roles('RL123')->update('Example Role', array('permission')); ``` #### 5.4.x ```php <?php use Twilio\Rest\Client; $client = new Client(); $client->chat->services('IS123')->roles('RL123')->update(array('permission')); ``` #### Rationale Role Updates do not support updating the friendlyName. ### CHANGED - Page Load Exception - `Page::processResponse(Response $response) throws DeserializeException` to `Page::processResponse(Response $response) throws RestException` #### 5.3.x ```php <?php use Twilio\Rest\Client; use Twilio\Exceptions\DeserializeException; $client = new Client(); try { $calls = $client->calls->read(); } catch (DeserializeException $e) { echo("Error reading: {$e->getMessage()}"); } ``` #### 5.4.x ```php <?php use Twilio\Rest\Client; use Twilio\Exceptions\RestException; $client = new Client(); try { $calls = $client->calls->read(); } catch (RestException $e) { echo("Error reading: {$e->getMessage()}"); } ``` Alternatively ```php <?php use Twilio\Rest\Client; use Twilio\Exceptions\TwilioException; $client = new Client(); try { $calls = $client->calls->read(); } catch (TwilioException $e) { echo("Error reading: {$e->getMessage()}"); } ``` #### Rationale Exceptions were improved to include more information about what went wrong. The `Page` class that is used by `read` and `stream` was missed, this bring `Page` up to parity with other exceptions. The Exception class was changed to reflect that the failure is not in processing the response (Deserialization) but that the response is invalid (Rest). [2015-08-30] 5.2.x to 5.3.x --------------------------- ### CHANGED - SIP Credential Update - `CredentialInstance::update(string $username, string $password)` to `CredentialInstance::update(array|CredentialOptions $options)` - `CredentialContext::update(string $username, string $password)` to `CredentialContext::update(array|CredentialOptions $options)` #### 5.2.x ```php <?php use Twilio\Rest\Client; $client = new Client(); $client->sip->credentialLists('CL123')->credentials('CA123')->update('username', 'password'); ``` #### 5.3.x ```php <?php use Twilio\Rest\Client; $client = new Client(); $client->sip->credentialLists('CL123')->credentials('CA123')->update(array( 'password' => 'password' )); ``` #### Rationale Credential Updates only supported Updating the password and it is an optional parameter. ### CHANGED - Chat/IP Messaging Role Creation #### 5.2.x ```php <?php use Twilio\Rest\Client; $client = new Client(); $client->chat->v1->services('IS123')->users->create('identity', 'RL123'); ``` #### 5.3.x ```php <?php use Twilio\Rest\Client; $client = new Client(); $client->chat->v1->services('IS123')->users->create('identity', array( 'roleSid' => 'RL123' )); ``` #### Rationale As the Chat product has evolved, we have added a default Role sid to User creation making the parameter optional. [2016-08-29] 5.1.x to 5.2.x --------------------------- ### CHANGED - Conference Participant Update - `ParticipantInstance::update(boolean $muted)` to `ParticipantInstance::update(array|ParticipantOptions $options)` - `ParticipantContext::update(boolean $muted)` to `ParticipantContext::update(array|ParticipantOptions $options)` #### 5.1.x ```php <?php use Twilio\Rest\Client; $client = new Client(); $client->conferences('CF123')->participants('CA123')->update(true); ``` #### 5.2.x ```php <?php use Twilio\Rest\Client; $client = new Client(); $client->conferences('CF123')->participants('CA123')->update(array( 'muted' => true, )); ``` #### Rationale Conference Participants actually support a wider range of mutations than the `5.1.x` library supported. Mute was incorrectly marked as a `required` property when it is actually `optional`. This change allows the library to provide support for the full range of mutation options. | Option | Definition | |:-----------|:---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | hold | Specifying true will hold the participant, while false will un-hold. | | holdUrl | The 'HoldUrl' attribute lets you specify a URL for music that plays when a participant is held. The URL may be an MP3, a WAV or a TwiML document that uses <Play> <Say> or <Redirect>. | | holdMethod | Specify GET or POST, defaults to POST | | muted | Specifying true will mute the participant, while false will un-mute. Anything other than true or false is interpreted as false. | [Full documentation](https://www.twilio.com/docs/api/rest/participant#instance-post) ### CHANGED - Taskrouter Workflow Create - `WorkflowList::create(string $friendlyName, string $configuration, string $assignmentCallbackUrl, array|WorkflowOptions $options)` to `WorkflowList::create(string $friendlyName, string $configuration, array|WorkflowOptions $options)` #### 5.1.x ```php <?php use Twilio\Rest\Client; $client = new Client(); $client->taskrouter->workspaces('WS123')->workflows->create( 'My New Workflow', '{...}', 'http://assignment-callback-url.com' ); ``` #### 5.2.x ```php <?php use Twilio\Rest\Client; $client = new Client(); $client->taskrouter->workspaces('WS123')->workflows->create( 'My New Workflow', '{...}', array( 'assignmentCallbackUrl' => 'http://assignment-callback-url.com', ) ); ``` #### Rationale When Taskrouter was first released all workflows had to communicate reservations back to a server for handling. As the product has matured a capable JavaScript SDK has been released that can handle reservations. This change allows one to use Taskrouter without an `assignmentCallbackUrl` instead using the client events to handle reservations. [Full documentation](https://www.twilio.com/docs/api/taskrouter/worker-js) sdk/docs-update.sh 0000604 00000000515 15174325134 0010073 0 ustar 00 export GIT_INDEX_FILE=$PWD/.git/index-deploy export GIT_WORK_TREE=$PWD/docs/api REF=refs/heads/gh-pages git read-tree "$REF" git add --all --intent-to-add git diff --quiet && exit git add --all TREE=$(git write-tree) COMMIT=$(git commit-tree "$TREE" -p "$REF" -m "snapshot $(date '+%y-%m-%d %H:%M')") git update-ref "$REF" "$COMMIT" sdk/docs/read_the_docs/Makefile 0000604 00000016706 15174325134 0012513 0 ustar 00 # Makefile for Sphinx documentation # # You can set these variables from the command line. SPHINXOPTS = SPHINXBUILD = sphinx-build PAPER = BUILDDIR = _build # Internal variables. PAPEROPT_a4 = -D latex_paper_size=a4 PAPEROPT_letter = -D latex_paper_size=letter ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . # the i18n builder cannot share the environment and doctrees with the others I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . .PHONY: help help: @echo "Please use \`make <target>' where <target> is one of" @echo " html to make standalone HTML files" @echo " dirhtml to make HTML files named index.html in directories" @echo " singlehtml to make a single large HTML file" @echo " pickle to make pickle files" @echo " json to make JSON files" @echo " htmlhelp to make HTML files and a HTML help project" @echo " qthelp to make HTML files and a qthelp project" @echo " applehelp to make an Apple Help Book" @echo " devhelp to make HTML files and a Devhelp project" @echo " epub to make an epub" @echo " epub3 to make an epub3" @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" @echo " latexpdf to make LaTeX files and run them through pdflatex" @echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx" @echo " text to make text files" @echo " man to make manual pages" @echo " texinfo to make Texinfo files" @echo " info to make Texinfo files and run them through makeinfo" @echo " gettext to make PO message catalogs" @echo " changes to make an overview of all changed/added/deprecated items" @echo " xml to make Docutils-native XML files" @echo " pseudoxml to make pseudoxml-XML files for display purposes" @echo " linkcheck to check all external links for integrity" @echo " doctest to run all doctests embedded in the documentation (if enabled)" @echo " coverage to run coverage check of the documentation (if enabled)" @echo " dummy to check syntax errors of document sources" .PHONY: clean clean: rm -rf $(BUILDDIR)/* .PHONY: html html: $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html @echo @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." .PHONY: dirhtml dirhtml: $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml @echo @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml." .PHONY: singlehtml singlehtml: $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml @echo @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml." .PHONY: pickle pickle: $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle @echo @echo "Build finished; now you can process the pickle files." .PHONY: json json: $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json @echo @echo "Build finished; now you can process the JSON files." .PHONY: htmlhelp htmlhelp: $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp @echo @echo "Build finished; now you can run HTML Help Workshop with the" \ ".hhp project file in $(BUILDDIR)/htmlhelp." .PHONY: qthelp qthelp: $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp @echo @echo "Build finished; now you can run "qcollectiongenerator" with the" \ ".qhcp project file in $(BUILDDIR)/qthelp, like this:" @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/twilio-php.qhcp" @echo "To view the help file:" @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/twilio-php.qhc" .PHONY: applehelp applehelp: $(SPHINXBUILD) -b applehelp $(ALLSPHINXOPTS) $(BUILDDIR)/applehelp @echo @echo "Build finished. The help book is in $(BUILDDIR)/applehelp." @echo "N.B. You won't be able to view it unless you put it in" \ "~/Library/Documentation/Help or install it in your application" \ "bundle." .PHONY: devhelp devhelp: $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp @echo @echo "Build finished." @echo "To view the help file:" @echo "# mkdir -p $$HOME/.local/share/devhelp/twilio-php" @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/twilio-php" @echo "# devhelp" .PHONY: epub epub: $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub @echo @echo "Build finished. The epub file is in $(BUILDDIR)/epub." .PHONY: epub3 epub3: $(SPHINXBUILD) -b epub3 $(ALLSPHINXOPTS) $(BUILDDIR)/epub3 @echo @echo "Build finished. The epub3 file is in $(BUILDDIR)/epub3." .PHONY: latex latex: $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex @echo @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." @echo "Run \`make' in that directory to run these through (pdf)latex" \ "(use \`make latexpdf' here to do that automatically)." .PHONY: latexpdf latexpdf: $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex @echo "Running LaTeX files through pdflatex..." $(MAKE) -C $(BUILDDIR)/latex all-pdf @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." .PHONY: latexpdfja latexpdfja: $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex @echo "Running LaTeX files through platex and dvipdfmx..." $(MAKE) -C $(BUILDDIR)/latex all-pdf-ja @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." .PHONY: text text: $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text @echo @echo "Build finished. The text files are in $(BUILDDIR)/text." .PHONY: man man: $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man @echo @echo "Build finished. The manual pages are in $(BUILDDIR)/man." .PHONY: texinfo texinfo: $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo @echo @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo." @echo "Run \`make' in that directory to run these through makeinfo" \ "(use \`make info' here to do that automatically)." .PHONY: info info: $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo @echo "Running Texinfo files through makeinfo..." make -C $(BUILDDIR)/texinfo info @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo." .PHONY: gettext gettext: $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale @echo @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale." .PHONY: changes changes: $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes @echo @echo "The overview file is in $(BUILDDIR)/changes." .PHONY: linkcheck linkcheck: $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck @echo @echo "Link check complete; look for any errors in the above output " \ "or in $(BUILDDIR)/linkcheck/output.txt." .PHONY: doctest doctest: $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest @echo "Testing of doctests in the sources finished, look at the " \ "results in $(BUILDDIR)/doctest/output.txt." .PHONY: coverage coverage: $(SPHINXBUILD) -b coverage $(ALLSPHINXOPTS) $(BUILDDIR)/coverage @echo "Testing of coverage in the sources finished, look at the " \ "results in $(BUILDDIR)/coverage/python.txt." .PHONY: xml xml: $(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml @echo @echo "Build finished. The XML files are in $(BUILDDIR)/xml." .PHONY: pseudoxml pseudoxml: $(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml @echo @echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml." .PHONY: dummy dummy: $(SPHINXBUILD) -b dummy $(ALLSPHINXOPTS) $(BUILDDIR)/dummy @echo @echo "Build finished. Dummy builder generates no files." sdk/docs/read_the_docs/index.rst 0000604 00000001262 15174325134 0012703 0 ustar 00 .. twilio-php documentation master file, created by sphinx-quickstart on Thu Aug 11 13:48:59 2016. You can adapt this file completely to your liking, but it should at least contain the root `toctree` directive. twilio-php ========== Hey there! You can find documentation for the latest versions of twilio-php here: - **Version 5.x API docs:** https://twilio.github.io/twilio-php/ - **Migration guide:** https://www.twilio.com/docs/libraries/php/migration-guide - **General documentation:** https://www.twilio.com/docs/libraries/php .. note:: Looking for API reference docs for twilio-php version 4.x? Check out http://twilio-php.readthedocs.io/en/4.11.0/ sdk/docs/read_the_docs/conf.py 0000604 00000023104 15174325134 0012340 0 ustar 00 # -*- coding: utf-8 -*- # # twilio-php documentation build configuration file, created by # sphinx-quickstart on Thu Aug 11 13:48:59 2016. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All configuration values have a default; values that are commented out # serve to show the default. # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. # # import os # import sys # sys.path.insert(0, os.path.abspath('.')) # -- General configuration ------------------------------------------------ # If your documentation needs a minimal Sphinx version, state it here. # # needs_sphinx = '1.0' # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. extensions = [] # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] # The suffix(es) of source filenames. # You can specify multiple suffix as a list of string: # # source_suffix = ['.rst', '.md'] source_suffix = '.rst' # The encoding of source files. # # source_encoding = 'utf-8-sig' # The master toctree document. master_doc = 'index' # General information about the project. project = u'twilio-php' copyright = u'2016, Neuman Vong' author = u'Neuman Vong' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the # built documents. # # The short X.Y version. version = u'5.x' # The full version, including alpha/beta/rc tags. release = u'5.x' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. # # This is also used if you do content translation via gettext catalogs. # Usually you set "language" from the command line for these cases. language = None # There are two options for replacing |today|: either, you set today to some # non-false value, then it is used: # # today = '' # # Else, today_fmt is used as the format for a strftime call. # # today_fmt = '%B %d, %Y' # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. # This patterns also effect to html_static_path and html_extra_path exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] # The reST default role (used for this markup: `text`) to use for all # documents. # # default_role = None # If true, '()' will be appended to :func: etc. cross-reference text. # # add_function_parentheses = True # If true, the current module name will be prepended to all description # unit titles (such as .. function::). # # add_module_names = True # If true, sectionauthor and moduleauthor directives will be shown in the # output. They are ignored by default. # # show_authors = False # The name of the Pygments (syntax highlighting) style to use. pygments_style = 'sphinx' # A list of ignored prefixes for module index sorting. # modindex_common_prefix = [] # If true, keep warnings as "system message" paragraphs in the built documents. # keep_warnings = False # If true, `todo` and `todoList` produce output, else they produce nothing. todo_include_todos = False # -- Options for HTML output ---------------------------------------------- # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. # html_theme = 'alabaster' # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the # documentation. # # html_theme_options = {} # Add any paths that contain custom themes here, relative to this directory. # html_theme_path = [] # The name for this set of Sphinx documents. # "<project> v<release> documentation" by default. # # html_title = u'twilio-php v5.x' # A shorter title for the navigation bar. Default is the same as html_title. # # html_short_title = None # The name of an image file (relative to this directory) to place at the top # of the sidebar. # # html_logo = None # The name of an image file (relative to this directory) to use as a favicon of # the docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 # pixels large. # # html_favicon = None # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". html_static_path = ['_static'] # Add any extra paths that contain custom files (such as robots.txt or # .htaccess) here, relative to this directory. These files are copied # directly to the root of the documentation. # # html_extra_path = [] # If not None, a 'Last updated on:' timestamp is inserted at every page # bottom, using the given strftime format. # The empty string is equivalent to '%b %d, %Y'. # # html_last_updated_fmt = None # If true, SmartyPants will be used to convert quotes and dashes to # typographically correct entities. # # html_use_smartypants = True # Custom sidebar templates, maps document names to template names. # # html_sidebars = {} # Additional templates that should be rendered to pages, maps page names to # template names. # # html_additional_pages = {} # If false, no module index is generated. # # html_domain_indices = True # If false, no index is generated. # # html_use_index = True # If true, the index is split into individual pages for each letter. # # html_split_index = False # If true, links to the reST sources are added to the pages. # # html_show_sourcelink = True # If true, "Created using Sphinx" is shown in the HTML footer. Default is True. # # html_show_sphinx = True # If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. # # html_show_copyright = True # If true, an OpenSearch description file will be output, and all pages will # contain a <link> tag referring to it. The value of this option must be the # base URL from which the finished HTML is served. # # html_use_opensearch = '' # This is the file name suffix for HTML files (e.g. ".xhtml"). # html_file_suffix = None # Language to be used for generating the HTML full-text search index. # Sphinx supports the following languages: # 'da', 'de', 'en', 'es', 'fi', 'fr', 'hu', 'it', 'ja' # 'nl', 'no', 'pt', 'ro', 'ru', 'sv', 'tr', 'zh' # # html_search_language = 'en' # A dictionary with options for the search language support, empty by default. # 'ja' uses this config value. # 'zh' user can custom change `jieba` dictionary path. # # html_search_options = {'type': 'default'} # The name of a javascript file (relative to the configuration directory) that # implements a search results scorer. If empty, the default will be used. # # html_search_scorer = 'scorer.js' # Output file base name for HTML help builder. htmlhelp_basename = 'twilio-phpdoc' # -- Options for LaTeX output --------------------------------------------- latex_elements = { # The paper size ('letterpaper' or 'a4paper'). # # 'papersize': 'letterpaper', # The font size ('10pt', '11pt' or '12pt'). # # 'pointsize': '10pt', # Additional stuff for the LaTeX preamble. # # 'preamble': '', # Latex figure (float) alignment # # 'figure_align': 'htbp', } # Grouping the document tree into LaTeX files. List of tuples # (source start file, target name, title, # author, documentclass [howto, manual, or own class]). latex_documents = [ (master_doc, 'twilio-php.tex', u'twilio-php Documentation', u'Neuman Vong', 'manual'), ] # The name of an image file (relative to this directory) to place at the top of # the title page. # # latex_logo = None # For "manual" documents, if this is true, then toplevel headings are parts, # not chapters. # # latex_use_parts = False # If true, show page references after internal links. # # latex_show_pagerefs = False # If true, show URL addresses after external links. # # latex_show_urls = False # Documents to append as an appendix to all manuals. # # latex_appendices = [] # It false, will not define \strong, \code, itleref, \crossref ... but only # \sphinxstrong, ..., \sphinxtitleref, ... To help avoid clash with user added # packages. # # latex_keep_old_macro_names = True # If false, no module index is generated. # # latex_domain_indices = True # -- Options for manual page output --------------------------------------- # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). man_pages = [ (master_doc, 'twilio-php', u'twilio-php Documentation', [author], 1) ] # If true, show URL addresses after external links. # # man_show_urls = False # -- Options for Texinfo output ------------------------------------------- # Grouping the document tree into Texinfo files. List of tuples # (source start file, target name, title, author, # dir menu entry, description, category) texinfo_documents = [ (master_doc, 'twilio-php', u'twilio-php Documentation', author, 'twilio-php', 'One line description of project.', 'Miscellaneous'), ] # Documents to append as an appendix to all manuals. # # texinfo_appendices = [] # If false, no module index is generated. # # texinfo_domain_indices = True # How to display URL addresses: 'footnote', 'no', or 'inline'. # # texinfo_show_urls = 'footnote' # If true, do not generate a @detailmenu in the "Top" node's menu. # # texinfo_no_detailmenu = False
| ver. 1.4 |
Github
|
.
| PHP 8.3.23 | Generation time: 0.13 |
proxy
|
phpinfo
|
Settings